[wmi] self review: remove useless try in wmi query & bugs fix in modules
Signed-off-by: XiaoliChan <2209553467@qq.com>main
parent
b22b2aadf4
commit
c8c2c8d3d7
|
@ -70,6 +70,6 @@ class CMEModule:
|
||||||
context.log.highlight("\t" + d)
|
context.log.highlight("\t" + d)
|
||||||
data += "\t" + d + "\n"
|
data += "\t" + d + "\n"
|
||||||
|
|
||||||
log_name = "DNS-Enum-{}-{}.log".format(connection.args.target[0], datetime.now().strftime("%Y-%m-%d_%H%M%S"))
|
log_name = "DNS-Enum-{}-{}.log".format(connection.host, datetime.now().strftime("%Y-%m-%d_%H%M%S"))
|
||||||
write_log(data, log_name)
|
write_log(data, log_name)
|
||||||
context.log.display(f"Saved raw output to ~/.cme/logs/{log_name}")
|
context.log.display(f"Saved raw output to ~/.cme/logs/{log_name}")
|
||||||
|
|
|
@ -35,6 +35,6 @@ class CMEModule:
|
||||||
|
|
||||||
data.append(cards)
|
data.append(cards)
|
||||||
|
|
||||||
log_name = "network-connections-{}-{}.log".format(connection.args.target[0], datetime.now().strftime("%Y-%m-%d_%H%M%S"))
|
log_name = "network-connections-{}-{}.log".format(connection.host, datetime.now().strftime("%Y-%m-%d_%H%M%S"))
|
||||||
write_log(json.dumps(data), log_name)
|
write_log(json.dumps(data), log_name)
|
||||||
context.log.display(f"Saved raw output to ~/.cme/logs/{log_name}")
|
context.log.display(f"Saved raw output to ~/.cme/logs/{log_name}")
|
||||||
|
|
|
@ -420,11 +420,8 @@ class wmi(connection):
|
||||||
raise e
|
raise e
|
||||||
else:
|
else:
|
||||||
break
|
break
|
||||||
try:
|
|
||||||
iEnumWbemClassObject.RemRelease()
|
|
||||||
dcom.disconnect()
|
dcom.disconnect()
|
||||||
except:
|
|
||||||
pass
|
|
||||||
|
|
||||||
return records
|
return records
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue