mirror of
https://github.com/The-Art-of-Hacking/h4cker
synced 2024-11-26 04:40:18 +00:00
18 lines
442 B
Python
18 lines
442 B
Python
|
#!/usr/bin/python
|
||
|
# Author: Omar Santos @santosomar
|
||
|
# version 1.0
|
||
|
# This is a quick demonstration on how to create a
|
||
|
# snifffer (packet capture script) using python.
|
||
|
#####################################################################
|
||
|
|
||
|
import socket
|
||
|
|
||
|
#create an INET, raw socket
|
||
|
s = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.IPPROTO_TCP)
|
||
|
|
||
|
# receive a packet
|
||
|
while True:
|
||
|
|
||
|
# print output on terminal
|
||
|
print s.recvfrom(65565)
|