Skip to content

Commit e629620

Browse files
committed
Merge pull request #10 from sqlmapproject/master
update all commits
2 parents 57f75c1 + f042a73 commit e629620

8 files changed

Lines changed: 31 additions & 9 deletions

File tree

lib/core/common.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2928,6 +2928,7 @@ def createGithubIssue(errMsg, excMsg):
29282928
_ = re.sub(r"'[^']+'", "''", excMsg)
29292929
_ = re.sub(r"\s+line \d+", "", _)
29302930
_ = re.sub(r'File ".+?/(\w+\.py)', "\g<1>", _)
2931+
_ = re.sub(r".+\Z", "", _)
29312932
key = hashlib.md5(_).hexdigest()[:8]
29322933

29332934
if key in issues:

lib/core/option.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1079,7 +1079,12 @@ def _setHTTPProxy():
10791079
debugMsg = "setting the HTTP/SOCKS proxy for all HTTP requests"
10801080
logger.debug(debugMsg)
10811081

1082-
_ = urlparse.urlsplit(conf.proxy)
1082+
try:
1083+
_ = urlparse.urlsplit(conf.proxy)
1084+
except Exception, ex:
1085+
errMsg = "invalid proxy address '%s' ('%s')" % (conf.proxy, ex)
1086+
raise SqlmapSyntaxException, errMsg
1087+
10831088
hostnamePort = _.netloc.split(":")
10841089

10851090
scheme = _.scheme.upper()
@@ -2182,6 +2187,13 @@ def _basicOptionValidation():
21822187
errMsg = "option '--regexp' is incompatible with switch '--null-connection'"
21832188
raise SqlmapSyntaxException(errMsg)
21842189

2190+
if conf.regexp:
2191+
try:
2192+
re.compile(conf.regexp)
2193+
except re.error, ex:
2194+
errMsg = "invalid regular expression '%s' ('%s')" % (conf.regexp, ex)
2195+
raise SqlmapSyntaxException(errMsg)
2196+
21852197
if conf.dumpTable and conf.dumpAll:
21862198
errMsg = "switch '--dump' is incompatible with switch '--dump-all'"
21872199
raise SqlmapSyntaxException(errMsg)

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@
517517
DNS_BOUNDARIES_ALPHABET = re.sub("[a-fA-F]", "", string.ascii_letters)
518518

519519
# Alphabet used for heuristic checks
520-
HEURISTIC_CHECK_ALPHABET = ('"', '\'', ')', '(', '[', ']', ',', '.')
520+
HEURISTIC_CHECK_ALPHABET = ('"', '\'', ')', '(', ',', '.')
521521

522522
# String used for dummy XSS check of a tested parameter value
523523
DUMMY_XSS_CHECK_APPENDIX = "<'\">"

lib/parse/cmdline.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def cmdLineParser():
4343

4444
checkSystemEncoding()
4545

46-
_ = getUnicode(os.path.normpath(sys.argv[0]), encoding=sys.getfilesystemencoding())
46+
_ = getUnicode(os.path.basename(sys.argv[0]), encoding=sys.getfilesystemencoding())
4747

4848
usage = "%s%s [options]" % ("python " if not IS_WIN else "", \
4949
"\"%s\"" % _ if " " in _ else _)

lib/request/comparison.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,16 @@ def _comparison(page, headers, code, getRatioValue, pageLength):
135135
while True:
136136
try:
137137
seqMatcher.set_seq1(seq1)
138+
except MemoryError:
139+
seq1 = seq1[:len(seq1) / 1024]
140+
else:
141+
break
142+
143+
while True:
144+
try:
138145
seqMatcher.set_seq2(seq2)
139146
except MemoryError:
140-
seq1 = seq1[:len(seq1) / 4]
141-
seq2 = seq2[:len(seq2) / 4]
147+
seq2 = seq2[:len(seq2) / 1024]
142148
else:
143149
break
144150

lib/request/httpshandler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def create_sock():
5353
break
5454
else:
5555
sock.close()
56-
except ssl.SSLError, errMsg:
56+
except (ssl.SSLError, socket.error), errMsg:
5757
logger.debug("SSL connection error occurred ('%s')" % errMsg)
5858

5959
if not success:

lib/utils/hash.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,7 @@ def _bruteProcessVariantB(user, hash_, kwargs, hash_regex, suffix, retVal, found
665665

666666
def dictionaryAttack(attack_dict):
667667
suffix_list = [""]
668-
custom_wordlist = []
668+
custom_wordlist = [""]
669669
hash_regexes = []
670670
results = []
671671
resumes = []
@@ -769,9 +769,9 @@ def dictionaryAttack(attack_dict):
769769

770770
kb.wordlists = dictPaths
771771

772-
except SqlmapFilePathException, msg:
772+
except Exception, ex:
773773
warnMsg = "there was a problem while loading dictionaries"
774-
warnMsg += " ('%s')" % msg
774+
warnMsg += " ('%s')" % ex
775775
logger.critical(warnMsg)
776776

777777
message = "do you want to use common password suffixes? (slow!) [y/N] "

plugins/generic/databases.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -772,6 +772,9 @@ def getSchema(self):
772772
return kb.data.cachedColumns
773773

774774
def _tableGetCount(self, db, table):
775+
if not db or not table:
776+
return None
777+
775778
if Backend.getIdentifiedDbms() in (DBMS.ORACLE, DBMS.DB2):
776779
db = db.upper()
777780
table = table.upper()

0 commit comments

Comments
 (0)