From 6890048041f30bc747f73c8709c3909c4d2642df Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Sat, 26 Jul 2025 12:13:57 +0200 Subject: [PATCH] Modifying the mechanism to check for --check-internet --- data/txt/sha256sums.txt | 4 ++-- lib/controller/checks.py | 5 ++--- lib/core/settings.py | 8 ++++---- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/data/txt/sha256sums.txt b/data/txt/sha256sums.txt index 68daefeeb..b7a6a87ae 100644 --- a/data/txt/sha256sums.txt +++ b/data/txt/sha256sums.txt @@ -160,7 +160,7 @@ df768bcb9838dc6c46dab9b4a877056cb4742bd6cfaaf438c4a3712c5cc0d264 extra/shutils/ 4608f21a4333c162ab3c266c903fda4793cc5834de30d06affe9b7566dd09811 extra/vulnserver/__init__.py eed1db5da17eca4c65a8f999166e2246eef84397687ae820bbe4984ef65a09df extra/vulnserver/vulnserver.py 96a39b4e3a9178e4e8285d5acd00115460cc1098ef430ab7573fc8194368da5c lib/controller/action.py -fad6640f60eac8ad1b65895cbccc39154864843a2a0b0f2ac596d3227edcd4f6 lib/controller/checks.py +2c8652359d6790755117ec5c68d0ddffacff5f3377ad5004c4fffd29c2446d61 lib/controller/checks.py 34e9cf166e21ce991b61ca7695c43c892e8425f7e1228daec8cadd38f786acc6 lib/controller/controller.py 49bcd74281297c79a6ae5d4b0d1479ddace4476fddaf4383ca682a6977b553e3 lib/controller/handler.py 4608f21a4333c162ab3c266c903fda4793cc5834de30d06affe9b7566dd09811 lib/controller/__init__.py @@ -188,7 +188,7 @@ c4bfb493a03caf84dd362aec7c248097841de804b7413d0e1ecb8a90c8550bc0 lib/core/readl d1bd70c1a55858495c727fbec91e30af267459c8f64d50fabf9e4ee2c007e920 lib/core/replication.py 1d0f80b0193ac5204527bfab4bde1a7aee0f693fd008e86b4b29f606d1ef94f3 lib/core/revision.py d2eb8e4b05ac93551272b3d4abfaf5b9f2d3ac92499a7704c16ed0b4f200db38 lib/core/session.py -1bb803780eb75c2a1f7f815e307f2531d76409e78863426e535401c551243beb lib/core/settings.py +8382e074a0233294ac9d274abbf0bbfa190c1d263f1d8c1a218f4fe7189e7405 lib/core/settings.py 1c5eab9494eb969bc9ce118a2ea6954690c6851cbe54c18373c723b99734bf09 lib/core/shell.py 4eea6dcf023e41e3c64b210cb5c2efc7ca893b727f5e49d9c924f076bb224053 lib/core/subprocessng.py cdd352e1331c6b535e780f6edea79465cb55af53aa2114dcea0e8bf382e56d1a lib/core/target.py diff --git a/lib/controller/checks.py b/lib/controller/checks.py index 06bf5d8b6..92b1aac67 100644 --- a/lib/controller/checks.py +++ b/lib/controller/checks.py @@ -73,7 +73,7 @@ from lib.core.exception import SqlmapUserQuitException from lib.core.settings import BOUNDED_INJECTION_MARKER from lib.core.settings import CANDIDATE_SENTENCE_MIN_LENGTH from lib.core.settings import CHECK_INTERNET_ADDRESS -from lib.core.settings import CHECK_INTERNET_VALUE +from lib.core.settings import CHECK_INTERNET_CODE from lib.core.settings import DEFAULT_COOKIE_DELIMITER from lib.core.settings import DEFAULT_GET_POST_DELIMITER from lib.core.settings import DUMMY_NON_SQLI_CHECK_APPENDIX @@ -1586,8 +1586,7 @@ def checkConnection(suppressOutput=False): return True def checkInternet(): - content = Request.getPage(url=CHECK_INTERNET_ADDRESS, checking=True)[0] - return CHECK_INTERNET_VALUE in (content or "") + return Request.getPage(url=CHECK_INTERNET_ADDRESS, checking=True)[2] == CHECK_INTERNET_CODE def setVerbosity(): # Cross-referenced function raise NotImplementedError diff --git a/lib/core/settings.py b/lib/core/settings.py index b98e99675..9648bc0f1 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -19,7 +19,7 @@ from lib.core.enums import OS from thirdparty import six # sqlmap version (...) -VERSION = "1.9.7.8" +VERSION = "1.9.7.9" TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable" TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34} VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE) @@ -634,10 +634,10 @@ LAST_UPDATE_NAGGING_DAYS = 180 MIN_ERROR_PARSING_NON_WRITING_RATIO = 0.05 # Generic address for checking the Internet connection while using switch --check-internet (Note: https version does not work for Python < 2.7.9) -CHECK_INTERNET_ADDRESS = "http://ipinfo.io/json" +CHECK_INTERNET_ADDRESS = "http://www.google.com/generate_204" -# Value to look for in response to CHECK_INTERNET_ADDRESS -CHECK_INTERNET_VALUE = '"ip":' +# HTTP code to look in response to CHECK_INTERNET_ADDRESS +CHECK_INTERNET_CODE = 204 # Payload used for checking of existence of WAF/IPS (dummier the better) IPS_WAF_CHECK_PAYLOAD = "AND 1=1 UNION ALL SELECT 1,NULL,'',table_name FROM information_schema.tables WHERE 2>1--/**/; EXEC xp_cmdshell('cat ../../../etc/passwd')#"