From ea1824b5cad2a3d4230bce3d9a2329a28cd58d84 Mon Sep 17 00:00:00 2001 From: Matias Barcenas Date: Thu, 17 Aug 2017 17:37:44 -0500 Subject: [PATCH] Started implementing airmon-ng independence. --- lib/InterfaceUtils.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 lib/InterfaceUtils.sh diff --git a/lib/InterfaceUtils.sh b/lib/InterfaceUtils.sh new file mode 100644 index 0000000..3b1ddfc --- /dev/null +++ b/lib/InterfaceUtils.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +# The methods used in this script are taken from airmon-ng. +# This is all thanks for the airmon-ng authors, thanks guys. + +function interface_list_all() { + InterfaceListAll=($(ls -1 /sys/class/net)) +} + +function interface_list_wireless() { + InterfaceListWireless=() + interface_list_all + local __interface_list_wireless__candidate + for __interface_list_wireless__candidate in "${InterfaceListAll[@]}"; do + if grep -q "DEVTYPE=wlan" /sys/class/net/$__interface_list_wireless__candidate/uevent 2> /dev/null + then InterfaceListWireless+=("$__interface_list_wireless__candidate") + fi + done +}