Hacking and Cyber Security Tutorials, Learn How To Hack, Linux Tutorials, Programming Tutorials, Android & iOS Hacking
Please note 1st that this is a Linux Tutorial but most of the same will apply to Mac & Windows; Python comes native to Linux so please install Python and put it in your System Path if using Windows. sudo apt-get install scapy => sudo su scapy has to ran as root type scapy =>
INFO: Can't import python gnuplot wrapper . Won't be able to plot. INFO: Can't import PyX. Won't be able to use psdump() or pdfdump(). WARNING: No route found for IPv6 destination :: (no default route?) INFO: Can't import python Crypto lib. Won't be able to decrypt WEP. INFO: Can't import python Crypto lib. Disabled certificate manipulation tools Welcome to Scapy (2.2.0) >>>
this is your new playground, so let's learn a couple of commands to get familiar with the Functions of scapy has built into it
the ls() command will show you a huge list of Protocols that can be used and new ones can be added also if need be.
the lsc() command will give you a much shorter list of commands applicable to the Protocols above... you get the gist now about how to view what is available to you in this Module. Python has a Standard Library of 80 built in Functions without importing other Modules or Functions from them. I will start out with Basic Network Protocols & some common Attacks on them becouse they are the nasty buggers we always see in Network Hacking; I am taking this straight from my Terminal & whatever you see here can also be found anywhere on the Web, I just think a nice series of Articles on Protocols & Protocol Hacks is needed HERE! At any point you need HELP just type help(protocol) or help(command) and you will get the lowdown on how to use those Options Once I get past the Intro. I will continue with how each can be exploited using scapy. We will start out with the most Basic Packets of all DHCP this is used to assign IP Addresses; however, since there are so many options available for this I will touch back on it, It will take up a whole Article in it's self to cover DHCP() We can see the Options though =>
Not very many other Protocols have this many as you will soon see, we have countless Options here! So we will move on to the next most important Protocol ARP! It's a Layer 2 Protocol & works with Layer 3 in networks and in conjunction with DHCP & IP.ARP communicates with other Machines on your Network and associates Hardware Addresses with IP Addresses. So ARP says."Who has this " RARP says,"This Machine has " and is associated with Mac to IP Identification Only!
you can customise any field in any Protocol by using the Protocol().show()or var.show() Set variable pkt and as above scapy will fill all unused options except Machine & IP destination >>> pkt=ARP() >>> pkt.show() ###[ ARP ]### hwtype= 0x1 ptype= 0x800 hwlen= 6 plen= 4 op= who-has hwsrc= e0:ca:94:db:2f:d7 psrc= 192.168.1.7 hwdst= 00:00:00:00:00:00 pdst= 0.0.0.0
>>> pkt = ARP(psrc="192.168.1.2", hwsr
c="00:11:22:33:44:55") >>> pkt
and as you can see I just Spoofed an IP & Mac address
>>>pkt.op >>>pkt.hwsrc >>>pkt.len can all be viewed & chanded induvidually with just this method & when you get better you will build whole Packets at a time like a Pro
The perpose of ARP Spoofing & ARP Cache poisoning is to use MiTM Attacks to intercept Data meant for a particular Machine, and or sending & receiving request masqeurading as another on a Network and DoS. Being able to write, save, call Packet Streams is simple & I will get to it all very shortly!As well as Atacks.