Skip to content

Commit

Permalink
Merge pull request #3 from KeyofBlueS/dev
Browse files Browse the repository at this point in the history
Dev into Master
  • Loading branch information
KeyofBlueS committed May 7, 2020
2 parents 40b54a4 + ff330c2 commit 99702dc
Show file tree
Hide file tree
Showing 7 changed files with 93 additions and 38 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ Plugins for airgeddon https://github.com/v1s1t0r1sh3r3/airgeddon
### DESCRIPTION

* **Captured-Handshakes (minimum airgeddon version: 10.20):**
Put Your captured handshakes files in plugins/captured_handshakes/HANDSHAKES_FILES
then choose one of them inside airgeddon itself.
Put Your captured handshakes files in a directory of Your choice, then choose one of them inside airgeddon itself. Default path is plugins/captured_handshakes/HANDSHAKES_FILES


* **Custom-Portals (minimum airgeddon version: 10.20):**
Put Your custom captive portal files in plugins/custom_portals/PORTAL_FOLDER/PORTAL_FILES.
Put Your custom captive portal files in a directory of Your choice. Default path is plugins/custom_portals/PORTAL_FOLDER/PORTAL_FILES.
You can have multiple PORTAL_FOLDER, then choose one of them inside airgeddon itself. Take a look at custom_portals/OpenWRT_EXAMPLE for a custom captive portal example.

* **Regdomain (minimum airgeddon version: 10.20):**
Expand All @@ -24,15 +24,15 @@ When selecting targets, sort them by one of the following value:
bssid, channel, power, essid, encryption, default

* **UI-Boost:**
Speed up user interface by making a specifc language strings file.
Even if slowness is fixed in airgeddon 10.20, this plugin can decrease ram consumption, useful in devices with limited ram memory.
Make a specifc language strings file instead of using the complete one, speeding up ui and lowering ram usage.
The advantages of using this plugin are a more reactive ui (not needed in airgeddon >=10.20), and a lower ram usage, useful in devices with limited ram memory e.g smartphones, tablets ecc...

### INSTALL
Simply put the .sh file of your choice in airgeddon's plugins folder.
For more detailed instructions, please refer to airgeddon's documentations here https://github.com/v1s1t0r1sh3r3/airgeddon/wiki/Plugins%20System

### USAGE
Some plugins can be configured, so please take a look inside the .sh file before use.
Some plugins can be configured, so please take a look at # USER CONFIG SECTION # inside the .sh file before use.

### DONATIONS
If You enjoyed my work and found it useful, You can support the project by making a donation through Paypal. Any amount, not matter how small (1, 2, 5 $/€) is welcome.
Expand Down
20 changes: 12 additions & 8 deletions captured_handshakes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Captured-Handshakes airgeddon plugin

# Version: 0.0.3
# Version: 0.1.0
# Author: KeyofBlueS
# Repository: https://github.com/KeyofBlueS/airgeddon-plugins
# License: GNU General Public License v3.0, https://opensource.org/licenses/GPL-3.0
Expand All @@ -22,11 +22,15 @@ plugin_minimum_ag_affected_version="10.20"
plugin_maximum_ag_affected_version=""
plugin_distros_supported=("*")

################################# USER CONFIG SECTION #################################

# Put Your captured handshakes files in plugins/captured_handshakes/HANDSHAKES
# Put Your captured handshakes files in a directory of Your choice
# Default is plugins/captured_handshakes/HANDSHAKES
# Example:
captured_handshakes_dir="${scriptfolder}${plugins_dir}captured_handshakes/"
# then choose one of them inside airgeddon itself.

captured_handshakes_dir="captured_handshakes/"
############################## END OF USER CONFIG SECTION ##############################

#Captured handshakes selection menu
function list_captured_handshakes_files() {
Expand All @@ -52,7 +56,7 @@ function list_captured_handshakes_files() {
print_simple_separator

echo "${manual_handshakes_text}" > "${tmpdir}ag.captured_handshakes.txt"
ls -d1 -- "${scriptfolder}${plugins_dir}${captured_handshakes_dir}"* 2>/dev/null | rev | awk -F'/' '{print $1}' | rev | sort >> "${tmpdir}ag.captured_handshakes.txt"
ls -d1 -- "${captured_handshakes_dir}"* 2>/dev/null | rev | awk -F'/' '{print $1}' | rev | sort >> "${tmpdir}ag.captured_handshakes.txt"
local i=0
while IFS=, read -r exp_handshake; do

Expand All @@ -69,7 +73,7 @@ function list_captured_handshakes_files() {

if [[ -n "${essid}" ]] && [[ -n "${bssid}" ]]; then
if ! echo "${exp_handshake}" | grep -q "${manual_handshakes_text}"; then
if cat "${scriptfolder}${plugins_dir}${captured_handshakes_dir}${exp_handshake}" | grep -Fq "${essid}" > /dev/null 2>&1 || echo "${exp_handshake}" | grep -q "${bssid}"; then
if cat "${captured_handshakes_dir}${exp_handshake}" | grep -Fq "${essid}" > /dev/null 2>&1 || echo "${exp_handshake}" | grep -q "${bssid}"; then
likely_tip="1"
handshake_color="${yellow_color}"
likely="*"
Expand All @@ -90,7 +94,7 @@ function list_captured_handshakes_files() {
if ! cat "${tmpdir}ag.captured_handshakes.txt" | grep -Exvq "${manual_handshakes_text}$"; then
language_strings "${language}" "captured_handshakes_text_3" "yellow"
language_strings "${language}" "captured_handshakes_text_4" "yellow"
echo_brown "${scriptfolder}${plugins_dir}${captured_handshakes_dir}HANDSHAKES.cap"
echo_brown "${captured_handshakes_dir}HANDSHAKES.cap"
fi
read -rp "> " selected_captured_handshake
if [[ ! "${selected_captured_handshake}" =~ ^[[:digit:]]+$ ]] || [[ "${selected_captured_handshake}" -gt "${i}" ]] || [[ "${selected_captured_handshake}" -lt 1 ]]; then
Expand All @@ -106,7 +110,7 @@ function list_captured_handshakes_files() {
unset enteredpath
unset handshakepath
else
captured_handshake="${scriptfolder}${plugins_dir}${captured_handshakes_dir}$(sed -n "${selected_captured_handshake}"p "${tmpdir}ag.captured_handshakes.txt")"
captured_handshake="${captured_handshakes_dir}$(sed -n "${selected_captured_handshake}"p "${tmpdir}ag.captured_handshakes.txt")"
et_handshake="${captured_handshake}"
enteredpath="${captured_handshake}"
rm "${tmpdir}ag.captured_handshakes.txt"
Expand Down Expand Up @@ -160,7 +164,7 @@ function set_custom_default_save_path() {
if [ "${is_docker}" -eq 1 ]; then
default_save_path="${docker_io_dir}"
else
default_save_path="${scriptfolder}${plugins_dir}${captured_handshakes_dir}"
default_save_path="${captured_handshakes_dir}"
fi
}

Expand Down
31 changes: 23 additions & 8 deletions custom_portals.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Custom-Portals airgeddon plugin

# Version: 0.0.4
# Version: 0.1.0
# Author: KeyofBlueS
# Repository: https://github.com/KeyofBlueS/airgeddon-plugins
# License: GNU General Public License v3.0, https://opensource.org/licenses/GPL-3.0
Expand All @@ -22,21 +22,31 @@ plugin_minimum_ag_affected_version="10.20"
plugin_maximum_ag_affected_version=""
plugin_distros_supported=("*")

################################# USER CONFIG SECTION #################################

# Put Your custom captive portal files in plugins/custom_portals/PORTAL_FOLDER/PORTAL_FILES
# Put Your custom captive portal files in a directory of Your choice
# Default is plugins/custom_portals/PORTAL_FOLDER/PORTAL_FILES
# Example:
custom_portals_dir="${scriptfolder}${plugins_dir}custom_portals/"
# You can have multiple PORTAL_FOLDER, then choose one of them inside airgeddon itself.
# Including ESSID_HERE in the body of Your custom index file, will be replaced with the
# essid of the target network.
# Including TITLE_HERE in the body of Your custom index file, will be replaced with the
# title in the chosen language. It's recommended to not customize title as, in my
# experience, this will prevent clients to correctly detect a captive portal, so please
# consider to use TITLE_HERE in order to set the default one, unless You know what You
# are doing.
# Take a look at custom_portals/OpenWRT_EXAMPLE for a custom captive portal example.

custom_portals_dir="custom_portals/"
############################## END OF USER CONFIG SECTION ##############################

#Copy custom captive portal files.
function custom_portals_override_set_captive_portal_page() {

debug_print

if [[ "${copy_custom_portal}" -eq "1" ]]; then
cp "${scriptfolder}${plugins_dir}${custom_portals_dir}${custom_portal}/"* "${tmpdir}${webdir}"
cp "${custom_portals_dir}${custom_portal}/"* "${tmpdir}${webdir}"
unset copy_custom_portal
fi

Expand Down Expand Up @@ -145,8 +155,13 @@ function custom_portals_override_set_captive_portal_page() {
echo -e "echo '</html>'"
echo -e "exit 0"
} >> "${tmpdir}${webdir}${indexfile}"
elif cat "${tmpdir}${webdir}${indexfile}" | grep -q "ESSID_HERE"; then
sed -i "s/ESSID_HERE/${essid//[\`\']/}/g" "${tmpdir}${webdir}${indexfile}"
else
if cat "${tmpdir}${webdir}${indexfile}" | grep -q "ESSID_HERE"; then
sed -i "s/ESSID_HERE/${essid//[\`\']/}/g" "${tmpdir}${webdir}${indexfile}"
fi
if cat "${tmpdir}${webdir}${indexfile}" | grep -q "TITLE_HERE"; then
sed -i "s/TITLE_HERE/${et_misc_texts[${captive_portal_language},15]}/g" "${tmpdir}${webdir}${indexfile}"
fi
fi

exec 4>"${tmpdir}${webdir}${checkfile}"
Expand Down Expand Up @@ -263,7 +278,7 @@ function custom_portals_prehook_set_captive_portal_language() {
print_simple_separator

echo "${standard_portal_text}" > "${tmpdir}ag.custom_portals.txt"
ls -d1 -- "${scriptfolder}${plugins_dir}${custom_portals_dir}"*/ 2>/dev/null | rev | awk -F'/' '{print $2}' | rev | sort >> "${tmpdir}ag.custom_portals.txt"
ls -d1 -- "${custom_portals_dir}"*/ 2>/dev/null | rev | awk -F'/' '{print $2}' | rev | sort >> "${tmpdir}ag.custom_portals.txt"
local i=0
while IFS=, read -r exp_folder; do

Expand All @@ -284,7 +299,7 @@ function custom_portals_prehook_set_captive_portal_language() {
if ! cat "${tmpdir}ag.custom_portals.txt" | grep -Exvq "${standard_portal_text}$"; then
language_strings "${language}" "custom_portals_text_2" "yellow"
language_strings "${language}" "custom_portals_text_3" "yellow"
echo_brown "${scriptfolder}${plugins_dir}${custom_portals_dir}PORTAL_FOLDER/PORTAL_FILES"
echo_brown "${custom_portals_dir}PORTAL_FOLDER/PORTAL_FILES"
fi
read -rp "> " selected_custom_portal
if [[ ! "${selected_custom_portal}" =~ ^[[:digit:]]+$ ]] || [[ "${selected_custom_portal}" -gt "${i}" ]] || [[ "${selected_custom_portal}" -lt 1 ]]; then
Expand Down
2 changes: 1 addition & 1 deletion custom_portals/OpenWRT_EXAMPLE/index.htm
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
echo '<html>'
echo -e '<head>'
echo -e ' <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>'
echo -e ' <title>Internet Portal</title>'
echo -e ' <title>TITLE_HERE</title>'
echo -e ' <link rel="stylesheet" type="text/css" href="portal.css"/>'
echo -e ' <script type="text/javascript" src="portal.js"></script>'
echo -e '</head>'
Expand Down
14 changes: 10 additions & 4 deletions regdomain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Regdomain airgeddon plugin

# Version: 0.0.2
# Version: 0.1.0
# Author: KeyofBlueS
# Repository: https://github.com/KeyofBlueS/airgeddon-plugins
# License: GNU General Public License v3.0, https://opensource.org/licenses/GPL-3.0
Expand All @@ -22,11 +22,16 @@ plugin_minimum_ag_affected_version="10.20"
plugin_maximum_ag_affected_version=""
plugin_distros_supported=("*")

#You can check the country codes database i.e. here https://git.kernel.org/pub/scm/linux/kernel/git/sforshee/wireless-regdb.git/tree/db.txt
#Set the country code
#Example:
################################# USER CONFIG SECTION #################################

# You can check the country codes database i.e. here:
# https://git.kernel.org/pub/scm/linux/kernel/git/sforshee/wireless-regdb.git/tree/db.txt
# Set the country code
# Example:
regulatory_domain=BZ

############################## END OF USER CONFIG SECTION ##############################

#Custom function to set regulatory domain
function set_regulatory_domain() {

Expand Down Expand Up @@ -65,6 +70,7 @@ function set_regulatory_domain() {
fi
language_strings "${language}" "regdomain_text_2" "yellow"
echo_yellow "${current_regulatory_domain}"
echo
}

#Prehook to set regulatory domain when setting interface in monitor mode
Expand Down
8 changes: 6 additions & 2 deletions sort_targets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Sort-Targets airgeddon plugin

# Version: 0.0.2
# Version: 0.1.0
# Author: KeyofBlueS
# Repository: https://github.com/KeyofBlueS/airgeddon-plugins
# License: GNU General Public License v3.0, https://opensource.org/licenses/GPL-3.0
Expand All @@ -22,11 +22,13 @@ plugin_minimum_ag_affected_version="10.20"
plugin_maximum_ag_affected_version=""
plugin_distros_supported=("*")

################################# USER CONFIG SECTION #################################

# When selecting targets, sort them by one of the following value:
# "bssid", "channel", "power", "essid", "encryption", "default"
# or:
# "menu"
# if You want to choose sorting within a menu, this override reverse option.
# if You want to choose sorting within a menu, this override reverse option too.
# Example:
#sort_by="power"
sort_by=menu
Expand All @@ -40,6 +42,8 @@ reverse=false
# Example:
remember_sort=false

############################## END OF USER CONFIG SECTION ##############################

#Sort targets
function sort_targets_prehook_select_target() {

Expand Down
44 changes: 35 additions & 9 deletions ui_boost.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# UI-Boost airgeddon plugin

# Version: 0.1.8
# Version: 0.1.9
# Author: KeyofBlueS
# Repository: https://github.com/KeyofBlueS/airgeddon-plugins
# License: GNU General Public License v3.0, https://opensource.org/licenses/GPL-3.0
Expand All @@ -13,7 +13,7 @@
#shellcheck disable=SC2034,SC2154

plugin_name="UI-Boost"
plugin_description="Speed up user interface by making a specifc language strings file"
plugin_description="Make a specifc language strings file instead of using the complete one, speeding up ui and lowering ram usage"
plugin_author="KeyofBlueS"

plugin_enabled=1
Expand All @@ -22,14 +22,24 @@ plugin_minimum_ag_affected_version="10.0"
plugin_maximum_ag_affected_version=""
plugin_distros_supported=("*")

#Enabled 1 / Disabled 0 - Use hardcoded language menu strings when in language_menu - Default value 0
#Enabling it it's a faster but a less reilable approach than using
#original language_strings_file, in case of changes in this last.
################################# USER CONFIG SECTION #################################

# The advantages of using this plugin are a more reactive ui (not needed in
# airgeddon >=10.20), and a lower ram usage, useful in devices with limited ram
# memory e.g smartphones, tablets ecc...

# Enabled 1 / Disabled 0 - Use hardcoded language menu strings when in language_menu - Default value 0
# Enabling it it's a faster but a less reilable approach than using
# original language_strings_file, in case of changes in this last.
hardcoded_language_menu_strings=0

############################## END OF USER CONFIG SECTION ##############################

#Custom function to make specifc language strings file
function make_specifc_language_strings() {

debug_print

# detect languages to be excluded
if [ -n "${languages_to_exclude}" ]; then
unset languages_to_exclude
Expand Down Expand Up @@ -58,6 +68,8 @@ function make_specifc_language_strings() {
#Custom function to check if specifc language strings file exist and it's coherence
function check_specifc_language_strings() {

debug_print

language_to_make="${1}"
if [ -e "${scriptfolder}${language_strings_file_complete%.*}"_"${language_to_make}".sh ]; then
source "${scriptfolder}${language_strings_file_complete%.*}"_"${language_to_make}".sh
Expand All @@ -78,6 +90,8 @@ function check_specifc_language_strings() {
#Posthook to store some variables
function ui_boost_posthook_remap_colors() {

debug_print

# store current language
language_current="${language}"
# store language_strings_file
Expand All @@ -88,15 +102,19 @@ function ui_boost_posthook_remap_colors() {
#Prehook to let user change language in captive portal page
function ui_boost_prehook_set_captive_portal_page() {

if [ "${captive_portal_language}" != "${language}" ]; then
check_specifc_language_strings "${captive_portal_language}"
#source "${scriptfolder}${language_strings_file_complete}"
fi
debug_print

if [ "${captive_portal_language}" != "${language}" ]; then
check_specifc_language_strings "${captive_portal_language}"
#source "${scriptfolder}${language_strings_file_complete}"
fi
}

#Posthook to let user change language in captive portal page
function ui_boost_posthook_set_captive_portal_page() {

debug_print

if [ "${captive_portal_language}" != "${language}" ]; then
check_specifc_language_strings "${language}"
fi
Expand All @@ -105,6 +123,8 @@ function ui_boost_posthook_set_captive_portal_page() {
#Prehook to let user change language in options menu
function ui_boost_prehook_language_menu() {

debug_print

if [ "${hardcoded_language_menu_strings}" -eq "1" ]; then
#hardcoded language_menu strings
declare -gA arr
Expand Down Expand Up @@ -155,6 +175,8 @@ function ui_boost_prehook_language_menu() {
#Posthook to let user change language in options menu
function ui_boost_posthook_language_menu() {

debug_print

check_specifc_language_strings "${language}"
}

Expand All @@ -164,6 +186,8 @@ function ui_boost_posthook_language_menu() {
#strings here, in case of changes in the original language_strings_file.
function ui_boost_prehook_capture_traps() {

debug_print

if [ "${current_menu}" = "language_menu" ]; then
source "${scriptfolder}${language_strings_file_complete}"
fi
Expand All @@ -172,6 +196,8 @@ function ui_boost_prehook_capture_traps() {
#Posthook to restore specifc language strings if user choose to not terminate the script anymore
function ui_boost_posthook_capture_traps() {

debug_print

if [ "${current_menu}" = "language_menu" ]; then
check_specifc_language_strings "${language}"
fi
Expand Down

0 comments on commit 99702dc

Please sign in to comment.