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) -

c# - passing input text from view to contoller with FacebookContext using Facebook app -

Calling a C++ function from C# by passing a string with variable size to it -