Version without proprietary binaries

This commit is contained in:
xchwarze 2023-11-09 20:06:00 -08:00
commit 19341aa6ae
46 changed files with 3839 additions and 0 deletions

106
README.md Normal file
View File

@ -0,0 +1,106 @@
![Project Logo](assets/logo.png)
# Wifi Pineapple Cloner v4
The Pineapple NANO and TETRA are excellent security hardware but in 2020 they reached their end of life.<br>
So to give a new life to this platform on modern hardware I developed these scripts to port it to different routers.<br>
Sometime between 2019 and 2020 we started using the private beta of this project which my friends called "Pineapple Termidor".<br>
So at the time of redoing this project I decided to rescue the original name from forgotten 🤣
## About this project
This project is the result of everything I've experienced from 2018 to 2022 to successfully clone the NANO and TETRA in any hardware.<br>
For this I've develop:
* The method of patching the file system with the minimum to be able to work. For this I created the list of files to copy and the script that copies them.
* A script to patch the file system to work on any hardware.
* Completely updated [panel](https://github.com/xchwarze/wifi-pineapple-panel) with fixes and improvements.
* Completely updated [packages repository](https://github.com/xchwarze/wifi-pineapple-community-packages) ([build](https://github.com/xchwarze/wifi-pineapple-community/tree/main/packages)).
* New [module repository](https://github.com/xchwarze/wifi-pineapple-community/tree/main/modules).
* And some new modules that are basic to use a device like this nowadays. New modules: [PMKIDAttack](https://github.com/xchwarze/wifi-pineapple-community/tree/main/modules/src/PMKIDAttack) and [Terminal](https://github.com/xchwarze/wifi-pineapple-community/tree/main/modules/src/Terminal)
* I also carefully checked every dependency that was installed on the device in order to have more free space on the main partition.
![Panel](assets/termidor-mipsel.png)
## Builds
You can find the complete steps to build this project in [this document](build.md). I also added several important notes about this.
<br>
## Supported devices
There are 211 devices supported by the project. You can see the full [list here](devices.md).
<br>
Also I made a second repo for [downloads](https://github.com/xchwarze/wifi-pineapple-cloner-builds) where you can find the firmwares already made for the most common devices of the Supported devices list.
<br>
## What differences are there with other methods using by firmwares that I can download from the internet?
All the firmwares found on the internet have been created using the [securityaddicted method](https://www.securityaddicted.com/2016/11/17/weaponizing-gl-inet-gl-ar150/), which involves duplicating the entire original file system. However, this approach consumes excessive space and often leads to instability. As a result, I have developed a new and improved method.
I introduced this new method method during my presentations at EkoParty 2020 and DragonJar 2021. You can access the materials from those [presentations here](https://github.com/indetectables-net/embedded).
In 2021, an [idiot named Samy Younsi](https://github.com/xchwarze/wifi-pineapple-cloner/issues/26), shamelessly plagiarized the method I had developed and presented at conferences. Months later, he adapted it to Python using the Wifi Pineapple Cloner v1 version and continued spreading it as his own creation.
Throughout 2022, I debugged the method and mastered its usage, enabling me to successfully port the pineapple to any hardware and achieve flawless functionality, identical to that of the original device.
Therefore, the most refined method I have devised not only significantly reduces the firmware's file size but also guarantees stability comparable to the original hardware.<br>
<br>
## Install steps
1. Install OpenWrt version 19.07.7 on your router.
<br>
2. Use SCP to upload the [firmware image](https://github.com/xchwarze/wifi-pineapple-cloner-builds) in your device.
```bash
scp gl-ar750s-universal-sysupgrade.bin root@192.168.1.1:/tmp
root@192.168.1.1's password:
gl-ar750s-universal-sysupgrade.bin 100% 13MB 2.2MB/s 00:05
```
<br>
3. Once the image is uploaded, execute sysupgrade command to update firmware. Wait few minutes until the device install the new firmware.
```bash
ssh root@192.168.1.1
sysupgrade -n -F /tmp/gl-ar750s-universal-sysupgrade.bin
```
<br>
4. Enter to pineapple panel and enjoy! `http://172.16.42.1:1471/`
In the [download](https://github.com/xchwarze/wifi-pineapple-cloner-builds) repo you can find some debugging tips if you have problems.
<br>
5. Once installed, the project has a tool that helps us to do several things.
For example you can use it to change the panel theme with this command:
```bash
wpc-tools theme_install
```
## Recomended setup
1. [GL-AR150](https://www.gl-inet.com/products/gl-ar150/) or [GL-AR750S](https://www.gl-inet.com/products/gl-ar750s)
2. USB 2.0 [2 ports hub](https://www.ebay.com/itm/144520475350)
3. Generic [RT5370 WIFI adapter](https://www.ebay.com/itm/284904442887) or [MT7612U WIFI adapter](https://www.ebay.com/itm/175219205235) **you're really going to need this on hardware that doesn't have two wifi adapters**
4. Please support Hak5 work and buy the new hardware!
## Patreon and Tips!
Those who want to help buy testing hardware or just give me a tip, you can do it by sending donations to my Binance account.
I also made a [Patreon](https://www.patreon.com/xchwarze) account where I share private builds and tests. Here you can find updates for the **Pineapple Nano** and builds to **improve stability** on 5g.
[![patreon](assets/patreon.png)](https://www.patreon.com/xchwarze)
![binance-qr](assets/binance-qr.png)

BIN
assets/binance-qr.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
assets/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

BIN
assets/patreon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 KiB

BIN
assets/termidor-mipsel.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 KiB

171
build.md Normal file
View File

@ -0,0 +1,171 @@
## Automatic Build steps
All these steps are automated in `dependencies-install.sh` and `builder.sh`
```bash
chmod +x tools/*.sh
tools/dependencies-install.sh openwrt-deps-mips
sudo tools/dependencies-install.sh ubuntu-deps
tools/builder.sh mips universal imagebuilder-19.07.7-ar71xx-generic gl-ar750s
```
<br>
## Manual Build steps
1. Unpack firmware for get file system
```bash
# install last version of binwalk first!
# https://github.com/ReFirmLabs/binwalk
# tetra
#wget https://www.wifipineapple.com/downloads/tetra/latest -O basefw.bin
#binwalk basefw.bin -e
#binwalk _basefw.bin.extracted/sysupgrade-pineapple-tetra/root -e --preserve-symlinks
#mv _basefw.bin.extracted/sysupgrade-pineapple-tetra/_root.extracted/squashfs-root/ rootfs-base
# nano
wget https://www.wifipineapple.com/downloads/nano/latest -O basefw.bin
binwalk basefw.bin -e --preserve-symlinks
mv _basefw.bin.extracted/squashfs-root/ rootfs-base
```
2. Get opkg packages list from openwrt file system
```bash
# get packages list
php tools/opkg-parser.php rootfs-base/usr/lib/opkg/status
```
3. Generate openwrt extra files
```bash
# copy pineapple files
chmod +x tools/copier.sh
tools/copier.sh lists/nano.filelist rootfs-base rootfs
# fix files
chmod +x tools/fs-patcher.sh
tools/fs-patcher.sh mips rootfs nano
```
4. Build your custom build
```bash
# for this poc use openwrt imagebuilder v19.07.2 for ar71xx
wget https://downloads.openwrt.org/releases/19.07.2/targets/ar71xx/generic/openwrt-imagebuilder-19.07.2-ar71xx-generic.Linux-x86_64.tar.xz
tar xJf openwrt-imagebuilder-19.07.2-ar71xx-generic.Linux-x86_64.tar.xz
cd openwrt-imagebuilder-19.07.2-ar71xx-generic.Linux-x86_64
# based on step 2 data!
# ar71xx profile name: gl-ar150
# ath79 profile name: glinet_gl-ar150
make image PROFILE=gl-ar150 PACKAGES="at autossh base-files block-mount ca-certificates chat dnsmasq e2fsprogs ethtool firewall hostapd-utils ip6tables iperf3 iwinfo kmod-crypto-manager kmod-fs-ext4 kmod-fs-nfs kmod-fs-vfat kmod-gpio-button-hotplug kmod-ipt-offload kmod-leds-gpio kmod-ledtrig-default-on kmod-ledtrig-netdev kmod-ledtrig-timer kmod-mt76x2u kmod-nf-nathelper kmod-rt2800-usb kmod-rtl8187 kmod-rtl8192cu kmod-scsi-generic kmod-usb-acm kmod-usb-net-asix kmod-usb-net-asix-ax88179 kmod-usb-net-qmi-wwan kmod-usb-net-rndis kmod-usb-net-sierrawireless kmod-usb-net-smsc95xx kmod-usb-ohci kmod-usb-storage-extras kmod-usb-uhci kmod-usb2 libbz2-1.0 libcurl4 libelf1 libffi libgmp10 libiconv-full2 libintl libltdl7 libnet-1.2.x libnl200 libreadline8 libustream-mbedtls20150806 libxml2 logd macchanger mt7601u-firmware mtd nano ncat netcat nginx odhcp6c odhcpd-ipv6only openssh-client openssh-server openssh-sftp-server openssl-util php7-cgi php7-fpm php7-mod-hash php7-mod-json php7-mod-mbstring php7-mod-openssl php7-mod-session php7-mod-sockets php7-mod-sqlite3 ppp ppp-mod-pppoe procps-ng-pkill procps-ng-ps python-logging python-openssl python-sqlite3 rtl-sdr ssmtp tcpdump uboot-envtools uci uclibcxx uclient-fetch urandom-seed urngd usb-modeswitch usbreset usbutils wget wireless-tools wpad busybox libatomic1 libstdcpp6 -wpad-basic -dropbear" FILES=../rootfs
cp bin/targets/ar71xx/generic/openwrt-19.07.2-ar71xx-generic-gl-ar150-squashfs-sysupgrade.bin ../gl-ar150-pineapple-nano.bin
```
5. Flash the target hardware with this custom firmware!
```bash
# Use SCP to upload the image in your device
scp gl-ar150-pineapple-nano.bin root@192.168.1.1:/tmp
# Once the image is uploaded execute sysupgrade command to update firmware
ssh root@192.168.1.1
sysupgrade -n -F /tmp/gl-ar150-pineapple-nano.bin
```
<br>
## Original Harware specifications
#### WiFi Pineapple NANO specifications:
- SoC: Atheros AR9331 (400 MHz)
- RAM: 64 MB (DDR2)
- FLASH: 16 MB
- WiFi: 1T1R AR9331 (built-in), 1T1R AR9271 (built-in via USB bus)
- Ethernet: 1x FE over USB (ASIX AX88772A)
- Ports: 2x RP-SMA for antennas, 1x USB 2.0 (host), 1x micro SD
- Power: USB 5 V, 1.5 A
- Other: status LED, reset button
#### WiFi Pineapple TETRA specifications:
- SoC: Atheros AR9344 (533 MHz MIPS 74K)
- RAM: 64 MB (DDR2)
- FLASH: 2 GB NAND Flash
- WiFi: Atheros AR9344 + Atheros AR9580
- Ethernet: 1 x RJ45 Ethernet, 1x FE over USB (ASIX AX88772A)
- Ports: 4x RP-SMA Antenna, 1 x USB 2.0 (host)
- Power: DC Barrel 12V/2A. Accepts power from any combination of sources; DC Barrel Port, USB ETH port, USB UART port.
- Other: status LED, reset button
<br>
## Important notes
1. The original hardware is designed to have 2 Wi-Fi cards and have at least 2 gigabytes of disk space!
<br>
To meet these requirements in your hard you will have to:
* Add a pendrive. The pendrive has to be formatted from the pineapple panel `Advanced > USB & Storage > Format SD Card`
* In case your hardware does not have a second Wi-Fi adapter you will have to add one of the recommended ones (RT5370 or MT7612U).
* You can connect both with a usb hub!
<br>
2. As tetra is made to be used on hardware with 32 MB of flash I had to cut some dependencies from the default installation.
<br>
These dependencies will be installed automatically when the pinapple is connected to the internet and booting.
<br>
If you want to manually run this process `wpc-tools missing_packages` or `opkg update && opkg --dest sd install python-logging python-openssl python-sqlite3 python-codecs`
<br>
Without these dependencies you will not be able to use the live scan type and some modules.
However, you will be able to use the timed scans and the rest of the tools.
<br>
3. The original pineapple binaries are compiled with mips24kc and BE endianness.
So your target hardware must support the instructionset with this endianness. Check this in the [openwrt list of hardware](https://openwrt.org/docs/techref/instructionset/mips_24kc).
<br>
4. The original pineapple binaries are compiled with SSP ([Stack-Smashing Protection](https://openwrt.org/docs/guide-user/security/security-features))
Your version has to support it, so as not to have this type of errors:
```bash
[ 7.383577] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[ 8.052737] crypto_hash: Unknown symbol __stack_chk_guard (err 0)
[ 8.057461] crypto_hash: Unknown symbol __stack_chk_fail (err 0)
```
<br>
5. WiFi Pineapple use a modified version of:
```bash
/lib/netifd/wireless/mac80211.sh
/lib/netifd/hostapd.sh
/lib/wifi/mac80211.sh
```
You may have to make yours based on these.
<br>
6. Busybox applets list:
```
# openwrt: used 118 applets
[ [[ ash awk basename brctl bunzip2 bzcat cat chgrp chmod chown chroot clear cmp cp crond crontab cut date dd df dirname dmesg du echo egrep env expr false fgrep find flock free fsync grep gunzip gzip halt head hexdump hwclock id ifconfig ip kill killall less ln lock logger login ls md5sum mkdir mkfifo mknod mkswap mktemp mount mv nc netmsg netstat nice nslookup ntpd passwd pgrep pidof ping ping6 pivot_root poweroff printf ps pwd readlink reboot reset rm rmdir route sed seq sh sha256sum sleep sort start-stop-daemon strings swapoff swapon switch_root sync sysctl tail tar tee test time top touch tr traceroute traceroute6 true udhcpc umount uname uniq uptime vi wc which xargs yes zcat
# nano: used 116 applets
[ [[ ash awk basename bash brctl cat chgrp chmod chown chroot clear cmp cp crond crontab cut date dd df dirname dmesg du echo egrep env expr false fdisk fgrep find flock free fsync grep gunzip gzip halt head hexdump hwclock id ifconfig ip kill killall less ln lock logger login ls md5sum mkdir mkfifo mknod mkswap mktemp mount mv nc netmsg netstat nice nslookup ntpd passwd pgrep pidof ping ping6 pivot_root poweroff printf ps pwd readlink reboot reset rm rmdir route sed seq sh sha256sum sleep sort start-stop-daemon swapoff swapon switch_root sync sysctl tail tar tee test time top touch tr traceroute true udhcpc umount uname uniq uptime uuencode vi wc which xargs yes
# tetra: used 120 applets
[ [[ ash awk basename brctl bunzip2 bzcat cat chgrp chmod chown chroot clear cmp cp crond crontab cut date dd df dirname dmesg du echo egrep env expr false fdisk fgrep find flock free fsync grep gunzip gzip halt head hexdump hwclock id ifconfig ip kill killall less ln lock logger login ls md5sum mkdir mkfifo mknod mkswap mktemp mount mv nc netmsg netstat nice nslookup ntpd passwd pgrep pidof ping ping6 pivot_root poweroff printf ps pwd readlink reboot reset rm rmdir route sed seq sh sha256sum sleep sort start-stop-daemon strings swapoff swapon switch_root sync sysctl tail tar tee test time top touch tr traceroute traceroute6 true udhcpc umount uname uniq uptime uuencode vi wc which xargs yes zcat
```
Diferences with Openwrt Busybox build
```
Nano build
--------------------
Remove: bunzip2 bzcat strings traceroute6 zcat
Add: bash fdisk uuencode
Tetra build
--------------------
Remove: (nothing was removed)
Add: fdisk uuencode
```
If you don't want to do a custom Busybox build you can install `fdisk` and `mpack`.
Don't forget to refactor the uses of `uuencode` with `mpack`! (reporting script)<br>

219
devices.md Normal file
View File

@ -0,0 +1,219 @@
# Devices list
The list of compatible devices is made with the data provided by OpenWRT. The criteria used to generate this list were that they are available in OpenWRT 19 and have the same capabilities as the original hardware.<br>
**OpenWRT data may be incorrect for some devices.**
<br><br>
Brand | Device | Type | CPU (MHz) | Flash (MB) | RAM (MB) | Architecture | Availability |
-------------|-------------|-----------|-----------|-----------|-----------|-----------|-----------|
8devices | Carambola 2 | Single Board Computer | 400 | 16 | 64 | mips_24kc | Available 2019
8devices | Lima | Single Board Computer | 650 | 32 | 64 | mips_24kc | Available 2019
8devices | Rambutan | Single Board Computer | 720 | 128NAND | 128 | mips_24kc | Available 2019
Abicom International | Scorpion SC300M | Single Board Computer | 700 | 16 | 256 | mips_24kc | Available 2020
Aerohive | AP121 | WiFi AP | 560 | 128NAND | 128 | mips_24kc | Discontinued 2017
Afoundry | EW1200 | WiFi Router | 880 | 16 | 128 | mipsel_24kc | Discontinued 2019
ALFA Network | AC1200RM | WiFi Router | 580 | 16 | 64 | mipsel_24kc | Discontinued
ALFA Network | Hornet-UB x2 | Travel Router | 400 | 16 | 64 | mips_24kc | Discontinued
ALFA Network | R36A | WiFi Router | 650 | 16 | 64 | mips_24kc | Available 2019
ALLNET | ALL5002 | Single Board Computer | 400 | 32 | 64 | mipsel_24kc | Available 2019
Arcadyan / Astoria | VGV7510KW22 (o2 Box 6431) | WiFi Router | 500 | 16 | 64 | mips_24kc | unknown 2018
Arcadyan / Astoria | ARV7519RW22 (Livebox 2.1) | WiFi Router | 500 | 32 | 128 | mips_24kc | unknown 2018
Arcadyan / Astoria | Easybox 904 LTE | WiFi Router | 500 | 512 | 128 | mips_24kc | unknown 2018
Arcadyan / Astoria | VGV7519KW (KPN Experia Box v8) R01 | WiFi Router | 500 | 16 | 64 | mips_24kc | unknown 2018
Arcadyan / Astoria | VGV7519KW (KPN Experia Box v8) R02 | WiFi Router | 500 | 16 | 64 | mips_24kc | unknown 2018
Arduino.cc | Yun | Single Board Computer | 400 | 16,microSDHC | 64 | mips_24kc | Discontinued 2016
AsiaRF | AP7621-002 | Router | 880 | 16 | 512 | mipsel_24kc | Available 2020
ASUS | RT-AC51U | WiFi Router | 580 | 16 | 64 | mipsel_24kc | Available 2019
ASUS | RT-AC57U v1 | WiFi Router | 880 | 16 | 128 | mipsel_24kc | Available 2019
ASUS | RT-N14U C1 | WiFi Router | 600 | 16 | 64 | mipsel_24kc | Discontinued 2016
AVM | FRITZ!Box 7360 SL | WiFi Router | 500 | 16,32 | 128 | mips_24kc | Discontinued
AVM | FRITZ!Box 7362 SL | WiFi Router | 500 | 128NAND | 128 | mips_24kc | Discontinued
AVM | FRITZ!Box WLAN 3370 | WiFi Router | 500 | 128NAND,512NAND | 128 | mips_24kc | Discontinued
AVM | FRITZ!Box 4020 | WiFi Router | 750 | 16 | 128 | mips_24kc | Available 2019
BDCOM | WAP2100-SK | WiFi Router | 580 | 16,SD | 128 | mipsel_24kc | unknown 2018
Beeline | Smartbox GIGA | WiFi Router | 880 | 128NAND | 256 | mipsel_24kc | Available 2022
Beeline | SmartBox TURBO+ | WiFi Router | 880 | 128 | 128 | mipsel_24kc | unknown 2022
Belkin | F9K1115 (AC 1750 DB) v2 | WiFi Router | 720 | 16 | 128 | mips_24kc | Discontinued 2016
Blueendless | U35WF | NAS | 580 | 16 | 64 | mipsel_24kc | Available 2018
Blueendless | U25AWF HSEN-KI-300M-HDD-V3.0 | NAS | 580 | 16 | 64 | mipsel_24kc | Available 2018
BT | Home Hub 5 Type A | WiFi Router | 500 | 128NAND | 128 | mips_24kc | unknown 2018
Buffalo | WZR-HP-G300NH v1 | WiFi Router | 400 | 32 | 64 | mips_24kc | Discontinued 2016
Buffalo | WZR-HP-G300NH2 A0A0,A0A1,A1A0,C1A0 | WiFi Router | 400 | 32 | 64 | mips_24kc | Discontinued 2016
Buffalo | WZR-HP-G302H A1A0 | WiFi Router | 400 | 32 | 64 | mips_24kc | unknown 2018
Buffalo | WZR-HP-G450H v1 | WiFi Router | 400 | 32 | 64 | mips_24kc | Discontinued 2016
Buffalo | WZR-300HP | WiFi Router | 400 | 32 | 64 | mips_24kc | Discontinued 2016
Buffalo | WZR-600DHP | WiFi Router | 680 | 32 | 128 | mips_24kc | Discontinued
Buffalo | WZR-HP-AG300H v1 | WiFi Router | 680 | 32 | 128 | mips_24kc | Discontinued 2016
COMFAST | CF-E5 | WiFi AP | 650 | 16 | 64 | mips_24kc | Available 2019
Compex | WPJ531 7A03 | Single Board Computer | 550 | 16 | 64 | mips_24kc | Available 2020
D-Link | DGL-5500 A1 | WiFi Router | 720 | 16 | 128 | mips_24kc | Discontinued 2017
D-Link | DHP-1565 | WiFi Router | 560 | 16 | 128 | mips_24kc | Discontinued 2018
D-Link | DIR-510L A1 | Travel Router - Battery powered | 580 | 16 | 128 | mipsel_24kc | Discontinued 2017
D-Link | DIR-825 C1 | WiFi Router | 560 | 16 | 128 | mips_24kc | Discontinued 2013
D-Link | DIR-835 A1 | WiFi Router | 560 | 16 | 128 | mips_24kc | Discontinued 2016
D-Link | DIR-860L B1 | WiFi Router | 880 | 16 | 128 | mipsel_24kc | Discontinued 2017
D-Link | DWR-118 A1 | WiFi Router | 580 | 16 | 64 | mipsel_24kc | Discontinued
D-Link | DWR-118 A2 | WiFi Router | 580 | 16 | 128 | mipsel_24kc | Discontinued
D-Link | DWR-922 E2 | WiFi Router | 580 | 16 | 64 | mipsel_24kc | Discontinued
D-Team | Newifi D2 (Newifi3) | Router | 880 | 32 | 512 | mipsel_24kc | Available 2020
Digineo | AC1200 Pro | WiFi Router | 880 | 32 | 512 | mipsel_24kc | unknown 2018
DomyWifi | DW33D | unknown | 720 | 16,128NAND | 256 | mips_24kc | unknown 2018
Dragino | MS14 | WiFi Router | 400 | 16 | 64 | mips_24kc | Available 2019
Dragino | LPS8 | other | 400 | 16 | 64 | mips_24kc | Available 2021
ELECOM | WRH-300CR | Travel Router | 580 | 16 | 64 | mipsel_24kc | Available 2019
Embedded Wireless | Balin | Single Board Computer | 560 | 16 | 64 | mips_24kc | unknown 2018
Embedded Wireless | Dorin Platform Rev 1.2 | WiFi Router | 400 | 16 | 64 | mips_24kc | unknown 2018
EnGenius | EPG5000 v1.0.0 | WiFi Router | 720 | 16 | 256 | mips_24kc | Discontinued 2017
EnGenius | ESR900 v1.00 | WiFi Router | 720 | 16 | 128 | mips_24kc | Discontinued
EnGenius | ESR1750 v1.1.0 | WiFi Router | 720 | 16 | 256 | mips_24kc | Discontinued 2015
Firefly | FireWRT | WiFi Router | 880 | 16 | 512 | mipsel_24kc | Discontinued
Gainstrong | MiniBox v1.0 | Travel Router | 400 | 16 | 64 | mips_24kc | unknown 2018
Gainstrong | MiniBox v3.2 | WiFi Router | 550 | 16 | 128 | mips_24kc | Available 2019
Gainstrong | Oolite v5.2 | other | 650 | 16 | 128 | mips_24kc | Available 2019
Gainstrong | Oolite v1.0 | Single Board Computer | 400 | 16 | 64 | mips_24kc | unknown 2018
GL.iNet | GL-MiFi | Travel Router - Battery powered | 400 | 16 | 64 | mips_24kc | Available 2020
GL.iNet | GL-M9331 Core (Domino Core) | Single Board Computer | 400 | 16 | 64 | mips_24kc | Available 2020
GL.iNet | Domino Pi | Single Board Computer | 400 | 16 | 64 | mips_24kc | Discontinued 2017
GL.iNet | GL-AR150 | Travel Router | 400 | 16 | 64 | mips_24kc | Available 2019
GL.iNet | GL-AR300 v3 | WiFi Router | 560 | 16 | 128 | mips_24kc | Discontinued 2017
GL.iNet | GL-AR300M-Lite v1 | Travel Router | 650 | 16 | 128 | mips_24kc | Available 2019
GL.iNet | GL-AR300M v1.4.0 | WiFi Router | 650 | 16,128NAND | 128 | mips_24kc | Available 2020
GL.iNet | GL-AR750 | Travel Router | 650 | 16 | 128 | mips_24kc | Available 2019
GL.iNet | GL-AR750S v1 | Travel Router | 775 | 16,128NAND,microSDXC | 128 | mips_24kc | Available 2019
GL.iNet | GL-MT300A v1.3 | Travel Router | 580 | 16 | 128 | mipsel_24kc | Discontinued
GL.iNet | GL-MT300N v1 | Travel Router | 580 | 16 | 64 | mipsel_24kc | Discontinued
GL.iNet | GL-MT300N v2 | WiFi Router | 580 | 16 | 128 | mipsel_24kc | Available 2020
GL.iNet | GL-MT750 | WiFi Router | 580 | 16 | 128 | mipsel_24kc | Discontinued 2017
GL.iNet | GL-USB150 | WiFi Router | 400 | 16 | 64 | mips_24kc | Discontinued 2022
GL.iNet | GL-X750 (Spitz) | WiFi Router | 650 | 16,microSDXC | 128 | mips_24kc | Available 2019
GL.iNet | 6416A v1.0 | Travel Router | 400 | 16 | 64 | mips_24kc | Discontinued 2017
Head Weblink | HDRM200 | WiFi Router | 580 | 16,microSD | 64 | mipsel_24kc | Available 2019
HiWiFi/Gee | HC5661A | WiFi Router | 580 | 16 | 128 | mipsel_24kc | Discontinued
HiWiFi/Gee | HC5962 | WiFi Router | 880 | 128NAND | 256 | mipsel_24kc | Discontinued
HiWiFi/Gee | HC6361 | WiFi Router | 400 | 16,4096NAND | 64 | mips_24kc | Discontinued
I-O Data | WN-AC1600DGR | WiFi Router | 720 | 16 | 128 | mips_24kc | Discontinued
I-O Data | WN-AC1600DGR2 | WiFi Router | 720 | 16 | 128 | mips_24kc | Discontinued 2014
I-O Data | WN-AC1167DGR | WiFi Router | 720 | 16 | 128 | mips_24kc | Discontinued 2014
I-O Data | WN-AC1600DGR3 | WiFi Router | 720 | 16 | 128 | mips_24kc | Available 2019
I-O Data | WN-AG300DGR | WiFi Router | 535 | 16 | 64 | mips_24kc | unknown 2018
jjPlus | JWAP230 | WiFi Router | 720 | 16 | 128 | mips_24kc | Discontinued
Kingston | MLW221 | Travel Router - Battery powered | 580 | 16 | 64 | mipsel_24kc | Available 2019
Kingston | MLWG2 | Travel Router - Battery powered | 580 | 16 | 64 | mipsel_24kc | Discontinued 2016
Lava | LR-25G001 | WiFi Router | 580 | 16 | 64 | mipsel_24kc | unknown 2018
Lenovo | Newifi D1 | WiFi Router | 880 | 32,128 | 256 | mipsel_24kc | Discontinued
Lenovo | Newifi mini Y1 | WiFi Router | 580 | 16 | 128 | mipsel_24kc | Discontinued
Lenovo | Newifi Y1S | WiFi Router | 580 | 16 | 256 | mipsel_24kc | Discontinued
Librerouter | LibreRouter v1 | WiFi Router | 720 | 16 | 128 | mips_24kc | Available 2020
MediaTek | LinkIt Smart 7688 | Single Board Computer | 580 | 32 | 128 | mipsel_24kc | Discontinued 2020
Meraki | Z1 | WiFi Router | 560 | 128NAND | 128 | mips_24kc | Discontinued 2018
Microduino | MicroWRT Core | Single Board Computer | 580 | 16 | 64 | mipsel_24kc | unknown 2018
MikroTik | RB751G-2HnD | WiFi Router | 400 | 64NAND | 64 | mips_24kc | Discontinued
MikroTik | RB411UAHR | Single Board Computer | 680 | 64NAND | 64 | mips_24kc | Discontinued
MikroTik | RB951G-2HnD | Single Board Computer | 600 | 128NAND | 128 | mips_24kc | Available 2019
MikroTik | RB951Ui-2HnD | Single Board Computer | 600 | 128NAND | 128 | mips_24kc | Available 2019
MikroTik | RB951Ui-2nD (hAP) | WiFi Router | 650 | 16 | 64 | mips_24kc | Available 2019
MikroTik | RB952Ui-5ac2nD (hAP ac lite) | WiFi AP | 650 | 16 | 64 | mips_24kc | Available 2020
MikroTik | RB962UiGS-5HacT2HnT (hAP ac) | WiFi Router | 720 | 16 | 128 | mips_24kc | Available 2019
MikroTik | RB2011 | Single Board Computer | 600 | ¿ | 128 | mips_24kc | Discontinued
MikroTik | RB2011UAS-2HnD-IN | Single Board Computer | 600 | 128NAND | 128 | mips_24kc | Available 2021
MikroTik | RB2011UiAS-2HnD-IN r2 | WiFi Router | 600 | 128NAND | 128 | mips_24kc | Available 2019
MikroTik | RBmAP-2nD (mAP) | WiFi AP | 650 | 16 | 64 | mips_24kc | Available 2019
MikroTik | RBmAPL-2nD (mAP lite) rev1,rev2 | WiFi AP | 650 | 16 | 64 | mips_24kc | Available 2019
MikroTik | RBwAPR-2nD (wAP R) | WiFi AP | 650 | 16 | 64 | mips_24kc | Available 2019
MikroTik | RB912UAG-2HPnD | Single Board Computer | 600 | 128NAND | 64 | mips_24kc | Available 2019
MikroTik | RB912UAG-5HPnd | Single Board Computer | 600 | 128NAND | 64 | mips_24kc | Available 2019
MQMaker | WiTi Board v2.0 / 512MB | WiFi Router | 880 | 16 | 512 | mipsel_24kc | Available 2018
MQMaker | WiTi Board v2.0 / 256MB | WiFi Router | 880 | 16 | 256 | mipsel_24kc | Discontinued 2019
MTC | WR1201 | WiFi Router | 880 | 16,microSD | 128 | mipsel_24kc | Available 2019
NETGEAR | WNDR3800 | WiFi Router | 680 | 16 | 128 | mips_24kc | Discontinued
NETGEAR | WNDR3800 1CHNAS | WiFi Router | 680 | 16 | 128 | mips_24kc | Discontinued
NETGEAR | WNDRMAC v1 | WiFi Router | 680 | 16 | 64 | mips_24kc | Discontinued
NETGEAR | WNDRMAC v2 | WiFi Router | 680 | 16 | 128 | mips_24kc | Discontinued
NETGEAR | R6120 | WiFi Router | 580 | 16 | 64 | mipsel_24kc | Available 2019
NETGEAR | R6220 | WiFi Router | 880 | 128NAND | 128 | mipsel_24kc | Available 2020
NETGEAR | R6100 v1 | WiFi AP | 560 | 128 | 128 | mips_24kc | Available 2021
NETGEAR | R6350 | WiFi Router | 880 | 128NAND | 128 | mipsel_24kc | Available 2019
NETGEAR | WNDR3700 v2 | WiFi Router | 680 | 16 | 64 | mips_24kc | Discontinued
NETGEAR | WNDR3700 v4 | WiFi Router | 560 | 128NAND | 128 | mips_24kc | Discontinued
NETGEAR | WNDR3700 v5 | WiFi Router | 880 | 16 | 128 | mipsel_24kc | Available 2019
NETGEAR | WNDR4300 v1 | WiFi Router | 560 | 128NAND | 128 | mips_24kc | Discontinued
NETGEAR | R6230 | WiFi Router | 880 | 128 | 128 | mipsel_24kc | Available 2019
netis | WF2881 | WiFi Router | 880 | 128NAND | 128 | mipsel_24kc | Discontinued 2016
netis | M1200AC | WiFi Router | 880 | 128NAND | 128 | mipsel_24kc | Discontinued 2017
Nexx | WT3020A | Travel Router | 580 | 4 | 64 | mipsel_24kc | unknown 2018
OMYlink | OMY-G1 | WiFi Router | 535 | 16 | 64 | mips_24kc | Discontinued
Onion | Omega | Single Board Computer | 400 | 16 | 64 | mips_24kc | Discontinued
Onion | Omega2+ | Single Board Computer | 580 | 32,microSD | 128 | mipsel_24kc | Available 2019
Onion | Omega2 | Single Board Computer | 580 | 16 | 64 | mipsel_24kc | Available 2019
Open-Mesh | A60 | WiFi AP | 720 | 16 | 128 | mips_24kc | Discontinued 2019
Oyewifi | OYE-0001 | WiFi Router | 580 | 16,SD | 128 | mipsel_24kc | Discontinued
PHICOMM | K2T | WiFi Router | 750 | 16 | 64 | mips_24kc | unknown 2018
PISEN | WMM003N (Cloud Easy Power) | Travel Router - Battery powered | 400 | 8,microSD | 64 | mips_24kc | Available 2021
Qihoo hardware | C301 | WiFi Router | 560 | 32 | 128 | mips_24kc | Discontinued
Qxwlan | E600GAC v2 | WiFi AP | 650 | 16 | 128 | mips_24kc | unknown 2018
Qxwlan | E750G v8 16M | WiFi AP | 560 | 16 | 128 | mips_24kc | unknown 2018
Qxwlan | E1700AC v2 | WiFi AP | 750 | 8,16 | 128 | mips_24kc | unknown 2018
SamKnows | SK-WB8 | WiFi Router | 880 | 16 | 128 | mipsel_24kc | Available 2018
Sanlinking | D240 | WiFi Router | 580 | 16 | 128 | mipsel_24kc | Discontinued
Sitecom | WLR-8100 v1 001 | WiFi Router | 720 | 16 | 128 | mips_24kc | Discontinued
Skylab | SKW92A EVB E16 | Single Board Computer | 580 | 16 | 64 | mipsel_24kc | unknown 2018
Strong | 1200 | WiFi Router | 880 | 16 | 128 | mipsel_24kc | Available 2019
Tama | W06 | WiFi Router | 575 | 16 | 64 | mipsel_24kc | unknown 2018
TP-Link | Archer A7 v5 | WiFi Router | 750 | 16 | 128 | mips_24kc | Available 2019
TP-Link | Archer C5 AC1200 v1 | WiFi Router | 720 | 16 | 128 | mips_24kc | Discontinued
TP-Link | Archer C7 v2,v2.1 | WiFi Router | 720 | 16 | 128 | mips_24kc | Discontinued
TP-Link | Archer C7 v3 | WiFi Router | 720 | 16 | 128 | mips_24kc | Discontinued
TP-Link | Archer C7 v4 | WiFi Router | 775 | 16 | 128 | mips_24kc | Discontinued 2017
TP-Link | Archer C7 v5 | WiFi Router | 750 | 16 | 128 | mips_24kc | Available 2019
TP-Link | Archer C59 v1 | WiFi Router | 775 | 16 | 128 | mips_24kc | Discontinued 2017
TP-Link | Archer C59 v2 | WiFi Router | 775 | 16 | 128 | mips_24kc | Discontinued
TP-Link | TL-WR842N v3 | WiFi Router | 650 | 16 | 64 | mips_24kc | Discontinued
TP-Link | TL-WR942N v1 | WiFi Router | 775 | 16 | 128 | mips_24kc | Discontinued
TP-Link | TL-WR1043ND v4 | WiFi Router | 750 | 16 | 64 | mips_24kc | Discontinued
TP-Link | VR200 | WiFi Router | 500 | 16 | 128 | mips_24kc | Available 2019
TP-Link | VR200v | WiFi Router | 500 | 16 | 128 | mips_24kc | Available 2019
TRENDnet | TEW-823DRU v1.0R | WiFi Router | 720 | 16 | 256 | mips_24kc | Discontinued 2016
Ubiquiti | airCube ISP | WiFi AP | 650 | 16 | 64 | mips_24kc | Available 2019
Ubiquiti | UniFi AP AC PRO | WiFi Router | 775 | 16 | 128 | mips_24kc | Available 2018
UniElec | U7628-01 | WiFi Router | 580 | 16,microSD | 128 | mipsel_24kc | Available 2019
VoCore | VoCore2 | Single Board Computer | 580 | 16 | 128 | mipsel_24kc | Available 2018
Western Digital | My Net N750 | WiFi Router | 560 | 16 | 128 | mips_24kc | Discontinued 2013
Western Digital | My Net N600 | WiFi Router | 560 | 16 | 128 | mips_24kc | Discontinued
WeVO | W2914NS v2 | WiFi Router | 880 | 16 | 128 | mipsel_24kc | Discontinued
WeVO | 11AC NAS | WiFi Router | 880 | 16 | 256 | mipsel_24kc | unknown 2019
Widora | Widora-NEO 16M | Single Board Computer | 580 | 16 | 128 | mipsel_24kc | Discontinued
Widora | Widora-NEO 32M | Single Board Computer | 580 | 32 | 128 | mipsel_24kc | Discontinued
WIZnet | WizFi630S | Single Board Computer | 580 | 32 | 128 | mipsel_24kc | Available 2019
WRTnode | WRTnode 1 | WiFi Router | 580 | 16 | 64 | mipsel_24kc | Available 2018
WRTnode | WRTnode 2P | Single Board Computer | 580 | 32 | 256 | mipsel_24kc | unknown 2018
WRTnode | WRTnode 2R | Single Board Computer | 580 | 32 | 256 | mipsel_24kc | Available 2020
Xiaomi | Mi Router 3 Pro | WiFi Router | 880 | 256NAND | 512 | mipsel_24kc | Available 2019
Xiaomi | Mi WiFi Mini v1 | WiFi Router | 580 | 16 | 128 | mipsel_24kc | Discontinued
Xiaomi | MiWiFi 3G v1 | WiFi Router | 880 | 128NAND | 256 | mipsel_24kc | Discontinued
Xiaomi | MiWiFi Nano | WiFi Router | 575 | 16 | 64 | mipsel_24kc | Discontinued
YouHua | WR1200JS | WiFi Router | 880 | 16 | 128 | mipsel_24kc | Discontinued
YOUKU | YK1, YK-L1 | WiFi Router | 580 | 32 | 128 | mipsel_24kc | Discontinued 2017
YOUKU | YK-L2 | WiFi Router | 880 | 16 | 256 | mipsel_24kc | unknown 2019
YunCore | SR3200 | WiFi Router | 775 | 16 | 128 | mips_24kc | unknown 2018
YunCore | T830 | WiFi Router | 650 | 16 | 128 | mips_24kc | unknown 2018
ZBT | WE826-E | WiFi Router | 580 | 32 | 128 | mipsel_24kc | unknown 2019
ZBT | WE826 B0 16M | WiFi Router | 580 | 16,SD | 128 | mipsel_24kc | Available 2019
ZBT | WE826 B0 32M | WiFi Router | 580 | 32 | 128 | mipsel_24kc | Available 2021
ZBT | WE826 T 16M | WiFi Router | 580 | 16,SD | 128 | mipsel_24kc | Available 2019
ZBT | WE826 T 32M | WiFi Router | 580 | 32 | 128 | mipsel_24kc | Available 2021
ZBT | WE1026-5G | WiFi Router | 580 | 16,microSD | 64 | mipsel_24kc | Available 2019
ZBT | WE1326 | WiFi Router | 880 | 16 | 512 | mipsel_24kc | Available 2019
ZBT | WE1526 | WiFi Router | 650 | 16 | 128 | mips_24kc | Available 2019
ZBT | WE3526 | WiFi AP | 880 | 16 | 512 | mipsel_24kc | Available 2019
ZBT | WG2626 v03 | WiFi Router | 880 | 16 | 512 | mipsel_24kc | Available 2019
ZBT | WG3526 16M | WiFi Router | 880 | 16 | 512 | mipsel_24kc | Available 2020
ZBT | WG3526 32M | WiFi Router | 880 | 32 | 512 | mipsel_24kc | Available 2019
ZBT | ZBT-WD323 | WiFi Router | 560 | 16 | 128 | mips_24kc | Available 2019
ZTE | Q7 | Travel Router - Battery powered | 580 | 8,SD | 64 | mipsel_24kc | Discontinued 2020
ZyXEL | Keenetic Extra II | WiFi Router | 580 | 32 | 128 | mipsel_24kc | unknown 2018
ZyXEL | Keenetic 4G III rev. B | WiFi Router | 575 | 16 | 64 | mipsel_24kc | Discontinued
ZyXEL | EMG2926-Q10A 1.00,A02,A03 | WiFi Router | 720 | 16,128NAND | 256 | mips_24kc | Available 2019
ZyXEL | Keenetic Viva rev. B | WiFi Router | 580 | 16 | 128 | mipsel_24kc | Discontinued 2020
ZyXEL | NBG6616 A00 | WiFi Router | 720 | 16 | 128 | mips_24kc | Discontinued 2020
ZyXEL | NBG6716 A01 | WiFi Router | 720 | 16,256 | 256 | mips_24kc | Discontinued 2016
ZyXEL | P-2812HNU-F1 | WiFi Router | 500 | 128NAND | 128 | mips_24kc | Discontinued

View File

@ -0,0 +1,64 @@
#!/bin/bash
# this script fix the nano mechanism of usb\30-sd -> block\20-sd - by DSR!
device=`basename $DEVPATH`
devNum=$(echo $device | awk -F "" '{print $4}')
[[ $ACTION == "add" ]] && {
mkdir -p /dev/sdcard
mkdir -p /sd
[[ $devNum == "" ]] && {
rm -rf /dev/sdcard/sd
ln -s /dev/$device /dev/sdcard/sd
} || {
rm -rf /dev/sdcard/sd$devNum
ln -s /dev/$device /dev/sdcard/sd$devNum
[[ $devNum == "1" ]] && {
logger "== Add pendrive as SD"
umount /sd
mount /dev/sdcard/sd$devNum /sd && {
[[ -e "/sd/etc" ]] || {
sleep 5
ln -s /etc/ /sd/etc
}
}
if [[ -e "/sd/modules/" ]]; then
logger "== Link modules in /sd/modules/"
for module in `ls /sd/modules/`; do
if [[ ! -d "/pineapple/modules/$module" ]]; then
ln -s /sd/modules/$module /pineapple/modules/$module
fi
done
fi
# autoinstall python in universal flavor
if [[ ! -d "/usr/lib/python2.7" && ! -d "/sd/usr/lib/python2.7" ]]; then
/usr/bin/wpc-tools missing_packages
fi
}
[[ $devNum == "2" ]] && {
logger "== Add swap"
swapoff /dev/sdcard/sd$devNum
swapon /dev/sdcard/sd$devNum
}
}
}
[[ $ACTION == "remove" ]] && {
[[ $devNum == "" ]] && {
umount /sd
rm -rf /dev/sdcard/sd
}
[[ $devNum == "1" ]] && {
rm -rf /dev/sdcard/sd$devNum
}
[[ $devNum == "2" ]] && {
swapoff /dev/sdcard/sd$devNum
}
}

View File

@ -0,0 +1,12 @@
#!/bin/bash
[[ $ACTION == "remove" ]] && exit
[[ $DEVTYPE == "usb_interface" ]] || exit
wifi config >> /etc/config/wireless
WIFIDEV=$(uci show wireless | grep "${DEVPATH:9}" | awk -F'.' '{print $2}')
[[ ! -z $WIFIDEV ]] && {
wifi reload $WIFIDEV
wifi up $WIFIDEV
}

View File

@ -0,0 +1,94 @@
# -- Setup firewall configuration
uci set firewall.@defaults[0].syn_flood=1
uci set firewall.@defaults[0].input=ACCEPT
uci set firewall.@defaults[0].output=ACCEPT
uci set firewall.@defaults[0].forward=ACCEPT
uci add firewall zone
uci set firewall.@zone[-1]=zone
uci set firewall.@zone[-1].name=usb
uci add_list firewall.@zone[-1].network='usb'
uci set firewall.@zone[-1].input=ACCEPT
uci set firewall.@zone[-1].output=ACCEPT
uci set firewall.@zone[-1].forward=ACCEPT
uci set firewall.@zone[-1].masq=1
uci set firewall.@zone[-1].mtu_fix=1
uci add firewall forwarding
uci set firewall.@forwarding[-1].src=lan
uci set firewall.@forwarding[-1].dest=usb
uci add firewall forwarding
uci set firewall.@forwarding[-1].src=usb
uci set firewall.@forwarding[-1].dest=lan
uci add firewall zone
uci set firewall.@zone[-1]=zone
uci set firewall.@zone[-1].name=wwan
uci add_list firewall.@zone[-1].network=wwan
uci add_list firewall.@zone[-1].network=wwan6
uci set firewall.@zone[-1].input=ACCEPT
uci set firewall.@zone[-1].output=ACCEPT
uci set firewall.@zone[-1].forward=ACCEPT
uci set firewall.@zone[-1].masq=1
uci set firewall.@zone[-1].mtu_fix=1
uci add firewall forwarding
uci set firewall.@forwarding[-1].src=lan
uci set firewall.@forwarding[-1].dest=wwan
uci add firewall forwarding
uci set firewall.@forwarding[-1].src=wwan
uci set firewall.@forwarding[-1].dest=lan
uci add firewall zone
uci set firewall.@zone[-1].name=wan
uci add_list firewall.@zone[-1].network='wan'
uci add_list firewall.@zone[-1].network='wan6'
uci set firewall.@zone[-1].input=ACCEPT
uci set firewall.@zone[-1].output=ACCEPT
uci set firewall.@zone[-1].forward=ACCEPT
uci set firewall.@zone[-1].masq=1
uci set firewall.@zone[-1].mtu_fix=1
uci add firewall forwarding
uci set firewall.@forwarding[-1].src=lan
uci set firewall.@forwarding[-1].dest=wan
uci add firewall forwarding
uci set firewall.@forwarding[-1].src=wan
uci set firewall.@forwarding[-1].dest=lan
uci add firewall allowssh
uci set firewall.allowssh=rule
uci set firewall.allowssh.name='Allow-SSH'
uci set firewall.allowssh.src='wan'
uci set firewall.allowssh.proto='tcp'
uci set firewall.allowssh.dest_port='22'
uci set firewall.allowssh.target='ACCEPT'
uci set firewall.allowssh.family='ipv4'
uci set firewall.allowssh.enabled='0'
uci add firewall allowui
uci set firewall.allowui=rule
uci set firewall.allowui.name='Allow-WEB'
uci set firewall.allowui.src='wan'
uci set firewall.allowui.proto='tcp'
uci set firewall.allowui.dest_port='1471'
uci set firewall.allowui.target='ACCEPT'
uci set firewall.allowui.family='ipv4'
uci set firewall.allowui.enabled='0'
uci add firewall allowws
uci set firewall.allowws=rule
uci set firewall.allowws.name='Allow-WEB-WS'
uci set firewall.allowws.src='wan'
uci set firewall.allowws.proto='tcp'
uci set firewall.allowws.dest_port='1337'
uci set firewall.allowws.target='ACCEPT'
uci set firewall.allowws.family='ipv4'
uci set firewall.allowws.enabled='1'
uci commit firewall
exit 0

View File

@ -0,0 +1,8 @@
# -- Setup system configuration
# Change the hostname
uci set system.@system[0].hostname=Pineapple
uci commit system
echo $(uci get system.@system[0].hostname) > /proc/sys/kernel/hostname
exit 0

View File

@ -0,0 +1,24 @@
# -- Set up Networking configuration
uci set network.lan.type='bridge'
uci set network.lan.proto='static'
uci set network.lan.ipaddr='172.16.42.1'
uci set network.lan.netmask='255.255.255.0'
uci set network.lan.gateway='172.16.42.42'
uci set network.lan.dns='8.8.8.8, 8.8.4.4'
uci set network.usb=interface
uci set network.usb.ifname='usb0'
uci set network.usb.proto='dhcp'
uci set network.usb.dns='8.8.8.8, 8.8.4.4'
uci set network.wwan=interface
uci set network.wwan.proto='dhcp'
uci set network.wwan.dns='8.8.8.8, 8.8.4.4'
uci set network.wan.proto='dhcp'
uci set network.wan.dns='8.8.8.8, 8.8.4.4'
uci set network.wan6.proto='dhcpv6'
uci commit network
exit 0

View File

@ -0,0 +1,51 @@
# Make SSH banner have the correct version and device
version=$(cat /pineapple/pineapple_version | head -c 5)
eval "sed -i s/VERSION/$version/g /etc/banner"
# Configure PATH with SD card directories
echo "export PATH=/usr/bin/pineapple:/bin:/sbin:/usr/bin:/usr/sbin:/sd/bin:/sd/sbin:/sd/usr/sbin:/sd/usr/bin" >> /etc/profile
echo "export LD_LIBRARY_PATH=/lib:/usr/lib:/sd/lib:/sd/usr/lib" >> /etc/profile
# Touch known hosts
mkdir -p /root/.ssh/
touch /root/.ssh/known_hosts
# "Temporarily" soft-link libpcap.so.1 to libpcap.so.1.3
ln -s /usr/lib/libpcap.so.1 /usr/lib/libpcap.so.1.3
# Disable AutoSSH
/etc/init.d/autossh stop
/etc/init.d/autossh disable
# Correct opkg sources
sed -i "s/src\/gz openwrt_freifunk/#src\/gz openwrt_freifunk/" /etc/opkg/distfeeds.conf
sed -i "s/src\/gz openwrt_luci/#src\/gz openwrt_luci/" /etc/opkg/distfeeds.conf
sed -i "s/src\/gz openwrt_telephony/#src\/gz openwrt_telephon/" /etc/opkg/distfeeds.conf
# Get valid led value
PINE_LED=""
LED_TYPES="wps status system wan"
LED_LIST=$(ls "/sys/class/leds/")
for LED_TYPE in $LED_TYPES; do
for LED_NAME in $LED_LIST; do
if expr match "$LED_NAME" "\(.*:$LED_TYPE\)"; then
PINE_LED="$LED_NAME"
break
fi
done
if [[ $PINE_LED != "" ]]; then
break
fi
done
if [[ $PINE_LED == "" && $LED_LIST != "" ]]; then
PINE_LED=$(ls "/sys/class/leds/" | tail -1)
fi
if [[ $PINE_LED != "" ]]; then
sed -i "s/wifi-pineapple-nano:blue:system/$PINE_LED/" /sbin/led
echo 255 > "/sys/class/leds/$PINE_LED/brightness"
fi
exit 0

23
files/common/etc/banner Normal file
View File

@ -0,0 +1,23 @@
.NN,
.cxxdl' xMMO 'cdxxl'
.c0WMNk;,NMMW:,xXMMKo.
...:KMMMWMMMMWMMMXc... .
, .l0NMMMNXMMMMMMMMMMMMXNMMMWKl' xWd
,0Wd .':xNMMMMMMMMMMMMMMMMNkc'. ;KM0'
lWMo .;dNMMMMMMMMMMMMMMWx:. .l. dMWc
:WWo oNd .;xKWMMMMMMMMMMMMMMMMMMMMWXx:. dWX: dMW;
,NWo oMW: .. ..,lOXWMMMMMMMMMMWN0o;.. .. cWMl dMN'
.XMx oWN; lc .loooolcooclooool. cXl oMWc kMK.
oMW' ,WMl cMW: lWMW0d:;cdd:;:o0WMWl lMW: OMW' ,WMl
0M0 xMX. .XMd .lo:.,dXMMMMMMXd,.:ol. kMK. 'NMd KMO
NMd KMk lMN. .;:xOxollccddcclloxOx:;. 'WM: OM0 xMX
WMo .XMx dMK oNMMMMWOc;;ol;;cOWMMMMNo .XMl kMK dMN
NMx 0MO :Kd. .lllcl;.:0WMMMMW0:.;lclll. .xK; 0MO kMX
__ ___ ______ _ _____ _.:W0;,oxl:::oOOo:::lxo,;0W: _ .ONo KMk
\ \ / (_| ____(_) | __ (_);cKMMMMWk:.;,.;kWMMMMKc;. | | .OX:
\ \ /\ / / _| |__ _ | |__) _ _ __ ___ __ _ _ __ _ __ | | ___ DEVICE
\ \/ \/ / | | __| | | | ___| | '_ \ / _ \/ _` | '_ \| '_ \| |/ _ \ VERSION
\ /\ / | | | | | | | | | | | | __| (_| | |_) | |_) | | __/ by DSR!
\/ \/ |_|_| |_| |_| |_|_| |_|\___|\__,_| .__/| .__/|_|\___|
web: github.com/xchwarze/wifi-pineapple-cloner | | | |
------------------------------ |_| |_|

5
files/common/etc/shadow Normal file
View File

@ -0,0 +1,5 @@
root:$1$3DBtk82B$6EPlkFc9GQrtDwmzKsUn31:18739:0:99999:7:::
daemon:*:0:0:99999:7:::
ftp:*:0:0:99999:7:::
network:*:0:0:99999:7:::
nobody:*:0:0:99999:7:::

View File

@ -0,0 +1,14 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2022 DSR!
START=99
start() {
wpc-tools correct_sd_mount
wpc-tools missing_packages
wpc-tools handle_lost_phys
}
boot() {
start
}

84
files/common/etc/wps Normal file
View File

@ -0,0 +1,84 @@
#!/bin/sh
wps_catch_credentials() {
local iface ifaces ifc ifname ssid encryption key radio radios
local found=0
. /usr/share/libubox/jshn.sh
ubus -S -t 30 listen wps_credentials | while read creds; do
json_init
json_load "$creds"
json_select wps_credentials || continue
json_get_vars ifname ssid key encryption
local ifcname="$ifname"
json_init
json_load "$(ubus -S call network.wireless status)"
json_get_keys radios
for radio in $radios; do
json_select $radio
json_select interfaces
json_get_keys ifaces
for ifc in $ifaces; do
json_select $ifc
json_get_vars ifname
[ "$ifname" = "$ifcname" ] && {
ubus -S call uci set "{\"config\":\"wireless\", \"type\":\"wifi-iface\", \
\"match\": { \"device\": \"$radio\", \"encryption\": \"wps\" }, \
\"values\": { \"encryption\": \"$encryption\", \
\"ssid\": \"$ssid\", \
\"key\": \"$key\" } }"
ubus -S call uci commit '{"config": "wireless"}'
ubus -S call uci apply
}
json_select ..
done
json_select ..
json_select ..
done
done
}
# from mk6 reset script
#########################
if [ -f "/etc/pineapple/setupRequired" ]; then
if [ -f /etc/pineapple/init ]; then
exit
fi
if [ ! -f /tmp/button_setup ]; then
if [ "$SEEN" -lt 2 ]; then
logger "First Setup: Disable WiFi"
wifi down
ifconfig wlan0 down && ifconfig wlan0-1 down
/sbin/led blue on
else
logger "First Setup: Keep WiFi On"
fi
touch /tmp/button_setup
fi
exit
fi
#########################
if [ "$ACTION" = "pressed" -a "$BUTTON" = "wps" ]; then
wps_done=0
ubusobjs="$( ubus -S list hostapd.* )"
for ubusobj in $ubusobjs; do
ubus -S call $ubusobj wps_start && wps_done=1
done
[ $wps_done = 0 ] || return 0
wps_done=0
ubusobjs="$( ubus -S list wpa_supplicant.* )"
for ubusobj in $ubusobjs; do
ifname="$(echo $ubusobj | cut -d'.' -f2 )"
multi_ap=""
if [ -e "/var/run/wpa_supplicant-${ifname}.conf.is_multiap" ]; then
ubus -S call $ubusobj wps_start '{ "multi_ap": true }' && wps_done=1
else
ubus -S call $ubusobj wps_start && wps_done=1
fi
done
[ $wps_done = 0 ] || wps_catch_credentials &
fi
return 0

View File

@ -0,0 +1,5 @@
/etc/pineape
/etc/pineapple
/pineapple/css
/pineapple/img/logo.png
/pineapple/img/throbber.gif

View File

@ -0,0 +1,20 @@
<?php
class DeviceConfig
{
// third party modules can change the options based on this
// the allowed values are: "nano" or "tetra"
const DEVICE_TYPE = 'nano';
const USE_INTERNAL_STORAGE = false;
const USE_USB_STORAGE = true;
const SHOW_FIREWALL_CONFIG = false;
// third party modules do not have this flag implemented
const SHOW_SCAN_TYPE = false;
// hide wlan0 in getClientInterfaces() enumeration
const HIDE_WLAN0_CLIENT = true;
}

View File

@ -0,0 +1,20 @@
<?php
class DeviceConfig
{
// third party modules can change the options based on this
// the allowed values are: "nano" or "tetra"
const DEVICE_TYPE = 'tetra';
const USE_INTERNAL_STORAGE = true;
const USE_USB_STORAGE = true;
const SHOW_FIREWALL_CONFIG = true;
// third party modules do not have this flag implemented
const SHOW_SCAN_TYPE = true;
// hide wlan0 in getClientInterfaces() enumeration
const HIDE_WLAN0_CLIENT = true;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 508 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

54
files/common/sbin/led Normal file
View File

@ -0,0 +1,54 @@
#!/bin/sh
# Usage: led <color|reset> [on|off]
usage() {
echo "Usage: led <color|reset> [on|off]"
echo " "
echo "Available colors are: BLUE"
exit 1
}
resetLEDs() {
/etc/init.d/led restart
}
setLED() {
led=$1
state=$2
case "$led" in
blue|BLUE|all|ALL)
echo "$state" > /sys/class/leds/wifi-pineapple-nano:blue:system/brightness
;;
*)
usage
;;
esac
}
color=$(echo "$1" | tr '[:upper:]' '[:lower:]')
mode=$(echo "$2" | tr '[:upper:]' '[:lower:]')
case "$color" in
reset)
resetLEDs
;;
blue|all)
case "$mode" in
on)
setLED $color 255
;;
off)
setLED $color 0
;;
*)
usage
;;
esac
;;
*)
usage
;;
esac
echo "Done."

1533
files/common/usr/airmon-ng Normal file

File diff suppressed because it is too large Load Diff

190
files/common/usr/wpc-tools Normal file
View File

@ -0,0 +1,190 @@
#!/bin/sh
# Copyright (C) 2023 DSR!
COMMANDS="format_sd correct_sd_mount missing_packages theme_install set_panel_port set_router_ip set_pineap_interface handle_lost_phys"
HELP="
Available commands:
format_sd Format SD/pendrive for use with Pineapple
correct_sd_mount Fix ghost SD/pendrive issues
missing_packages Install the missing OpenWRT packages
theme_install Deploys the tool to change panel theme
set_panel_port Change the port used by panel
set_router_ip Change the IP used by the hardware
set_pineap_interface Change the interface used by PineAP
handle_lost_phys Fix unrecognized wifi interfaces
"
PACKAGES="python-logging python-openssl python-sqlite3 python-codecs"
to_logger() {
logger -s -t wpc "$1"
}
format_sd() {
to_logger "[+] Formatting SD using the panel script..."
/pineapple/modules/Advanced/formatSD/format_sd
to_logger "Process finished. Read the log to see if it was completed correctly."
to_logger "The partition may take a few seconds to become available."
}
correct_sd_mount() {
SD_STATUS=$(/bin/mount | /bin/grep "on /sd" -c)
SD_COUNT=$(ls /sd | wc -l)
if [[ -d /sd && $SD_STATUS == "0" && $SD_COUNT == "0" ]]; then
to_logger "[+] Fix sd status"
rm -rf /sd
fi
}
missing_packages() {
if [[ ! -d "/usr/lib/python2.7" && ! -d "/sd/usr/lib/python2.7" ]]; then
FREE_SPACE=$(df / | tail -1 | awk '{print $4}')
if [[ ! -d /sd && $FREE_SPACE -lt 10240 ]]; then
to_logger "[!] There is not enough space to install the packages"
elif ping -q -c 1 -W 1 1.1.1.1 >/dev/null; then
to_logger "[+] Installing missing packages..."
INSTALL_ROUTE="--dest sd"
if [[ $FREE_SPACE -gt 10240 ]]; then
INSTALL_ROUTE=""
to_logger "[*] Found available space in the system partition"
fi
opkg update && opkg $INSTALL_ROUTE install $PACKAGES && python -m compileall
if [[ ! -d "/usr/lib/python2.7" && ! -d "/sd/usr/lib/python2.7" ]]; then
to_logger "[!] Packages were not installed!"
else
to_logger "[*] Install Complete!"
fi
else
to_logger "[!] Connect to the internet and run \"wpc-tools missing_packages\" command!"
fi
fi
}
theme_install() {
to_logger "[+] Downloading theme manager..."
wget -q "https://raw.githubusercontent.com/xchwarze/wifi-pineapple-community/main/themes/install.sh" -O /tmp/theme-install.sh
chmod +x /tmp/theme-install.sh
to_logger "[*] By running /tmp/theme-install.sh you will be able to see the available themes and choose the one you want"
/tmp/theme-install.sh "$1"
}
set_panel_port() {
new_port="$1"
config_file="/etc/nginx/nginx.conf"
if [ -z "$new_port" ] || ! echo "$new_port" | grep -qE '^[1-9][0-9]{0,4}$' || [ "$new_port" -gt 65535 ]; then
to_logger "[!] Error: You must provide a valid TCP port (1-65535) as a parameter"
exit 1
fi
old_port=$(awk '/listen/ {++counter; if(counter==2) print NR}' "$config_file")
sed -i "${old_port}s/[0-9]\+/$new_port/" "$config_file"
/etc/init.d/nginx restart
uci set firewall.allowui.dest_port="$new_port"
uci commit firewall
/etc/init.d/firewall restart
to_logger "[+] The port has been changed to: $new_port"
}
set_router_ip() {
new_ip="$1"
if [ -z "$new_ip" ] || ! echo "$new_ip" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$'; then
to_logger "[!] Error: You must provide a valid IP address as a parameter"
exit 1
fi
gateway_ip="${new_ip%.*}.42"
uci set network.lan.ipaddr="$gateway_ip"
uci set network.lan.gateway="$new_ip"
uci commit network
to_logger "[+] The LAN IP address has been updated to: $new_ip"
/etc/init.d/network restart
}
set_pineap_interface() {
new_iface=$(echo $1 | sed 's/mon//')
iface=$(uci get pineap.@config[0].pineap_interface | sed 's/mon//')
if [[ "$new_iface" == "" ]]; then
to_logger "[!] Error: You must select a new interface to assign to"
exit 1
fi
to_logger "[+] Current interface : ${iface}"
to_logger "[+] New interface : ${new_iface}"
airmon-ng stop "${iface}mon" &>/dev/null
airmon-ng stop "${new_iface}mon" &>/dev/null
uci set pineap.@config[0].pineap_interface="${new_iface}mon"
uci commit pineap
/etc/init.d/pineapd restart
}
# based on airmon-ng code
handle_lost_phys() {
to_logger "[+] Looking for unrecognized wifi interfaces..."
if [ -d /sys/class/ieee80211 ]; then
for i in $(ls /sys/class/ieee80211/); do
if [ ! -d /sys/class/ieee80211/${i}/device/net ]; then
to_logger "[*] Found ${i} with no interface assigned!"
find_free_interface ${i}
fi
done
fi
to_logger "[*] Check completed"
}
find_free_interface() {
PHYDEV="${1}"
target_mode="station"
target_type="1"
for i in $(seq 0 100); do
if [ "$i" = "100" ]; then
to_logger "[!] Unable to find a free name between wlan0 and wlan99"
return 1
fi
if [ ! -e /sys/class/net/wlan${i} ] && [ ! -e /sys/class/net/wlan${i}mon ]; then
to_logger "[*] Candidate wlan${i} and wlan${i}mon are both clear, creating wlan${i}"
IW_ERROR="$(iw phy ${PHYDEV} interface add wlan${i} type ${target_mode} 2>&1)"
if [ -z "${IW_ERROR}" ]; then
if [ -d /sys/class/ieee80211/${PHYDEV}/device/net ]; then
for j in $(ls /sys/class/ieee80211/${PHYDEV}/device/net/); do
if [ "$(cat /sys/class/ieee80211/${PHYDEV}/device/net/${j}/type)" = "${target_type}" ]; then
k=${j#wlan}
i=${k%mon}
fi
done
else
to_logger "[!] Unable to create wlan${i} and no error received"
return 1
fi
to_logger "[!] mac80211 ${target_mode} mode vif enabled on [${PHYDEV}]wlan${i}"
unset IW_ERROR
break
else
to_logger "[!] Error: Adding ${target_mode} mode interface: ${IW_ERROR}"
break
fi
fi
done
}
# handle commands
if [[ $# -gt 0 ]]; then
if echo "${COMMANDS}" | grep -wq "$1"; then
$1 "$2"
else
to_logger "Unknown command: $1"
echo "${HELP}"
fi
else
echo "${HELP}"
fi

View File

@ -0,0 +1,2 @@
# Community Packages
src/gz community_packages https://raw.githubusercontent.com/xchwarze/wifi-pineapple-community/main/packages/mips_24kc

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,2 @@
# Community Packages
src/gz community_packages https://raw.githubusercontent.com/xchwarze/wifi-pineapple-community/main/packages/mipsel_24kc

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

118
lists/nano.filelist Normal file
View File

@ -0,0 +1,118 @@
# bin
/bin/bash
/bin/busybox
# etc
/etc/config/autossh
/etc/hotplug.d/block/20-sd
/etc/hotplug.d/iface/20-autossh
/etc/hotplug.d/iface/30-usb
/etc/hotplug.d/usb/30-fix_wifi
/etc/hotplug.d/usb/30-sd
/etc/init.d/atd
/etc/init.d/autossh
/etc/init.d/dnsmasq
/etc/init.d/php7-fpm
/etc/init.d/pineapd
/etc/init.d/pineapple
/etc/init.d/resetssids
/etc/nginx/nginx.conf
/etc/opkg/customfeeds.conf
/etc/php7-fpm.d/www.conf
/etc/pineape
/etc/pineapple
/etc/rc.button/BTN_1
/etc/rc.button/reset
/etc/ssh/sshd_config
/etc/ssl/openssl.cnf
/etc/uci-defaults/90-firewall.sh
/etc/uci-defaults/91-fstab.sh
/etc/uci-defaults/92-system.sh
/etc/uci-defaults/93-pineap.sh
/etc/uci-defaults/94-reporting.sh
/etc/uci-defaults/95-network.sh
/etc/uci-defaults/96-landingpage.sh
/etc/uci-defaults/97-pineapple.sh
/etc/banner
/etc/inittab
/etc/opkg.conf
/etc/php.ini
/etc/php7-fpm.conf
/etc/rc.local
/etc/shadow
# lib
/lib/preinit/30_failsafe_wait
/lib/preinit/40_run_failsafe_hook
/lib/upgrade/keep.d/busybox
/lib/wifi/mac80211.sh
# pineapple
/pineapple
# sbin
/sbin/fdisk
/sbin/led
# usr
/usr/bin/pineapple
/usr/bin/pineap
/usr/bin/uuencode
#/usr/lib/python2.7/encodings
/usr/lib/libwifi.so
/usr/sbin/http_sniffer
/usr/sbin/pineapd
/usr/sbin/resetssids
# www
/www
# Packages
# cc-client
# libc, libpthread, libstdcpp6, libcurl4, libopenssl1.1, libsqlite3-0, protobuf-lite
#/usr/lib/libprotobuf-lite.so
#/usr/lib/libprotobuf-lite.so.15
#/usr/lib/libprotobuf-lite.so.15.0.1
#/usr/sbin/C2DISCONNECT
#/usr/sbin/C2CONNECT
#/usr/sbin/C2EXFIL
#/etc/init.d/cc-client
#/usr/sbin/cc-client
# aircrack-ng-hak5
# libc, libpcap1, libpcre, libpthread, uclibcxx, libopenssl1.1, libnl-core200, libnl-genl200, zlib
/usr/lib/libaircrack-osdep-1.5.2.so
/usr/lib/libaircrack-ce-wpa-1.5.2.so
/usr/lib/libaircrack-osdep.so
/usr/lib/libaircrack-ce-wpa.la
/usr/lib/libaircrack-ce-wpa.so
/usr/lib/libaircrack-osdep.la
/usr/bin/aircrack-ng
/usr/sbin/airmon-ng
/usr/sbin/airodump-ng-oui-update
/usr/sbin/aireplay-ng
/usr/sbin/airodump-ng

112
lists/tetra.filelist Normal file
View File

@ -0,0 +1,112 @@
# etc
/etc/config/autossh
/etc/hotplug.d/block/20-sd
/etc/hotplug.d/iface/20-autossh
/etc/hotplug.d/iface/30-usb
/etc/hotplug.d/usb/30-fix_wifi
/etc/hotplug.d/usb/30-sd
/etc/init.d/atd
/etc/init.d/autossh
/etc/init.d/dnsmasq
/etc/init.d/php7-fpm
/etc/init.d/pineapd
/etc/init.d/pineapple
/etc/init.d/resetssids
/etc/nginx/nginx.conf
/etc/opkg/customfeeds.conf
/etc/php7-fpm.d/www.conf
/etc/pineape
/etc/pineapple
/etc/rc.button/BTN_1
/etc/rc.button/reset
/etc/ssh/sshd_config
/etc/ssl/openssl.cnf
/etc/uci-defaults/90-firewall.sh
/etc/uci-defaults/91-fstab.sh
/etc/uci-defaults/92-system.sh
/etc/uci-defaults/93-pineap.sh
/etc/uci-defaults/94-reporting.sh
/etc/uci-defaults/95-network.sh
/etc/uci-defaults/96-landingpage.sh
/etc/uci-defaults/97-pineapple.sh
/etc/banner
/etc/inittab
/etc/opkg.conf
/etc/php.ini
/etc/php7-fpm.conf
/etc/rc.local
/etc/shadow
# lib
/lib/preinit/30_failsafe_wait
/lib/preinit/40_run_failsafe_hook
/lib/upgrade/keep.d/busybox
/lib/wifi/mac80211.sh
# pineapple
/pineapple
# sbin
/sbin/led
# usr
/usr/bin/pineapple
/usr/bin/pineap
/usr/lib/libwifi.so
/usr/sbin/http_sniffer
/usr/sbin/pineapd
/usr/sbin/resetssids
# I understand that this was deprecated and deleted since version 2.1.0...
#/usr/sbin/log_daemon
# www
/www
# Packages
# cc-client
# libc, libpthread, libstdcpp6, libcurl4, libopenssl1.1, libsqlite3-0, protobuf-lite
#/usr/lib/libprotobuf-lite.so
#/usr/lib/libprotobuf-lite.so.15
#/usr/lib/libprotobuf-lite.so.15.0.1
#/usr/sbin/C2DISCONNECT
#/usr/sbin/C2CONNECT
#/usr/sbin/C2EXFIL
#/etc/init.d/cc-client
#/usr/sbin/cc-client
# aircrack-ng-hak5
# libc, libpcap1, libpcre, libpthread, uclibcxx, libopenssl1.1, libnl-core200, libnl-genl200, zlib
/usr/lib/libaircrack-osdep-1.5.2.so
/usr/lib/libaircrack-ce-wpa-1.5.2.so
/usr/lib/libaircrack-osdep.so
/usr/lib/libaircrack-ce-wpa.la
/usr/lib/libaircrack-ce-wpa.so
/usr/lib/libaircrack-osdep.la
/usr/bin/aircrack-ng
/usr/sbin/airmon-ng
/usr/sbin/airodump-ng-oui-update
/usr/sbin/aireplay-ng
/usr/sbin/airodump-ng

112
lists/universal.filelist Normal file
View File

@ -0,0 +1,112 @@
# etc
/etc/config/autossh
/etc/hotplug.d/block/20-sd
/etc/hotplug.d/iface/20-autossh
/etc/hotplug.d/iface/30-usb
/etc/hotplug.d/usb/30-fix_wifi
/etc/hotplug.d/usb/30-sd
/etc/init.d/atd
/etc/init.d/autossh
/etc/init.d/dnsmasq
/etc/init.d/php7-fpm
/etc/init.d/pineapd
/etc/init.d/pineapple
/etc/init.d/resetssids
/etc/nginx/nginx.conf
/etc/opkg/customfeeds.conf
/etc/php7-fpm.d/www.conf
/etc/pineape
/etc/pineapple
/etc/rc.button/BTN_1
/etc/rc.button/reset
/etc/ssh/sshd_config
/etc/ssl/openssl.cnf
/etc/uci-defaults/90-firewall.sh
/etc/uci-defaults/91-fstab.sh
/etc/uci-defaults/92-system.sh
/etc/uci-defaults/93-pineap.sh
/etc/uci-defaults/94-reporting.sh
/etc/uci-defaults/95-network.sh
/etc/uci-defaults/96-landingpage.sh
/etc/uci-defaults/97-pineapple.sh
/etc/banner
/etc/inittab
/etc/opkg.conf
/etc/php.ini
/etc/php7-fpm.conf
/etc/rc.local
/etc/shadow
# lib
/lib/preinit/30_failsafe_wait
/lib/preinit/40_run_failsafe_hook
/lib/upgrade/keep.d/busybox
/lib/wifi/mac80211.sh
# pineapple
/pineapple
# sbin
/sbin/led
# usr
/usr/bin/pineapple
/usr/bin/pineap
/usr/lib/libwifi.so
/usr/sbin/http_sniffer
/usr/sbin/pineapd
/usr/sbin/resetssids
# I understand that this was deprecated and deleted since version 2.1.0...
#/usr/sbin/log_daemon
# www
/www
# Packages
# cc-client
# libc, libpthread, libstdcpp6, libcurl4, libopenssl1.1, libsqlite3-0, protobuf-lite
#/usr/lib/libprotobuf-lite.so
#/usr/lib/libprotobuf-lite.so.15
#/usr/lib/libprotobuf-lite.so.15.0.1
#/usr/sbin/C2DISCONNECT
#/usr/sbin/C2CONNECT
#/usr/sbin/C2EXFIL
#/etc/init.d/cc-client
#/usr/sbin/cc-client
# aircrack-ng-hak5
# libc, libpcap1, libpcre, libpthread, uclibcxx, libopenssl1.1, libnl-core200, libnl-genl200, zlib
/usr/lib/libaircrack-osdep-1.5.2.so
/usr/lib/libaircrack-ce-wpa-1.5.2.so
/usr/lib/libaircrack-osdep.so
/usr/lib/libaircrack-ce-wpa.la
/usr/lib/libaircrack-ce-wpa.so
/usr/lib/libaircrack-osdep.la
/usr/bin/aircrack-ng
/usr/sbin/airmon-ng
/usr/sbin/airodump-ng-oui-update
/usr/sbin/aireplay-ng
/usr/sbin/airodump-ng

171
tools/builder.sh Executable file
View File

@ -0,0 +1,171 @@
#!/bin/bash
# by DSR! from https://github.com/xchwarze/wifi-pineapple-cloner
ARCHITECTURE="$1"
FLAVOR="$2"
IMAGEBUILDER_FOLDER="$3"
PROFILE="$4"
declare -a ARCHITECTURE_TYPES=("mips" "mipsel")
declare -a FLAVOR_TYPES=("nano" "tetra" "universal")
if [[ ! -d "$IMAGEBUILDER_FOLDER" || "$PROFILE" == "" ]] || ! grep -q "$ARCHITECTURE" <<< "${ARCHITECTURE_TYPES[*]}" || ! grep -q "$FLAVOR" <<< "${FLAVOR_TYPES[*]}"; then
echo "Run with \"builder.sh [ARCHITECTURE] [FLAVOR] [IMAGEBUILDER_FOLDER] [PROFILE]\""
echo " ARCHITECTURE -> must be one of these values: mips, mipsel"
echo " FLAVOR -> must be one of these values: nano, tetra, universal"
echo " IMAGEBUILDER_FOLDER -> path to openwrt imagebuilder"
echo " PROFILE -> profile for use in imagebuilder build"
exit 1
fi
# dependencies installed, uninstalled and the order in which they are installed is for a reason!
# no rtl-sdr, no kmod-usb-net-*, no kmod-rtl8192cu, no kmod-usb-acm
PACKAGES_NANO="iw at autossh base-files block-mount ca-certificates chat dnsmasq e2fsprogs ethtool firewall hostapd-utils ip6tables iperf3 iwinfo kmod-crypto-manager kmod-fs-ext4 kmod-fs-nfs kmod-fs-vfat kmod-gpio-button-hotplug kmod-ipt-offload kmod-leds-gpio kmod-ledtrig-default-on kmod-ledtrig-netdev kmod-ledtrig-timer kmod-mt76x2u kmod-nf-nathelper kmod-rt2800-usb kmod-rtl8187 kmod-scsi-generic kmod-usb-ohci kmod-usb-storage-extras kmod-usb-uhci kmod-usb2 libbz2-1.0 libcurl4 libelf1 libffi libgmp10 libiconv-full2 libintl libltdl7 libnet-1.2.x libnl200 libreadline8 libustream-mbedtls20150806 libxml2 logd macchanger mtd nano ncat netcat nginx openssh-client openssh-server openssh-sftp-server openssl-util php7-fpm php7-mod-hash php7-mod-json php7-mod-mbstring php7-mod-session php7-mod-sqlite3 ppp ppp-mod-pppoe procps-ng-pkill procps-ng-ps python-logging python-openssl python-sqlite3 ssmtp tcpdump-mini uci uclibcxx uclient-fetch urandom-seed urngd usb-modeswitch usbreset usbutils wget wireless-tools wpad busybox libatomic1 libstdcpp6 -wpad-basic -dropbear -swconfig -odhcpd-ipv6only -odhcp6c"
# no rtl-sdr, no kmod-usb-net-*, no kmod-usb-serial-*, no kmod-rtl8192cu, no kmod-usb-acm, no kmod-usb-wdm, no kmod-lib-crc-itu-t
PACKAGES_TETRA="iw at autossh base-files bash block-mount ca-certificates chat dnsmasq e2fsprogs ethtool firewall hostapd-utils ip6tables iwinfo kmod-crypto-manager kmod-fs-ext4 kmod-fs-nfs kmod-fs-vfat kmod-gpio-button-hotplug kmod-ipt-offload kmod-leds-gpio kmod-ledtrig-default-on kmod-ledtrig-netdev kmod-ledtrig-timer kmod-mt76x2u kmod-nf-nathelper kmod-rt2800-usb kmod-rtl8187 kmod-scsi-generic kmod-usb-ohci kmod-usb-storage-extras kmod-usb-uhci kmod-usb2 libbz2-1.0 libcurl4 libelf1 libffi libgdbm libgmp10 libiconv-full2 libltdl7 libnet-1.2.x libnl200 libustream-mbedtls20150806 libxml2 logd macchanger mtd nano ncat netcat nginx openssh-client openssh-server openssh-sftp-server openssl-util php7-fpm php7-mod-hash php7-mod-json php7-mod-mbstring php7-mod-session php7-mod-sqlite3 ppp ppp-mod-pppoe procps-ng-pkill procps-ng-ps python-logging python-openssl python-sqlite3 ssmtp tcpdump-mini uci uclibcxx uclient-fetch urandom-seed urngd usb-modeswitch usbreset usbutils wget wireless-tools wpad busybox libatomic1 libstdcpp6 -wpad-basic -dropbear -odhcp6c -odhcpd-ipv6only"
# if you don't install a custom build of busybox you have to install fdisk
# no rtl-sdr, no kmod-usb-net-*, no kmod-usb-serial-*, no kmod-rtl8192cu, no kmod-usb-acm, no kmod-usb-wdm, no kmod-lib-crc-itu-t, no ppp*, no python-*
PACKAGES_UNIVERSAL="iw at autossh base-files bash block-mount ca-certificates chat dnsmasq e2fsprogs ethtool firewall hostapd-utils ip6tables iwinfo kmod-crypto-manager kmod-fs-ext4 kmod-fs-nfs kmod-fs-vfat kmod-gpio-button-hotplug kmod-ipt-offload kmod-leds-gpio kmod-ledtrig-default-on kmod-ledtrig-netdev kmod-ledtrig-timer kmod-mt76x2u kmod-nf-nathelper kmod-rt2800-usb kmod-rtl8187 kmod-scsi-generic kmod-usb-ohci kmod-usb-storage-extras kmod-usb-uhci kmod-usb2 libbz2-1.0 libcurl4 libelf1 libffi libgdbm libgmp10 libiconv-full2 libltdl7 libnet-1.2.x libnl200 libustream-mbedtls20150806 libxml2 logd macchanger mtd nano ncat netcat nginx openssh-client openssh-server openssh-sftp-server openssl-util php7-fpm php7-mod-hash php7-mod-json php7-mod-mbstring php7-mod-session php7-mod-sqlite3 procps-ng-pkill procps-ng-ps ssmtp tcpdump-mini uci uclibcxx uclient-fetch urandom-seed urngd usb-modeswitch usbreset usbutils wget wireless-tools wpad busybox libatomic1 libstdcpp6 -wpad-basic -dropbear -odhcpd-ipv6only -ppp -ppp-mod-pppoe"
# add missing deps and custom busybox build
declare -a FORCE_PACKAGES=("libubus20191227_2019-12-27-041c9d1c-1" "busybox_1.30.1-6")
IMAGEBUILDER_FOLDER="$(realpath $IMAGEBUILDER_FOLDER)"
TOOL_FOLDER="$(realpath $(dirname $0)/../tools)"
BUILD_FOLDER="$(realpath $(dirname $0)/../build)"
# steps
prepare_builder () {
echo "[*] Prepare builder"
echo "******************************"
echo ""
PACKAGES_ARQ="${ARCHITECTURE}_24kc"
DOWNLOAD_BASE_URL="https://github.com/xchwarze/wifi-pineapple-community/raw/main/packages/experimental"
for TARGET in ${FORCE_PACKAGES[@]}; do
PACKAGE_IPK="${TARGET}_${PACKAGES_ARQ}.ipk"
PACKAGE_PATH="$IMAGEBUILDER_FOLDER/packages/$PACKAGE_IPK"
if [ ! -f "$PACKAGE_PATH" ]; then
echo "[+] Install: $TARGET"
wget -q "$DOWNLOAD_BASE_URL/$PACKAGES_ARQ/$PACKAGE_IPK" -O "$PACKAGE_PATH"
else
echo "[+] Already exist: $TARGET"
fi
done
echo "[+] Builder setup complete"
echo ""
}
prepare_build () {
echo "[*] Prepare build"
echo "******************************"
echo ""
# clean
rm -rf _basefw.* basefw.bin
rm -rf "$BUILD_FOLDER"
mkdir -p "$BUILD_FOLDER/release"
# get target firmware
# this work only with lastest binwalk version!
if [[ "$FLAVOR" == "tetra" || "$FLAVOR" == "universal" ]]; then
echo "[+] Downloading TETRA firmware..."
wget -q https://github.com/xchwarze/wifi-pineapple-community/raw/main/firmwares/2.7.0-tetra.bin -O basefw.bin
echo "[+] Unpack firmware for get file system"
binwalk basefw.bin -e
binwalk _basefw.bin.extracted/sysupgrade-pineapple-tetra/root -e --preserve-symlinks
mv _basefw.bin.extracted/sysupgrade-pineapple-tetra/_root.extracted/squashfs-root/ "$BUILD_FOLDER/rootfs-base"
else
echo "[+] Downloading NANO firmware..."
wget -q https://github.com/xchwarze/wifi-pineapple-community/raw/main/firmwares/2.7.0-nano.bin -O basefw.bin
echo "[+] Unpack firmware for get file system"
binwalk basefw.bin -e --preserve-symlinks
mv _basefw.bin.extracted/squashfs-root/ "$BUILD_FOLDER/rootfs-base"
fi
rm -rf _basefw.* basefw.bin
#sudo chmod +x "$TOOL_FOLDER/*.sh"
echo "[+] Copying the original files"
"$TOOL_FOLDER/copier.sh" "$TOOL_FOLDER/../lists/$FLAVOR.filelist" "$BUILD_FOLDER/rootfs-base" "$BUILD_FOLDER/rootfs"
if [ $? -ne 0 ]; then
echo "[!] An error occurred while copying the original files. Check the log for errors."
exit 1
fi
echo "[+] Patch file system"
"$TOOL_FOLDER/fs-patcher.sh" "$ARCHITECTURE" "$FLAVOR" "$BUILD_FOLDER/rootfs"
if [ $? -ne 0 ]; then
echo "[!] An error occurred during the execution of the process. Check the log for errors."
exit 1
fi
rm -rf "$BUILD_FOLDER/rootfs-base"
echo ""
}
build () {
echo "[*] Build"
echo "******************************"
echo ""
# clean
echo "[+] Clean last build data"
#make clean
rm -rf "$IMAGEBUILDER_FOLDER/tmp/"
rm -rf "$IMAGEBUILDER_FOLDER/build_dir/target-*/root*"
rm -rf "$IMAGEBUILDER_FOLDER/build_dir/target-*/json_*"
rm -rf "$IMAGEBUILDER_FOLDER/bin/targets/*"
# set selected packages
echo "[+] Executing make"
selected_packages="$PACKAGES_UNIVERSAL"
if [[ "$FLAVOR" == "nano" ]];
then
selected_packages="$PACKAGES_NANO"
elif [[ "$FLAVOR" == "tetra" ]];
then
selected_packages="$PACKAGES_TETRA"
fi
# build
cd "$IMAGEBUILDER_FOLDER"
make image PROFILE="$1" PACKAGES="$selected_packages" FILES="$BUILD_FOLDER/rootfs" BIN_DIR="$BUILD_FOLDER/release" > "$BUILD_FOLDER/release/make.log"
if [ $? -ne 0 ]; then
echo ""
echo "[!] An error occurred in the build process. Check file release/make.log for more information."
exit 1
fi
# add this second check for build process
checkFwFileExist=$(ls "$BUILD_FOLDER/release"/*-sysupgrade.* 2>/dev/null | wc -l)
if [ $checkFwFileExist -eq 0 ]; then
echo ""
echo "[!] OpenWRT finished the build process but no firmware was found. Check the release/make.log to see if the process was completed correctly."
#exit 1
fi
echo ""
}
# implement this shitty logic
echo "Wifi Pineapple Cloner - builder"
echo "************************************** by DSR!"
echo ""
prepare_builder
prepare_build
build "$PROFILE"
echo "[*] Firmware folder: $BUILD_FOLDER/release"
echo "******************************"
ls -l "$BUILD_FOLDER/release"
echo ""

72
tools/copier.sh Executable file
View File

@ -0,0 +1,72 @@
#!/bin/bash
# by DSR! from https://github.com/xchwarze/wifi-pineapple-cloner
FILE_LIST="$1"
FROM_FOLDER="$2"
TO_FOLDER="$3"
COUNTER=0
if [[ ! -f "$FILE_LIST" || ! -d "$FROM_FOLDER" || "$TO_FOLDER" == "" ]]; then
echo "Run with \"copier.sh [FILE_LIST] [FROM_FOLDER] [TO_FOLDER]\""
echo " FILE_LIST -> flavor file list"
echo " FROM_FOLDER -> path to base fs"
echo " TO_FOLDER -> path to new fs"
exit 1
fi
FILE_LIST="$(realpath $FILE_LIST)"
FROM_FOLDER="$(realpath $FROM_FOLDER)"
TO_FOLDER="$(realpath $TO_FOLDER)"
echo "Filelist2Copy - by DSR!"
echo "******************************"
echo ""
echo "[*] Start copy loop"
rm -rf "$TO_FOLDER"
mkdir "$TO_FOLDER"
for FILE in $(cat "$FILE_LIST")
do
if [[ "${FILE:0:1}" != '/' ]]; then
continue
fi
# fix name chars
FILE=$(echo $FILE | sed $'s/\r//')
# check exist
if [[ ! -f "$FROM_FOLDER$FILE" ]] && [[ ! -d "$FROM_FOLDER$FILE" ]]; then
echo "[!] File does not exist: ${FROM_FOLDER}${FILE}"
continue
fi
# check file type
#TYPE_CHECK=$(file "$FROM_FOLDER$FILE" | grep "ELF")
#if [[ $TYPE_CHECK != "" ]]; then
# echo "[+] ELF: $FILE"
# continue
#fi
let COUNTER++
FOLDER=$(dirname $FILE)
mkdir -p "$TO_FOLDER$FOLDER"
# if folder...
if [[ -d "$FROM_FOLDER$FILE" ]]; then
cp -R "$FROM_FOLDER$FILE" "$TO_FOLDER$FILE"
else
cp -P "$FROM_FOLDER$FILE" "$TO_FOLDER$FILE"
fi
done
if [ $COUNTER -eq 0 ]; then
echo "[!] No files were copied. Verify that the paths are correct."
exit 1
fi
echo "[+] Files copied: $COUNTER"
echo ""

103
tools/dependencies-install.sh Executable file
View File

@ -0,0 +1,103 @@
#!/bin/bash
# by DSR! from https://github.com/xchwarze/wifi-pineapple-cloner
OPENWRT_VERSION="19.07.7"
OPENWRT_BASE_URL="https://downloads.openwrt.org/releases/$OPENWRT_VERSION/targets"
declare -a OPENWRT_MIPS_TARGET_LIST=(
"ar71xx-generic" "ar71xx-nand" "ath79-generic" "lantiq-xrx200"
)
declare -a OPENWRT_MIPSEL_TARGET_LIST=(
"ramips-mt7620" "ramips-mt7621" "ramips-mt76x8"
)
install_openwrt_deps () {
TARGET="$1"
FOLDER_NAME="imagebuilder-$OPENWRT_VERSION-$TARGET"
ORIGINAL_FOLDER_NAME="openwrt-imagebuilder-$OPENWRT_VERSION-$TARGET.Linux-x86_64"
FILE="$FOLDER_NAME.tar.xz"
# download imagebuilder
if [ ! -d "$FOLDER_NAME" ]; then
if [ ! -f "$FILE" ]; then
echo " [+] Downloading imagebuilder..."
TYPE=$(echo $TARGET | sed "s/-/\//g")
wget -q "$OPENWRT_BASE_URL/$TYPE/$ORIGINAL_FOLDER_NAME.tar.xz" -O "$FILE"
fi
# install...
echo " [+] Install imagebuilder..."
rm -rf "$FOLDER_NAME"
tar xJf "$FILE"
mv "$ORIGINAL_FOLDER_NAME" "$FOLDER_NAME"
# correct opkg feeds
echo " [+] Correct opkg feeds"
sed -i "s/src\/gz openwrt_freifunk/#/" "$FOLDER_NAME/repositories.conf"
sed -i "s/src\/gz openwrt_luci/#/" "$FOLDER_NAME/repositories.conf"
sed -i "s/src\/gz openwrt_telephony/#/" "$FOLDER_NAME/repositories.conf"
fi
}
install_ubuntu_deps () {
echo "Install ubuntu deps..."
echo "******************************"
# install deps openwrt make and others
apt-get install build-essential python2 wget gawk libncurses5-dev libncursesw5-dev zip rename -y
# install binwalk
git clone https://github.com/ReFirmLabs/binwalk
cd binwalk && sudo python3 setup.py install && sudo ./deps.sh
echo ""
echo "[*] Install script end!"
}
install_openwrt_deps_mips () {
echo "Install OpenWrt MIPS deps..."
echo "******************************"
for TARGET in ${OPENWRT_MIPS_TARGET_LIST[@]}; do
echo "[*] Install: $TARGET"
install_openwrt_deps $TARGET
done
echo ""
echo "[*] Install script end!"
}
install_openwrt_deps_mipsel () {
echo "Install OpenWrt MIPSEL deps..."
echo "******************************"
for TARGET in ${OPENWRT_MIPSEL_TARGET_LIST[@]}; do
echo "[*] Install: $TARGET"
install_openwrt_deps $TARGET
done
echo ""
echo "[*] Install script end!"
}
echo "Wifi Pineapple Cloner - dependencies"
echo "************************************** by DSR!"
echo ""
if [ "$1" == "openwrt-deps-mips" ]
then
install_openwrt_deps_mips
elif [ "$1" == "openwrt-deps-mipsel" ]
then
install_openwrt_deps_mipsel
elif [ "$1" == "ubuntu-deps" ]
then
install_ubuntu_deps
else
echo "Valid command:"
echo "openwrt-deps-mips -> install imagebuilders for mips and configure it"
echo "openwrt-deps-mipsel -> install imagebuilders for mipsel and configure it"
echo "ubuntu-deps -> install ubuntu dependencies"
fi

291
tools/fs-patcher.sh Executable file
View File

@ -0,0 +1,291 @@
#!/bin/bash
# by DSR! from https://github.com/xchwarze/wifi-pineapple-cloner
ARCHITECTURE="$1"
FLAVOR="$2"
ROOT_FS="$3"
declare -a ARCHITECTURE_TYPES=("mips" "mipsel")
declare -a FLAVOR_TYPES=("nano" "tetra" "universal")
if [[ ! -d "$ROOT_FS" ]] || ! grep -q "$ARCHITECTURE" <<< "${ARCHITECTURE_TYPES[*]}" || ! grep -q "$FLAVOR" <<< "${FLAVOR_TYPES[*]}"; then
echo "Run with \"fs-patcher.sh [ARCHITECTURE] [FLAVOR] [FS_FOLDER]\""
echo " ARCHITECTURE -> must be one of these values: mips, mipsel"
echo " FLAVOR -> must be one of these values: nano, tetra, universal"
echo " FS_FOLDER -> folder containing the fs to use"
exit 1
fi
ROOT_FS="$(realpath $ROOT_FS)"
FILES_FOLDER="$(realpath $(dirname $0)/../files)"
common_patch () {
echo "[*] Device detection fix"
# fix "unknown operand" error
sed -i 's/print $6/print $1/' "$ROOT_FS/etc/hotplug.d/block/20-sd"
sed -i 's/print $6/print $1/' "$ROOT_FS/etc/hotplug.d/usb/30-sd"
sed -i 's/print $6/print $1/' "$ROOT_FS/etc/init.d/pineapple"
sed -i 's/print $6/print $1/' "$ROOT_FS/etc/rc.button/BTN_1"
sed -i 's/print $6/print $1/' "$ROOT_FS/etc/rc.button/reset"
sed -i 's/print $6/print $1/' "$ROOT_FS/etc/rc.local"
sed -i 's/print $6/print $1/' "$ROOT_FS/etc/uci-defaults/90-firewall.sh"
sed -i 's/print $6/print $1/' "$ROOT_FS/etc/uci-defaults/91-fstab.sh"
sed -i 's/print $6/print $1/' "$ROOT_FS/etc/uci-defaults/92-system.sh"
sed -i 's/print $6/print $1/' "$ROOT_FS/etc/uci-defaults/95-network.sh"
sed -i 's/print $6/print $1/' "$ROOT_FS/etc/uci-defaults/97-pineapple.sh"
sed -i 's/print $6/print $1/' "$ROOT_FS/sbin/led"
# force setup
sed -i 's/..Get Device/device="NANO"/' "$ROOT_FS/etc/rc.button/BTN_1"
sed -i 's/..Get Device/device="NANO"/' "$ROOT_FS/etc/rc.button/reset"
sed -i 's/..Get Device/device="NANO"/' "$ROOT_FS/etc/rc.local"
sed -i 's/..Get Version and Device/device="TETRA"/' "$ROOT_FS/etc/uci-defaults/90-firewall.sh"
sed -i 's/..Get Version and Device/device="NANO"/' "$ROOT_FS/etc/uci-defaults/91-fstab.sh"
sed -i 's/..Get Version and Device/device="NANO"/' "$ROOT_FS/etc/uci-defaults/95-network.sh"
sed -i 's/..Get Version and Device/device="NANO"/' "$ROOT_FS/etc/uci-defaults/97-pineapple.sh"
sed -i 's/..Get device type/device="NANO"/' "$ROOT_FS/etc/uci-defaults/92-system.sh"
#sed -i 's/..led (C) Hak5 2018/device="NANO"/' "$ROOT_FS/sbin/led"
echo "[*] Correct OPKG feed url"
cp "$FILES_FOLDER/$ARCHITECTURE/customfeeds.conf" "$ROOT_FS/etc/opkg/customfeeds.conf"
echo "[*] Pineap"
cp "$FILES_FOLDER/$ARCHITECTURE/pineap/pineapd" "$ROOT_FS/usr/sbin/pineapd"
cp "$FILES_FOLDER/$ARCHITECTURE/pineap/pineap" "$ROOT_FS/usr/bin/pineap"
cp "$FILES_FOLDER/$ARCHITECTURE/pineap/resetssids" "$ROOT_FS/usr/sbin/resetssids"
cp "$FILES_FOLDER/$ARCHITECTURE/pineap/libwifi.so" "$ROOT_FS/usr/lib/libwifi.so"
chmod +x "$ROOT_FS/usr/sbin/pineapd"
chmod +x "$ROOT_FS/usr/bin/pineap"
chmod +x "$ROOT_FS/usr/sbin/resetssids"
chmod +x "$ROOT_FS/usr/lib/libwifi.so"
echo "[*] Add Karma support"
mkdir -p "$ROOT_FS/lib/netifd/wireless"
cp "$FILES_FOLDER/common/karma/mac80211.sh" "$ROOT_FS/lib/netifd/wireless/mac80211.sh"
cp "$FILES_FOLDER/common/karma/hostapd.sh" "$ROOT_FS/lib/netifd/hostapd.sh"
cp "$FILES_FOLDER/$ARCHITECTURE/karma/hostapd_cli" "$ROOT_FS/usr/sbin/hostapd_cli"
cp "$FILES_FOLDER/$ARCHITECTURE/karma/wpad" "$ROOT_FS/usr/sbin/wpad"
chmod +x "$ROOT_FS/lib/netifd/wireless/mac80211.sh"
chmod +x "$ROOT_FS/lib/netifd/hostapd.sh"
chmod +x "$ROOT_FS/usr/sbin/hostapd_cli"
chmod +x "$ROOT_FS/usr/sbin/wpad"
echo "[*] Install panel fixes and improvements"
# update panel code
rm -rf "$ROOT_FS/pineapple"
wget -q https://github.com/xchwarze/wifi-pineapple-panel/archive/refs/heads/wpc.zip -O updated-panel.zip
unzip -q updated-panel.zip
cp -r wifi-pineapple-panel-wpc/src/* "$ROOT_FS/"
rm -rf wifi-pineapple-panel-wpc updated-panel.zip
chmod +x "$ROOT_FS/etc/init.d/pineapd"
chmod +x "$ROOT_FS/etc/uci-defaults/93-pineap.sh"
chmod +x "$ROOT_FS/pineapple/modules/Advanced/formatSD/format_sd"
chmod +x "$ROOT_FS/pineapple/modules/Help/files/debug"
chmod +x "$ROOT_FS/pineapple/modules/PineAP/executable/executable"
chmod +x "$ROOT_FS/pineapple/modules/Reporting/files/reporting"
cp "$FILES_FOLDER/common/pineapple/favicon.ico" "$ROOT_FS/pineapple/img/favicon.ico"
cp "$FILES_FOLDER/common/pineapple/favicon-16x16.png" "$ROOT_FS/pineapple/img/favicon-16x16.png"
cp "$FILES_FOLDER/common/pineapple/favicon-32x32.png" "$ROOT_FS/pineapple/img/favicon-32x32.png"
# fix docs size
truncate -s 0 "$ROOT_FS/pineapple/modules/Setup/eula.txt"
truncate -s 0 "$ROOT_FS/pineapple/modules/Setup/license.txt"
echo "[*] Enable ssh by default"
sed -i 's/\/etc\/init.d\/sshd/#\/etc\/init.d\/sshd/' "$ROOT_FS/etc/rc.local"
echo "[*] Change root password to: root"
cp "$FILES_FOLDER/common/etc/shadow" "$ROOT_FS/etc/shadow"
echo "[*] Fix uci-defaults"
cp "$FILES_FOLDER/common/etc/92-system.sh" "$ROOT_FS/etc/uci-defaults/92-system.sh"
cp "$FILES_FOLDER/common/etc/95-network.sh" "$ROOT_FS/etc/uci-defaults/95-network.sh"
cp "$FILES_FOLDER/common/etc/97-pineapple.sh" "$ROOT_FS/etc/uci-defaults/97-pineapple.sh"
echo "[*] Fix pendrive hotplug"
cp "$FILES_FOLDER/common/etc/20-sd-universal" "$ROOT_FS/etc/hotplug.d/block/20-sd-universal"
rm "$ROOT_FS/etc/hotplug.d/block/20-sd"
rm "$ROOT_FS/etc/hotplug.d/usb/30-sd"
echo "[*] Add support for reflash"
mkdir -p "$ROOT_FS/lib/upgrade/keep.d"
cp "$FILES_FOLDER/common/lib/pineapple.keep" "$ROOT_FS/lib/upgrade/keep.d/pineapple"
echo "[*] Fix airmon-ng listInterfaces()"
mkdir -p "$ROOT_FS/usr/sbin"
cp "$FILES_FOLDER/common/usr/airmon-ng" "$ROOT_FS/usr/sbin/airmon-ng"
chmod +x "$ROOT_FS/usr/sbin/airmon-ng"
echo "[*] Add wpc-tools and service"
cp "$FILES_FOLDER/common/etc/wpc-tools" "$ROOT_FS/etc/init.d/wpc-tools"
cp "$FILES_FOLDER/common/usr/wpc-tools" "$ROOT_FS/usr/bin/wpc-tools"
chmod +x "$ROOT_FS/etc/init.d/wpc-tools"
chmod +x "$ROOT_FS/usr/bin/wpc-tools"
echo "[*] Other fixs"
# clean files
rm -f "$ROOT_FS/etc/pineapple/changes"
rm -f "$ROOT_FS/etc/pineapple/pineapple_version"
# default wifi config
cp "$FILES_FOLDER/common/lib/mac80211.sh" "$ROOT_FS/lib/wifi/mac80211.sh"
# fix wifi detection
cp "$FILES_FOLDER/common/etc/30-fix_wifi" "$ROOT_FS/etc/hotplug.d/usb/30-fix_wifi"
# copy clean version of led script
cp "$FILES_FOLDER/common/sbin/led" "$ROOT_FS/sbin/led"
chmod +x "$ROOT_FS/sbin/led"
# add setup support for routers that do not have a reset button but do have wps
# this modified the package "hostapd-common" wps button script
mkdir -p "$ROOT_FS/etc/rc.button"
cp "$FILES_FOLDER/common/etc/wps" "$ROOT_FS/etc/rc.button/wps"
chmod +x "$ROOT_FS/etc/rc.button/wps"
# add new banner
cp "$FILES_FOLDER/common/etc/banner" "$ROOT_FS/etc/banner"
}
mipsel_patch () {
echo "[*] Add mipsel support"
cp "$FILES_FOLDER/$ARCHITECTURE/aircrack/aircrack-ng" "$ROOT_FS/usr/bin/aircrack-ng"
cp "$FILES_FOLDER/$ARCHITECTURE/aircrack/aireplay-ng" "$ROOT_FS/usr/sbin/aireplay-ng"
cp "$FILES_FOLDER/$ARCHITECTURE/aircrack/airodump-ng" "$ROOT_FS/usr/sbin/airodump-ng"
cp "$FILES_FOLDER/$ARCHITECTURE/aircrack/airodump-ng-oui-update" "$ROOT_FS/usr/sbin/airodump-ng-oui-update"
cp "$FILES_FOLDER/$ARCHITECTURE/aircrack/libaircrack-osdep-1.5.2.so" "$ROOT_FS/usr/lib/libaircrack-osdep-1.5.2.so"
cp "$FILES_FOLDER/$ARCHITECTURE/aircrack/libaircrack-ce-wpa-1.5.2.so" "$ROOT_FS/usr/lib/libaircrack-ce-wpa-1.5.2.so"
cp "$FILES_FOLDER/$ARCHITECTURE/aircrack/libaircrack-osdep.so" "$ROOT_FS/usr/lib/libaircrack-osdep.so"
cp "$FILES_FOLDER/$ARCHITECTURE/aircrack/libaircrack-ce-wpa.la" "$ROOT_FS/usr/lib/libaircrack-ce-wpa.la"
cp "$FILES_FOLDER/$ARCHITECTURE/aircrack/libaircrack-ce-wpa.so" "$ROOT_FS/usr/lib/libaircrack-ce-wpa.so"
cp "$FILES_FOLDER/$ARCHITECTURE/aircrack/libaircrack-osdep.la" "$ROOT_FS/usr/lib/libaircrack-osdep.la"
chmod +x "$ROOT_FS/usr/bin/aircrack-ng"
chmod +x "$ROOT_FS/usr/sbin/aireplay-ng"
chmod +x "$ROOT_FS/usr/sbin/airodump-ng"
chmod +x "$ROOT_FS/usr/sbin/airodump-ng-oui-update"
chmod +x "$ROOT_FS/usr/lib/libaircrack-osdep-1.5.2.so"
chmod +x "$ROOT_FS/usr/lib/libaircrack-ce-wpa-1.5.2.so"
chmod +x "$ROOT_FS/usr/lib/libaircrack-osdep.so"
chmod +x "$ROOT_FS/usr/lib/libaircrack-ce-wpa.la"
chmod +x "$ROOT_FS/usr/lib/libaircrack-ce-wpa.so"
chmod +x "$ROOT_FS/usr/lib/libaircrack-osdep.la"
cp "$FILES_FOLDER/$ARCHITECTURE/others/http_sniffer" "$ROOT_FS/usr/sbin/http_sniffer"
chmod +x "$ROOT_FS/usr/sbin/http_sniffer"
}
nano_patch () {
# correct python-codecs version (from python-codecs_2.7.18-3_mips_24kc.ipk)
mkdir -p "$ROOT_FS/usr/lib/python2.7/encodings"
cp "$FILES_FOLDER/$ARCHITECTURE/python/encodings/__init__.pyc" "$ROOT_FS/usr/lib/python2.7/encodings/__init__.pyc"
cp "$FILES_FOLDER/$ARCHITECTURE/python/encodings/aliases.pyc" "$ROOT_FS/usr/lib/python2.7/encodings/aliases.pyc"
cp "$FILES_FOLDER/$ARCHITECTURE/python/encodings/base64_codec.pyc" "$ROOT_FS/usr/lib/python2.7/encodings/base64_codec.pyc"
cp "$FILES_FOLDER/$ARCHITECTURE/python/encodings/hex_codec.pyc" "$ROOT_FS/usr/lib/python2.7/encodings/hex_codec.pyc"
# panel changes
# sed -i "s/\$data = file_get_contents('\/proc\/cpuinfo')/return 'nano'/" "$ROOT_FS/pineapple/api/pineapple.php"
cp "$FILES_FOLDER/common/pineapple/config.php.nano" "$ROOT_FS/pineapple/config.php"
# other changes
sed -i "s/exec(\"cat \/proc\/cpuinfo | grep 'machine'\")/'nano'/" "$ROOT_FS/usr/bin/pineapple/site_survey"
# fix banner info
sed -i 's/DEVICE/NANO/' "$ROOT_FS/etc/banner"
}
tetra_patch () {
# correct python-codecs version (from python-codecs_2.7.18-3_mips_24kc.ipk)
mkdir -p "$ROOT_FS/usr/lib/python2.7/encodings"
cp "$FILES_FOLDER/$ARCHITECTURE/python/encodings/__init__.pyc" "$ROOT_FS/usr/lib/python2.7/encodings/__init__.pyc"
cp "$FILES_FOLDER/$ARCHITECTURE/python/encodings/aliases.pyc" "$ROOT_FS/usr/lib/python2.7/encodings/aliases.pyc"
cp "$FILES_FOLDER/$ARCHITECTURE/python/encodings/base64_codec.pyc" "$ROOT_FS/usr/lib/python2.7/encodings/base64_codec.pyc"
cp "$FILES_FOLDER/$ARCHITECTURE/python/encodings/hex_codec.pyc" "$ROOT_FS/usr/lib/python2.7/encodings/hex_codec.pyc"
# panel changes
# sed -i 's/tetra/nulled/' "$ROOT_FS/pineapple/js/directives.js"
# sed -i 's/tetra/nulled/' "$ROOT_FS/pineapple/modules/ModuleManager/js/module.js"
# sed -i 's/tetra/nulled/' "$ROOT_FS/pineapple/modules/Advanced/module.html"
# sed -i 's/nano/tetra/' "$ROOT_FS/pineapple/html/install-modal.html"
# sed -i 's/nano/tetra/' "$ROOT_FS/pineapple/modules/Advanced/module.html"
# sed -i 's/nano/tetra/' "$ROOT_FS/pineapple/modules/ModuleManager/js/module.js"
# sed -i 's/nano/tetra/' "$ROOT_FS/pineapple/modules/Reporting/js/module.js"
# sed -i 's/nano/tetra/' "$ROOT_FS/pineapple/modules/Reporting/api/module.php"
# sed -i "s/\$data = file_get_contents('\/proc\/cpuinfo')/return 'tetra'/" "$ROOT_FS/pineapple/api/pineapple.php"
cp "$FILES_FOLDER/common/pineapple/config.php.tetra" "$ROOT_FS/pineapple/config.php"
# other changes
sed -i "s/exec(\"cat \/proc\/cpuinfo | grep 'machine'\")/'tetra'/" "$ROOT_FS/usr/bin/pineapple/site_survey"
# fix banner info
sed -i 's/DEVICE/TETRA/' "$ROOT_FS/etc/banner"
}
universal_patch () {
# panel changes
cp "$FILES_FOLDER/common/pineapple/config.php.tetra" "$ROOT_FS/pineapple/config.php"
# other changes
sed -i "s/exec(\"cat \/proc\/cpuinfo | grep 'machine'\")/'tetra'/" "$ROOT_FS/usr/bin/pineapple/site_survey"
# fix banner info
sed -i 's/DEVICE/OMEGA/' "$ROOT_FS/etc/banner"
}
# implement....
echo "Wifi Pineapple Cloner v4"
echo "by DSR!"
echo "******************************"
echo ""
# apply patches in order
common_patch
if [[ "$ARCHITECTURE" == "mipsel" ]]; then
mipsel_patch
fi
echo "[*] Setting target as: $FLAVOR"
if [[ $FLAVOR = 'nano' ]]
then
nano_patch
elif [[ $FLAVOR = 'tetra' ]]
then
tetra_patch
elif [[ $FLAVOR = 'universal' ]]
then
universal_patch
fi
echo "[*] Done!"
echo ""

159
tools/opkg-parser.php Normal file
View File

@ -0,0 +1,159 @@
<?php
# by DSR! from https://github.com/xchwarze/wifi-pineapple-cloner
error_reporting(E_ALL);
if (!isset($_SERVER['argv']) && !isset($argv)) {
echo "Please enable the register_argc_argv directive in your php.ini\n";
exit(1);
} elseif (!isset($argv)) {
$argv = $_SERVER['argv'];
}
if (!isset($argv[1])) {
echo "Run with \"php opkg-parser.php [PATH] [DIFF_SEPARATOR]\"\n";
echo " PATH -> path to opkg status file\n";
echo " DIFF_SEPARATOR -> use /n separator\n";
exit(1);
}
function processFile($filePath, $showEssentials, $showDependencies)
{
$block = [];
$packagesData = [];
foreach (file($filePath) as $line) {
$clean = trim($line);
if (empty($clean)) {
if (count($block) > 0) {
$packagesData[] = $block;
$block = [];
}
} else {
$parts = explode(': ', $clean);
if (count($parts) == 2) {
$block[ trim($parts[0]) ] = trim($parts[1]);
}
}
}
if (count($block) > 0) {
$packagesData[] = $block;
}
return cleanInstallData($packagesData, $showEssentials, $showDependencies);
}
function cleanInstallData($output, $showEssentials, $showDependencies)
{
$packages = [];
$depends = [];
// generate packages and depends array
foreach ($output as $data) {
if (
!isset($data['Auto-Installed']) &&
isValidPackage($data['Package'])
) {
if (
!isset($data['Essential']) ||
(
isset($data['Essential']) && $showEssentials
)
) {
$packages[] = $data['Package'];
if (isset($data['Depends'])) {
foreach (explode(',', $data['Depends']) as $dependency) {
$dependency = trim($dependency);
if (!in_array($dependency, $depends)) {
$depends[] = $dependency;
}
}
}
}
}
}
// show all installed packages
if ($showDependencies) {
sort($packages);
return $packages;
}
// show only target packages
$targetPackages = [];
foreach ($packages as $package) {
if (!in_array($package, $depends)) {
$targetPackages[] = $package;
}
}
//var_dump($depends);
sort($targetPackages);
return $targetPackages;
}
function isValidPackage($name)
{
$packageBlacklist = [
// hak5 packages (based on mk6)
'pineap',
'aircrack-ng-hak5',
'cc-client',
'libwifi',
'resetssids',
'http_sniffer',
'log_daemon',
// based on hardware
'kmod-ath',
'kmod-ath9k',
'kmod-ath9k-htc',
'mt7601u-firmware',
'uboot-envtools',
'ubi-utils',
];
// only kmod
//return !in_array($name, $packageBlacklist) && strpos($name, 'kmod-') !== false;
// not show kmod
//return !in_array($name, $packageBlacklist) && strpos($name, 'kmod-') === false;
// all
return !in_array($name, $packageBlacklist);
}
echo "\nopkg status parser - by DSR!";
echo "\n---------------------------------------\n\n";
$printSep = (isset($argv[2]) && filter_var($argv[2], FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE)) ? "\n" : ' ';
$statusFile = $argv[1];
if (!file_exists($statusFile)) {
echo "[!!!] File not found: \"($statusFile)\"\n";
return 0;
}
$statusData = processFile($statusFile, false, false);
echo "======== Packages (" . count($statusData) . ") ========\n";
echo implode($printSep, $statusData);
echo "\n\n\n";
$statusDataEssentials = processFile($statusFile, true, false);
$essentialPackages = [];
foreach ($statusDataEssentials as $key) {
if (!in_array($key, $statusData)) {
$essentialPackages[] = $key;
}
}
echo "======== Essentials Packages (" . count($essentialPackages) . ") ========\n";
echo implode($printSep, $essentialPackages);
echo "\n";