Arp cache poisoning using scapy

B

bakbakinfo123

I am trying to get the arp cache poisoning working with scapy and python but having problems

The python script itself is very simple:
root@ubuntu:/home/joker/Downloads/scapy-2.2.0/scripts# cat arp_poison.py
#!/usr/bin/env python

import sys

from scapy.all import *

arpcachepoison("00:22:fa:98:5e:04", "192.168.1.131")

The error I am getting is illegal IP address. How do I fix it?



root@ubuntu:/home/joker/Downloads/scapy-2.2.0/scripts# python arp_poison.py
WARNING: No route found for IPv6 destination :: (no default route?)
Traceback (most recent call last):
File "arp_poison.py", line 7, in <module>
arpcachepoison("00:22:fa:98:5e:04", "192.168.1.131")
File "/usr/lib/python2.7/dist-packages/scapy/layers/l2.py", line 440, in arpcachepoison
tmac = getmacbyip(target)
File "/usr/lib/python2.7/dist-packages/scapy/layers/l2.py", line 53, in getmacbyip
tmp = map(ord, inet_aton(ip))
socket.error: illegal IP address string passed to inet_aton
root@ubuntu:/home/joker/Downloads/scapy-2.2.0/scripts#
root@ubuntu:/home/joker/Downloads/scapy-2.2.0/scripts#
 
D

Dan Stromberg

I am trying to get the arp cache poisoning working with scapy and python
but having problems

The python script itself is very simple:
root@ubuntu:/home/joker/Downloads/scapy-2.2.0/scripts# cat arp_poison.py
#!/usr/bin/env python

import sys

from scapy.all import *

arpcachepoison("00:22:fa:98:5e:04", "192.168.1.131")

The error I am getting is illegal IP address. How do I fix it?

It looks to me like arpcachepoison wants two IP's, not a MAC and an IP.
 
B

bakbakinfo123

I am trying to get the arp cache poisoning working with scapy and python but having problems



The python script itself is very simple:

root@ubuntu:/home/joker/Downloads/scapy-2.2.0/scripts# cat arp_poison.py

#!/usr/bin/env python



import sys



from scapy.all import *



arpcachepoison("00:22:fa:98:5e:04", "192.168.1.131")



The error I am getting is illegal IP address. How do I fix it?







root@ubuntu:/home/joker/Downloads/scapy-2.2.0/scripts# python arp_poison.py

WARNING: No route found for IPv6 destination :: (no default route?)

Traceback (most recent call last):

File "arp_poison.py", line 7, in <module>

arpcachepoison("00:22:fa:98:5e:04", "192.168.1.131")

File "/usr/lib/python2.7/dist-packages/scapy/layers/l2.py", line 440, in arpcachepoison

tmac = getmacbyip(target)

File "/usr/lib/python2.7/dist-packages/scapy/layers/l2.py", line 53, ingetmacbyip

tmp = map(ord, inet_aton(ip))

socket.error: illegal IP address string passed to inet_aton

root@ubuntu:/home/joker/Downloads/scapy-2.2.0/scripts#

root@ubuntu:/home/joker/Downloads/scapy-2.2.0/scripts#

This works. Although it shouldn't.

The documentation should be changed to reflect this. As per document:

arpcachepoison
arpcachepoison(target,victim,interval=60)
Poison target’s cache with (your MAC,victim’s IP)

It makes more sense to assign a MAC to the vitim ip to falsly claim and poison the network so ideally the documentation is correct the the command does not work as such. However the command with 2 IPs does the thing correctly.. So change documentation? How do one go about it?

Also all the items in () need to have "" or it gives syntax error. Is that how it should work?
 
B

bakbakinfo123

I am trying to get the arp cache poisoning working with scapy and python but having problems



The python script itself is very simple:

root@ubuntu:/home/joker/Downloads/scapy-2.2.0/scripts# cat arp_poison.py

#!/usr/bin/env python



import sys



from scapy.all import *



arpcachepoison("00:22:fa:98:5e:04", "192.168.1.131")



The error I am getting is illegal IP address. How do I fix it?







root@ubuntu:/home/joker/Downloads/scapy-2.2.0/scripts# python arp_poison.py

WARNING: No route found for IPv6 destination :: (no default route?)

Traceback (most recent call last):

File "arp_poison.py", line 7, in <module>

arpcachepoison("00:22:fa:98:5e:04", "192.168.1.131")

File "/usr/lib/python2.7/dist-packages/scapy/layers/l2.py", line 440, in arpcachepoison

tmac = getmacbyip(target)

File "/usr/lib/python2.7/dist-packages/scapy/layers/l2.py", line 53, in getmacbyip

tmp = map(ord, inet_aton(ip))

socket.error: illegal IP address string passed to inet_aton

root@ubuntu:/home/joker/Downloads/scapy-2.2.0/scripts#

root@ubuntu:/home/joker/Downloads/scapy-2.2.0/scripts#
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top