mirror of
https://github.com/lgandx/Responder.git
synced 2025-08-20 13:23:38 -07:00
minor fix
This commit is contained in:
parent
4dd9d8c1df
commit
938f9bd533
1 changed files with 10 additions and 6 deletions
|
@ -240,6 +240,7 @@ def Validate_NBT_NS(data,Wredirect):
|
||||||
|
|
||||||
def Decode_Name(nbname):
|
def Decode_Name(nbname):
|
||||||
#From http://code.google.com/p/dpkt/ with author's permission.
|
#From http://code.google.com/p/dpkt/ with author's permission.
|
||||||
|
try:
|
||||||
if len(nbname) != 32:
|
if len(nbname) != 32:
|
||||||
return nbname
|
return nbname
|
||||||
l = []
|
l = []
|
||||||
|
@ -247,6 +248,8 @@ def Decode_Name(nbname):
|
||||||
l.append(chr(((ord(nbname[i]) - 0x41) << 4) |
|
l.append(chr(((ord(nbname[i]) - 0x41) << 4) |
|
||||||
((ord(nbname[i+1]) - 0x41) & 0xf)))
|
((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.
|
# NBT_NS Server class.
|
||||||
class NB(BaseRequestHandler):
|
class NB(BaseRequestHandler):
|
||||||
|
@ -1611,3 +1614,4 @@ if __name__ == '__main__':
|
||||||
raise
|
raise
|
||||||
raw_input()
|
raw_input()
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue