Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # module sniff sniff
- class PrimarySpoof:
- """ Primary spoof class.
- This class shall be used to read tcpdump output from the system
- it shall then pass this packet to a class variable called capturedPacket
- to make it available to other methods for further manupulation
- """
- capturedPacket=None
- def __init__(self,port):
- """ initialize the port.
- """
- self.port = port
- def initializeTcpdump(self):
- # you must have imported the os module
- """ This method will initialize tcpdump for the port indicated in the init.
- """
- import os
- cmd = "tcpdump -nnvvXSs 1514 -i eth0 dst port %d"%self.port
- # test if it returns some output
- #cmd = "tcpdump -nnvvXSs 1514 -i eth0"
- PrimarySpoof.capturedPacket = os.system(cmd)
- def displayCapturedPacket(self):
- """ Display the raw packet.
- """
- print PrimarySpoof.capturedPacket
- ################### end of part sample
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement