Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Override default sensor_id value with value of command-line switch #279

Merged
merged 1 commit into from
Jan 15, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion pyrdp/mitm/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def buildArgParser():
parser.add_argument("--auth", help="Specify allowed authentication mechanisms (Comma-separated, choose from: tls, ssp)", default="tls")
parser.add_argument(
"-s", "--sensor-id", help="Sensor ID (to differentiate multiple instances of the MITM"
" where logs are aggregated at one place)", default="PyRDP")
" where logs are aggregated at one place)")
parser.add_argument("--payload", help="Command to run automatically upon connection", default=None)
parser.add_argument("--payload-powershell",
help="PowerShell command to run automatically upon connection", default=None)
Expand Down Expand Up @@ -149,6 +149,8 @@ def configure(cmdline=None) -> MITMConfig:
cfg.set('logs', 'filter', args.log_filter)
if args.log_level:
cfg.set('vars', 'level', args.log_level)
if args.sensor_id:
cfg.set('vars', 'sensor_id', args.sensor_id)

outDir = Path(cfg.get('vars', 'output_dir'))
outDir.mkdir(exist_ok=True)
Expand Down