mirror of
https://github.com/lgandx/Responder.git
synced 2025-12-27 09:59:08 +00:00
minor fix
This commit is contained in:
16
Responder.py
16
Responder.py
@@ -240,13 +240,16 @@ def Validate_NBT_NS(data,Wredirect):
|
||||
|
||||
def Decode_Name(nbname):
|
||||
#From http://code.google.com/p/dpkt/ with author's permission.
|
||||
if len(nbname) != 32:
|
||||
return nbname
|
||||
l = []
|
||||
for i in range(0, 32, 2):
|
||||
l.append(chr(((ord(nbname[i]) - 0x41) << 4) |
|
||||
try:
|
||||
if len(nbname) != 32:
|
||||
return nbname
|
||||
l = []
|
||||
for i in range(0, 32, 2):
|
||||
l.append(chr(((ord(nbname[i]) - 0x41) << 4) |
|
||||
((ord(nbname[i+1]) - 0x41) & 0xf)))
|
||||
return ''.join(l).split('\x00', 1)[0].strip()
|
||||
return ''.join(l).split('\x00', 1)[0].strip()
|
||||
except:
|
||||
return "Illegal NetBIOS name"
|
||||
|
||||
# NBT_NS Server class.
|
||||
class NB(BaseRequestHandler):
|
||||
@@ -1611,3 +1614,4 @@ if __name__ == '__main__':
|
||||
raise
|
||||
raw_input()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user