mirror of
https://github.com/ivre/masscanned.git
synced 2025-10-02 06:38:21 +00:00
commit
96b82bdce2
1 changed files with 14 additions and 4 deletions
|
@ -54,6 +54,7 @@ if HAS_IVRE:
|
||||||
ZEEK_PASSIVERECON = bool(os.environ.get("USE_ZEEK"))
|
ZEEK_PASSIVERECON = bool(os.environ.get("USE_ZEEK"))
|
||||||
else:
|
else:
|
||||||
ZEEK_PASSIVERECON = False
|
ZEEK_PASSIVERECON = False
|
||||||
|
P0F = bool(os.environ.get("USE_P0F"))
|
||||||
conf.verb = 0
|
conf.verb = 0
|
||||||
|
|
||||||
# prepare configuration file for masscanned
|
# prepare configuration file for masscanned
|
||||||
|
@ -95,8 +96,14 @@ if ZEEK_PASSIVERECON:
|
||||||
"redef tcp_content_deliver_all_orig = T; "
|
"redef tcp_content_deliver_all_orig = T; "
|
||||||
f"redef PassiveRecon::HONEYPOTS += {{ {IPV4_ADDR}, [{IPV6_ADDR}] }}",
|
f"redef PassiveRecon::HONEYPOTS += {{ {IPV4_ADDR}, [{IPV6_ADDR}] }}",
|
||||||
],
|
],
|
||||||
stdout=open("test/res/zeek_passiverecon.stdout", "w"),
|
stdout=open(os.path.join(OUTDIR, "zeek_passiverecon.stdout"), "w"),
|
||||||
stderr=open("test/res/zeek_passiverecon.stderr", "w"),
|
stderr=open(os.path.join(OUTDIR, "zeek_passiverecon.stderr"), "w"),
|
||||||
|
)
|
||||||
|
if P0F:
|
||||||
|
p0f = subprocess.Popen(
|
||||||
|
["p0f", "-i", IFACE, "-o", os.path.join(OUTDIR, "p0f_log.txt")],
|
||||||
|
stdout=open(os.path.join(OUTDIR, "p0f.stdout"), "w"),
|
||||||
|
stderr=open(os.path.join(OUTDIR, "p0f.stderr"), "w"),
|
||||||
)
|
)
|
||||||
# run masscanned
|
# run masscanned
|
||||||
masscanned = subprocess.Popen(
|
masscanned = subprocess.Popen(
|
||||||
|
@ -113,8 +120,8 @@ masscanned = subprocess.Popen(
|
||||||
# if args in CLI, they are passed to masscanned
|
# if args in CLI, they are passed to masscanned
|
||||||
+ sys.argv[1:],
|
+ sys.argv[1:],
|
||||||
env=dict(os.environ, RUST_BACKTRACE="1"),
|
env=dict(os.environ, RUST_BACKTRACE="1"),
|
||||||
stdout=open("test/res/masscanned.stdout", "w"),
|
stdout=open(os.path.join(OUTDIR, "masscanned.stdout"), "w"),
|
||||||
stderr=open("test/res/masscanned.stderr", "w"),
|
stderr=open(os.path.join(OUTDIR, "masscanned.stderr"), "w"),
|
||||||
)
|
)
|
||||||
sleep(1)
|
sleep(1)
|
||||||
|
|
||||||
|
@ -133,4 +140,7 @@ if TCPDUMP:
|
||||||
if ZEEK_PASSIVERECON:
|
if ZEEK_PASSIVERECON:
|
||||||
zeek.kill()
|
zeek.kill()
|
||||||
zeek.wait()
|
zeek.wait()
|
||||||
|
if P0F:
|
||||||
|
p0f.kill()
|
||||||
|
p0f.wait()
|
||||||
sys.exit(result)
|
sys.exit(result)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue