diff --git a/.claude/skills/ffind/SKILL.md b/.claude/skills/ffind/SKILL.md index f415adf..457c568 100644 --- a/.claude/skills/ffind/SKILL.md +++ b/.claude/skills/ffind/SKILL.md @@ -21,12 +21,14 @@ When the user asks to analyze files, find specific file types, or extract filesy - Ask if they want all file types or just artifact types 2. **Execute the analysis**: - - Use the ffind command from the iothackbot bin directory - - Basic usage: `ffind [ ...]` - - To extract filesystems: `ffind -e` - - Custom extraction directory: `ffind -e -d /path/to/output` - - Show all file types: `ffind -a` - - Verbose output: `ffind -v` + - Use the ffind command via uv run entry point + - Basic usage: `uv run ffind [ ...]` + - To extract filesystems: `uv run ffind -e` + - Custom extraction directory: `uv run ffind -e -d /path/to/output` + - Show all file types: `uv run ffind -a` + - Verbose output: `uv run ffind -v` + + **Note**: If the venv is activated or if bin/ is in PATH, you can use `ffind` directly without `uv run` 3. **Output formats**: - `--format text` (default): Human-readable colored output with type summaries @@ -43,24 +45,26 @@ When the user asks to analyze files, find specific file types, or extract filesy Analyze a firmware file to see file types: ```bash -ffind /path/to/firmware.bin +uv run ffind /path/to/firmware.bin ``` Extract all filesystems from a firmware image: ```bash -sudo ffind /path/to/firmware.bin -e +sudo uv run ffind /path/to/firmware.bin -e ``` Analyze multiple files and show all types: ```bash -ffind /path/to/file1.bin /path/to/file2.bin -a +uv run ffind /path/to/file1.bin /path/to/file2.bin -a ``` Extract to a custom directory: ```bash -sudo ffind /path/to/firmware.bin -e -d /tmp/my-extraction +sudo uv run ffind /path/to/firmware.bin -e -d /tmp/my-extraction ``` +**Note**: You can also use `ffind` directly (without `uv run`) if the venv is activated or bin/ is in your PATH. + ## Important Notes - Extraction requires root/sudo privileges diff --git a/.claude/skills/iotnet/SKILL.md b/.claude/skills/iotnet/SKILL.md index 5c8ce40..5fefe84 100644 --- a/.claude/skills/iotnet/SKILL.md +++ b/.claude/skills/iotnet/SKILL.md @@ -32,20 +32,22 @@ When the user asks to analyze network traffic, capture IoT traffic, or assess ne - Check if custom detection rules are needed 3. **Execute the analysis**: - - Use the iotnet command from the iothackbot bin directory + - Use the iotnet command via uv run entry point + + **Note**: If the venv is activated or if bin/ is in PATH, you can use `iotnet` directly without `uv run` ## Usage Modes ### PCAP Analysis (Offline) Analyze one or more existing packet capture files: ```bash -iotnet capture1.pcap capture2.pcap +uv run iotnet capture1.pcap capture2.pcap ``` ### Live Capture Capture and analyze traffic in real-time: ```bash -sudo iotnet -i eth0 -d 30 +sudo uv run iotnet -i eth0 -d 30 ``` ## Parameters @@ -74,34 +76,36 @@ sudo iotnet -i eth0 -d 30 Analyze a packet capture file: ```bash -iotnet /path/to/capture.pcap +uv run iotnet /path/to/capture.pcap ``` Live capture for 60 seconds on wifi interface: ```bash -sudo iotnet -i wlan0 -d 60 +sudo uv run iotnet -i wlan0 -d 60 ``` Analyze traffic for specific IP: ```bash -iotnet capture.pcap --ip 192.168.1.100 +uv run iotnet capture.pcap --ip 192.168.1.100 ``` Live capture with BPF filter: ```bash -sudo iotnet -i eth0 -c "port 1883 or port 5683" -d 45 +sudo uv run iotnet -i eth0 -c "port 1883 or port 5683" -d 45 ``` Multiple PCAPs with custom config: ```bash -iotnet file1.pcap file2.pcap --config custom-rules.json +uv run iotnet file1.pcap file2.pcap --config custom-rules.json ``` Filter by display filter (Wireshark syntax): ```bash -iotnet capture.pcap --display-filter "mqtt or coap" +uv run iotnet capture.pcap --display-filter "mqtt or coap" ``` +**Note**: You can also use `iotnet` directly (without `uv run`) if the venv is activated or bin/ is in your PATH. + ## Detected IoT Protocols The tool can identify: diff --git a/.claude/skills/onvifscan/SKILL.md b/.claude/skills/onvifscan/SKILL.md index 0df3797..891bd71 100644 --- a/.claude/skills/onvifscan/SKILL.md +++ b/.claude/skills/onvifscan/SKILL.md @@ -27,15 +27,17 @@ When the user asks to scan ONVIF devices, test IP cameras, or assess IoT device - Check if they have custom wordlists 3. **Execute the scan**: - - Use the onvifscan command from the iothackbot bin directory - - Format: `onvifscan [options]` + - Use the onvifscan command via uv run entry point + - Format: `uv run onvifscan [options]` + + **Note**: If the venv is activated or if bin/ is in PATH, you can use `onvifscan` directly without `uv run` ## Subcommands ### Auth Scan Tests ONVIF endpoints for authentication requirements: ```bash -onvifscan auth http://192.168.1.100 +uv run onvifscan auth http://192.168.1.100 ``` Options: @@ -46,7 +48,7 @@ Options: ### Brute Force Attempts credential brute-forcing on protected endpoints: ```bash -onvifscan brute http://192.168.1.100 +uv run onvifscan brute http://192.168.1.100 ``` Options: @@ -58,19 +60,21 @@ Options: Quick auth check on a device: ```bash -onvifscan auth 192.168.1.100 +uv run onvifscan auth 192.168.1.100 ``` Auth check with verbose output: ```bash -onvifscan auth http://192.168.1.100:8080 -v +uv run onvifscan auth http://192.168.1.100:8080 -v ``` Brute force with custom wordlists: ```bash -onvifscan brute 192.168.1.100 --usernames custom-users.txt --passwords custom-pass.txt +uv run onvifscan brute 192.168.1.100 --usernames custom-users.txt --passwords custom-pass.txt ``` +**Note**: You can also use `onvifscan` directly (without `uv run`) if the venv is activated or bin/ is in your PATH. + ## Important Notes - URLs can omit `http://` - it will be added automatically diff --git a/.claude/skills/picocom/SKILL.md b/.claude/skills/picocom/SKILL.md index 13791b8..6347d05 100644 --- a/.claude/skills/picocom/SKILL.md +++ b/.claude/skills/picocom/SKILL.md @@ -10,7 +10,10 @@ This skill enables interaction with IoT device UART consoles using picocom for s ## Prerequisites - picocom must be installed on the system -- Python 3 with pyserial library (`sudo pacman -S python-pyserial` on Arch, or `pip install pyserial`) +- Python 3 with pyserial library: + - **Arch Linux:** `sudo pacman -S python-pyserial` + - **Using uv (recommended):** Run `uv sync` from the project root to install all dependencies + - **Using pip:** `pip install pyserial` - UART connection to the target device (USB-to-serial adapter, FTDI cable, etc.) - Appropriate permissions to access serial devices (typically /dev/ttyUSB* or /dev/ttyACM*) @@ -42,42 +45,75 @@ The helper script solves many problems with direct picocom usage: ### Quick Start with Serial Helper -**Single Command:** +**Note:** If you installed dependencies with `uv sync`, use `uv run` from the project root: ```bash -python3 .claude/skills/picocom/serial_helper.py --device /dev/ttyUSB0 --command "help" +# From project root (recommended) +uv run python .claude/skills/picocom/serial_helper.py --device /dev/ttyUSB0 --command "help" +``` + +Alternatively, activate the virtual environment: +```bash +source .venv/bin/activate # On Windows: .venv\Scripts\activate +python .claude/skills/picocom/serial_helper.py --device /dev/ttyUSB0 --command "help" +``` + +**Single Command (from project root):** +```bash +python .claude/skills/picocom/serial_helper.py --device /dev/ttyUSB0 --command "help" ``` **With Custom Prompt (recommended for known devices):** ```bash -python3 .claude/skills/picocom/serial_helper.py --device /dev/ttyUSB0 --prompt "User@[^>]+>" --command "ifconfig" +# Using uv (recommended) +uv run python .claude/skills/picocom/serial_helper.py --device /dev/ttyUSB0 --prompt "User@[^>]+>" --command "ifconfig" + +# Or with activated venv: source .venv/bin/activate +# Or with system Python if dependencies are installed: python3 .claude/skills/picocom/serial_helper.py ... ``` **Interactive Mode:** ```bash -python3 .claude/skills/picocom/serial_helper.py --device /dev/ttyUSB0 --interactive +# Using uv (recommended) +uv run python .claude/skills/picocom/serial_helper.py --device /dev/ttyUSB0 --interactive + +# Or with activated venv: source .venv/bin/activate +# Or with system Python if dependencies are installed: python3 .claude/skills/picocom/serial_helper.py ... ``` **Batch Commands from File:** ```bash # Create a file with commands (one per line) echo -e "help\ndate\nifconfig\nps" > commands.txt -python3 .claude/skills/picocom/serial_helper.py --device /dev/ttyUSB0 --script commands.txt + +# Using uv (recommended) +uv run python .claude/skills/picocom/serial_helper.py --device /dev/ttyUSB0 --script commands.txt + +# Or with activated venv: source .venv/bin/activate +# Or with system Python if dependencies are installed: python3 .claude/skills/picocom/serial_helper.py ... ``` **JSON Output (for parsing):** ```bash -python3 .claude/skills/picocom/serial_helper.py --device /dev/ttyUSB0 --command "help" --json +# Using uv (recommended) +uv run python .claude/skills/picocom/serial_helper.py --device /dev/ttyUSB0 --command "help" --json + +# Or with activated venv: source .venv/bin/activate +# Or with system Python if dependencies are installed: python3 .claude/skills/picocom/serial_helper.py ... ``` **Debug Mode:** ```bash -python3 .claude/skills/picocom/serial_helper.py --device /dev/ttyUSB0 --command "help" --debug +# Using uv (recommended) +uv run python .claude/skills/picocom/serial_helper.py --device /dev/ttyUSB0 --command "help" --debug + +# Or with activated venv: source .venv/bin/activate +# Or with system Python if dependencies are installed: python3 .claude/skills/picocom/serial_helper.py ... ``` **Session Logging (for observation):** ```bash -# Terminal 1 - Run with logging -python3 .claude/skills/picocom/serial_helper.py \ +# Terminal 1 - Run with logging (using uv recommended) +uv run python .claude/skills/picocom/serial_helper.py \ --device /dev/ttyUSB0 \ --prompt "User@[^>]+>" \ --logfile /tmp/session.log \ @@ -85,6 +121,9 @@ python3 .claude/skills/picocom/serial_helper.py \ # Terminal 2 - Watch the session in real-time tail -f /tmp/session.log + +# Or with activated venv: source .venv/bin/activate +# Or with system Python if dependencies are installed: python3 .claude/skills/picocom/serial_helper.py ... ``` **Note:** See `OBSERVING_SESSIONS.md` for comprehensive guide on monitoring serial sessions. @@ -101,29 +140,34 @@ tail -f /tmp/session.log **Basic passive monitoring:** ```bash -python3 .claude/skills/picocom/serial_helper.py \ +# Using uv (recommended) +uv run python .claude/skills/picocom/serial_helper.py \ --device /dev/ttyUSB0 \ --monitor \ --duration 30 \ --logfile /tmp/uart.log + +# Or with activated venv: source .venv/bin/activate && python .claude/skills/picocom/serial_helper.py ... ``` **Monitor with external trigger script:** ```bash -# Run external script after 5 seconds and capture triggered UART output -python3 .claude/skills/picocom/serial_helper.py \ +# Run external script after 5 seconds and capture triggered UART output (using uv) +uv run python .claude/skills/picocom/serial_helper.py \ --device /dev/ttyUSB0 \ --monitor \ --duration 60 \ --trigger-script "python3 /path/to/test_script.py" \ --trigger-delay 5 \ --logfile /tmp/triggered_uart.log + +# Or with activated venv: source .venv/bin/activate && python .claude/skills/picocom/serial_helper.py ... ``` **Monitor with baseline capture:** ```bash -# Capture 10s baseline, run trigger at 15s, continue for total 60s -python3 .claude/skills/picocom/serial_helper.py \ +# Capture 10s baseline, run trigger at 15s, continue for total 60s (using uv) +uv run python .claude/skills/picocom/serial_helper.py \ --device /dev/ttyUSB0 \ --monitor \ --duration 60 \ @@ -131,6 +175,8 @@ python3 .claude/skills/picocom/serial_helper.py \ --trigger-delay 15 \ --baseline-duration 10 \ --logfile /tmp/reboot_monitor.log + +# Or with activated venv: source .venv/bin/activate && python .claude/skills/picocom/serial_helper.py ... ``` **Monitor mode options:** @@ -199,8 +245,8 @@ The helper script includes common prompt patterns, but you can specify custom on Here's a complete example of safely enumerating a device: ```bash -# Set variables for convenience -HELPER="python3 .claude/skills/picocom/serial_helper.py" +# Set variables for convenience (using uv) +HELPER="uv run python .claude/skills/picocom/serial_helper.py" DEVICE="/dev/ttyUSB0" PROMPT="User@[^>]+>" # Adjust for your device LOGFILE="/tmp/serial_session.log" @@ -226,6 +272,9 @@ $HELPER --device $DEVICE --prompt "$PROMPT" --logfile "$LOGFILE" --command "ls / # Device identifiers $HELPER --device $DEVICE --prompt "$PROMPT" --logfile "$LOGFILE" --command "getudid" $HELPER --device $DEVICE --prompt "$PROMPT" --logfile "$LOGFILE" --command "catmwarestate" + +# Note: If using activated venv, set HELPER="python .claude/skills/picocom/serial_helper.py" +# If using system Python with deps installed, set HELPER="python3 .claude/skills/picocom/serial_helper.py" ``` **IMPORTANT FOR CLAUDE CODE**: When using this skill, ALWAYS include `--logfile /tmp/serial_session.log` in every command so the user can monitor activity with `tail -f /tmp/serial_session.log`. @@ -236,8 +285,8 @@ A common IoT pentesting scenario: testing if network requests, API calls, or har **Example: Testing if API requests generate UART logs** ```bash -# Monitor UART while sending network request -python3 .claude/skills/picocom/serial_helper.py \ +# Monitor UART while sending network request (using uv) +uv run python .claude/skills/picocom/serial_helper.py \ --device /dev/ttyUSB0 \ --monitor \ --duration 30 \ @@ -247,12 +296,15 @@ python3 .claude/skills/picocom/serial_helper.py \ # Review what the device logged when API was called cat /tmp/api_test.log + +# Or with activated venv: source .venv/bin/activate && python .claude/skills/picocom/serial_helper.py ... +# Or with system Python: python3 .claude/skills/picocom/serial_helper.py ... ``` **Example: Testing authentication attempts** ```bash -# Monitor UART during login attempts -python3 .claude/skills/picocom/serial_helper.py \ +# Monitor UART during login attempts (using uv) +uv run python .claude/skills/picocom/serial_helper.py \ --device /dev/ttyUSB0 \ --monitor \ --duration 45 \ @@ -261,18 +313,24 @@ python3 .claude/skills/picocom/serial_helper.py \ --baseline-duration 5 \ --logfile /tmp/auth_test.log \ --json > /tmp/auth_results.json + +# Or with activated venv: source .venv/bin/activate && python .claude/skills/picocom/serial_helper.py ... +# Or with system Python: python3 .claude/skills/picocom/serial_helper.py ... ``` **Example: Boot sequence analysis** ```bash -# Capture device boot logs (reboot via network API) -python3 .claude/skills/picocom/serial_helper.py \ +# Capture device boot logs (reboot via network API, using uv) +uv run python .claude/skills/picocom/serial_helper.py \ --device /dev/ttyUSB0 \ --monitor \ --duration 120 \ --trigger-script "curl http://192.168.1.100/api/reboot" \ --trigger-delay 5 \ --logfile /tmp/boot_sequence.log + +# Or with activated venv: source .venv/bin/activate && python .claude/skills/picocom/serial_helper.py ... +# Or with system Python: python3 .claude/skills/picocom/serial_helper.py ... ``` **Why this is useful for pentesting:** diff --git a/.claude/skills/telnetshell/SKILL.md b/.claude/skills/telnetshell/SKILL.md index 3638036..269b5f5 100644 --- a/.claude/skills/telnetshell/SKILL.md +++ b/.claude/skills/telnetshell/SKILL.md @@ -9,7 +9,10 @@ This skill enables interaction with IoT device shells accessible via telnet for ## Prerequisites -- Python 3 with pexpect library (`pip install pexpect` or `sudo pacman -S python-pexpect`) +- Python 3 with pexpect library: + - **Arch Linux:** `sudo pacman -S python-pexpect` + - **Using uv (recommended):** Run `uv sync` from the project root to install all dependencies + - **Using pip:** `pip install pexpect` - telnet client installed on the system (`sudo pacman -S inetutils` on Arch) - Network access to the target device's telnet port @@ -42,47 +45,88 @@ The helper script solves many problems with direct telnet usage: ### Quick Start with Telnet Helper -**Single Command:** +**Note:** If you installed dependencies with `uv sync`, use `uv run` from the project root: ```bash -python3 .claude/skills/telnetshell/telnet_helper.py --host 192.168.1.100 --command "uname -a" +# From project root (recommended) +uv run python .claude/skills/telnetshell/telnet_helper.py --host 192.168.1.100 --command "uname -a" +``` + +Alternatively, activate the virtual environment: +```bash +source .venv/bin/activate # On Windows: .venv\Scripts\activate +python .claude/skills/telnetshell/telnet_helper.py --host 192.168.1.100 --command "uname -a" +``` + +**Single Command (from project root):** +```bash +# Using uv (recommended) +uv run python .claude/skills/telnetshell/telnet_helper.py --host 192.168.1.100 --command "uname -a" + +# Or with activated venv: source .venv/bin/activate +# Or with system Python: python3 .claude/skills/telnetshell/telnet_helper.py ... ``` **Custom Port:** ```bash -python3 .claude/skills/telnetshell/telnet_helper.py --host 192.168.1.100 --port 2222 --command "ls /" +# Using uv (recommended) +uv run python .claude/skills/telnetshell/telnet_helper.py --host 192.168.1.100 --port 2222 --command "ls /" + +# Or with activated venv: source .venv/bin/activate +# Or with system Python: python3 .claude/skills/telnetshell/telnet_helper.py ... ``` **With Custom Prompt (recommended for known devices):** ```bash -python3 .claude/skills/telnetshell/telnet_helper.py --host 192.168.1.100 --prompt "^/ [#\$]" --command "ifconfig" +# Using uv (recommended) +uv run python .claude/skills/telnetshell/telnet_helper.py --host 192.168.1.100 --prompt "^/ [#\$]" --command "ifconfig" + +# Or with activated venv: source .venv/bin/activate +# Or with system Python: python3 .claude/skills/telnetshell/telnet_helper.py ... ``` **Interactive Mode:** ```bash -python3 .claude/skills/telnetshell/telnet_helper.py --host 192.168.1.100 --port 2222 --interactive +# Using uv (recommended) +uv run python .claude/skills/telnetshell/telnet_helper.py --host 192.168.1.100 --port 2222 --interactive + +# Or with activated venv: source .venv/bin/activate +# Or with system Python: python3 .claude/skills/telnetshell/telnet_helper.py ... ``` **Batch Commands from File:** ```bash # Create a file with commands (one per line) echo -e "uname -a\ncat /proc/version\nifconfig\nps" > commands.txt -python3 .claude/skills/telnetshell/telnet_helper.py --host 192.168.1.100 --script commands.txt + +# Using uv (recommended) +uv run python .claude/skills/telnetshell/telnet_helper.py --host 192.168.1.100 --script commands.txt + +# Or with activated venv: source .venv/bin/activate +# Or with system Python: python3 .claude/skills/telnetshell/telnet_helper.py ... ``` **JSON Output (for parsing):** ```bash -python3 .claude/skills/telnetshell/telnet_helper.py --host 192.168.1.100 --command "uname -a" --json +# Using uv (recommended) +uv run python .claude/skills/telnetshell/telnet_helper.py --host 192.168.1.100 --command "uname -a" --json + +# Or with activated venv: source .venv/bin/activate +# Or with system Python: python3 .claude/skills/telnetshell/telnet_helper.py ... ``` **Debug Mode:** ```bash -python3 .claude/skills/telnetshell/telnet_helper.py --host 192.168.1.100 --command "ls" --debug +# Using uv (recommended) +uv run python .claude/skills/telnetshell/telnet_helper.py --host 192.168.1.100 --command "ls" --debug + +# Or with activated venv: source .venv/bin/activate +# Or with system Python: python3 .claude/skills/telnetshell/telnet_helper.py ... ``` **Session Logging (for observation):** ```bash -# Terminal 1 - Run with logging -python3 .claude/skills/telnetshell/telnet_helper.py \ +# Terminal 1 - Run with logging (using uv recommended) +uv run python .claude/skills/telnetshell/telnet_helper.py \ --host 192.168.1.100 \ --port 2222 \ --logfile /tmp/session.log \ @@ -90,6 +134,9 @@ python3 .claude/skills/telnetshell/telnet_helper.py \ # Terminal 2 - Watch the session in real-time tail -f /tmp/session.log + +# Or with activated venv: source .venv/bin/activate +# Or with system Python: python3 .claude/skills/telnetshell/telnet_helper.py ... ``` **Note:** See `OBSERVING_SESSIONS.md` for comprehensive guide on monitoring telnet sessions. @@ -138,8 +185,8 @@ The helper script includes common prompt patterns, but you can specify custom on Here's a complete example of safely enumerating a device: ```bash -# Set variables for convenience -HELPER="python3 .claude/skills/telnetshell/telnet_helper.py" +# Set variables for convenience (using uv) +HELPER="uv run python .claude/skills/telnetshell/telnet_helper.py" HOST="192.168.1.100" PORT="2222" LOGFILE="/tmp/telnet_session.log" @@ -168,6 +215,9 @@ $HELPER --host $HOST --port $PORT --logfile "$LOGFILE" --command "df -h" # Security assessment $HELPER --host $HOST --port $PORT --logfile "$LOGFILE" --command "cat /etc/passwd" $HELPER --host $HOST --port $PORT --logfile "$LOGFILE" --command "find / -perm -4000 2>/dev/null" + +# Note: If using activated venv, set HELPER="python .claude/skills/telnetshell/telnet_helper.py" +# If using system Python with deps installed, set HELPER="python3 .claude/skills/telnetshell/telnet_helper.py" ``` **IMPORTANT FOR CLAUDE CODE**: When using this skill, ALWAYS include `--logfile /tmp/telnet_session.log` in every command so the user can monitor activity with `tail -f /tmp/telnet_session.log`. @@ -408,15 +458,21 @@ busybox httpd -p 8000 ### Scenario 1: No Authentication Shell ```bash -# Connect - drops directly to root shell -python3 .claude/skills/telnetshell/telnet_helper.py --host 192.168.1.100 --interactive +# Connect - drops directly to root shell (using uv) +uv run python .claude/skills/telnetshell/telnet_helper.py --host 192.168.1.100 --interactive # Enumerate and exploit + +# Or with activated venv: source .venv/bin/activate +# Or with system Python: python3 .claude/skills/telnetshell/telnet_helper.py ... ``` ### Scenario 2: Custom Port No-Auth Shell ```bash -# Many IoT cameras use port 2222 -python3 .claude/skills/telnetshell/telnet_helper.py --host 192.168.1.100 --port 2222 --interactive +# Many IoT cameras use port 2222 (using uv) +uv run python .claude/skills/telnetshell/telnet_helper.py --host 192.168.1.100 --port 2222 --interactive + +# Or with activated venv: source .venv/bin/activate +# Or with system Python: python3 .claude/skills/telnetshell/telnet_helper.py ... ``` ### Scenario 3: Password-Protected Shell @@ -494,40 +550,48 @@ The skill includes pre-built enumeration scripts for common tasks: **Usage:** ```bash -python3 .claude/skills/telnetshell/telnet_helper.py \ +# Using uv (recommended) +uv run python .claude/skills/telnetshell/telnet_helper.py \ --host 192.168.1.100 \ --port 2222 \ --script .claude/skills/telnetshell/enum_system.txt + +# Or with activated venv: source .venv/bin/activate +# Or with system Python: python3 .claude/skills/telnetshell/telnet_helper.py ... ``` ## Example Usage ```bash -# Basic connection to standard telnet port -python3 .claude/skills/telnetshell/telnet_helper.py --host 192.168.1.100 --command "uname -a" +# Basic connection to standard telnet port (using uv) +uv run python .claude/skills/telnetshell/telnet_helper.py --host 192.168.1.100 --command "uname -a" -# Connection to custom port (common for IoT cameras) -python3 .claude/skills/telnetshell/telnet_helper.py --host 192.168.1.100 --port 2222 --command "ls /" +# Connection to custom port (common for IoT cameras, using uv) +uv run python .claude/skills/telnetshell/telnet_helper.py --host 192.168.1.100 --port 2222 --command "ls /" -# Interactive session with logging -python3 .claude/skills/telnetshell/telnet_helper.py \ +# Interactive session with logging (using uv) +uv run python .claude/skills/telnetshell/telnet_helper.py \ --host 192.168.1.100 \ --port 2222 \ --logfile /tmp/camera_session.log \ --interactive -# Batch enumeration -python3 .claude/skills/telnetshell/telnet_helper.py \ +# Batch enumeration (using uv) +uv run python .claude/skills/telnetshell/telnet_helper.py \ --host 192.168.1.100 \ --port 2222 \ --script enum_system.txt \ --json > results.json -# Long-running command with custom timeout -python3 .claude/skills/telnetshell/telnet_helper.py \ +# Long-running command with custom timeout (using uv) +uv run python .claude/skills/telnetshell/telnet_helper.py \ --host 192.168.1.100 \ --timeout 10 \ --command "find / -name '*.conf'" + +# Note: For all examples above, you can also use: +# - Activated venv: source .venv/bin/activate && python .claude/skills/telnetshell/telnet_helper.py ... +# - System Python: python3 .claude/skills/telnetshell/telnet_helper.py ... ``` ## References diff --git a/.claude/skills/wsdiscovery/SKILL.md b/.claude/skills/wsdiscovery/SKILL.md index 4598814..fc2be0a 100644 --- a/.claude/skills/wsdiscovery/SKILL.md +++ b/.claude/skills/wsdiscovery/SKILL.md @@ -21,10 +21,12 @@ When the user asks to discover ONVIF devices, find network cameras, or scan for - Decide on output format 2. **Execute the scan**: - - Use the wsdiscovery command from the iothackbot bin directory - - Basic usage: `wsdiscovery ` - - For verbose output: `wsdiscovery -v` - - For JSON output: `wsdiscovery --format json` + - Use the wsdiscovery command via uv run entry point + - Basic usage: `uv run wsdiscovery ` + - For verbose output: `uv run wsdiscovery -v` + - For JSON output: `uv run wsdiscovery --format json` + + **Note**: If the venv is activated or if bin/ is in PATH, you can use `wsdiscovery` directly without `uv run` 3. **Output formats**: - `--format text` (default): Human-readable colored output with device details @@ -50,24 +52,26 @@ The tool extracts and displays: Discover devices on a specific host: ```bash -wsdiscovery 192.168.1.100 +uv run wsdiscovery 192.168.1.100 ``` Discover with full XML responses: ```bash -wsdiscovery 192.168.1.100 -v +uv run wsdiscovery 192.168.1.100 -v ``` Output device information as JSON: ```bash -wsdiscovery 192.168.1.100 --format json +uv run wsdiscovery 192.168.1.100 --format json ``` Scan network broadcast address to find all devices: ```bash -wsdiscovery 239.255.255.250 +uv run wsdiscovery 239.255.255.250 ``` +**Note**: You can also use `wsdiscovery` directly (without `uv run`) if the venv is activated or bin/ is in your PATH. + ## Important Notes - WS-Discovery uses multicast/broadcast discovery diff --git a/.gitignore b/.gitignore index 95ad927..22eb6b7 100644 --- a/.gitignore +++ b/.gitignore @@ -111,6 +111,13 @@ ENV/ env.bak/ venv.bak/ +# uv +.python-version +uv.lock + +# Serena +.serena + # Spyder project settings .spyderproject .spyproject diff --git a/README.md b/README.md index 8c67967..0662a67 100644 --- a/README.md +++ b/README.md @@ -45,14 +45,42 @@ IoTHackBot is a collection of specialized tools and Claude Code skills designed ### Prerequisites +#### Python Dependencies + +**Option 1: Using uv (recommended)** +```bash +# Install uv if you haven't already +curl -LsSf https://astral.sh/uv/install.sh | sh + +# Install dependencies in a virtual environment +uv sync +``` + +**Option 2: Using pip** ```bash -# Python dependencies +# Create and activate a virtual environment (recommended) +python -m venv .venv +source .venv/bin/activate # On Windows: .venv\Scripts\activate + +# Install dependencies pip install colorama pyserial pexpect requests +``` -# System dependencies (Arch Linux) -sudo pacman -S nmap e2fsprogs f2fs-tools python python-pip inetutils +#### System Dependencies -# For other distributions, install equivalent packages +**Arch Linux:** +```bash +sudo pacman -S nmap e2fsprogs f2fs-tools python inetutils +``` + +**Ubuntu/Debian:** +```bash +sudo apt install nmap e2fsprogs f2fs-tools python3 inetutils-telnet +``` + +**macOS:** +```bash +brew install nmap e2fsprogs f2fs-tools ``` ### Setup @@ -63,23 +91,45 @@ git clone https://github.com/BrownFineSecurity/iothackbot.git cd iothackbot ``` -2. Add the bin directory to your PATH: +2. Install Python dependencies (see above) + +3. **Using uv (recommended)**: The tools are automatically available via entry points after `uv sync`: +```bash +# Tools are available via uv run +uv run wsdiscovery 192.168.1.0/24 +uv run ffind firmware.bin +uv run onvifscan auth http://192.168.1.100 +uv run iotnet capture.pcap + +# Or activate the venv to use them directly +source .venv/bin/activate +wsdiscovery 192.168.1.0/24 +ffind firmware.bin +``` + +4. **Using bin/ directory**: Alternatively, add the bin directory to your PATH: ```bash export PATH="$PATH:$(pwd)/bin" ``` -3. For permanent setup, add to your shell configuration: +For permanent setup, add to your shell configuration: ```bash echo 'export PATH="$PATH:/path/to/iothackbot/bin"' >> ~/.bashrc ``` ## Usage +**Note:** All examples below assume you've either: +- Activated the uv virtual environment (`source .venv/bin/activate`), OR +- Are using `uv run` prefix (e.g., `uv run wsdiscovery 192.168.1.0/24`), OR +- Added `bin/` to your PATH + ### Quick Start Examples #### Discover ONVIF Devices ```bash wsdiscovery 192.168.1.0/24 +# Or: uv run wsdiscovery 192.168.1.0/24 ``` #### Test ONVIF Device Security diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..4378ea8 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,30 @@ +[project] +name = "iothackbot" +version = "0.1.0" +description = "Open-source IoT security testing toolkit with integrated Claude Code skills for automated vulnerability discovery" +readme = "README.md" +requires-python = ">=3.11" +dependencies = [ + "colorama>=0.4.6", + "pexpect>=4.9.0", + "pyserial>=3.5", + "requests>=2.32.5", +] + +[project.urls] +Homepage = "https://github.com/BrownFineSecurity/iothackbot" +Repository = "https://github.com/BrownFineSecurity/iothackbot" +Issues = "https://github.com/BrownFineSecurity/iothackbot/issues" + +[project.scripts] +ffind = "iothackbot.ffind:ffind" +iotnet = "iothackbot.iotnet:iotnet" +onvifscan = "iothackbot.onvifscan:onvifscan" +wsdiscovery = "iothackbot.wsdiscovery:wsdiscovery" + +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[tool.hatch.build.targets.wheel] +packages = ["tools/iothackbot"]