Python wrapper for the MR3040.
GPL-3.0 License
A Python wrapper for the MR3040.
Instructions heavily based on the minipwner.
tar xvzf {filename}
).make image PROFILE=TLMR3040 PACKAGES="blkid block-mount kmod-fs-ext4 kmod-usb2 kmod-usb-uhci kmod-usb-ohci kmod-usb-storage"
bin/ar71xx/openwrt-15.05.1-ar71xx-generic-tl-mr3040-v2-squashfs-factory.bin
to openwrt.bin
http://192.168.0.1
, then go to System tools -> Firmware Upgrade and upload the openwrt.bin
image file.telnet 192.168.1.1 23
and set the password passwd
to enable ssh (no longer need telnet).ssh [email protected]
vi /etc/config/fstab
where partitions can be sda1
or sda2
config 'global'
option anon_swap '0'
option anon_mount '0'
option auto_swap '1'
option auto_mount '1'
option delay_root '0'
option check_fs '0'
config 'swap'
option device '/dev/{swap partition}'
option enabled '1'
config 'mount'
option target '/overlay'
option device '/dev/{ext4 partition}'
option fstype 'ext4'
option options 'rw,sync'
option enabled '1'
option enabled_fsck '0'
mkdir -p /tmp/cproot
mount -o bind / /tmp/cproot
mkdir /mnt/{ext4 partition}
mount /dev/{ext4 partition} /mnt/{ext4 partition}
tar -C /tmp/cproot -cvf - . | tar -C /mnt/{ext4 partition} -xf -
umount /tmp/cproot
/etc/config/fstab
from '/overlay'
to '/'
reboot
git clone https://github.com/sshh12/PwnSSHH.git
scp -r /path/to/PwnSSHH [email protected]:/root/PwnSSHH
python /root/PwnSSHH/setup.py
(This will override config files, banners, etc...)reboot
python /root/PwnSSHH/main.py
.If you want to write your own code, the pwnsshh
lib will allow you to interface
(read switch state, control leds, init configs, etc...) with the router.
For example:
from pwnsshh.switch import get_switch_id
from pwnsshh.leds import all_off, leds
import time
all_off() # Turn off all leds
last_pos = 0
while True: # Poll switch state
switch = get_switch_id() # Index of the switch position {0, 1, 2}
if switch != last_pos:
leds[last_pos].on = False
leds[switch].on = True # Light corresponding led
last_pos = switch
time.sleep(1) # Commands can get buggy if not enough delay