python - Scapy In A Script -


I used scapy as a session in Python, but I want to use it in a script Why so? I want to be able to use an IP address to use and use sys.argv to use the other module. How can this be accomplished?

You have to import it as any other Python module. scapy.layers.inet import scam, import scapy.sendrecv import sr sr.s IP (DST = sys.argv [1]) / ICMP ()) / pre>

Or if you want to import everything at a time:

  import scapy import sys scapy.sr (scapy.IP (dst = Sys.argv [1]) /scapy.ICMP ()) [...]   

Or if you want to code correctly in scp console: from scapy.all

  import * import SYS sr (IP (DST = sys.argv [1]) / ICMP ()    

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -