scapy.main module

Main module for interactive startup.

scapy.main.init_session(session_name, mydict=None)
scapy.main.interact(mydict=None, argv=None, mybanner=None, loglevel=20)

Starts Scapy’s console.

scapy.main.list_contrib(name=None, ret=False, _debug=False)

Show the list of all existing contribs.

Parameters:
  • name – filter to search the contribs
  • ret – whether the function should return a dict instead of printing it
Returns:

None or a dictionary containing the results if ret=True

scapy.main.load_contrib(name, globals_dict=None, symb_list=None)

Loads a Scapy contrib module to make variables, objects and functions available globally.

If no contrib module can be found with the given name, try to find a layer module, since a contrib module may become a layer module.

scapy.main.load_layer(name, globals_dict=None, symb_list=None)

Loads a Scapy layer module to make variables, objects and functions available globally.

scapy.main.load_module(name, globals_dict=None, symb_list=None)

Loads a Scapy module to make variables, objects and functions available globally.

scapy.main.load_session(fname=None)

Load current Scapy session from the file specified in the fname arg. This will erase any existing session.

params:
  • fname: file to load the scapy session from
scapy.main.save_session(fname='', session=None, pickleProto=-1)

Save current Scapy session to the file specified in the fname arg.

params:
  • fname: file to save the scapy session in
  • session: scapy session to use. If None, the console one will be used
  • pickleProto: pickle proto version (default: -1 = latest)
scapy.main.scapy_delete_temp_files()
scapy.main.update_ipython_session(session)

Updates IPython session with a custom one

scapy.main.update_session(fname=None)

Update current Scapy session from the file specified in the fname arg.

params:
  • fname: file to load the scapy session from