diff --git a/hw6/app.py b/hw6/app.py index e83fff2..4281157 100644 --- a/hw6/app.py +++ b/hw6/app.py @@ -18,7 +18,8 @@ from tools import ( wifi_network_reconnissance, wifi_encryption_cracking, packet_frame_transmission, - packet_capture_reconnaissance + packet_capture_reconnaissance, + deauth_and_capture ) from langchain import hub @@ -46,8 +47,9 @@ tools.extend( change_adapter_mode, #wifi_network_reconnissance, wifi_encryption_cracking, - packet_frame_transmission, - packet_capture_reconnaissance + #packet_frame_transmission, + packet_capture_reconnaissance, + deauth_and_capture ] ) base_prompt = hub.pull("langchain-ai/react-agent-template") diff --git a/hw6/tools.py b/hw6/tools.py index 8c50504..68d1cd5 100644 --- a/hw6/tools.py +++ b/hw6/tools.py @@ -54,9 +54,27 @@ class CrackPassword(BaseModel): def wifi_encryption_cracking(params: str) -> str: """Can pass parameters to aircrack-ng to perform wifi encryption cracking""" params = params.replace("`", "").replace("\n", "") # fix buggy input from LLM + hash = random.getrandbits(16) res = shell_tool.run({"commands": [f"aircrack-ng {params}"]}) return res +class DeauthAndCapture(BaseModel): + bssid: str = Field( + description="Should be a BSSID of a wifi AP" + ) + client: str = Field(description="Should be a MAC of a client connected to the above BSSID, as the target of the de-auth") + + +@tool( + "Perform a de-auth and capture for a given wifi BSSID and client", + args_schema=DeauthAndCapture, + return_direct=False, +) +def deauth_and_capture(bssid: str, client:str) -> str: + """Can pass bssid and client parameters to aireplay-ng to perform and capture a de-auth""" + params = params.replace("`", "").replace("\n", "") # fix buggy input from LLM + res = shell_tool.run({"commands": [f"sudo aireplay-ng --deauth 10 -a {bssid} -c {client} wlo1mon"]}) + return res class PacketTransmission(BaseModel): params: str = Field(