Skip to content

Commit

Permalink
Merge pull request #5 from andreashappe/web3
Browse files Browse the repository at this point in the history
Promise less, show more
  • Loading branch information
andreashappe authored Oct 18, 2024
2 parents f5c523e + cc2e12f commit 41a6a2c
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 11 deletions.
47 changes: 43 additions & 4 deletions docs/blog/posts/2024-10-18-adding-a-scribe.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ This block ensures that the notes are displayed in real-time, providing a clear
Here is a video of the Scribe in action, you can reproduce it by running `python src/executor_and_scribe.py`:
<video src="/screencast_offensive_graph.mp4" controls></video>


#### 5. **Managing Shared State with the Scribe**
Let's move from our small example to a more complex one by integrating the Scribe into the `plan_and_execute` graph:
Our shared state (`PlanExecute`) must accommodate the notes taken by the Scribe. Here's the updated structure:
Expand Down Expand Up @@ -176,9 +175,49 @@ If you were not able to complete the task, stop after 15 planning steps and give
Notice the inclusion of `{notes}` in the prompt, allowing the Replanner to make informed decisions based on the accumulated notes.

### Conclusion
Let's take a look at the notes after we finished our run:

``` markdown
# Linux System Notes

## User Information
- Current user: `lowpriv`
- User password: `trustno1`
- User privilege: Low-privilege
- User ID: `uid=1001(lowpriv)`
- Group ID: `gid=1001(lowpriv)`
- Groups: `1001(lowpriv)`

## Authentication
- SSH login successful with provided credentials (`lowpriv` / `trustno1`).
- User `lowpriv` is not root.

## Privilege Escalation
- Successful privilege escalation to root using SUID binary `/usr/bin/python3.11`.
- Command used: `python3.11 -c 'import os; os.setuid(0); os.system("/bin/bash")'`.

## SUID Binaries
- Identified SUID binaries:
- `/usr/bin/python3.11` (used for privilege escalation)
- `/usr/bin/newgrp`
- `/usr/bin/chfn`
- `/usr/bin/gpasswd`
- `/usr/bin/chsh`
- `/usr/bin/passwd`
- `/usr/bin/sudo`
- `/usr/bin/mount`
- `/usr/bin/su`
- `/usr/bin/find`
- `/usr/bin/umount`
- `/usr/lib/openssh/ssh-keysign`
- `/usr/lib/dbus-1.0/dbus-daemon-launch-helper`

## Next Steps
- Verify system access and capabilities as root.
- Document any additional findings or configurations.
```
The Scribe agent was able to reduce the vast output of our tool calls into a concise fact sheet. Depending on the recursion-limit we set to our executor this can be the result of multiple thousend lines of command line output.

The addition of the Scribe node has been transformative for our plan-and-execute architecture. By meticulously capturing and managing contextual information, we've not only optimized the performance of our LLMs but also enhanced the system's overall reasoning capabilities. This structured approach to note-taking paves the way for more sophisticated and efficient planning mechanisms, setting the stage for future advancements in our multi-agent architecture.

As we continue to refine and expand our system, the Scribe will undoubtedly play a pivotal role in ensuring that our agents remain informed, agile, and capable of tackling increasingly complex tasks with unwavering precision.
This structured approach to note-taking paves the way for more sophisticated and efficient planning mechanisms, setting the stage for future advancements in our journey to multi-step attack planning. As we continue to refine and expand our system, the Scribe will undoubtedly play a pivotal role in ensuring that our agents remain informed, agile, and capable of tackling increasingly complex tasks.


7 changes: 0 additions & 7 deletions docs/series/initial-journey.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,3 @@ This is our initial foray into using LangChain/LangGraph for security agents. Th
| 10.10.2024 | [First Steps and Initial Version](./../blog/posts/2024-10-10-first-steps-and-initial-version.md) | Creating a first autonomous linux priv-esc agent using langgraph. Introduce `ssh connection` as Tool so that the agent can execute commands over SSH. |
| 11.10.2024 | [Improving Configuration Handling, esp. for Tools](./../blog/posts/2024-10-11-configuration-for-tool-calls.md) | Remove Hardcoded Configuration and improve Tool-Integration. |
| 12.10.2024 | [Simplify our Tool-Calling Agent through `create_react_agent`](./../blog/posts/2024-10-12-create_react_agent.md) | LangGraph offers a prebuilt react agent that highly simplifies our code (albeit does not allow us to further customize the agent flows). |

## Advanced Implementations

| Date | Blog Post | Description |
| --- | --- | --- |
| 14.10.2024 | [Adding Plan-and-Execute Planner](./../blog/posts/2024-10-14-plan-and-exec.md) | Implement the Plan-and-Execute pattern for pen-testing. This combines a high-level task list for pen-test planing with a low-level executor that tries to execute the given high-level task against a target virtual machine. |
| 18.10.2024 | [Implementing a scribe for notetaking](./../blog/posts/2024-10-18-adding-a-scribe.md) | Introduces a Scribe node to manage context and take structured notes, addressing the challenge of growing context in LLMs. The Scribe efficiently captures and condenses crucial information, improving the system's overall reasoning capabilities and provides a human readable fact sheet. |

0 comments on commit 41a6a2c

Please sign in to comment.