minor fix

This commit is contained in:
Miroslav Stampar 2011-03-26 21:10:31 +00:00
parent afe2be6a9f
commit 4f00b9fa4b

View File

@ -1,4 +1,5 @@
#!/usr/bin/env python #!/usr/bin/env python
# -*- coding: utf-8 -*-
""" """
$Id$ $Id$
@ -7,6 +8,11 @@ Copyright (c) 2006-2010 sqlmap developers (http://sqlmap.sourceforge.net/)
See the file 'doc/COPYING' for copying permission See the file 'doc/COPYING' for copying permission
""" """
try:
import crypt
except ImportError, _:
pass
import re import re
import time import time
@ -347,7 +353,6 @@ def dictionaryAttack(attack_dict):
warnMsg = "attack on '%s' is not available for Windows platform" % __functions__[hash_regex].func_name warnMsg = "attack on '%s' is not available for Windows platform" % __functions__[hash_regex].func_name
logger.warning(warnMsg) logger.warning(warnMsg)
else: else:
import crypt
attack_info.append([(user, hash_), {'salt': hash_[0:2]}]) attack_info.append([(user, hash_), {'salt': hash_[0:2]}])
if not attack_info: if not attack_info:
@ -384,7 +389,7 @@ def dictionaryAttack(attack_dict):
length = len(kb.wordlist) * len(suffix_list) length = len(kb.wordlist) * len(suffix_list)
if hash_regex in (HASH.MYSQL, HASH.MYSQL_OLD, HASH.MD5_GENERIC, HASH.SHA1_GENERIC, HASH.CRYPT_GENERIC): if hash_regex in (HASH.MYSQL, HASH.MYSQL_OLD, HASH.MD5_GENERIC, HASH.SHA1_GENERIC):
count = 0 count = 0
for suffix in suffix_list: for suffix in suffix_list: