├── .github
├── README.md
└── workflows
│ └── ci.yaml
├── FIRMWARE
└── openwrt-ar71xx-generic-tl-mr3040-v2-squashfs-factory.bin
├── LICENSE
├── OVERLAY
└── minipwner-overlay_2.0.0.tar
├── banner.png
├── src
├── bin
│ ├── banner
│ ├── firewall
│ ├── minimodes
│ ├── minimodes.html
│ └── minipwner.tar
└── setup.sh
└── test
├── customize_environment.sh
└── main.sh
/.github/README.md:
--------------------------------------------------------------------------------
1 | # MiniPwner [](https://github.com/nicholasadamou/minipwner/actions/workflows/ci.yaml)
2 |
3 | 
4 |
5 | A script to configure a *TP-Link MR3040* running *OpenWRT* into a simple, yet powerful penetration-testing "drop box".
6 |
7 | What is the "MiniPwner"?
8 | -------
9 |
10 | **The MiniPwner is a penetration testing "drop box".**
11 |
12 | It is designed as a small, simple but powerful device that can be inconspicuously plugged into a network and provide the penetration tester remote access to that network.
13 |
14 | It's made up of a portable *TP-Link MR3040* running *OpenWRT*.
15 |
16 | Features
17 | -------
18 |
19 | * **Integrated Wired and Wireless connections**
20 |
21 | Once plugged into a target network, the Mini-Pwner can establish an SSH tunnel through the target network, or can be accessed by wifi. In addition, the MiniPwner can be configured as a wifi sniffer and logger - war walking in your pocket.
22 |
23 | * **Low power consumption, can be run off battery.**
24 |
25 | With a 2000 mAh built-in battery, the Mini-Pwner will run for over five hours of active wired and wireless activity. No need to find a power outlet during the pen test.
26 |
27 | * **Multiple Pen Testing Tools included**
28 |
29 | aircrack-ng, elinks, ettercap-ng, karma, kismet, nbtscan, netcat, nmap, openvpn, perl 5, samba client, snort, tar, tcpdump, tmux, yafc, and wget all come pre-installed.
30 |
31 | * **Flexible and Expandable**
32 |
33 | The MiniPwner runs on the open source OpenWrt operating system. You can easily add or change the installed packages.
34 |
35 | * **Small size**
36 |
37 | The MiniPwner can be easily carried in a pocket, hidden behind a telephone, or hang from a jack by a short ethernet cable (included).
38 |
39 | Specifications
40 | -------
41 |
42 | The MiniPwner is a *TP-Link MR3040* router with a *16GB flash drive* to expand its storage capability.
43 |
44 | Includes *802.11n Wireless N* WiFi and an *Ethernet port*.
45 |
46 | Operating System is *OpenWrt Barrier Breaker*.
47 |
48 | What can you do with it?
49 | -------
50 |
51 | * **Pen Testing Drop Box**
52 |
53 | In this mode, the MiniPwner used to establish rogue access to a target network during a penetration test. The penetration tester uses stealth or social engineering techniques to plug the MiniPwner into an available network port. (common locations include conference rooms, unoccupied workstations, the back of IP Telephones, etc.)
54 |
55 | Once it is plugged in, the penetration tester can log into the MiniPwner and begin scanning and attacking the network. The MiniPwner can simultaneously establish SSH tunnels through the target network, and also allow the penetration tester to connect to the MiniPwner via WiFi.
56 |
57 | The MiniPwner can run some software directly from the box, such as nmap to map the target network or the samba client to connect to windows shares. Other tools, such as Metasploit or Nessus can be run through the box using a VPN tunnel.
58 |
59 | * **Wireless war-walking**
60 |
61 | The battery-powered MiniPwner is small enough to fit in your jeans pocket and can run for hours. In wireless war-walking mode you start kismet or aircrack-ng on the MiniPwner and record details about all of the wireless networks detected by the device.
62 |
63 | * **Captive WiFi Portal or Rogue Access Point**
64 |
65 | Use the Karma application to discover clients and their preferred/trusted networks by passively listening for 802.11 Probe Request frames. From there, individual clients can be targetted by creating a Rogue AP for one of their probed networks (which they may join automatically) or using a custom driver that responds to probes and association requests for any SSID. Higher-level fake services can then capture credentials or exploit client-side vulnerabilities on the host.
66 |
67 | *There are many other creative ways to use the MiniPwner.*
68 |
69 | Here is a list of *some* of the software that comes pre-installed:
70 |
71 | * `Aircrack` Wireless network analysis
72 | * `elinks` Text Based Web Browser
73 | * `ettercap-ng` Man-in-the-middle attack tool
74 | * `kismet` Wireless network analysis
75 | * `nbtscan` NetBIOS Network Scanner
76 | * `Netcat` Hacker’s swiss army knife
77 | * `Nmap` network scanner
78 | * `openssh-sftp-client` Secure File Transfer Client
79 | * `openvpn` VPN Client and Server
80 | * `perl 5` Perl Scripting Language
81 | * `samba2-client` Windows File Sharing Client
82 | * `snort` Sniffer, Packet Logger, Intrusion Detection System
83 | * `tar` File archiving
84 | * `Tcpdump` sniffer
85 | * `yafc` FTP Client
86 |
87 | Install
88 | -------
89 |
90 | **Note**: *Please see the [Wiki/Configuring-a-TP-Link-MR3040-into-a-MiniPwner](https://github.com/nicholasadamou/minipwner/wiki/Configuring-a-TP-Link-MR3040-into-a-MiniPwner) for instructions on configuring the MiniPwner*.
91 |
92 | There are *two methods* provided for installing and configure the *TP-Link MR3040* router into a *MiniPwner*. Please review and choose one below.
93 |
94 | Review, then execute the below script on the *TP-Link MR3040* running *OpenWRT*:
95 |
96 | **Method One**:
97 | ```
98 | wget -O /tmp/minipwner.zip https://github.com/nicholasadamou/minipwner/archive/master.zip && \
99 | unzip /tmp/minipwner.zip && \
100 | cd /tmp/minipwner && \
101 | bash src/setup.sh
102 | ```
103 |
104 | **Method Two**:
105 | ```
106 | wget -O /tmp/minipwner-overlay_2.0.0.tar https://raw.githubusercontent.com/nicholasadamou/minipwner/master/OVERLAY/minipwner-overlay_2.0.0.tar && \
107 | mkdir /tmp/minipwner-overlay_2.0.0 && \
108 | tar -C /tmp/minipwner-overlay_2.0.0 -xvf /tmp/minipwner-overlay_2.0.0.tar && \
109 | cd /tmp/minipwner-overlay_2.0.0 && \
110 | sh src/setup.sh
111 | ```
112 |
113 | License
114 | -------
115 |
116 | MiniPwner is © Nicholas Adamou, Michael Vieau.
117 |
118 | It is free software, and may be redistributed under the terms specified in the [LICENSE] file.
119 |
120 | [LICENSE]: /LICENSE
121 |
--------------------------------------------------------------------------------
/.github/workflows/ci.yaml:
--------------------------------------------------------------------------------
1 | name: CI
2 |
3 | on:
4 | push:
5 | branches: [master]
6 | pull_request:
7 | branches: [master]
8 |
9 | jobs:
10 | build:
11 | runs-on: ubuntu-latest
12 |
13 | steps:
14 | - name: Checkout code
15 | uses: actions/checkout@v4
16 |
17 | - name: Set executable permissions
18 | run: chmod +x ./test/customize_environment.sh ./test/main.sh ./src/setup.sh
19 |
20 | - name: Customize environment
21 | run: ./test/customize_environment.sh
22 |
23 | - name: Set TERM variable
24 | run: echo "TERM=xterm" >> $GITHUB_ENV
25 |
26 | - name: Install dependencies
27 | run: ./src/setup.sh -y
28 |
29 | - name: Run tests
30 | run: ./test/main.sh
31 |
--------------------------------------------------------------------------------
/FIRMWARE/openwrt-ar71xx-generic-tl-mr3040-v2-squashfs-factory.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nicholasadamou/minipwner/664e2d549d54fea17243544f2b1216c36bf41b8a/FIRMWARE/openwrt-ar71xx-generic-tl-mr3040-v2-squashfs-factory.bin
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 Nicholas Adamou, Michael Vieau
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/OVERLAY/minipwner-overlay_2.0.0.tar:
--------------------------------------------------------------------------------
1 | minipwner.tar 000766 001750 001750 00000062000 12441143757 014427 0 ustar 00mvieau mvieau 000000 000000 minipwner/ 000755 000000 000000 00000000000 12435770321 013050 5 ustar 00root root 000000 000000 minipwner/kismet/ 000755 000000 000000 00000000000 12431655540 014345 5 ustar 00root root 000000 000000 minipwner/kismet/kismet.sh 000755 000000 000000 00000004627 12412776415 016215 0 ustar 00root root 000000 000000 #!/bin/sh
2 | # Name: kismet.sh
3 | clear
4 |
5 | PROCESS="kismet_server"
6 | LOG="/minipwner/kismet/logs/$PROCESS.log"
7 |
8 | if test -z $1; then
9 | echo "Supply an argument [start | stop | status]"
10 | exit 1
11 | fi
12 |
13 | case $1 in
14 | "start")
15 | if ps | grep -v grep | grep $PROCESS; then
16 | echo "`date`,start,$PROCESS already runing" >> $LOG
17 | echo "$PROCESS is already running, nothing to do"
18 | else
19 | mkdir /minipwner/kismet/logs > /dev/null 2>&1
20 | mkdir /minipwner/kismet/logsold > /dev/null 2>&1
21 | mv /minipwner/kismet/logs/* /minipwner/kismet/logsold/ > /dev/null 2>&1
22 | cd /minipwner/kismet/logs
23 | $PROCESS > /dev/null 2>&1 &
24 | echo "`date`,start,$PROCESS started" >> $LOG
25 | echo "$PROCESS started"
26 | fi
27 | ;;
28 | "stop")
29 | PID=`ps | grep -v grep | grep $PROCESS | awk '{print $1}'`
30 | mkdir /minipwner/kismet/logs > /dev/null 2>&1
31 | if test -z $PID; then
32 | echo "`date`,stop,$PROCESS is not running" >> $LOG
33 | echo "$PROCESS is not running, nothing to do."
34 | else
35 | kill $PID
36 | echo "`date`,stop,killed pid $PID to stop $PROCESS" >> $LOG
37 | echo "Killed pid $PID to stop $PROCESS"
38 | fi
39 | ;;
40 | "status")
41 | PID=`ps | grep -v grep | grep $PROCESS | awk '{print $1}'`
42 | mkdir /minipwner/kismet/logs > /dev/null 2>&1
43 | if test -z $PID; then
44 | echo "`date`,status,$PROCESS is not running" >> $LOG
45 | echo "$PROCESS is not running at this time"
46 | else
47 | echo "`date`,status,$PROCESS is running at pid $PID" >> $LOG
48 | echo "$PROCESS is running at pid $PID"
49 | fi
50 | ;;
51 | *)
52 | echo "That sir, is invalid. Please try again."
53 | exit 1
54 | ;;
55 | esac
56 | minipwner/minimodes/ 000755 000000 000000 00000000000 12440127374 015034 5 ustar 00root root 000000 000000 minipwner/minimodes/Lights-On/ 000755 000000 000000 00000000000 12440127331 016631 5 ustar 00root root 000000 000000 minipwner/minimodes/Lights-On/Lights-On.sh 000755 000000 000000 00000000363 12440127331 020776 0 ustar 00root root 000000 000000 #!/bin/sh
57 |
58 | echo 255 > /sys/devices/platform/leds-gpio/leds/tp-link:green:3g/brightness
59 | echo 255 > /sys/devices/platform/leds-gpio/leds/tp-link:green:wlan/brightness
60 | echo 255 > /sys/devices/platform/leds-gpio/leds/tp-link:green:lan/brightness
61 | minipwner/minimodes/switch.sh 000755 000000 000000 00000001714 12440141514 016667 0 ustar 00root root 000000 000000 #!/bin/sh
62 |
63 |
64 | # Vars
65 | # -----
66 | SLEEP=5 # Set the number of seconds between each cycle
67 | PROCESS="switch.sh"
68 | LOG="/minipwner/minimodes/logs.txt"
69 | DIR="/minipwner/minimodes/"
70 |
71 | while :
72 | do
73 | STAT=`cat /minipwner/minimodes/stat`
74 | SW1=`grep -i sw1 /sys/kernel/debug/gpio | cut -d" " -f24`
75 | SW2=`grep -i sw2 /sys/kernel/debug/gpio | cut -d" " -f24`
76 | POS=$SW1$SW2
77 |
78 | POS1=`grep lohi /minipwner/minimodes/mode | cut -d"=" -f2`
79 | POS2=`grep hihi /minipwner/minimodes/mode | cut -d"=" -f2`
80 |
81 | case $POS in
82 | "lohi")
83 | if [ "$STAT" != "$POS" ]; then
84 | echo $POS > /minipwner/minimodes/stat
85 | /minipwner/minimodes/$POS1/*.sh
86 | fi
87 | ;;
88 | "hilo")
89 | if [ "$STAT" != "$POS" ]; then
90 | echo $POS > /minipwner/minimodes/stat
91 | /minipwner/minimodes/Setup_Mode/*.sh
92 | fi
93 | ;;
94 | "hihi")
95 | if [ "$STAT" != "$POS" ]; then
96 | echo $POS > /minipwner/minimodes/stat
97 | /minipwner/minimodes/$POS2/*.sh
98 | fi
99 | ;;
100 |
101 | *)
102 | echo "Something went very, very wrong..."
103 | ;;
104 | esac
105 |
106 | sleep $SLEEP
107 | done
108 | minipwner/minimodes/Lights-Out/ 000755 000000 000000 00000000000 12440127344 017030 5 ustar 00root root 000000 000000 minipwner/minimodes/Lights-Out/Lights-Out.sh 000755 000000 000000 00000000355 12440127344 021371 0 ustar 00root root 000000 000000 #!/bin/sh
109 |
110 | echo 0 > /sys/devices/platform/leds-gpio/leds/tp-link:green:3g/brightness
111 | echo 0 > /sys/devices/platform/leds-gpio/leds/tp-link:green:wlan/brightness
112 | echo 0 > /sys/devices/platform/leds-gpio/leds/tp-link:green:lan/brightness
113 | minipwner/minimodes/WarWalk/ 000755 000000 000000 00000000000 12436116606 016405 5 ustar 00root root 000000 000000 minipwner/minimodes/WarWalk/Lights-Out.sh 000755 000000 000000 00000000355 12436116606 020746 0 ustar 00root root 000000 000000 #!/bin/sh
114 |
115 | echo 0 > /sys/devices/platform/leds-gpio/leds/tp-link:green:3g/brightness
116 | echo 0 > /sys/devices/platform/leds-gpio/leds/tp-link:green:wlan/brightness
117 | echo 0 > /sys/devices/platform/leds-gpio/leds/tp-link:green:lan/brightness
118 | minipwner/minimodes/WarWalk/start.sh 000755 000000 000000 00000000055 12436116575 020106 0 ustar 00root root 000000 000000 #!/bin/sh
119 |
120 | /minipwner/kismet/kismet start &
121 |
122 | minipwner/minimodes/mode 000644 001750 001750 00000000025 12440635343 016540 0 ustar 00mvieau mvieau 000000 000000 lohi=AP
123 | hihi=WarWalk
124 | minipwner/minimodes/WiFi_Client/ 000755 000000 000000 00000000000 12440127412 017161 5 ustar 00root root 000000 000000 minipwner/minimodes/WiFi_Client/client.sh 000755 000000 000000 00000000230 12435721372 021002 0 ustar 00root root 000000 000000 #/bin/sh
125 |
126 | cp -f /minipwner/minimodes/WiFi_Client/network /etc/config/network
127 | cp -f /minipwner/minimodes/WiFi_Client/wireless /etc/config/wireless
128 |
129 | wifi
130 | minipwner/minimodes/WiFi_Client/network 000644 000000 000000 00000000662 12434447566 020623 0 ustar 00root root 000000 000000
131 | config interface 'loopback'
132 | option ifname 'lo'
133 | option proto 'static'
134 | option ipaddr '127.0.0.1'
135 | option netmask '255.0.0.0'
136 |
137 | config globals 'globals'
138 | option ula_prefix 'fdc1:4f83:acf4::/48'
139 |
140 | config interface 'lan'
141 | option ifname 'eth0'
142 | option force_link '1'
143 | option proto 'static'
144 | option ipaddr '192.168.1.1'
145 | option netmask '255.255.255.0'
146 |
147 | config interface 'wan'
148 | option ifname 'wlan0'
149 | option proto 'dhcp'
150 | minipwner/minimodes/WiFi_Client/wireless 000644 001750 001750 00000000602 12441143747 021611 0 ustar 00mvieau mvieau 000000 000000 config wifi-device radio0
151 | option type mac80211
152 | option channel 11
153 | option hwmode 11g
154 | option path 'platform/ar933x_wmac'
155 | option htmode HT20
156 | option disabled 0 # 0=wifi enabled, 1=wifi disabled
157 |
158 | # Client mode
159 | config wifi-iface
160 | option device radio0
161 | option network wan
162 | option mode sta
163 | option ssid Your_SSID_here
164 | option encryption psk2
165 | option key "Your_key_here"
166 | minipwner/minimodes/Setup_Mode/ 000755 000000 000000 00000000000 12435763211 017100 5 ustar 00root root 000000 000000 minipwner/minimodes/Setup_Mode/setup_mode.sh 000755 000000 000000 00000000227 12435767037 021616 0 ustar 00root root 000000 000000 #!/bin/sh
167 |
168 | cp -f /minipwner/minimodes/Setup_Mode/network /etc/config/network
169 | cp -f /minipwner/minimodes/Setup_Mode/wireless /etc/config/wireless
170 |
171 | wifi
172 | minipwner/minimodes/Setup_Mode/network 000644 000000 000000 00000001045 12435763262 020522 0 ustar 00root root 000000 000000
173 | config interface 'loopback'
174 | option ifname 'lo'
175 | option proto 'static'
176 | option ipaddr '127.0.0.1'
177 | option netmask '255.0.0.0'
178 |
179 | config globals 'globals'
180 | option ula_prefix 'fdc1:4f83:acf4::/48'
181 |
182 | config interface 'lan'
183 | option ifname 'eth0'
184 | option force_link '1'
185 | #option type 'bridge'
186 | option proto 'static'
187 | option ipaddr '192.168.1.1'
188 | option netmask '255.255.255.0'
189 | #option ip6assign '60'
190 |
191 | config interface 'wan'
192 | option ifname 'wlan0'
193 | option proto 'static'
194 | option ipaddr '192.168.3.1'
195 | option netmask '255.255.255.0'
196 | minipwner/minimodes/Setup_Mode/wireless 000644 001750 001750 00000000615 12440636650 021524 0 ustar 00mvieau mvieau 000000 000000 config wifi-device radio0
197 | option type mac80211
198 | option channel 11
199 | option hwmode 11g
200 | option path 'platform/ar933x_wmac'
201 | option htmode HT20
202 | option disabled 0 # 0=wifi enabled, 1=wifi disabled
203 |
204 | # AP mode
205 | config wifi-iface
206 | option device radio0
207 | option network wan
208 | option mode ap
209 | option ssid "MiniPwner-Setup"
210 | option encryption psk2
211 | option key "M!n!Pwn3r$etup"
212 | minipwner/minimodes/AP/ 000755 000000 000000 00000000000 12434450072 015331 5 ustar 00root root 000000 000000 minipwner/minimodes/AP/network 000644 000000 000000 00000001045 12434450054 016745 0 ustar 00root root 000000 000000
213 | config interface 'loopback'
214 | option ifname 'lo'
215 | option proto 'static'
216 | option ipaddr '127.0.0.1'
217 | option netmask '255.0.0.0'
218 |
219 | config globals 'globals'
220 | option ula_prefix 'fdc1:4f83:acf4::/48'
221 |
222 | config interface 'lan'
223 | option ifname 'eth0'
224 | option force_link '1'
225 | #option type 'bridge'
226 | option proto 'static'
227 | option ipaddr '192.168.1.1'
228 | option netmask '255.255.255.0'
229 | #option ip6assign '60'
230 |
231 | config interface 'wan'
232 | option ifname 'wlan0'
233 | option proto 'static'
234 | option ipaddr '192.168.2.1'
235 | option netmask '255.255.255.0'
236 | minipwner/minimodes/AP/wireless 000644 001750 001750 00000000607 12440636771 017765 0 ustar 00mvieau mvieau 000000 000000 config wifi-device radio0
237 | option type mac80211
238 | option channel 11
239 | option hwmode 11g
240 | option path 'platform/ar933x_wmac'
241 | option htmode HT20
242 | option disabled 0 # 0=wifi enabled, 1=wifi disabled
243 |
244 | # AP mode
245 | config wifi-iface
246 | option device radio0
247 | option network wan
248 | option mode ap
249 | option ssid "MiniPwner-AP"
250 | option encryption psk2
251 | option key "M!n!Pwn3rAP"
252 | minipwner/minimodes/AP/ap.sh 000755 000000 000000 00000000207 12435721165 016274 0 ustar 00root root 000000 000000 #!/bin/sh
253 |
254 | cp -f /minipwner/minimodes/AP/network /etc/config/network
255 | cp -f /minipwner/minimodes/AP/wireless /etc/config/wireless
256 |
257 | wifi
258 | files/minimodes 000777 001750 001750 00000006001 12441217233 014710 0 ustar 00mvieau mvieau 000000 000000 #!/bin/sh
259 | # Name: minimodes
260 | # Purpose: To setup and start the MiniModes for the MiniPwner
261 | # By: Michael Vieau
262 | # Date: 11.27.14
263 | # Modified: 12.07.14
264 | # Rev Level 0.2
265 | # ----------------------------------------------------------------
266 |
267 | # Build html file for user interface
268 | FILE="/www/cgi-bin/minimodes"
269 | echo "#!/bin/sh" > $FILE
270 | echo "echo \"Content-type: text/html\"" >> $FILE
271 | echo "echo \"\"" >> $FILE
272 | echo "CTOP=\`grep lohi /minipwner/minimodes/mode | cut -d\"=\" -f2\`" >> $FILE
273 | echo "CBOT=\`grep hihi /minipwner/minimodes/mode | cut -d\"=\" -f2\`" >> $FILE
274 | echo "" >> $FILE
275 | echo "read QUERY_STRING" >> $FILE
276 | echo "TOP=\`echo \$QUERY_STRING | cut -d\"&\" -f1\`" >> $FILE
277 | echo "BOT=\`echo \$QUERY_STRING | cut -d\"&\" -f2\`" >> $FILE
278 | echo "" >> $FILE
279 | echo "if [ \"\$TOP\" = \"lohi=0\" ] || [ -z \"\$TOP\" ]; then" >> $FILE
280 | echo " TOP=\"lohi=\"\$CTOP" >> $FILE
281 | echo "fi" >> $FILE
282 | echo "" >> $FILE
283 | echo "if [ \"\$BOT\" = \"hihi=0\" ] || [ -z \"\$BOT\" ]; then" >> $FILE
284 | echo " BOT=\"hihi=\"\$CBOT" >> $FILE
285 | echo "fi" >> $FILE
286 | echo "" >> $FILE
287 | echo "echo \$TOP > /minipwner/minimodes/mode" >> $FILE
288 | echo "echo \$BOT >> /minipwner/minimodes/mode" >> $FILE
289 | echo "" >> $FILE
290 | echo "CTOP=\`grep lohi /minipwner/minimodes/mode | cut -d\"=\" -f2\`" >> $FILE
291 | echo "CBOT=\`grep hihi /minipwner/minimodes/mode | cut -d\"=\" -f2\`" >> $FILE
292 | echo "" >> $FILE
293 | echo "echo \"\"" >> $FILE
294 | echo "echo \"
Select your MiniModes
\"" >> $FILE
295 | echo "echo \"System time
\"" >> $FILE
296 | echo "echo \"\$(date)
\"" >> $FILE
297 | echo "" >> $FILE
298 | echo "echo \"\"" >> $FILE
299 | echo "echo \"Switch | Current Setting | New Setting |
\"" >> $FILE
300 | echo "echo \"3G/4G | \$CTOP | \"" >> $FILE
301 | echo "echo \" |
\"" >> $FILE
308 |
309 | echo "echo \"WISP | Setup | N/A |
\"" >> $FILE
310 |
311 | echo "echo \"AP | \$CBOT | \"" >> $FILE
312 | echo "echo \" |
\"" >> $FILE
319 |
320 | echo "echo \"
\"" >> $FILE
321 | echo "echo \"
\"" >> $FILE
322 | echo "echo \"\"" >> $FILE
325 | echo "echo \"\"" >> $FILE
326 |
327 | # Set permissions
328 | chmod +x $FILE
329 |
330 | # Blank out status file
331 | echo "null" > /minipwner/minimodes/stat 2>&1
332 |
333 | # Start the main script
334 | /minipwner/minimodes/switch.sh &
335 | files/ 000777 001750 001750 00000000000 12442672251 013007 5 ustar 00mvieau mvieau 000000 000000 files/minimodes.html 000766 001750 001750 00000000636 12440222651 015660 0 ustar 00mvieau mvieau 000000 000000
336 |
337 |
338 |
339 |
340 |
341 |
342 | MiniModes
343 |
344 |
345 | setup.sh 000766 001750 001750 00000001720 12450157772 013407 0 ustar 00mvieau mvieau 000000 000000 #!/bin/sh
346 | # Name: setup.sh
347 | # Purpose: Install the MiniPwner overlay to OpenWrt
348 | # By: Michael Vieau
349 | # Date: 12.12.14
350 | # Modified 12.12.14
351 | # Rev Level 0.1
352 | # -----------------------------------------------
353 | clear
354 |
355 | # Vars
356 | # ------
357 | FDIR="files"
358 |
359 | # Setup MiniPwner Dir
360 | tar -xf minipwner.tar -C /
361 |
362 | # Setup minimodes
363 | mv -f $FDIR/minimodes /etc/init.d/minimodes
364 | chmod +x /etc/init.d/minimodes
365 | ln -s /etc/init.d/minimodes /etc/rc.d/S99minimodes
366 | chmod +x /etc/rc.d/S99minimodes
367 |
368 | # Move files as needed
369 | mv -f $FDIR/minimodes.html /www/minimodes.html
370 | chmod +x /www/minimodes.html
371 | mv -f $FDIR/firewall /etc/config/firewall
372 | chmod 644 /etc/config/firewall
373 | mv -f $FDIR/banner /etc/banner
374 | chmod 644 /etc/banner
375 |
376 | # Clean up
377 | rm -f minipwner.tar
378 | rm -rf $FDIR
379 | rm -f setup.sh
380 |
381 | echo "The MiniPwner Overlay 2.0.0 has been applied."
382 | echo "Reboot your device for everything to take effect."
383 | echo "---------------------------------------------------"
384 | files/firewall 000766 001750 001750 00000007457 12441722370 014552 0 ustar 00mvieau mvieau 000000 000000 config defaults
385 | option syn_flood 1
386 | option input ACCEPT
387 | option output ACCEPT
388 | option forward REJECT
389 | # Uncomment this line to disable ipv6 rules
390 | # option disable_ipv6 1
391 |
392 | config zone
393 | option name lan
394 | list network 'lan'
395 | option input ACCEPT
396 | option output ACCEPT
397 | option forward ACCEPT
398 |
399 | config zone
400 | option name wan
401 | list network 'wan'
402 | list network 'wan6'
403 | option input ACCEPT
404 | option output ACCEPT
405 | option forward REJECT
406 | option masq 1
407 | option mtu_fix 1
408 |
409 | config forwarding
410 | option src lan
411 | option dest wan
412 |
413 | # We need to accept udp packets on port 68,
414 | # see https://dev.openwrt.org/ticket/4108
415 | config rule
416 | option name Allow-DHCP-Renew
417 | option src wan
418 | option proto udp
419 | option dest_port 68
420 | option target ACCEPT
421 | option family ipv4
422 |
423 | # Allow IPv4 ping
424 | config rule
425 | option name Allow-Ping
426 | option src wan
427 | option proto icmp
428 | option icmp_type echo-request
429 | option family ipv4
430 | option target ACCEPT
431 |
432 | # Allow DHCPv6 replies
433 | # see https://dev.openwrt.org/ticket/10381
434 | config rule
435 | option name Allow-DHCPv6
436 | option src wan
437 | option proto udp
438 | option src_ip fe80::/10
439 | option src_port 547
440 | option dest_ip fe80::/10
441 | option dest_port 546
442 | option family ipv6
443 | option target ACCEPT
444 |
445 | # Allow essential incoming IPv6 ICMP traffic
446 | config rule
447 | option name Allow-ICMPv6-Input
448 | option src wan
449 | option proto icmp
450 | list icmp_type echo-request
451 | list icmp_type echo-reply
452 | list icmp_type destination-unreachable
453 | list icmp_type packet-too-big
454 | list icmp_type time-exceeded
455 | list icmp_type bad-header
456 | list icmp_type unknown-header-type
457 | list icmp_type router-solicitation
458 | list icmp_type neighbour-solicitation
459 | list icmp_type router-advertisement
460 | list icmp_type neighbour-advertisement
461 | option limit 1000/sec
462 | option family ipv6
463 | option target ACCEPT
464 |
465 | # Allow essential forwarded IPv6 ICMP traffic
466 | config rule
467 | option name Allow-ICMPv6-Forward
468 | option src wan
469 | option dest *
470 | option proto icmp
471 | list icmp_type echo-request
472 | list icmp_type echo-reply
473 | list icmp_type destination-unreachable
474 | list icmp_type packet-too-big
475 | list icmp_type time-exceeded
476 | list icmp_type bad-header
477 | list icmp_type unknown-header-type
478 | option limit 1000/sec
479 | option family ipv6
480 | option target ACCEPT
481 |
482 | # include a file with users custom iptables rules
483 | config include
484 | option path /etc/firewall.user
485 |
486 |
487 | ### EXAMPLE CONFIG SECTIONS
488 | # do not allow a specific ip to access wan
489 | #config rule
490 | # option src lan
491 | # option src_ip 192.168.45.2
492 | # option dest wan
493 | # option proto tcp
494 | # option target REJECT
495 |
496 | # block a specific mac on wan
497 | #config rule
498 | # option dest wan
499 | # option src_mac 00:11:22:33:44:66
500 | # option target REJECT
501 |
502 | # block incoming ICMP traffic on a zone
503 | #config rule
504 | # option src lan
505 | # option proto ICMP
506 | # option target DROP
507 |
508 | # port redirect port coming in on wan to lan
509 | #config redirect
510 | # option src wan
511 | # option src_dport 80
512 | # option dest lan
513 | # option dest_ip 192.168.16.235
514 | # option dest_port 80
515 | # option proto tcp
516 |
517 | # port redirect of remapped ssh port (22001) on wan
518 | #config redirect
519 | # option src wan
520 | # option src_dport 22001
521 | # option dest lan
522 | # option dest_port 22
523 | # option proto tcp
524 |
525 | # allow IPsec/ESP and ISAKMP passthrough
526 | #config rule
527 | # option src wan
528 | # option dest lan
529 | # option protocol esp
530 | # option target ACCEPT
531 |
532 | #config rule
533 | # option src wan
534 | # option dest lan
535 | # option src_port 500
536 | # option dest_port 500
537 | # option proto udp
538 | # option target ACCEPT
539 |
540 | ### FULL CONFIG SECTIONS
541 | #config rule
542 | # option src lan
543 | # option src_ip 192.168.45.2
544 | # option src_mac 00:11:22:33:44:55
545 | # option src_port 80
546 | # option dest wan
547 | # option dest_ip 194.25.2.129
548 | # option dest_port 120
549 | # option proto tcp
550 | # option target REJECT
551 |
552 | #config redirect
553 | # option src lan
554 | # option src_ip 192.168.45.2
555 | # option src_mac 00:11:22:33:44:55
556 | # option src_port 1024
557 | # option src_dport 80
558 | # option dest_ip 194.25.2.129
559 | # option dest_port 120
560 | # option proto tcp
561 | files/banner 000766 001750 001750 00000000564 12442122064 014175 0 ustar 00mvieau mvieau 000000 000000 ___ ____ _______
562 | | \/ (_) (_) ___ \
563 | | . . |_ _ __ _| |_/ /_ ___ __ ___ _ __
564 | | |\/| | | '_ \| | __/\ \ /\ / / '_ \ / _ \ '__|
565 | | | | | | | | | | | \ V V /| | | | __/ |
566 | \_| |_/_|_| |_|_\_| \_/\_/ |_| |_|\___|_| V.2
567 |
568 |
569 | - Running OpenWrt Barrier Breaker (14.07, r42625)
570 | -----------------------------------------------------
571 |
572 |
--------------------------------------------------------------------------------
/banner.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nicholasadamou/minipwner/664e2d549d54fea17243544f2b1216c36bf41b8a/banner.png
--------------------------------------------------------------------------------
/src/bin/banner:
--------------------------------------------------------------------------------
1 | ___ ____ _______
2 | | \/ (_) (_) ___ \
3 | | . . |_ _ __ _| |_/ /_ ___ __ ___ _ __
4 | | |\/| | | '_ \| | __/\ \ /\ / / '_ \ / _ \ '__|
5 | | | | | | | | | | | \ V V /| | | | __/ |
6 | \_| |_/_|_| |_|_\_| \_/\_/ |_| |_|\___|_| V.2
7 |
8 |
9 | - Running OpenWrt Barrier Breaker (14.07, r42625)
10 | -----------------------------------------------------
11 |
12 |
--------------------------------------------------------------------------------
/src/bin/firewall:
--------------------------------------------------------------------------------
1 | config defaults
2 | option syn_flood 1
3 | option input ACCEPT
4 | option output ACCEPT
5 | option forward REJECT
6 | # Uncomment this line to disable ipv6 rules
7 | # option disable_ipv6 1
8 |
9 | config zone
10 | option name lan
11 | list network 'lan'
12 | option input ACCEPT
13 | option output ACCEPT
14 | option forward ACCEPT
15 |
16 | config zone
17 | option name wan
18 | list network 'wan'
19 | list network 'wan6'
20 | option input ACCEPT
21 | option output ACCEPT
22 | option forward REJECT
23 | option masq 1
24 | option mtu_fix 1
25 |
26 | config forwarding
27 | option src lan
28 | option dest wan
29 |
30 | # We need to accept udp packets on port 68,
31 | # see https://dev.openwrt.org/ticket/4108
32 | config rule
33 | option name Allow-DHCP-Renew
34 | option src wan
35 | option proto udp
36 | option dest_port 68
37 | option target ACCEPT
38 | option family ipv4
39 |
40 | # Allow IPv4 ping
41 | config rule
42 | option name Allow-Ping
43 | option src wan
44 | option proto icmp
45 | option icmp_type echo-request
46 | option family ipv4
47 | option target ACCEPT
48 |
49 | # Allow DHCPv6 replies
50 | # see https://dev.openwrt.org/ticket/10381
51 | config rule
52 | option name Allow-DHCPv6
53 | option src wan
54 | option proto udp
55 | option src_ip fe80::/10
56 | option src_port 547
57 | option dest_ip fe80::/10
58 | option dest_port 546
59 | option family ipv6
60 | option target ACCEPT
61 |
62 | # Allow essential incoming IPv6 ICMP traffic
63 | config rule
64 | option name Allow-ICMPv6-Input
65 | option src wan
66 | option proto icmp
67 | list icmp_type echo-request
68 | list icmp_type echo-reply
69 | list icmp_type destination-unreachable
70 | list icmp_type packet-too-big
71 | list icmp_type time-exceeded
72 | list icmp_type bad-header
73 | list icmp_type unknown-header-type
74 | list icmp_type router-solicitation
75 | list icmp_type neighbour-solicitation
76 | list icmp_type router-advertisement
77 | list icmp_type neighbour-advertisement
78 | option limit 1000/sec
79 | option family ipv6
80 | option target ACCEPT
81 |
82 | # Allow essential forwarded IPv6 ICMP traffic
83 | config rule
84 | option name Allow-ICMPv6-Forward
85 | option src wan
86 | option dest *
87 | option proto icmp
88 | list icmp_type echo-request
89 | list icmp_type echo-reply
90 | list icmp_type destination-unreachable
91 | list icmp_type packet-too-big
92 | list icmp_type time-exceeded
93 | list icmp_type bad-header
94 | list icmp_type unknown-header-type
95 | option limit 1000/sec
96 | option family ipv6
97 | option target ACCEPT
98 |
99 | # include a file with users custom iptables rules
100 | config include
101 | option path /etc/firewall.user
102 |
103 |
104 | ### EXAMPLE CONFIG SECTIONS
105 | # do not allow a specific ip to access wan
106 | #config rule
107 | # option src lan
108 | # option src_ip 192.168.45.2
109 | # option dest wan
110 | # option proto tcp
111 | # option target REJECT
112 |
113 | # block a specific mac on wan
114 | #config rule
115 | # option dest wan
116 | # option src_mac 00:11:22:33:44:66
117 | # option target REJECT
118 |
119 | # block incoming ICMP traffic on a zone
120 | #config rule
121 | # option src lan
122 | # option proto ICMP
123 | # option target DROP
124 |
125 | # port redirect port coming in on wan to lan
126 | #config redirect
127 | # option src wan
128 | # option src_dport 80
129 | # option dest lan
130 | # option dest_ip 192.168.16.235
131 | # option dest_port 80
132 | # option proto tcp
133 |
134 | # port redirect of remapped ssh port (22001) on wan
135 | #config redirect
136 | # option src wan
137 | # option src_dport 22001
138 | # option dest lan
139 | # option dest_port 22
140 | # option proto tcp
141 |
142 | # allow IPsec/ESP and ISAKMP passthrough
143 | #config rule
144 | # option src wan
145 | # option dest lan
146 | # option protocol esp
147 | # option target ACCEPT
148 |
149 | #config rule
150 | # option src wan
151 | # option dest lan
152 | # option src_port 500
153 | # option dest_port 500
154 | # option proto udp
155 | # option target ACCEPT
156 |
157 | ### FULL CONFIG SECTIONS
158 | #config rule
159 | # option src lan
160 | # option src_ip 192.168.45.2
161 | # option src_mac 00:11:22:33:44:55
162 | # option src_port 80
163 | # option dest wan
164 | # option dest_ip 194.25.2.129
165 | # option dest_port 120
166 | # option proto tcp
167 | # option target REJECT
168 |
169 | #config redirect
170 | # option src lan
171 | # option src_ip 192.168.45.2
172 | # option src_mac 00:11:22:33:44:55
173 | # option src_port 1024
174 | # option src_dport 80
175 | # option dest_ip 194.25.2.129
176 | # option dest_port 120
177 | # option proto tcp
178 |
--------------------------------------------------------------------------------
/src/bin/minimodes:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | # Name: minimodes
3 | # Purpose: To setup and start the MiniModes for the MiniPwner
4 | # By: Michael Vieau
5 | # Date: 11.27.14
6 | # Modified: 12.07.14
7 | # Rev Level 0.2
8 | # ----------------------------------------------------------------
9 |
10 | # Build html file for user interface
11 | FILE="/www/cgi-bin/minimodes"
12 | echo "#!/bin/sh" > $FILE
13 | echo "echo \"Content-type: text/html\"" >> $FILE
14 | echo "echo \"\"" >> $FILE
15 | echo "CTOP=\`grep lohi /minipwner/minimodes/mode | cut -d\"=\" -f2\`" >> $FILE
16 | echo "CBOT=\`grep hihi /minipwner/minimodes/mode | cut -d\"=\" -f2\`" >> $FILE
17 | echo "" >> $FILE
18 | echo "read QUERY_STRING" >> $FILE
19 | echo "TOP=\`echo \$QUERY_STRING | cut -d\"&\" -f1\`" >> $FILE
20 | echo "BOT=\`echo \$QUERY_STRING | cut -d\"&\" -f2\`" >> $FILE
21 | echo "" >> $FILE
22 | echo "if [ \"\$TOP\" = \"lohi=0\" ] || [ -z \"\$TOP\" ]; then" >> $FILE
23 | echo " TOP=\"lohi=\"\$CTOP" >> $FILE
24 | echo "fi" >> $FILE
25 | echo "" >> $FILE
26 | echo "if [ \"\$BOT\" = \"hihi=0\" ] || [ -z \"\$BOT\" ]; then" >> $FILE
27 | echo " BOT=\"hihi=\"\$CBOT" >> $FILE
28 | echo "fi" >> $FILE
29 | echo "" >> $FILE
30 | echo "echo \$TOP > /minipwner/minimodes/mode" >> $FILE
31 | echo "echo \$BOT >> /minipwner/minimodes/mode" >> $FILE
32 | echo "" >> $FILE
33 | echo "CTOP=\`grep lohi /minipwner/minimodes/mode | cut -d\"=\" -f2\`" >> $FILE
34 | echo "CBOT=\`grep hihi /minipwner/minimodes/mode | cut -d\"=\" -f2\`" >> $FILE
35 | echo "" >> $FILE
36 | echo "echo \"\"" >> $FILE
37 | echo "echo \"Select your MiniModes
\"" >> $FILE
38 | echo "echo \"System time
\"" >> $FILE
39 | echo "echo \"\$(date)
\"" >> $FILE
40 | echo "" >> $FILE
41 | echo "echo \"\"" >> $FILE
42 | echo "echo \"Switch | Current Setting | New Setting |
\"" >> $FILE
43 | echo "echo \"3G/4G | \$CTOP | \"" >> $FILE
44 | echo "echo \" |
\"" >> $FILE
51 |
52 | echo "echo \"WISP | Setup | N/A |
\"" >> $FILE
53 |
54 | echo "echo \"AP | \$CBOT | \"" >> $FILE
55 | echo "echo \" |
\"" >> $FILE
62 |
63 | echo "echo \"
\"" >> $FILE
64 | echo "echo \"
\"" >> $FILE
65 | echo "echo \"\"" >> $FILE
68 | echo "echo \"\"" >> $FILE
69 |
70 | # Set permissions
71 | chmod +x $FILE
72 |
73 | # Blank out status file
74 | echo "null" > /minipwner/minimodes/stat 2>&1
75 |
76 | # Start the main script
77 | /minipwner/minimodes/switch.sh &
78 |
--------------------------------------------------------------------------------
/src/bin/minimodes.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | MiniModes
9 |
10 |
11 |
--------------------------------------------------------------------------------
/src/bin/minipwner.tar:
--------------------------------------------------------------------------------
1 | minipwner/ 000755 000000 000000 00000000000 12435770321 013050 5 ustar 00root root 000000 000000 minipwner/kismet/ 000755 000000 000000 00000000000 12431655540 014345 5 ustar 00root root 000000 000000 minipwner/kismet/kismet.sh 000755 000000 000000 00000004627 12412776415 016215 0 ustar 00root root 000000 000000 #!/bin/sh
2 | # Name: kismet.sh
3 | clear
4 |
5 | PROCESS="kismet_server"
6 | LOG="/minipwner/kismet/logs/$PROCESS.log"
7 |
8 | if test -z $1; then
9 | echo "Supply an argument [start | stop | status]"
10 | exit 1
11 | fi
12 |
13 | case $1 in
14 | "start")
15 | if ps | grep -v grep | grep $PROCESS; then
16 | echo "`date`,start,$PROCESS already runing" >> $LOG
17 | echo "$PROCESS is already running, nothing to do"
18 | else
19 | mkdir /minipwner/kismet/logs > /dev/null 2>&1
20 | mkdir /minipwner/kismet/logsold > /dev/null 2>&1
21 | mv /minipwner/kismet/logs/* /minipwner/kismet/logsold/ > /dev/null 2>&1
22 | cd /minipwner/kismet/logs
23 | $PROCESS > /dev/null 2>&1 &
24 | echo "`date`,start,$PROCESS started" >> $LOG
25 | echo "$PROCESS started"
26 | fi
27 | ;;
28 | "stop")
29 | PID=`ps | grep -v grep | grep $PROCESS | awk '{print $1}'`
30 | mkdir /minipwner/kismet/logs > /dev/null 2>&1
31 | if test -z $PID; then
32 | echo "`date`,stop,$PROCESS is not running" >> $LOG
33 | echo "$PROCESS is not running, nothing to do."
34 | else
35 | kill $PID
36 | echo "`date`,stop,killed pid $PID to stop $PROCESS" >> $LOG
37 | echo "Killed pid $PID to stop $PROCESS"
38 | fi
39 | ;;
40 | "status")
41 | PID=`ps | grep -v grep | grep $PROCESS | awk '{print $1}'`
42 | mkdir /minipwner/kismet/logs > /dev/null 2>&1
43 | if test -z $PID; then
44 | echo "`date`,status,$PROCESS is not running" >> $LOG
45 | echo "$PROCESS is not running at this time"
46 | else
47 | echo "`date`,status,$PROCESS is running at pid $PID" >> $LOG
48 | echo "$PROCESS is running at pid $PID"
49 | fi
50 | ;;
51 | *)
52 | echo "That sir, is invalid. Please try again."
53 | exit 1
54 | ;;
55 | esac
56 | minipwner/minimodes/ 000755 000000 000000 00000000000 12440127374 015034 5 ustar 00root root 000000 000000 minipwner/minimodes/Lights-On/ 000755 000000 000000 00000000000 12440127331 016631 5 ustar 00root root 000000 000000 minipwner/minimodes/Lights-On/Lights-On.sh 000755 000000 000000 00000000363 12440127331 020776 0 ustar 00root root 000000 000000 #!/bin/sh
57 |
58 | echo 255 > /sys/devices/platform/leds-gpio/leds/tp-link:green:3g/brightness
59 | echo 255 > /sys/devices/platform/leds-gpio/leds/tp-link:green:wlan/brightness
60 | echo 255 > /sys/devices/platform/leds-gpio/leds/tp-link:green:lan/brightness
61 | minipwner/minimodes/switch.sh 000755 000000 000000 00000001714 12440141514 016667 0 ustar 00root root 000000 000000 #!/bin/sh
62 |
63 |
64 | # Vars
65 | # -----
66 | SLEEP=5 # Set the number of seconds between each cycle
67 | PROCESS="switch.sh"
68 | LOG="/minipwner/minimodes/logs.txt"
69 | DIR="/minipwner/minimodes/"
70 |
71 | while :
72 | do
73 | STAT=`cat /minipwner/minimodes/stat`
74 | SW1=`grep -i sw1 /sys/kernel/debug/gpio | cut -d" " -f24`
75 | SW2=`grep -i sw2 /sys/kernel/debug/gpio | cut -d" " -f24`
76 | POS=$SW1$SW2
77 |
78 | POS1=`grep lohi /minipwner/minimodes/mode | cut -d"=" -f2`
79 | POS2=`grep hihi /minipwner/minimodes/mode | cut -d"=" -f2`
80 |
81 | case $POS in
82 | "lohi")
83 | if [ "$STAT" != "$POS" ]; then
84 | echo $POS > /minipwner/minimodes/stat
85 | /minipwner/minimodes/$POS1/*.sh
86 | fi
87 | ;;
88 | "hilo")
89 | if [ "$STAT" != "$POS" ]; then
90 | echo $POS > /minipwner/minimodes/stat
91 | /minipwner/minimodes/Setup_Mode/*.sh
92 | fi
93 | ;;
94 | "hihi")
95 | if [ "$STAT" != "$POS" ]; then
96 | echo $POS > /minipwner/minimodes/stat
97 | /minipwner/minimodes/$POS2/*.sh
98 | fi
99 | ;;
100 |
101 | *)
102 | echo "Something went very, very wrong..."
103 | ;;
104 | esac
105 |
106 | sleep $SLEEP
107 | done
108 | minipwner/minimodes/Lights-Out/ 000755 000000 000000 00000000000 12440127344 017030 5 ustar 00root root 000000 000000 minipwner/minimodes/Lights-Out/Lights-Out.sh 000755 000000 000000 00000000355 12440127344 021371 0 ustar 00root root 000000 000000 #!/bin/sh
109 |
110 | echo 0 > /sys/devices/platform/leds-gpio/leds/tp-link:green:3g/brightness
111 | echo 0 > /sys/devices/platform/leds-gpio/leds/tp-link:green:wlan/brightness
112 | echo 0 > /sys/devices/platform/leds-gpio/leds/tp-link:green:lan/brightness
113 | minipwner/minimodes/WarWalk/ 000755 000000 000000 00000000000 12436116606 016405 5 ustar 00root root 000000 000000 minipwner/minimodes/WarWalk/Lights-Out.sh 000755 000000 000000 00000000355 12436116606 020746 0 ustar 00root root 000000 000000 #!/bin/sh
114 |
115 | echo 0 > /sys/devices/platform/leds-gpio/leds/tp-link:green:3g/brightness
116 | echo 0 > /sys/devices/platform/leds-gpio/leds/tp-link:green:wlan/brightness
117 | echo 0 > /sys/devices/platform/leds-gpio/leds/tp-link:green:lan/brightness
118 | minipwner/minimodes/WarWalk/start.sh 000755 000000 000000 00000000055 12436116575 020106 0 ustar 00root root 000000 000000 #!/bin/sh
119 |
120 | /minipwner/kismet/kismet start &
121 |
122 | minipwner/minimodes/mode 000644 001750 001750 00000000025 12440635343 016540 0 ustar 00mvieau mvieau 000000 000000 lohi=AP
123 | hihi=WarWalk
124 | minipwner/minimodes/WiFi_Client/ 000755 000000 000000 00000000000 12440127412 017161 5 ustar 00root root 000000 000000 minipwner/minimodes/WiFi_Client/client.sh 000755 000000 000000 00000000230 12435721372 021002 0 ustar 00root root 000000 000000 #/bin/sh
125 |
126 | cp -f /minipwner/minimodes/WiFi_Client/network /etc/config/network
127 | cp -f /minipwner/minimodes/WiFi_Client/wireless /etc/config/wireless
128 |
129 | wifi
130 | minipwner/minimodes/WiFi_Client/network 000644 000000 000000 00000000662 12434447566 020623 0 ustar 00root root 000000 000000
131 | config interface 'loopback'
132 | option ifname 'lo'
133 | option proto 'static'
134 | option ipaddr '127.0.0.1'
135 | option netmask '255.0.0.0'
136 |
137 | config globals 'globals'
138 | option ula_prefix 'fdc1:4f83:acf4::/48'
139 |
140 | config interface 'lan'
141 | option ifname 'eth0'
142 | option force_link '1'
143 | option proto 'static'
144 | option ipaddr '192.168.1.1'
145 | option netmask '255.255.255.0'
146 |
147 | config interface 'wan'
148 | option ifname 'wlan0'
149 | option proto 'dhcp'
150 | minipwner/minimodes/WiFi_Client/wireless 000644 001750 001750 00000000602 12441143747 021611 0 ustar 00mvieau mvieau 000000 000000 config wifi-device radio0
151 | option type mac80211
152 | option channel 11
153 | option hwmode 11g
154 | option path 'platform/ar933x_wmac'
155 | option htmode HT20
156 | option disabled 0 # 0=wifi enabled, 1=wifi disabled
157 |
158 | # Client mode
159 | config wifi-iface
160 | option device radio0
161 | option network wan
162 | option mode sta
163 | option ssid Your_SSID_here
164 | option encryption psk2
165 | option key "Your_key_here"
166 | minipwner/minimodes/Setup_Mode/ 000755 000000 000000 00000000000 12435763211 017100 5 ustar 00root root 000000 000000 minipwner/minimodes/Setup_Mode/setup_mode.sh 000755 000000 000000 00000000227 12435767037 021616 0 ustar 00root root 000000 000000 #!/bin/sh
167 |
168 | cp -f /minipwner/minimodes/Setup_Mode/network /etc/config/network
169 | cp -f /minipwner/minimodes/Setup_Mode/wireless /etc/config/wireless
170 |
171 | wifi
172 | minipwner/minimodes/Setup_Mode/network 000644 000000 000000 00000001045 12435763262 020522 0 ustar 00root root 000000 000000
173 | config interface 'loopback'
174 | option ifname 'lo'
175 | option proto 'static'
176 | option ipaddr '127.0.0.1'
177 | option netmask '255.0.0.0'
178 |
179 | config globals 'globals'
180 | option ula_prefix 'fdc1:4f83:acf4::/48'
181 |
182 | config interface 'lan'
183 | option ifname 'eth0'
184 | option force_link '1'
185 | #option type 'bridge'
186 | option proto 'static'
187 | option ipaddr '192.168.1.1'
188 | option netmask '255.255.255.0'
189 | #option ip6assign '60'
190 |
191 | config interface 'wan'
192 | option ifname 'wlan0'
193 | option proto 'static'
194 | option ipaddr '192.168.3.1'
195 | option netmask '255.255.255.0'
196 | minipwner/minimodes/Setup_Mode/wireless 000644 001750 001750 00000000615 12440636650 021524 0 ustar 00mvieau mvieau 000000 000000 config wifi-device radio0
197 | option type mac80211
198 | option channel 11
199 | option hwmode 11g
200 | option path 'platform/ar933x_wmac'
201 | option htmode HT20
202 | option disabled 0 # 0=wifi enabled, 1=wifi disabled
203 |
204 | # AP mode
205 | config wifi-iface
206 | option device radio0
207 | option network wan
208 | option mode ap
209 | option ssid "MiniPwner-Setup"
210 | option encryption psk2
211 | option key "M!n!Pwn3r$etup"
212 | minipwner/minimodes/AP/ 000755 000000 000000 00000000000 12434450072 015331 5 ustar 00root root 000000 000000 minipwner/minimodes/AP/network 000644 000000 000000 00000001045 12434450054 016745 0 ustar 00root root 000000 000000
213 | config interface 'loopback'
214 | option ifname 'lo'
215 | option proto 'static'
216 | option ipaddr '127.0.0.1'
217 | option netmask '255.0.0.0'
218 |
219 | config globals 'globals'
220 | option ula_prefix 'fdc1:4f83:acf4::/48'
221 |
222 | config interface 'lan'
223 | option ifname 'eth0'
224 | option force_link '1'
225 | #option type 'bridge'
226 | option proto 'static'
227 | option ipaddr '192.168.1.1'
228 | option netmask '255.255.255.0'
229 | #option ip6assign '60'
230 |
231 | config interface 'wan'
232 | option ifname 'wlan0'
233 | option proto 'static'
234 | option ipaddr '192.168.2.1'
235 | option netmask '255.255.255.0'
236 | minipwner/minimodes/AP/wireless 000644 001750 001750 00000000607 12440636771 017765 0 ustar 00mvieau mvieau 000000 000000 config wifi-device radio0
237 | option type mac80211
238 | option channel 11
239 | option hwmode 11g
240 | option path 'platform/ar933x_wmac'
241 | option htmode HT20
242 | option disabled 0 # 0=wifi enabled, 1=wifi disabled
243 |
244 | # AP mode
245 | config wifi-iface
246 | option device radio0
247 | option network wan
248 | option mode ap
249 | option ssid "MiniPwner-AP"
250 | option encryption psk2
251 | option key "M!n!Pwn3rAP"
252 | minipwner/minimodes/AP/ap.sh 000755 000000 000000 00000000207 12435721165 016274 0 ustar 00root root 000000 000000 #!/bin/sh
253 |
254 | cp -f /minipwner/minimodes/AP/network /etc/config/network
255 | cp -f /minipwner/minimodes/AP/wireless /etc/config/wireless
256 |
257 | wifi
258 |
--------------------------------------------------------------------------------
/src/setup.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Name: setup.sh
3 | # Purpose: Install the MiniPwner overlay to OpenWRT
4 | # By: Michael Vieau
5 | # By: Nicholas Adamou
6 | # Date: 12.12.14
7 | # Modified 8.20.18
8 | # Rev Level 0.1
9 | # -----------------------------------------------
10 |
11 | declare BASH_UTILS_URL="https://raw.githubusercontent.com/dotbrains/utilities/master/utilities.sh"
12 |
13 | # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
14 |
15 | # ----------------------------------------------------------------------
16 | # | Helper Functions |
17 | # ----------------------------------------------------------------------
18 |
19 | restart() {
20 | ask_for_confirmation "Do you want to restart?"
21 |
22 | if answer_is_yes; then
23 | sudo shutdown -r now &> /dev/null
24 | fi
25 | }
26 |
27 | setup_minipwner() {
28 | cat bin/banner
29 |
30 | # Setup MiniPwner Dir
31 | tar -xf minipwner.tar -C /
32 |
33 | # Setup minimodes
34 | mv -f bin/minimodes /etc/init.d/minimodes
35 | chmod +x /etc/init.d/minimodes
36 | ln -s /etc/init.d/minimodes /etc/rc.d/S99minimodes
37 | chmod +x /etc/rc.d/S99minimodes
38 |
39 | # Move files as needed
40 | mv -f bin/minimodes.html /www/minimodes.html
41 | chmod +x /www/minimodes.html
42 | mv -f bin/firewall /etc/config/firewall
43 | chmod 644 /etc/config/firewall
44 | mv -f bin/banner /etc/banner
45 | chmod 644 /etc/banner
46 |
47 | # Clean up
48 | rm -f bin
49 | rm -f setup.sh
50 |
51 | echo "The MiniPwner Overlay 2.0.0 has been applied."
52 | echo "Reboot your device for everything to take effect."
53 | echo "---------------------------------------------------"
54 | }
55 |
56 | # ----------------------------------------------------------------------
57 | # | Main |
58 | # ----------------------------------------------------------------------
59 |
60 | main() {
61 | # Ensure that there is a working internet connection
62 | if is_connected_to_internet; then
63 | # Ensure that the following actions
64 | # are made relative to this file's path.
65 |
66 | cd "$(dirname "${BASH_SOURCE[0]}")" \
67 | || exit 1
68 |
69 | # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
70 |
71 | # Load utils
72 |
73 | source <(curl -s "$BASH_UTILS_URL")
74 |
75 | # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
76 |
77 | ask_for_sudo
78 |
79 | # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
80 |
81 | setup_minipwner
82 |
83 | # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
84 |
85 | restart
86 | fi
87 | }
88 |
89 | main
90 |
--------------------------------------------------------------------------------
/test/customize_environment.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4 |
5 | # Linux
6 |
7 | if [ "$TRAVIS_OS_NAME" = "linux" ]; then
8 |
9 | # The Travis CI Ubuntu Trusty images do not
10 | # have the some of the suites enabled by default.
11 |
12 | sudo add-apt-repository multiverse
13 | sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu/ trusty-backports restricted main universe"
14 | sudo apt update -qqy
15 |
16 | # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
17 |
18 | # Install `ShellCheck`
19 | # (required for testing).
20 |
21 | sudo apt install -qqy shellcheck
22 |
23 | # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
24 |
25 | # OS X
26 |
27 | elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
28 |
29 | # Install `ShellCheck`
30 | # (required for testing).
31 |
32 | brew install shellcheck
33 |
34 | fi
35 |
36 | # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
37 |
38 | # To better simulate a clean OS install, remove certain things
39 | # included by default by Travis CI.
40 |
41 | rm -rf "$NVM_DIR"
--------------------------------------------------------------------------------
/test/main.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | cd "$(dirname "${BASH_SOURCE[0]}")" \
4 | && source <(curl -s "https://raw.githubusercontent.com/dotbrains/utilities/master/utilities.sh")
5 |
6 | # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
7 |
8 | main() {
9 |
10 | # ' At first you're like "shellcheck is awesome" but then you're
11 | # like "wtf[,] [why] are we still using bash[?]" '.
12 | #
13 | # (from: https://twitter.com/astarasikov/status/568825996532707330)
14 |
15 | find \
16 | ../src \
17 | -type f \
18 | ! -path '../src/bin/*' \
19 | -exec shellcheck \
20 | -e SC1090 \
21 | -e SC1091 \
22 | -e SC2033 \
23 | -e SC2129 \
24 | -e SC2155 \
25 | -e SC2164 \
26 | -e SC2200 \
27 | {} +
28 |
29 | print_result $? "Run code through ShellCheck"
30 |
31 | }
32 |
33 | main
34 |
--------------------------------------------------------------------------------