scapy.autorun module

Run commands when the Scapy interpreter starts.

class scapy.autorun.ScapyAutorunInterpreter(*args, **kargs)

Bases: code.InteractiveInterpreter

showsyntaxerror(*args, **kargs)

Display the syntax error that just occurred.

This doesn’t display a stack trace because there isn’t one.

If a filename is given, it is stuffed in the exception instead of what was there before (because Python’s parser always uses “<string>” when reading from a string).

The output is written by self.write(), below.

showtraceback(*args, **kargs)

Display the exception that just occurred.

We remove the first stack item because it is our own code.

The output is written by self.write(), below.

exception scapy.autorun.StopAutorun

Bases: scapy.error.Scapy_Exception

code_run = ''
class scapy.autorun.StringWriter(debug=None)

Bases: object

Util to mock sys.stdout and sys.stderr, and store their output in a ‘s’ var.

scapy.autorun.autorun_commands(cmds, my_globals=None, ignore_globals=None, verb=None)
scapy.autorun.autorun_get_ansi_interactive_session(cmds, **kargs)
scapy.autorun.autorun_get_html_interactive_session(cmds, **kargs)
scapy.autorun.autorun_get_interactive_session(cmds, **kargs)

Create an interactive session and execute the commands passed as “cmds” and return all output

Parameters:cmds – a list of commands to run
Returns:(output, returned) contains both sys.stdout and sys.stderr logs
scapy.autorun.autorun_get_latex_interactive_session(cmds, **kargs)
scapy.autorun.autorun_get_text_interactive_session(cmds, **kargs)