mirror of
https://github.com/lgandx/Responder.git
synced 2025-07-06 04:51:23 -07:00
Fixed bug in FindSMB2UPTime
This commit is contained in:
parent
2b322b227e
commit
6f3cc4564c
2 changed files with 38 additions and 3 deletions
35
packets.py
35
packets.py
|
@ -1597,4 +1597,39 @@ class SMB2Session2Data(Packet):
|
|||
])
|
||||
|
||||
|
||||
######################FindSMBTime.py##########################
|
||||
class SMBHeaderReq(Packet):
|
||||
fields = OrderedDict([
|
||||
("Proto", "\xff\x53\x4d\x42"),
|
||||
("Cmd", "\x72"),
|
||||
("Error-Code", "\x00\x00\x00\x00" ),
|
||||
("Flag1", "\x10"),
|
||||
("Flag2", "\x00\x00"),
|
||||
("Pidhigh", "\x00\x00"),
|
||||
("Signature", "\x00\x00\x00\x00\x00\x00\x00\x00"),
|
||||
("Reserved", "\x00\x00"),
|
||||
("TID", "\x00\x00"),
|
||||
("PID", "\xff\xfe"),
|
||||
("UID", "\x00\x00"),
|
||||
("MID", "\x00\x00"),
|
||||
])
|
||||
|
||||
class SMB2NegoReq(Packet):
|
||||
fields = OrderedDict([
|
||||
("Wordcount", "\x00"),
|
||||
("Bcc", "\x62\x00"),
|
||||
("Data", "")
|
||||
])
|
||||
|
||||
def calculate(self):
|
||||
self.fields["Bcc"] = struct.pack("<H",len(str(self.fields["Data"])))
|
||||
|
||||
class SMB2NegoDataReq(Packet):
|
||||
fields = OrderedDict([
|
||||
("StrType","\x02" ),
|
||||
("dialect", "NT LM 0.12\x00"),
|
||||
("StrType1","\x02"),
|
||||
("dialect1", "SMB 2.002\x00"),
|
||||
("StrType2","\x02"),
|
||||
("dialect2", "SMB 2.???\x00"),
|
||||
])
|
||||
|
|
|
@ -21,7 +21,7 @@ import struct
|
|||
import socket
|
||||
|
||||
sys.path.insert(0, os.path.realpath(os.path.join(os.path.dirname(__file__), '..')))
|
||||
from packets import SMB2Header, SMB2Nego, SMB2NegoData
|
||||
from packets import SMBHeaderReq, SMB2NegoReq, SMB2NegoDataReq
|
||||
|
||||
def GetBootTime(data):
|
||||
Filetime = int(struct.unpack('<q',data)[0])
|
||||
|
@ -43,8 +43,8 @@ def run(host):
|
|||
s.connect(host)
|
||||
s.settimeout(5)
|
||||
|
||||
Header = SMB2Header(Cmd="\x72",Flag1="\x18",Flag2="\x53\xc8")
|
||||
Nego = SMB2Nego(Data = SMB2NegoData())
|
||||
Header = SMBHeaderReq(Cmd="\x72",Flag1="\x18",Flag2="\x53\xc8")
|
||||
Nego = SMB2NegoReq(Data = SMB2NegoDataReq())
|
||||
Nego.calculate()
|
||||
|
||||
Packet = str(Header)+str(Nego)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue