hello all ...
im try to learn scapy ... i need to run this commands from python how i can do it : ?
Quote:ARP Ping
The fastest way to discover hosts on a local ethernet network is to use the ARP Ping method:
>>> ans, unans = srp(Ether(dst="ff:ff:ff:ff:ff:ff")/ARP(pdst="192.168.1.0/24"),timeout=2)
Answers can be reviewed with the following command:
>>> ans.summary(lambda (s,r): r.sprintf("%Ether.src% %ARP.psrc%") )
(Sep-09-2018, 12:42 PM)ichabod801 Wrote: [ -> ]Have you done the download and installation?
yes i already did what is the next step ?
note : i use python 2.7
Well, the next section on that web page is
usage. Full disclosure: I don't know anything about scapy.
(Sep-10-2018, 01:08 PM)ichabod801 Wrote: [ -> ]Well, the next section on that web page is usage. Full disclosure: I don't know anything about scapy.
im not asking about usage i know how to use it ...
but i need to know how to run it from python .... when i try to import
Quote:from scapy.all import *
via visual studio code i got this error :
Error:
Traceback (most recent call last):
File "/root/Desktop/scapy.py", line 1, in <module>
from scapy.all import *
File "/root/Desktop/scapy.py", line 1, in <module>
from scapy.all import *
ImportError: No module named all
and the same for pycharm .... run it from python terminal it does not give me any error :
![[Image: Screenshot_from_2018-09-10_11-36-49.png]](https://s15.postimg.cc/ht3xsatbf/Screenshot_from_2018-09-10_11-36-49.png)
Then it sounds like there is something wrong with your installation. Do you have two versions of Python? Could you have installed it for the one you're not importing from?
(Sep-10-2018, 05:28 PM)ichabod801 Wrote: [ -> ]Then it sounds like there is something wrong with your installation. Do you have two versions of Python? Could you have installed it for the one you're not importing from?
i already remove python 3 and still the same problem :
this is my code :
from scapy.all import srp,Ether,ARP,conf
conf.verb=0
ans, unans = srp(Ether(dst="ff:ff:ff:ff:ff:ff")/ARP(pdst="192.168.20.0/24"),timeout=2)
for snd,rcv in ans:
#print(rcv.sprintf("%Ether.src% - %ARP.psrc%"))
print(rcv.sprintf("%ARP.psrc%"))
this is the error :
Error:
Traceback (most recent call last):
File "/root/Desktop/scapy.py", line 1, in <module>
from scapy.all import srp,Ether,ARP,conf
File "/root/Desktop/scapy.py", line 1, in <module>
from scapy.all import srp,Ether,ARP,conf
ImportError: No module named all
What happens if you just try import scapy
.
(Sep-11-2018, 12:23 PM)ichabod801 Wrote: [ -> ]What happens if you just try import scapy
.
got this error :
Error:
Traceback (most recent call last):
File "/root/Desktop/scapy.py", line 1, in <module>
import scapy
File "/root/Desktop/scapy.py", line 4, in <module>
ans, unans = srp(Ether(dst="ff:ff:ff:ff:ff:ff")/ARP(pdst="192.168.20.0/24"),timeout=2)
NameError: name 'srp' is not defined
it's because your file name is scapy.py. You import your own file, not scapy package. Rename your file.