probemon icon indicating copy to clipboard operation
probemon copied to clipboard

Iso timestamp gives type object 'datetime.datetime' has no attribute 'datetime'

Open Dmeowmixer opened this issue 8 years ago • 4 comments

$ sudo python probemon.py -i wlan0 -t iso -o probemon.log -f -s -r Traceback (most recent call last): File "probemon.py", line 96, in main() File "probemon.py", line 93, in main sniff(iface=args.interface, prn=built_packet_cb, store=0) File "/usr/local/lib/python2.7/dist-packages/scapy/sendrecv.py", line 620, in sniff r = prn(p) File "probemon.py", line 36, in packet_callback log_time = datetime.datetime.now().isoformat() AttributeError: type object 'datetime.datetime' has no attribute 'datetime'

unix working fine, not sure if this is a local problem.

Dmeowmixer avatar Jul 01 '17 03:07 Dmeowmixer

I have same error on Kali

prylypko avatar Jul 09 '17 21:07 prylypko

@Dmeowmixer this fixes the problem https://github.com/nikharris0/probemon/pull/3/commits/c4920dbda3469f1c67c10f1e548886d78e87f3d1

prylypko avatar Jul 09 '17 21:07 prylypko

On line 36 remove the second datetime:

log_time = datetime.now().isoformat()

This works but the date and time is messed up.

mflannery avatar Oct 20 '17 02:10 mflannery

The following line 36:

log_time = datetime.fromtimestamp(int(time.time())).strftime('%Y-%m-%d %H:%M:%S')

works with the correct date and time.

pawmendi avatar Mar 15 '18 22:03 pawmendi