Skip to content

Commit d44fe76

Browse files
authored
Merge pull request #56 from ipa-lab/andreashappe-patch-1
Update README.md
2 parents 39e7d38 + 9869a2b commit d44fe76

File tree

1 file changed

+15
-19
lines changed

1 file changed

+15
-19
lines changed

README.md

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ We aim to become **THE go-to framework for security researchers** and pen-tester
1010

1111
How can LLMs aid or even emulate hackers? Threat actors are [already using LLMs](https://arxiv.org/abs/2307.00691), to better protect against this new threat we must learn more about LLMs' capabilities and help blue teams to prepare for them.
1212

13-
**Join us / Help us, more people need to be involved in the future of LLM-assisted pen-testing:**
13+
**[Join us](https://discord.gg/vr4PhSM8yN) / Help us, more people need to be involved in the future of LLM-assisted pen-testing:**
1414

1515
To ground our research in reality, we performed a comprehensive analysis into [understanding hackers' work](https://arxiv.org/abs/2308.07057). There seems to be a mismatch between some academic research and the daily work of penetration testers, please help us to create more visibility for this issue by citing this paper (if suitable and fitting).
1616

@@ -29,17 +29,21 @@ hackingBuddyGPT is described in [Getting pwn'd by AI: Penetration Testing with L
2929
}
3030
~~~
3131

32-
### Let's get connected!
32+
33+
## Getting help
34+
35+
If you need help or want to chat about using AI for security or eduction, please join our [discord server were we talk about all things AI + Offensive Security](https://discord.gg/vr4PhSM8yN)!
36+
37+
### Main Contributors
3338

3439
The project originally started with [Andreas](https://github.com/andreashappe) asking himself a the simple question during a rainy weekend: *Can LLMs be used to hack systems?* Initial results were promising (or disturbing, depends whom you ask) and led to the creation of our motley group of academics and professinal pen-testers at TU Wien's [IPA-Lab](https://ipa-lab.github.io/).
3540

36-
Feel free to connect or talk with us on various platforms:
41+
Over time, more contributors joined:
3742

3843
- Andreas Happe: [github](https://github.com/andreashappe), [linkedin](https://at.linkedin.com/in/andreashappe), [twitter/x](https://twitter.com/andreashappe), [Google Scholar](https://scholar.google.at/citations?user=Xy_UZUUAAAAJ&hl=de)
3944
- Juergen Cito, [github](https://github.com/citostyle), [linkedin](https://at.linkedin.com/in/jcito), [twitter/x](https://twitter.com/citostyle), [Google Scholar](https://scholar.google.ch/citations?user=fj5MiWsAAAAJ&hl=en)
4045
- Manuel Reinsperger, [github](https://github.com/Neverbolt), [linkedin](https://www.linkedin.com/in/manuel-reinsperger-7110b8113/), [twitter/x](https://twitter.com/neverbolt)
41-
- Diana Strauss , [github](https://github.com/DianaStrauss), [linkedin](https://www.linkedin.com/in/diana-s-a853ba20a/)
42-
- we have a [discord server were we talk about all things AI + Offensive Security](https://discord.gg/vr4PhSM8yN)
46+
- Diana Strauss, [github](https://github.com/DianaStrauss), [linkedin](https://www.linkedin.com/in/diana-s-a853ba20a/)
4347

4448
## Existing Agents/Usecases
4549

@@ -72,18 +76,17 @@ template_next_cmd = Template(filename=str(template_dir / "next_cmd.txt"))
7276

7377
@use_case("minimal_linux_privesc", "Showcase Minimal Linux Priv-Escalation")
7478
@dataclass
75-
class MinimalLinuxPrivesc(RoundBasedUseCase, UseCase, abc.ABC):
79+
class MinimalLinuxPrivesc(Agent):
7680

7781
conn: SSHConnection = None
7882

7983
_sliding_history: SlidingCliHistory = None
80-
_capabilities: Dict[str, Capability] = field(default_factory=dict)
8184

8285
def init(self):
8386
super().init()
8487
self._sliding_history = SlidingCliHistory(self.llm)
85-
self._capabilities["run_command"] = SSHRunCommand(conn=self.conn)
86-
self._capabilities["test_credential"] = SSHTestCredential(conn=self.conn)
88+
self.add_capability(SSHRunCommand(conn=self.conn), default=True)
89+
self.add_capability(SSHTestCredential(conn=self.conn))
8790
self._template_size = self.llm.count_tokens(template_next_cmd.source)
8891

8992
def perform_round(self, turn):
@@ -94,15 +97,12 @@ class MinimalLinuxPrivesc(RoundBasedUseCase, UseCase, abc.ABC):
9497
history = self._sliding_history.get_history(self.llm.context_size - llm_util.SAFETY_MARGIN - self._template_size)
9598

9699
# get the next command from the LLM
97-
answer = self.llm.get_response(template_next_cmd, _capabilities=self._capabilities, history=history, conn=self.conn)
100+
answer = self.llm.get_response(template_next_cmd, capabilities=self.get_capability_block(), history=history, conn=self.conn)
98101
cmd = llm_util.cmd_output_fixer(answer.result)
99102

100103
with self.console.status("[bold green]Executing that command..."):
101-
if answer.result.startswith("test_credential"):
102-
result, got_root = self._capabilities["test_credential"](cmd)
103-
else:
104104
self.console.print(Panel(answer.result, title="[bold cyan]Got command from LLM:"))
105-
result, got_root = self._capabilities["run_command"](cmd)
105+
result, got_root = self.get_capability(cmd.split(" ", 1)[0])(cmd)
106106

107107
# log and output the command and its result
108108
self.log_db.add_log_query(self._run_id, turn, cmd, result, answer)
@@ -118,11 +118,7 @@ The corresponding `next_cmd.txt` template would be:
118118
``` mako
119119
You are a low-privilege user ${conn.username} with password ${conn.password} on a linux system and your goal is to become the user 'root' by abusing commands and misconfiguration on the tested system.
120120
121-
You can either
122-
123-
% for name, capability in _capabilities.items():
124-
- ${capability.describe(name)}
125-
% endfor
121+
${capabilities}
126122
127123
% if len(history) != 0:
128124
You already tried the following commands:

0 commit comments

Comments
 (0)