Wir erstellen uns eine DarkNet-PiratenBox.
Vorbereitungen
Wir brauchen:
* Portable Mini TP-LINK TL-WR703N (25,-)
* mini USB-Stick mit 4GB oder 8GB (~8,-)
* Später für den Betrieb noch einen Akku-Pack
OpenWRT
1) Zuerst holen wir uns OpenWRT. Für den TL-WR703N verwenden wir diese Firmware.
2) Laptop mit dem LAN-Kabel an den TL-WR703N anschließen, und beides Starten.
3) Im Browser die Adminseite des Routers aufrufen. Der TL-WR703N läuft per Default unter 192.168.1.1. Und als Login wird admin:admin verwendet.
4) Dann kommt die große Überraschung ….
der TL-WR703N ist ein Importgerät, das haben schon die Aufkleber auf der Verpackung deutlich gemacht und die Navigation ist komplett in Chinesisch gehalten.
Aber keine Bange, das Internet Hilft mit einem Beitrag aus der Village Telco Development Community.
Die URL zum flashen der Firmware ist hier: http://192.168.1.1/userRpm/SoftwareUpgradeRpm.htm
Oder: letzter Menüpunkt Links, dann den dritten Untermenüpunkt auswählen.
5) OpenWRT läuft, Passwort und SSH-Optionen setzten
6) Login mit SSH und die Netzwerkkonfig bearbeiten
Dem Gerät geben wir eine feste IP-Adresse im Home-Netz, setzten das Gateway und den DNS auf die IP des Home-Routers fertig!
Anleitung für vi gibt es hier
1 |
vi /etc/config/network |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
config interface 'loopback' option ifname 'lo' option proto 'static' option ipaddr '127.0.0.1' option netmask '255.0.0.0' config interface 'lan' option ifname 'eth0' option type 'bridge' option proto 'static' option ipaddr '192.168.130.222' option netmask '255.255.255.0' option gateway '192.168.130.1' list dns '192.168.130.1 8.8.8.8' |
Dann noch kontrollieren, ob in der Datei /etc/config/wireless der Eintrag richtig gesetzt ist
1 |
option disabeld '0' |
7) So, jetzt ausschalten,
8) den LAN-Port mit dem Home-Router verbinden,
9) einschalten und per Laptop per WLAN verbinden
10) und mit PUTTY wieder rein in root@192.168.130.222
11) Jetzt installieren wir den USB-Support
1 2 3 4 5 6 7 8 9 |
opkg update opkg install nano ## ich mag vi nicht wirklich opkg install kmod-usb-uhci insmod usbcore ## mit der 12.09 kommt die Meldung: file exists insmod uhci opkg install kmod-usb-ohci ## bei der 12.09 ist hier die Meldung: up to date. insmod usb-ohci opkg list-upgradable |
Wenn es Pakete gibt, für die ein Update vorliegt, sollte dieses jetzt auch eingespielt werden 🙂
Piraten Box
Nachdem die Vorarbeiten erfolgreich abgeschlossen wurden, kann jetzt mit der Installation der Piratenbox begonnen werden.
Zuerst natürlich den USB-Stick (mind. 4GB, FAT32 formatiert) einstecken, dann
1 2 |
cd /tmp opkg update && opkg install http://piratebox.aod-rpg.de/piratebox_0.6.3_all.ipk |
Die Ausgabe des Scriptes:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 |
<div style="height:300px;overflow:scroll;"> Downloading http://piratebox.aod-rpg.de/piratebox_0.6.3_all.ipk. Installing piratebox (0.6.3) to root... Installing kmod-usb-storage (3.3.8-1) to root... Downloading http://downloads.openwrt.org/attitude_adjustment/12.09/ar71xx/generic/packages/kmod-usb-storage_3.3.8-1_ar71xx.ipk. Installing kmod-scsi-core (3.3.8-1) to root... Downloading http://downloads.openwrt.org/attitude_adjustment/12.09/ar71xx/generic/packages/kmod-scsi-core_3.3.8-1_ar71xx.ipk. Installing kmod-fs-vfat (3.3.8-1) to root... Downloading http://downloads.openwrt.org/attitude_adjustment/12.09/ar71xx/generic/packages/kmod-fs-vfat_3.3.8-1_ar71xx.ipk. Installing kmod-nls-cp437 (3.3.8-1) to root... Downloading http://downloads.openwrt.org/attitude_adjustment/12.09/ar71xx/generic/packages/kmod-nls-cp437_3.3.8-1_ar71xx.ipk. Installing kmod-nls-cp850 (3.3.8-1) to root... Downloading http://downloads.openwrt.org/attitude_adjustment/12.09/ar71xx/generic/packages/kmod-nls-cp850_3.3.8-1_ar71xx.ipk. Installing kmod-nls-iso8859-1 (3.3.8-1) to root... Downloading http://downloads.openwrt.org/attitude_adjustment/12.09/ar71xx/generic/packages/kmod-nls-iso8859-1_3.3.8-1_ar71xx.ipk. Installing kmod-nls-iso8859-15 (3.3.8-1) to root... Downloading http://downloads.openwrt.org/attitude_adjustment/12.09/ar71xx/generic/packages/kmod-nls-iso8859-15_3.3.8-1_ar71xx.ipk. Installing kmod-fs-ext4 (3.3.8-1) to root... Downloading http://downloads.openwrt.org/attitude_adjustment/12.09/ar71xx/generic/packages/kmod-fs-ext4_3.3.8-1_ar71xx.ipk. Installing kmod-lib-crc16 (3.3.8-1) to root... Downloading http://downloads.openwrt.org/attitude_adjustment/12.09/ar71xx/generic/packages/kmod-lib-crc16_3.3.8-1_ar71xx.ipk. Installing block-mount (0.2.0-9) to root... Downloading http://downloads.openwrt.org/attitude_adjustment/12.09/ar71xx/generic/packages/block-mount_0.2.0-9_ar71xx.ipk. Installing blkid (2.21.2-1) to root... Downloading http://downloads.openwrt.org/attitude_adjustment/12.09/ar71xx/generic/packages/blkid_2.21.2-1_ar71xx.ipk. Installing libblkid (2.21.2-1) to root... Downloading http://downloads.openwrt.org/attitude_adjustment/12.09/ar71xx/generic/packages/libblkid_2.21.2-1_ar71xx.ipk. Installing libuuid (2.21.2-1) to root... Downloading http://downloads.openwrt.org/attitude_adjustment/12.09/ar71xx/generic/packages/libuuid_2.21.2-1_ar71xx.ipk. Installing swap-utils (2.21.2-1) to root... Downloading http://downloads.openwrt.org/attitude_adjustment/12.09/ar71xx/generic/packages/swap-utils_2.21.2-1_ar71xx.ipk. Installing kmod-loop (3.3.8-1) to root... Downloading http://downloads.openwrt.org/attitude_adjustment/12.09/ar71xx/generic/packages/kmod-loop_3.3.8-1_ar71xx.ipk. Installing losetup (2.21.2-1) to root... Downloading http://downloads.openwrt.org/attitude_adjustment/12.09/ar71xx/generic/packages/losetup_2.21.2-1_ar71xx.ipk. Configuring kmod-scsi-core. Configuring kmod-usb-storage. Configuring kmod-lib-crc16. Configuring libuuid. Configuring libblkid. Configuring blkid. Configuring swap-utils. Configuring block-mount. Configuring kmod-fs-vfat. Configuring kmod-fs-ext4. Configuring losetup. Configuring kmod-nls-cp437. Configuring kmod-nls-cp850. Configuring kmod-nls-iso8859-1. Configuring kmod-nls-iso8859-15. Configuring kmod-loop. Configuring piratebox. Please connect USB disk. If it is already plugged-in, wait for a few seconds, and if nothing happens, please reconnect the device. Keep in mind that your router's ports may not be able to supply enough power to spin-up a USB HDD. .. USB disk is now available. Continuing... Stopping uttpd and disable it Stopping luci_fixtime and disable it /etc/init.d/piratebox: Mounting external USB storage... /etc/init.d/piratebox: Creating swapspace... 32+0 records in 32+0 records out Setting up swapspace version 1, size = 32764 KiB no label, UUID=c7dc27f7-4964-471d-a12c-fe982bd378ea /etc/init.d/piratebox: Creating ext loop image... /etc/init.d/piratebox: Creating piratebox loop image... No PirateBox Image file found... loading from Internet Connecting to piratebox.aod-rpg.de (87.237.121.137:80) piratebox_ws_0.6_img 100% |*******************************| 155k 0:00:00 ETA Check for WAN Connection .. PING google.com (173.194.112.65): 56 data bytes 64 bytes from 173.194.112.65: seq=0 ttl=55 time=11.396 ms 64 bytes from 173.194.112.65: seq=1 ttl=55 time=13.938 ms 64 bytes from 173.194.112.65: seq=2 ttl=55 time=13.498 ms --- google.com ping statistics --- 3 packets transmitted, 3 packets received, 0% packet loss round-trip min/avg/max = 11.396/12.944/13.938 ms Installing python from repository Downloading http://downloads.openwrt.org/attitude_adjustment/12.09/ar71xx/generic/packages/Packages.gz. Updated list of available packages in /var/opkg-lists/attitude_adjustment. Installing python (2.7.3-1) to piratebox... Downloading http://downloads.openwrt.org/attitude_adjustment/12.09/ar71xx/generic/packages/python_2.7.3-1_ar71xx.ipk. Installing libpthread (0.9.33.2-1) to piratebox... Downloading http://downloads.openwrt.org/attitude_adjustment/12.09/ar71xx/generic/packages/libpthread_0.9.33.2-1_ar71xx.ipk. Installing zlib (1.2.7-1) to piratebox... Downloading http://downloads.openwrt.org/attitude_adjustment/12.09/ar71xx/generic/packages/zlib_1.2.7-1_ar71xx.ipk. Installing libffi (3.0.10-1) to piratebox... Downloading http://downloads.openwrt.org/attitude_adjustment/12.09/ar71xx/generic/packages/libffi_3.0.10-1_ar71xx.ipk. Installing python-mini (2.7.3-1) to piratebox... Downloading http://downloads.openwrt.org/attitude_adjustment/12.09/ar71xx/generic/packages/python-mini_2.7.3-1_ar71xx.ipk. Configuring libpthread. Configuring zlib. Configuring libffi. Configuring python-mini. Configuring python. Installing lighttpd (1.4.30-2) to piratebox... Downloading http://downloads.openwrt.org/attitude_adjustment/12.09/ar71xx/generic/packages/lighttpd_1.4.30-2_ar71xx.ipk. Installing libopenssl (1.0.1e-1) to piratebox... Downloading http://downloads.openwrt.org/attitude_adjustment/12.09/ar71xx/generic/packages/libopenssl_1.0.1e-1_ar71xx.ipk. Installing libpcre (8.11-2) to piratebox... Downloading http://downloads.openwrt.org/attitude_adjustment/12.09/ar71xx/generic/packages/libpcre_8.11-2_ar71xx.ipk. Configuring libpcre. Configuring libopenssl. Configuring lighttpd. Installing lighttpd-mod-cgi (1.4.30-2) to piratebox... Downloading http://downloads.openwrt.org/attitude_adjustment/12.09/ar71xx/generic/packages/lighttpd-mod-cgi_1.4.30-2_ar71xx.ipk. Configuring lighttpd-mod-cgi. Installing lighttpd-mod-redirect (1.4.30-2) to piratebox... Downloading http://downloads.openwrt.org/attitude_adjustment/12.09/ar71xx/generic/packages/lighttpd-mod-redirect_1.4.30-2_ar71xx.ipk. Configuring lighttpd-mod-redirect. Installing lighttpd-mod-alias (1.4.30-2) to piratebox... Downloading http://downloads.openwrt.org/attitude_adjustment/12.09/ar71xx/generic/packages/lighttpd-mod-alias_1.4.30-2_ar71xx.ipk. Configuring lighttpd-mod-alias. Installing lighttpd-mod-setenv (1.4.30-2) to piratebox... Downloading http://downloads.openwrt.org/attitude_adjustment/12.09/ar71xx/generic/packages/lighttpd-mod-setenv_1.4.30-2_ar71xx.ipk. Configuring lighttpd-mod-setenv. Installing lighttpd-mod-webdav (1.4.30-2) to piratebox... Downloading http://downloads.openwrt.org/attitude_adjustment/12.09/ar71xx/generic/packages/lighttpd-mod-webdav_1.4.30-2_ar71xx.ipk. Installing libsqlite3 (3071201-1) to piratebox... Downloading http://downloads.openwrt.org/attitude_adjustment/12.09/ar71xx/generic/packages/libsqlite3_3071201-1_ar71xx.ipk. Installing libuuid (2.21.2-1) to piratebox... Downloading http://downloads.openwrt.org/attitude_adjustment/12.09/ar71xx/generic/packages/libuuid_2.21.2-1_ar71xx.ipk. Installing libxml2 (2.7.8-2) to piratebox... Downloading http://downloads.openwrt.org/attitude_adjustment/12.09/ar71xx/generic/packages/libxml2_2.7.8-2_ar71xx.ipk. Configuring libxml2. Configuring libuuid. Configuring libsqlite3. Configuring lighttpd-mod-webdav. Loading defaults Loading synflood protection Adding custom chains Loading zones Loading forwardings Loading rules Loading redirects Loading includes Optimizing conntrack Loading interfaces Configuration file: /var/run/hostapd-phy0.conf Using interface wlan0 with hwaddr 14:cf:92:ba:97:af and ssid "PirateBox - Share Freely" command failed: Invalid argument (-22) -------------- Initialize PirateBoxScripts ----------- chown: /opt/piratebox/share: Operation not permitted Starting script piratebox Generating hosts file .... Generating dnsmasq.conf ..... Generating Environment-config for ligttpd ..... Empty tmp folder rm: /opt/piratebox/tmp: is a directory Starting dnsmasq... 0 Starting droopy... 0 Generated HTML-Shoutbox File. Starting lighttpd... 0 PirateBox wireless SSID: PirateBox - Share Freely PirateBox DNS and hostname: piratebox.lan hostname with unique suffix is: HzOqkkKJ.piratebox.lan PirateBox LAN IP address: 192.168.1.1 PirateBox shared directory: /mnt/usb/PirateBox/Shared Setup complete, PirateBox started. You can remove the WAN connection now. Please reboot your PirateBox now: # reboot </div> |
Vor dem Reboot setzten wir aber zunächst noch das aktuelle Datum und installieren den time-saver im crontab
1 2 |
date -s "YYYY-MM-DD HH:ii" /opt/piratebox/bin/timesave.sh /opt/piratebox/conf/piratebox.conf install |
dann installieren wir das Kareha Board
1 |
/opt/piratebox/bin/install_piratebox.sh /opt/piratebox/conf/piratebox.conf imageboard |
Dann verschieben wir (Speicherplatzmangel) alles in das alternative www-Verzeichniss www_alt
1 2 3 4 5 |
mkdir /mnt/usb/PirateBox/www_alt cp -r /opt/piratebox/www/* /mnt/usb/PirateBox/www_alt/ mkdir /mnt/usb/PirateBox/www_alt/Shared mkdir /mnt/usb/PirateBox/www_alt/board cp -r /opt/piratebox/share/board/* /mnt/usb/PirateBox/www_alt/board |
Nachdem dies getan ist braucht die PB noch ein update….
1 2 3 |
/etc/init.d/piratebox stop /etc/init.d/piratebox updatePB /etc/init.d/piratebox start |
weiteres …..
http://piratebox.aod-rpg.de/dokuwiki/doku.php/modifications/lighttpd_051?s[]=piratebox&s[]=php