mirror of
https://github.com/lgandx/Responder.git
synced 2025-07-15 01:22:52 -07:00
FindSMB2UPTime: properly deal with servers not disclosing their boot time
This commit is contained in:
parent
7339411766
commit
80aa964294
1 changed files with 6 additions and 0 deletions
|
@ -25,12 +25,18 @@ from packets import SMBHeaderReq, SMB2NegoReq, SMB2NegoDataReq
|
||||||
|
|
||||||
def GetBootTime(data):
|
def GetBootTime(data):
|
||||||
Filetime = int(struct.unpack('<q',data)[0])
|
Filetime = int(struct.unpack('<q',data)[0])
|
||||||
|
if Filetime == 0: # server may not disclose this info
|
||||||
|
return 0, "Unknown"
|
||||||
t = divmod(Filetime - 116444736000000000, 10000000)
|
t = divmod(Filetime - 116444736000000000, 10000000)
|
||||||
time = datetime.datetime.fromtimestamp(t[0])
|
time = datetime.datetime.fromtimestamp(t[0])
|
||||||
return time, time.strftime('%Y-%m-%d %H:%M:%S')
|
return time, time.strftime('%Y-%m-%d %H:%M:%S')
|
||||||
|
|
||||||
|
|
||||||
def IsDCVuln(t, host):
|
def IsDCVuln(t, host):
|
||||||
|
if t[0] == 0:
|
||||||
|
print "Server", host[0], "did not disclose its boot time"
|
||||||
|
return
|
||||||
|
|
||||||
Date = datetime.datetime(2014, 11, 17, 0, 30)
|
Date = datetime.datetime(2014, 11, 17, 0, 30)
|
||||||
if t[0] < Date:
|
if t[0] < Date:
|
||||||
print "System is up since:", t[1]
|
print "System is up since:", t[1]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue