You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# for defaults we are using .env but allow overwrite through cli arguments
14
+
parser=argparse.ArgumentParser(description='Run an LLM vs a SSH connection.')
15
+
parser.add_argument('--enable-explanation', help="let the LLM explain each round's result", action="store_true")
16
+
parser.add_argument('--enable-update-state', help='ask the LLM to keep a multi-round state with findings', action="store_true")
17
+
parser.add_argument('--log', type=str, help='sqlite3 db for storing log files', default=os.getenv("LOG_DESTINATION") or':memory:')
18
+
parser.add_argument('--target-ip', type=str, help='ssh hostname to use to connect to target system', default=os.getenv("TARGET_IP") or'127.0.0.1')
19
+
parser.add_argument('--target-hostname', type=str, help='safety: what hostname to exepct at the target IP', default=os.getenv("TARGET_HOSTNAME") or"debian")
20
+
parser.add_argument('--target-user', type=str, help='ssh username to use to connect to target system', default=os.getenv("TARGET_USER") or'lowpriv')
21
+
parser.add_argument('--target-password', type=str, help='ssh password to use to connect to target system', default=os.getenv("TARGET_PASSWORD") or'trustno1')
22
+
parser.add_argument('--max-rounds', type=int, help='how many cmd-rounds to execute at max', default=int(os.getenv("MAX_ROUNDS")) or10)
23
+
parser.add_argument('--llm-connection', type=str, help='which LLM driver to use', choices=get_potential_llm_connections(), default=os.getenv("LLM_CONNECTION") or"openai_rest")
24
+
parser.add_argument('--target-os', type=str, help='What is the target operating system?', choices=["linux", "windows"], default="linux")
25
+
parser.add_argument('--model', type=str, help='which LLM to use', default=os.getenv("MODEL") or"gpt-3.5-turbo")
26
+
parser.add_argument('--llm-server-base-url', type=str, help='which LLM server to use', default=os.getenv("LLM_SERVER_BASE_URL") or"https://api.openai.com")
27
+
parser.add_argument('--tag', type=str, help='tag run with string', default="")
28
+
parser.add_argument('--context-size', type=int, help='model context size to use', default=int(os.getenv("CONTEXT_SIZE")) or4096)
29
+
parser.add_argument('--hints', type=argparse.FileType('r', encoding='latin-1'), help='json file with a hint per tested hostname', default=None)
30
+
31
+
returnparser.parse_args()
32
+
33
+
34
+
defget_hint(args, console):
35
+
ifargs.hints:
36
+
try:
37
+
hints=json.load(args.hints)
38
+
ifargs.target_hostnameinhints:
39
+
hint=hints[args.target_hostname]
40
+
console.print(f"[bold green]Using the following hint: '{hint}'")
41
+
returnhint
42
+
except:
43
+
console.print("[yellow]Was not able to load hint file")
0 commit comments