MCPcopy Index your code
hub / github.com/sqlmapproject/sqlmap / dictionaryAttack

Function dictionaryAttack

lib/utils/hash.py:984–1312  ·  view source on GitHub ↗
(attack_dict)

Source from the content-addressed store, hash-verified

982 proc_count.value -= 1
983
984def dictionaryAttack(attack_dict):
985 global _multiprocessing
986
987 suffix_list = [""]
988 custom_wordlist = [""]
989 hash_regexes = []
990 results = []
991 resumes = []
992 user_hash = []
993 processException = False
994 foundHash = False
995
996 if conf.disableMulti:
997 _multiprocessing = None
998 else:
999 # Note: https://github.com/sqlmapproject/sqlmap/issues/4367
1000 try:
1001 import multiprocessing
1002
1003 # problems on FreeBSD (Reference: https://web.archive.org/web/20110710041353/http://www.eggheadcafe.com/microsoft/Python/35880259/multiprocessing-on-freebsd.aspx)
1004 _ = multiprocessing.Queue()
1005
1006 # problems with ctypes (Reference: https://github.com/sqlmapproject/sqlmap/issues/2952)
1007 _ = multiprocessing.Value('i')
1008 except (ImportError, OSError, AttributeError):
1009 pass
1010 else:
1011 try:
1012 if multiprocessing.cpu_count() > 1:
1013 _multiprocessing = multiprocessing
1014 except NotImplementedError:
1015 pass
1016
1017 for (_, hashes) in attack_dict.items():
1018 for hash_ in hashes:
1019 if not hash_:
1020 continue
1021
1022 hash_ = hash_.split()[0] if hash_ and hash_.strip() else hash_
1023 regex = hashRecognition(hash_)
1024
1025 if regex and regex not in hash_regexes:
1026 hash_regexes.append(regex)
1027 infoMsg = "using hash method '%s'" % __functions__[regex].__name__
1028 logger.info(infoMsg)
1029
1030 for hash_regex in hash_regexes:
1031 keys = set()
1032 attack_info = []
1033
1034 for (user, hashes) in attack_dict.items():
1035 for hash_ in hashes:
1036 if not hash_:
1037 continue
1038
1039 foundHash = True
1040 hash_ = hash_.split()[0] if hash_ and hash_.strip() else hash_
1041

Callers 3

attackDumpedTableFunction · 0.85
crackHashFileFunction · 0.85

Calls 15

encodeHexFunction · 0.90
decodeBase64Function · 0.90
hashDBRetrieveFunction · 0.90
readInputFunction · 0.90
checkFileFunction · 0.90
getFileItemsFunction · 0.90
isZipFileFunction · 0.90
SqlmapDataExceptionClass · 0.90
getSafeExStringFunction · 0.90
normalizeUnicodeFunction · 0.90
clearConsoleLineFunction · 0.90
singleTimeLogMessageFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…