Follow

MiniPwner Build Guide

Remember: "MiniPwner-mode" is only 1/2 of the functionality of the r00tabaga. This guide shows you how to build that half, by itself.

If you want to re-create a r00tabaga from scratch, you'll need to check out Help! I broke my r00tabaga :(

These instructions for building a MiniPwner (originally created by Kevin Bong), built and tested on the inexpensive but widely revered TP-Link TL-WR703N, work equally well on our TP-Link TL-MR3040.

Kevin Bong's original build instructions have been trimmed to the minimal necessary steps here; his full original post can be found at MiniPwner.com on the Build It page.

MiniPwner Setup Steps:

  1. Download the OpenWrt image for the TP-Link WMR3040 v1 router from trunk (no longer suggested) or attitude adjustment (recommended). Make sure your device is a v1, as v2 is not yet fully supported by OpenWRT. 

    Get the file: openwrt-ar71xx-generic-tl-mr3040-v1-squashfs-factory.bin

    Also download the MiniPwner community edition scripts from here or here.

  2. Use your computer to repartition and format a USB drive >= 4GB:
    Partition 1: linux swap space 
    Partition2: ext4
    Then insert the USB drive into the port on your router.
  3. Configure your local ethernet adapter with a static address of 192.168.1.111 and connect your computer to the router with an ethernet cable.
  4. Power on the router and browse to 192.168.1.1. User admin password admin.
  5. Mouseover the left hand links to find the DateTimeCfgRpm.htm link and click. It should be the bottom link in the bullet list on the left.
  6. Mouseover the expanded menu to find SoftwareUpgradeRpm.htm link and click. It should be the 3rd link from the top of the newly expanded menu.
  7. Use the dialog to upload the new flash (openwrt-ar71xx-generic-tl-wr703n-v1-squashfs-factory.bin) to the router. It will go through a 100% status bar twice then reboot.
  8. On your computer open a command prompt. CD to the directory containing minipwner.tar, and open a netcat listener using "nc -l <minipwner.tar 3333"
  9. Once the router reboots, telnet to 192.168.1.1:


    *** If you mess up anything after this point, enter the command "firstboot" into your telnet session, reboot, and you will be right back here.***

    If you computer does not have telnet installed, you can use Putty.

  10. Copy and paste the following commands into your telnet session.
    cd /usr/share
    nc 192.168.1.111 3333 > minipwner.tar
    tar -xf minipwner.tar
  11. Paste these commands into your telnet session: 
  12. cd /usr/share/minipwner
    cp -f /etc/config/network /etc/config/network.orig 
    cp -f /etc/config/wireless /etc/config/wireless.orig
    cp -f /etc/config/firewall /etc/config/firewall.orig
    cp -f /etc/profile /etc/profile.orig
    cp -f /etc/config/fstab /etc/config/fstab.orig
    cp -f /etc/opkg.conf /etc/opkg.conf.orig
    cp -f /etc/config/system /etc/config/system.orig
    cp -f /etc/config/dhcp /etc/config/dhcp.orig
    cp -f ./network.1 /etc/config/network
    cp -f ./wireless.1 /etc/config/wireless
    cp -f firewall.1 /etc/config/firewall
    cat /etc/config/wireless.orig
    
  13. Your original /etc/config/wireless file should be displayed on screen. Copy the MAC address of your wireless adapter.
  14. Edit etc/config/wireless using 
    vi /etc/config/wireless

    Delete the bad MAC address (cursor to it and use x to delete) then paste in the copied MAC (i to insert then paste). Then change the Wifi settings to connect to your wireless router (by default tries to connect to SSID "TOKI"). Shift-ZZ to save and exit. :q! to exit without saving.
  15. Paste these commands into your telnet session: 
    /etc/init.d/network restart && wifi
  16. Type
    ifconfig wlan0
    to check that your wireless settings came up. If you don't have a DHCP assigned address you'll need to troubleshoot your settings.

  17. If your internet connection works you should be able to run "opkg update" and see that it connects and updates packages.

    Some people have challenges at this step. One common problem is that their wireless network is in the range 192.168.1.x, which is the same range as eth0. See the MiniPwner forum for options if this is your problem (simple fix is to change the IP range of your wireless network)

  18. Paste these commands into your telnet session: 
    cd /usr/share/minipwner
    opkg update
    opkg install kernel
    opkg install kmod-usb-storage
    opkg install kmod-fs-ext4
    opkg install block-mount
    cp -f profile.1 /etc/profile
    cp -f fstab.1 /etc/config/fstab
    cp -f opkg.conf.1 /etc/opkg.conf
    cp -f system.1 /etc/config/system
    mkdir /mnt/usb
    /etc/init.d/fstab enable
    /etc/init.d/fstab start
    ls /mnt/usb
    
  19. Check that your USB drive mounted. "mount" or "df" commands should show it. If not, you'll need to troubleshoot USB access.
  20. Paste these commands into your telnet session: 
    cd /usr/share/minipwner
    ln -s /mnt/usb /opt
    ln -s /etc /mnt/usb/etc
    opkg update
    opkg install netcat
    opkg -dest usb install tar
    opkg -dest usb install openssh-sftp-client
    opkg -dest usb install nmap
    opkg -dest usb install tcpdump
    opkg -dest usb install aircrack-ng
    opkg -dest usb install kismet-client
    opkg -dest usb install kismet-server
    opkg -dest usb install perl
    opkg -dest usb install openvpn
    opkg -dest usb install dsniff
    opkg -dest usb install nbtscan
    opkg -dest usb install snort
    opkg -dest usb install karma
    opkg -dest usb install samba36-client
    opkg -dest usb install elinks
    opkg -dest usb install yafc
    cp -f ./network.2 /etc/config/network
    cp -f ./wireless.2 /etc/config/wireless
    cp -f ./dhcp.2 /etc/config/dhcp
    ln -s /mnt/usb/usr/share/nmap /usr/share/nmap
    cat /etc/config/wireless.orig
  21. Your original /etc/config/wireless file should be displayed on the screen. Copy the MAC address of your wireless adapter.
  22. Edit etc/config/wireless using 
    vi etc/config/wireless

    Delete the bad MAC address (cursor to it and use x to delete) then paste in the copied MAC (i to insert then paste). Shift-ZZ to save and exit. :q! to exit without saving.
  23. Type passwd to set a root password.
  24. Reboot. The default configuration for the minipwner is acting as a wireless access point with an SSID of TLINK and a router IP of 192.168.50.1, and running DHCP on the ethernet port.

    If things get hosed up, see the "rebuilding" section of the FAQ for instructions on using fail-safe mode to rebuild your router.
  25. If you want to install other packages to the USB key, do: opkg -dest usb install <whatever>.  I have had problems where installed libraries, modules, or other resources are not found because they are not in the "normal" place.  In a lot of cases you can kinda fix this by creating a symlink, similar to the one above for "
    ln -s /mnt/usb/usr/share/nmap /usr/share/nmap"

 

Was this article helpful?
1 out of 1 found this helpful
Have more questions? Submit a request

0 Comments

Article is closed for comments.
Powered by Zendesk