Merge pull request #42 from 0i41E/master

Uploaded AirBridge
pull/43/head
Peaks 2024-07-30 07:02:45 -04:00 committed by GitHub
commit c8efd63beb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 96 additions and 0 deletions

View File

@ -0,0 +1,61 @@
#!/bin/bash
# Title: AirBridge
# Author: 0i41E
#
# Description: A payload to enable WiFi on the Squirrel, when a WiFi Adapter is attached.
# Requirements beforehand: opkg update && opkg install usb-modeswitch, MK7AC Module or similar WiFi Adapter.
# Usage: Connect with payload switch selected, and wait for the magenta LED, insert WiFi adapter, press button.
# Set Network mode
NETMODE BRIDGE
# Starting SSH & Web Interface
SSH_START
UI_START
LED M FAST
BUTTON
LED G FAST
SSID="<SSID>" # Station SSID
PASSPHRASE="<Passphrase>" # Passphrase
EXTERNAL_HOST="8.8.8.8" # Host to verify connection
WLAN_INTERFACE="wlan0"
# Removing old wpa_supplicant.conf file
rm /etc/wpa_supplicant.conf
# Check if wlan interface is up
if ! ip link show $WLAN_INTERFACE | grep -q "state UP"; then
ip link set $WLAN_INTERFACE
else
echo "$WLAN_INTERFACE is already up."
fi
# Create wpa_supplicant.conf file
cat > /etc/wpa_supplicant.conf <<EOF
ctrl_interface=/var/run/wpa_supplicant
network={
ssid="$SSID"
psk="$PASSPHRASE"
}
EOF
# Start wpa_supplicant
wpa_supplicant -B -i "$WLAN_INTERFACE" -c /etc/wpa_supplicant.conf
# Obtain IP address via DHCP
udhcpc -i "$WLAN_INTERFACE"
# Check connectivity to the external host
if ping -c 1 $EXTERNAL_HOST; then
C2NOTIFY INFO AirBridge initiated!
LED G SOLID
else
LED R SOLID
fi

View File

@ -0,0 +1,35 @@
# AirBridge
#### Author: 0i41E
**AirBridge** is a payload designed for the [Package Squirrel MK II](https://shop.hak5.org/products/packet-squirrel-mark-ii) in combination with Hak5's [MK7AC Module](https://shop.hak5.org/products/mk7ac-wifi-adapter), or similar WiFi adapters.
It is meant to help users to overcome a potential airgapped network, by utilizing the WiFi adapter to connect to a nearby Station.
![airbridge](https://github.com/user-attachments/assets/592a7a8d-9a4e-4050-b04c-c7ff31480f2d)
Since it'll start the SSH service, as well as the Web interface, users can then interact with the Squirrel as usual. C2 access or conection to a VPN are also possible afterwards.
## Preperation
Before deploying the Squirrel as also the payload, the user has to update the system and install `usb_modeswitch`, as without it, the WiFi adpater will be identified as storage. For this step, internet access is required.
`opkg update && opkg install usb-modeswitch`
Apart from this step, the payload needs to be configured.
Input the desired `SSID`, as well as its `PASSPHRASE`.
Optionally, the `EXTERNAL_HOST` may be changed from Googles DNS server to a different system. The users C2 instance may be a good alternative, if used. `NETMODE` can be configured to the users needs.
```
SSID="<SSID>" # Station SSID
PASSPHRASE="<Passphrase>" # Passphrase
EXTERNAL_HOST="8.8.8.8" # External Host to verify connection
```
The last step is obvious, but should be mentioned...
Prepare a Station, reachable by the AC Module.
## Usage
After saving the payload, put the switch into the correct position and power up the device.
After successfully booting, a blinking LED in the color magenta, will indicate the Squirrel being ready to proceed.
Plug in your WiFi adapter via USB-A and press the button. *This method was implemented intentionally, as during testing it caused problems to power up the device with the AC Module already attached.*
The LED will start blinking green.
A solid green LED will indicate the success. Otherwise, a red LED will appear.
If everything went well, you should now be able to access the Squirrel by whatever IP-Address your Station gave to the Squirrel.