Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

ipv4 false positive with 1.1.1.00 #92

Open
jessewriter opened this issue Apr 12, 2022 · 1 comment
Open

ipv4 false positive with 1.1.1.00 #92

jessewriter opened this issue Apr 12, 2022 · 1 comment

Comments

@jessewriter
Copy link

No description provided.

@lanpartyline
Copy link

lanpartyline commented May 24, 2022

This regex should resolve that. (messy as heck but does the job)

(?:(?:(?:(?:2[0-5][0-9])|(?:1[0-9][0-9]))|[1-9][0-9]|[0-9])(?<![^1-2]00)(?<!25[6-9])(?<!2[6-9][0-9])\.){3}(?!00)(?!25[6-9])(?!2[6-9][0-9])(?:(?:(?:2[0-5][0-9])|(?:1[0-9][0-9]))|[1-9][0-9]|[0-9])

also, the one on the site gives a false positive for these additional IPs 255.255.255.256, 9.9.9.256, 1.1.001.1, 1.1.1.00, 1.00.2.2, 00.1.3.3

Tested this one against:

192.168.1.1
127.0.0.1
0.0.0.0
999.999.999.999
99.99.99.99
99.99.99.255
99.99.99.256
99.256.99.99
255.255.255.255
246.255.255.255
246.255.255.246
255.246.255.246
246.246.246.246
256.256.256.256
265.255.255.255
255.265.255.255
255.255.265.255
255.255.255.265
00.1.3.3
1.00.2.2
95.255.256.23
1.2.3
1.2.3.4
0.2.3.4
9.9.9.256
9.256.9.0
1.1.1.00
1.1.1.100
100.1.1.100
100.1.1.0
10.1.1.0
1.1.001.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants