Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit faf154d

Browse files
committed
Update regarding #3553
1 parent 9958d77 commit faf154d

3 files changed

Lines changed: 22 additions & 2 deletions

File tree

lib/core/common.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3418,6 +3418,16 @@ def checkIntegrity():
34183418

34193419
return retVal
34203420

3421+
def getDaysFromLastUpdate():
3422+
"""
3423+
Get total number of days from last update
3424+
"""
3425+
3426+
if not paths:
3427+
return
3428+
3429+
return int(time.time() - os.path.getmtime(paths.SQLMAP_SETTINGS_PATH)) // (3600 * 24)
3430+
34213431
def unhandledExceptionMessage():
34223432
"""
34233433
Returns detailed message about occurred unhandled exception

lib/core/settings.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from lib.core.enums import OS
1818

1919
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
20-
VERSION = "1.3.4.11"
20+
VERSION = "1.3.4.12"
2121
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
2222
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
2323
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)
@@ -530,6 +530,9 @@
530530
# Data inside shellcodeexec to be filled with random string
531531
SHELLCODEEXEC_RANDOM_STRING_MARKER = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
532532

533+
# Period after last-update to start nagging about the old revision
534+
LAST_UPDATE_NAGGING_DAYS = 60
535+
533536
# Generic address for checking the Internet connection while using switch --check-internet
534537
CHECK_INTERNET_ADDRESS = "https://ipinfo.io/"
535538

@@ -676,7 +679,7 @@
676679
CHECK_ZERO_COLUMNS_THRESHOLD = 10
677680

678681
# Boldify all logger messages containing these "patterns"
679-
BOLD_PATTERNS = ("' injectable", "provided empty", "leftover chars", "might be injectable", "' is vulnerable", "is not injectable", "does not seem to be", "test failed", "test passed", "live test final result", "test shows that", "the back-end DBMS is", "created Github", "blocked by the target server", "protection is involved", "CAPTCHA", "specific response", "NULL connection is supported", "PASSED", "FAILED")
682+
BOLD_PATTERNS = ("' injectable", "provided empty", "leftover chars", "might be injectable", "' is vulnerable", "is not injectable", "does not seem to be", "test failed", "test passed", "live test final result", "test shows that", "the back-end DBMS is", "created Github", "blocked by the target server", "protection is involved", "CAPTCHA", "specific response", "NULL connection is supported", "PASSED", "FAILED", "for more than")
680683

681684
# TLDs used in randomization of email-alike parameter values
682685
RANDOMIZATION_TLDS = ("com", "net", "ru", "org", "de", "jp", "cn", "fr", "it", "pl", "tv", "edu", "in", "ir", "es", "me", "info", "gr", "gov", "ca", "co", "se", "cz", "to", "vn", "nl", "cc", "az", "hu", "ua", "be", "no", "biz", "io", "ch", "ro", "sk", "eu", "us", "tw", "pt", "fi", "at", "lt", "kz", "cl", "hr", "pk", "lv", "la", "pe")

sqlmap.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
from lib.core.common import createGithubIssue
4444
from lib.core.common import dataToStdout
4545
from lib.core.common import filterNone
46+
from lib.core.common import getDaysFromLastUpdate
4647
from lib.core.common import getSafeExString
4748
from lib.core.common import getUnicode
4849
from lib.core.common import maskSensitiveData
@@ -64,6 +65,7 @@
6465
from lib.core.patch import dirtyPatches
6566
from lib.core.settings import GIT_PAGE
6667
from lib.core.settings import IS_WIN
68+
from lib.core.settings import LAST_UPDATE_NAGGING_DAYS
6769
from lib.core.settings import LEGAL_DISCLAIMER
6870
from lib.core.settings import THREAD_FINALIZATION_TIMEOUT
6971
from lib.core.settings import UNICODE_ENCODING
@@ -351,6 +353,11 @@ def main():
351353
finally:
352354
kb.threadContinue = False
353355

356+
_ = getDaysFromLastUpdate()
357+
if _ > LAST_UPDATE_NAGGING_DAYS:
358+
warnMsg = "you haven't updated sqlmap for more than %d days!!!" % _
359+
logger.warn(warnMsg)
360+
354361
if conf.get("showTime"):
355362
dataToStdout("\n[*] ending @ %s\n\n" % time.strftime("%X /%Y-%m-%d/"), forceOutput=True)
356363

0 commit comments

Comments
 (0)