File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1818from thirdparty .six import unichr as _unichr
1919
2020# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
21- VERSION = "1.4.1.40 "
21+ VERSION = "1.4.1.41 "
2222TYPE = "dev" if VERSION .count ('.' ) > 2 and VERSION .split ('.' )[- 1 ] != '0' else "stable"
2323TYPE_COLORS = {"dev" : 33 , "stable" : 90 , "pip" : 34 }
2424VERSION_STRING = "sqlmap/%s#%s" % ('.' .join (VERSION .split ('.' )[:- 1 ]) if VERSION .count ('.' ) > 2 and VERSION .split ('.' )[- 1 ] == '0' else VERSION , TYPE )
Original file line number Diff line number Diff line change @@ -19,23 +19,28 @@ class DNSQuery(object):
1919 """
2020 >>> DNSQuery(b'|K\\ x01 \\ x00\\ x01\\ x00\\ x00\\ x00\\ x00\\ x00\\ x01\\ x03www\\ x06google\\ x03com\\ x00\\ x00\\ x01\\ x00\\ x01\\ x00\\ x00)\\ x10\\ x00\\ x00\\ x00\\ x00\\ x00\\ x00\\ x0c\\ x00\\ n\\ x00\\ x08O4|Np!\\ x1d\\ xb3')._query == b"www.google.com."
2121 True
22+ >>> DNSQuery(b'\\ x00')._query == b""
23+ True
2224 """
2325
2426 def __init__ (self , raw ):
2527 self ._raw = raw
2628 self ._query = b""
2729
28- type_ = (ord (raw [2 :3 ]) >> 3 ) & 15 # Opcode bits
29-
30- if type_ == 0 : # Standard query
31- i = 12
32- j = ord (raw [i :i + 1 ])
30+ try :
31+ type_ = (ord (raw [2 :3 ]) >> 3 ) & 15 # Opcode bits
3332
34- while j != 0 :
35- self ._query += raw [i + 1 :i + j + 1 ] + b'.'
36- i = i + j + 1
33+ if type_ == 0 : # Standard query
34+ i = 12
3735 j = ord (raw [i :i + 1 ])
3836
37+ while j != 0 :
38+ self ._query += raw [i + 1 :i + j + 1 ] + b'.'
39+ i = i + j + 1
40+ j = ord (raw [i :i + 1 ])
41+ except TypeError :
42+ pass
43+
3944 def response (self , resolution ):
4045 """
4146 Crafts raw DNS resolution response packet
You can’t perform that action at this time.
0 commit comments