Hey guys...
what I will be writing about here is Scapy.py which is a Python Module for crafting Packets.. but is it much more than that and It has the capabilities of replaceing numerous Network Hacking tools and the potential to be whatever tools you can conceive !
Guys.. First thing this is the Linux tutorial . Python comes native to Linux so please install Python !
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--->
>>>ls()
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.
>>>lsc()
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 =>
>>> DHCP()
>>> DHCP().show()
###[ DHCP options ]###
options= []
now the Options =>
>>> DHCPOptions
{0: 'pad', 1: , 2: 'time_zone', 3: , 4: , 5: , 6: , 7: , 8: , 9: , 12: 'hostname', 14: 'dump_path', 15: 'domain', 17: 'root_disk_path', 22: 'max_dgram_reass_size', 23: 'default_ttl', 24: 'pmtu_timeout', 28: , 35: 'arp_cache_timeout', 36: 'ether_or_dot3', 37: 'tcp_ttl', 38: 'tcp_keepalive_interval', 39: 'tcp_keepalive_garbage', 40: 'NIS_domain', 41: , 42: , 43: 'vendor_specific', 44: , 45: , 50: , 51: , 53: , 54: , 55: 'param_req_list', 57: , 58: , 59: , 60: 'vendor_class_id', 61: 'client_id', 64: 'NISplus_domain', 65: , 69: , 70: , 71: , 72: , 73: , 74: , 75: , 76: 'StreetTalk_Dir_Assistance', 82: 'relay_agent_Information', 255: 'end'}
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
and as you can see I just Spoofed an IP & Mac address
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.
Next we have IP()
If we send this over the Wire we get only an ICMP response(error)becouse we got no dport
ls(pkt) will also show you a better Table of the same pkt.show() command
So becouse IP piggybacks on TCP we will further build our Packet to send & receive a response
Now we can see things have changed a bit ... lets send this Packet on the Wire!
the sr1() will send,receive Packets to google
ans,unans is answered or unanswered Packets, so lets look at answered:
Summary is just about the same as sr1()
wireshark(ans) will show you the gui Packet (must have Wireshark installed)
A Packet can travel via TCP or UDP
TCP is Stateless which is why we have Sessions via Cookies on the Web & UDP is Connectionless so we just use Ports.. It's weird I know
Now we create/write a pcap file if we wish to same a particular Packet Capture & it's done like so:
We read/recall that File like so:
I hope you liked this guys....
I will be get more advanced stuff next time
thank you !!
what I will be writing about here is Scapy.py which is a Python Module for crafting Packets.. but is it much more than that and It has the capabilities of replaceing numerous Network Hacking tools and the potential to be whatever tools you can conceive !
Guys.. First thing this is the Linux tutorial . Python comes native to Linux so please install Python !
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--->
>>>ls()
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.
>>>lsc()
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 =>
>>> DHCP()
>>> DHCP().show()
###[ DHCP options ]###
options= []
now the Options =>
>>> DHCPOptions
{0: 'pad', 1: , 2: 'time_zone', 3: , 4: , 5: , 6: , 7: , 8: , 9: , 12: 'hostname', 14: 'dump_path', 15: 'domain', 17: 'root_disk_path', 22: 'max_dgram_reass_size', 23: 'default_ttl', 24: 'pmtu_timeout', 28: , 35: 'arp_cache_timeout', 36: 'ether_or_dot3', 37: 'tcp_ttl', 38: 'tcp_keepalive_interval', 39: 'tcp_keepalive_garbage', 40: 'NIS_domain', 41: , 42: , 43: 'vendor_specific', 44: , 45: , 50: , 51: , 53: , 54: , 55: 'param_req_list', 57: , 58: , 59: , 60: 'vendor_class_id', 61: 'client_id', 64: 'NISplus_domain', 65: , 69: , 70: , 71: , 72: , 73: , 74: , 75: , 76: 'StreetTalk_Dir_Assistance', 82: 'relay_agent_Information', 255: 'end'}
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
and as you can see I just Spoofed an IP & Mac address
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.
Next we have IP()
If we send this over the Wire we get only an ICMP response(error)becouse we got no dport
ls(pkt) will also show you a better Table of the same pkt.show() command
So becouse IP piggybacks on TCP we will further build our Packet to send & receive a response
Now we can see things have changed a bit ... lets send this Packet on the Wire!
the sr1() will send,receive Packets to google
ans,unans is answered or unanswered Packets, so lets look at answered:
Summary is just about the same as sr1()
wireshark(ans) will show you the gui Packet (must have Wireshark installed)
A Packet can travel via TCP or UDP
TCP is Stateless which is why we have Sessions via Cookies on the Web & UDP is Connectionless so we just use Ports.. It's weird I know
Now we create/write a pcap file if we wish to same a particular Packet Capture & it's done like so:
We read/recall that File like so:
I hope you liked this guys....
I will be get more advanced stuff next time
thank you !!