Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rewrite apps #116

Open
wants to merge 91 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
5431660
trap sighup and add cleanup to blue_hydra
dallaswinger Jul 27, 2016
5683483
minor tweaks to blue_hydra
dallaswinger Jul 28, 2016
b1016fb
make Rick less sad@me
dallaswinger Jul 28, 2016
49edca0
about that whitespace
dallaswinger Jul 29, 2016
89d0231
add f_hangup to airodump for sighup trap
dallaswinger Aug 19, 2016
9be2157
remove comments and service dbus stop
dallaswinger Aug 19, 2016
3d51579
less (overly)aggressive airodump cleanup
dallaswinger Aug 19, 2016
92f069f
pointless comment removal
dallaswinger Aug 19, 2016
6dedca3
inturrupt airodump on sighup
dallaswinger Oct 3, 2016
0bc66b7
call endsummary on sighup
dallaswinger Oct 3, 2016
f72789a
add cleanup function and traps to bluelog
dallaswinger Oct 3, 2016
b17ab47
trap and cleanup dnsspoof
dallaswinger Oct 3, 2016
a35531c
pkill instead of pgrep|xargs
dallaswinger Oct 3, 2016
58cabaa
pkill instead of pgrep|xargs
dallaswinger Oct 3, 2016
85fcbdb
pkill istead of pgrep & kill
dallaswinger Oct 3, 2016
0ec4a24
stop DBUS per Rick
dallaswinger Oct 3, 2016
9051da6
trap and cleanup dsniff
dallaswinger Oct 3, 2016
e77a966
trap and cleanup ettercap
dallaswinger Oct 3, 2016
87c1023
trap and cleanup kismet
dallaswinger Oct 3, 2016
a51b085
trap and cleanup msfconsole
dallaswinger Oct 3, 2016
d7bbdf2
indentation
dallaswinger Oct 3, 2016
9882a80
indentation
dallaswinger Oct 3, 2016
5e7990e
trap and cleanup tshark
dallaswinger Oct 3, 2016
81ce589
use interface variable - copypastafail
dallaswinger Oct 3, 2016
74d1a19
trap and cleanup tcpdump
dallaswinger Oct 3, 2016
8a1c116
blind attempt to trap and cleanup ubertooth as I cannot test without …
dallaswinger Oct 3, 2016
b63f758
target specific airodump command and kill script
dallaswinger Oct 3, 2016
f638bd9
inturrupt kismet_client
dallaswinger Oct 4, 2016
f136c5e
kill kismet script
dallaswinger Oct 4, 2016
2131478
actually do it
dallaswinger Oct 4, 2016
8e9e462
suicide is not the answer
dallaswinger Oct 4, 2016
522316d
suicide is never the answer
dallaswinger Oct 4, 2016
ef92a8c
exits for everyone + other fixes
dallaswinger Oct 4, 2016
c42db1f
okay gps too
dallaswinger Oct 4, 2016
3034047
dont need to trap int or kill
dallaswinger Oct 4, 2016
8c756af
rm trap int&&kill
dallaswinger Oct 4, 2016
cf1caf2
stop trapping int/kill where cleanup not required
dallaswinger Oct 4, 2016
df38654
take down gpsd with sighup to kismet
dallaswinger Oct 4, 2016
7769240
target ettercap specifically
dallaswinger Oct 4, 2016
63647ff
shouldnt blindly kill gps. dont try
dallaswinger Oct 4, 2016
681bd91
fml. right function
dallaswinger Oct 4, 2016
11054dc
inturrupt is too nice. pkill default
dallaswinger Oct 4, 2016
0d42411
replace KILL with TERM. stop trapping INT during f_run. trap INT duri…
dallaswinger Oct 6, 2016
24e2e89
put that # back tho
dallaswinger Oct 6, 2016
4b113df
remove exit. trap TERM instead of KILL, stop trapping INT, cleanup tr…
dallaswinger Oct 6, 2016
7ef5efe
untrap SIGHUP, exit with 0 status not 1
dallaswinger Oct 6, 2016
1ce9644
exit with 0 and cleanup traps in hangup function
dallaswinger Oct 6, 2016
7f6819e
exit with 0 and cleanup traps in hangup function
dallaswinger Oct 6, 2016
a0cb90e
cleanup traps
dallaswinger Oct 6, 2016
d71dcd6
cleanup traps and exit 0
dallaswinger Oct 6, 2016
fdab97b
exit 0, stop trapping INT, cleanup traps
dallaswinger Oct 6, 2016
199820f
remove INT cleanup - not trapping it to start
dallaswinger Oct 6, 2016
c7e71df
exit 0 cleanup SIGHUP trap
dallaswinger Oct 6, 2016
62a960b
exit 0 and cleanup traps
dallaswinger Oct 6, 2016
d7232b1
exit 0 and cleanup traps. remove INT trap
dallaswinger Oct 6, 2016
2367a13
consistency
dallaswinger Oct 6, 2016
f24f75d
exit 0 and cleanup trap
dallaswinger Oct 6, 2016
3e13922
exit 0 and cleanup trap
dallaswinger Oct 6, 2016
bb8921f
exit 0 and cleanup trap
dallaswinger Oct 6, 2016
5af5f62
stop user from cancelling out of cleanup
dallaswinger Oct 6, 2016
682462d
add paths to grep
dallaswinger Oct 6, 2016
d60f5f5
everything in the bin
dallaswinger Oct 6, 2016
ea9210c
disown hostapd background process to shut up exit status on cleanup
dallaswinger Oct 6, 2016
3e541b2
cleanup all traps
dallaswinger Oct 6, 2016
62b959b
remove exit and quiet cleanup output
dallaswinger Oct 6, 2016
6493404
make f_mon_disable non-optional - only cleanup needed
dallaswinger Oct 6, 2016
6118e3e
formatting/comments
dallaswinger Oct 7, 2016
45ade36
formatting/comments
dallaswinger Oct 7, 2016
ce411b3
formatting/comments
dallaswinger Oct 7, 2016
88daaa2
formatting/comments
dallaswinger Oct 7, 2016
54cba67
formatting/comments
dallaswinger Oct 7, 2016
c8238ea
formatting/comments
dallaswinger Oct 7, 2016
fb433c0
formatting/comments
dallaswinger Oct 7, 2016
bab839c
formatting/comments
dallaswinger Oct 7, 2016
62393d8
formatting/comments
dallaswinger Oct 7, 2016
7ac62cf
formatting/comments
dallaswinger Oct 7, 2016
4c8030a
formatting/comments
dallaswinger Oct 7, 2016
88be6a5
formatting/comments
dallaswinger Oct 7, 2016
89b6d7c
formatting/comments
dallaswinger Oct 7, 2016
dff5d04
formatting/comments
dallaswinger Oct 7, 2016
14dcddd
formatting/comments
dallaswinger Oct 7, 2016
88ed089
formmating/comments
dallaswinger Oct 7, 2016
f374572
formatting/comments
dallaswinger Oct 7, 2016
d9aeac3
formatting/comments & cleanup INT trap
dallaswinger Oct 7, 2016
55ea980
formatting/comments
dallaswinger Oct 7, 2016
9dda964
formatting/comments
dallaswinger Oct 7, 2016
9d36761
formatting/comments
dallaswinger Oct 7, 2016
6dd67b5
formatting/comments
dallaswinger Oct 7, 2016
678b460
formatting/comments
dallaswinger Oct 7, 2016
cba323a
formatting/comments
dallaswinger Oct 7, 2016
9960dc6
trap sooner to avoid leaving device in jank state
dallaswinger Oct 7, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 19 additions & 9 deletions scripts/airodump.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/bin/bash
# Run airodump-ng with no flags
#set the prompt to the name of the script
# Set the prompt to the name of the script
PS1=${PS1//@\\h/@airodump}
clear

. /opt/pwnix/pwnpad-scripts/px_functions.sh

COMMAND_RUN=""
f_run(){

# Check for OUI
Expand All @@ -14,22 +14,26 @@ f_run(){
f_log
# Check for GPS
f_gps
#we have a monitor interface now, so set traps to cleanup
trap f_cleanup INT
trap f_cleanup KILL
# Set traps to cleanup
trap f_cleanup TERM
trap f_hangup SIGHUP

STD_OPTS="-C0 --manufacturer"
if [ $opt_log -eq 1 ]; then
if [ $GPS_STATUS -eq 0 ]; then
airodump-ng $STD_OPTS --gpsd -w airodump wlan1mon
COMMAND_RUN="airodump-ng ${STD_OPTS} --gpsd -w /opt/pwnix/captures/wireless/airodump wlan1mon"
airodump-ng $STD_OPTS --gpsd -w /opt/pwnix/captures/wireless/airodump wlan1mon
else
airodump-ng $STD_OPTS -w airodump wlan1mon
COMMAND_RUN="airodump-ng ${STD_OPTS} -w /opt/pwnix/captures/wireless/airodump wlan1mon"
airodump-ng $STD_OPTS -w /opt/pwnix/captures/wireless/airodump wlan1mon
fi

elif [ $opt_log -eq 2 ]; then
if [ $GPS_STATUS -eq 0 ]; then
COMMAND_RUN="airodump-ng ${STD_OPTS} --gpsd wlan1mon"
airodump-ng $STD_OPTS --gpsd wlan1mon
else
COMMAND_RUN="airodump-ng ${STD_OPTS} wlan1mon"
airodump-ng $STD_OPTS wlan1mon
fi
fi
Expand Down Expand Up @@ -63,7 +67,6 @@ f_gps(){

ps ax |grep gpsd |grep -v grep &> /dev/null
GPSD_STATUS=$?

if [ $GPSD_STATUS -eq 1 ]; then
ps ax |grep bluenmea |grep -v grep &> /dev/null
GPS_STATUS=$?
Expand Down Expand Up @@ -96,12 +99,19 @@ f_gps_toggle(){
esac
}

f_hangup(){
pkill $COMMAND_RUN
trap - TERM SIGHUP
exit 0
}

f_cleanup(){
trap '' INT
f_mon_disable

if [ $GPS_STATUS -eq 0 ]; then
f_gps_toggle
fi
trap - INT TERM SIGHUP
}

f_mon_enable
Expand Down
20 changes: 17 additions & 3 deletions scripts/blue_hydra.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
#!/bin/bash
# Bluetooth scanning / logging script using bluelog
#set the prompt to the name of the script
# Set the prompt to the name of the script
PS1=${PS1//@\\h/@blue_hydra}
clear

bluetooth=1
. /opt/pwnix/pwnpad-scripts/px_functions.sh

f_intbh(){
pkill -f '/bin/blue_hydra'
printf "\nBlue_Hydra process killed...\n"
f_endsummary
}

f_cleanup(){
printf "\nStopping Services...\n"
service bluetooth stop
service dbus stop
trap - TERM SIGHUP
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the cleanup should probably stop dbus too

f_endsummary() {
clear
printf "\n[-] Blue_Hydra db file saved to /opt/pwnix/data/blue_hydra/blue_hydra.db\n\n"
Expand All @@ -28,6 +41,7 @@ EOF
printf "\n[-] Blue_Hydra summary saved to $FILENAME\n\n"
fi
cd /opt/pwnix/captures/bluetooth
f_cleanup
}

f_savecap() {
Expand All @@ -52,8 +66,8 @@ if loud_one=1 f_validate_one hci0; then
START_TIME=$(date +"%s")
FILENAME=/opt/pwnix/captures/bluetooth/blue_hydra_${START_TIME}.out
cd /opt/pwnix/blue_hydra/
trap f_endsummary INT
trap f_endsummary KILL
trap f_endsummary TERM
trap f_intbh SIGHUP
./bin/blue_hydra
f_endsummary
fi
12 changes: 11 additions & 1 deletion scripts/bluelog.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
#!/bin/bash
# Bluetooth scanning / logging script using bluelog
#set the prompt to the name of the script
# Set the prompt to the name of the script
PS1=${PS1//@\\h/@bluelog}
clear

# Cleanup
f_hangup(){
pkill -f 'bluelog -vtnc -i hci0'
trap - SIGHUP
exit 0
}

bluetooth=1
. /opt/pwnix/pwnpad-scripts/px_functions.sh

Expand All @@ -15,5 +22,8 @@ cd /opt/pwnix/captures/bluetooth/
clear
printf "\n[-] Bluelog scan log saved to /opt/pwnix/captures/bluetooth/\n\n"

# Set traps to cleanup
trap f_hangup SIGHUP

bluelog -vtnc -i hci0
fi
2 changes: 1 addition & 1 deletion scripts/btscan.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
# Bluetooth scanning / logging script using hcitool
#set the prompt to the name of the script
# Set the prompt to the name of the script
PS1=${PS1//@\\h/@btscan}
clear

Expand Down
14 changes: 11 additions & 3 deletions scripts/dnsspoof.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
#!/bin/bash
# Script to use ettercap to redirect all DNS traffic back to the device
# Use with SET (site cloner)
#set the prompt to the name of the script
# Set the prompt to the name of the script
PS1=${PS1//@\\h/@dnsspoof}
clear

. /opt/pwnix/pwnpad-scripts/px_functions.sh

f_hangup(){
pkill -f 'ettercap -i wlan1 -T -q -P dns_spoof'
trap - SIGHUP
exit 0
}

f_banner(){
printf "\nEvilAP Ettercap-NG DNS Spoofing Tool\n\n"
printf "[!] This only works when EvilAP is running!\n"
Expand All @@ -17,8 +23,10 @@ f_banner(){

f_run(){
f_banner

trap f_hangup SIGHUP

#ettercap fails if the interface is down
# Ettercap fails if the interface is down
ip link set ${evilap_eth} up

ettercap -i ${evilap_eth} -T -q -P dns_spoof
Expand All @@ -29,7 +37,7 @@ if loud_one=1 f_validate_one at0; then
fi
if f_validate_one wlan1; then
if pgrep hostapd-wpe; then
#this clear removes the noise from the at0 check
# This clear removes the noise from the at0 check
clear
evilap_eth="wlan1"
fi
Expand Down
17 changes: 12 additions & 5 deletions scripts/dsniff.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/bash
# Cleartext password sniffing on all available interfaces
#set the prompt to the name of the script
# Set the prompt to the name of the script
PS1=${PS1//@\\h/@dsniff}
clear

#this block controls the features for px_interface_selector
# This controls the features for px_interface_selector
include_all=1
. /opt/pwnix/pwnpad-scripts/px_functions.sh

Expand All @@ -28,10 +28,11 @@ f_get_logchoice(){
}

f_run(){
#ettercap fails if the interface is down
# Ettercap fails if the interface is down
ip link set $interface up
# If user chose to log, log to folder
# else just run cmd

trap f_hangup SIGHUP

if [ $logchoice -eq 1 ]; then
filename=/opt/pwnix/captures/passwords/dsniff_$(date +%F-%H%M).log
ettercap -i $interface -u -T -q | tee $filename
Expand All @@ -40,6 +41,12 @@ f_run(){
fi
}

f_hangup(){
pkill -f 'ettercap -i wlan0 -T -q -u'
trap - SIGHUP
exit 0
}

f_interface
f_logging_setup
f_run
14 changes: 11 additions & 3 deletions scripts/ettercap.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/bash
# Ettercap ARP cache poison script
#set the prompt to the name of the script
# Set the prompt to the name of the script
PS1=${PS1//@\\h/@ettercap}
clear

#this block controls the features for px_interface_selector
# This block controls the features for px_interface_selector
include_monitor=0
include_airbase=0
require_ip=1
Expand Down Expand Up @@ -54,8 +54,10 @@ f_run(){
read -p "Enter target IP of gateway/router: " gw
printf "\n"

#ettercap fails if the interface is down
# Ettercap fails if the interface is down
ip link set $interface up

trap f_hangup SIGHUP

# Check for Kali1 version for target syntax change...
dpkg --list ettercap-common | grep -q 1:0.8.2-2~kali1
Expand All @@ -80,6 +82,12 @@ f_run(){
ettercap -i $interface -T ${ssl} -q ${log} -M arp:remote ${syntax}/$gw/ ${syntax}/$target1/
}

f_hangup(){
pkill -f 'ettercap -i ${interface} -T ${ssl} -q ${log} -M arp:remote ${syntax}/${gw}/ ${syntax}/${target1}/'
trap - SIGHUP
exit 0
}

f_banner
f_interface
f_sslfake
Expand Down
Loading