Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Python socket sniffer on AIX5.3 not working

Status
Not open for further replies.

arnar75

Programmer
Sep 11, 2015
1
0
0
IS
Hello all,

I'm trying to create a python network sniffing script that will grab certain traffic that I need to log.

So far I have not been able to sniff anything but ICMP packets which is strange since the same code works fine on linux.

Python version is 2.7.5

python code :

import socket

#create an INET, STREAMing socket
s = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.IPPROTO_IP)
s.bind(('', 0))

# receive a packet
while True:
print "Sniffing"
packet = s.recvfrom(65565)
print packet


any help would be greatly appreciated :)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top