Hi developers,

Here is a regular expression recommendation that will match private IP 
addresses.
This matches only valid rfc1918, local loopback and the link local block IP 
addresses.

(?:(?:10|127)\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)|192\.168|169\.254|172\.0?(?:1[6-9]|2[0-9]|3[01]))(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){2}

I also included this as an attachment since mailing may break it.
This regex returns 9 IP addresses against my test bed (Private IP 
addresses.txt).

It will return a list when used with re.findall and will return a match
object that will fit w3af code in privateIP.py when used with re.search.


PS: To get an exact match, \b might be added to both sides of the
expression.

Best regards,
Sertan
(?:(?:10|127)\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)|192\.168|169\.254|172\.0?(?:1[6-9]|2[0-9]|3[01]))(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){2}
a a 19.20.33.2 ss
10.2.1.3
10.m2.1.3
192.168.3.45
192.168.3j.45
127.0.0.1
a244.24.23.22
172.16.6.2
193.192.101.1
172.24.3.3
172.24.257.3
172.31.2.3
172.0.2.3
172.31a.2.a3
169.254.25.2
172.32.7.2
172.017.092.001
http://172.32.7.2/index.html
http://192.168.8.24/index.html
------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
W3af-develop mailing list
W3af-develop@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/w3af-develop

Reply via email to