Skip to content

Commit 89e9f49

Browse files
authored
Merge pull request sqlmapproject#2418 from Ekultek/ip_regex
IP address regex updated to not provide a false positive
2 parents a0a6702 + 71984fc commit 89e9f49

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
TEXT_TAG_REGEX = r"(?si)<(abbr|acronym|b|blockquote|br|center|cite|code|dt|em|font|h\d|i|li|p|pre|q|strong|sub|sup|td|th|title|tt|u)(?!\w).*?>(?P<result>[^<]+)"
110110

111111
# Regular expression used for recognition of IP addresses
112-
IP_ADDRESS_REGEX = r"\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b"
112+
IP_ADDRESS_REGEX = r"^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$"
113113

114114
# Regular expression used for recognition of generic "your ip has been blocked" messages
115115
BLOCKED_IP_REGEX = r"(?i)(\A|\b)ip\b.*\b(banned|blocked|block list|firewall)"

0 commit comments

Comments
 (0)