i've got custom script listening on port 161 udp packets come in. listens fine, receives string fine - , when send message test script (on box), displays fine in log, etc. i'm gathering udp data follows: data, addr = sock.recvfrom(1024) data contains string information need. when performing tcpdump on interface data coming in, looks normal, such as: .1.3.6.1.4.1.3375.2.1.1.2.12.6 .1.3.6.1.4.1.3375.2.1.1.2.12.6 public "this trap" .1.3.6.1.4.1.3375.2.1.1.2.12.6 .1.3.6.1.4.1.3375.2.1.1.2.12.6 when take incoming data (in python) , print it, or output file, bunch of esc sequences, or otherwise unprintable data in log file. everything inside of quote preserved. i've been able strip out esc sequences , store 'good stuff' inside of quotes, i'm losing oid's. it's if python thinks ascii characters else. i did notice when trying save garbled data, if change encoding latin-1 -- becomes readable...but still there's garbled charact...
Comments
Post a Comment