Skip to content
Snippets Groups Projects
Commit af80bbfa authored by Dirk Loss's avatar Dirk Loss
Browse files

Merge with main repo

parents f2647ee6 adb84366
No related branches found
No related tags found
No related merge requests found
......@@ -287,6 +287,7 @@ def _prompt_changer(attr,val):
class Conf(ConfClass):
"""This object contains the configuration of scapy.
session : filename where the session will be saved
interactive_shell : If set to "ipython", use IPython as shell. Default: Python
stealth : if 1, prevents any unwanted packet to go out (ARP, DNS, ...)
checkIPID: if 0, doesn't check that IPID matches between IP sent and ICMP IP citation received
if 1, checks that they either are equal or byte swapped equals (bug in some IP stacks)
......@@ -314,6 +315,7 @@ extensions_paths: path or list of paths where extensions are to be looked for
version = "2.1.0-dev"
session = ""
interactive = False
interactive_shell = ""
stealth = "not implemented"
iface = None
readfunc = None
......
......@@ -296,8 +296,23 @@ def interact(mydict=None,argv=None,mybanner=None,loglevel=20):
atexit.register(scapy_delete_temp_files)
conf.color_theme = DefaultTheme()
code.interact(banner = the_banner % (conf.version),
local=session, readfunc=conf.readfunc)
IPYTHON=False
if conf.interactive_shell.lower() == "ipython":
try:
import IPython
IPYTHON=True
except ImportError, e:
log_loading.warning("IPython not available. Using standard Python shell instead.")
IPYTHON=False
if IPYTHON:
banner = the_banner % (conf.version) + " using IPython %s" % IPython.__version__
ipshell = IPython.Shell.IPShellEmbed(banner = banner)
ipshell(local_ns=session)
else:
code.interact(banner = the_banner % (conf.version),
local=session, readfunc=conf.readfunc)
if conf.session:
save_session(conf.session, session)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment