├── version.txt ├── _config.yml ├── images ├── anon1.png ├── anon2.png ├── logo1.png ├── logo2.png ├── ovpn.png ├── sniff.png ├── chkdep.png ├── macman.png ├── malware.gif ├── traffic.png ├── anon_nord.gif ├── ip_abuse.png ├── malware_no.png ├── public_ip.png ├── speed_test.png ├── banner_menu.png ├── malware_yes.png ├── banner_menu_0.6.9.png └── banner_menu_0.7.1.png ├── scripts ├── hackutils ├── conky │ ├── internet_test.sh │ ├── Conky.desktop │ └── .conkyrc ├── installer.sh ├── htbMkt.sh ├── fkap.sh ├── bl.sh ├── dwa.sh └── hack_utils.sh ├── README.md └── LICENSE /version.txt: -------------------------------------------------------------------------------- 1 | 0.7.3 2 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-hacker -------------------------------------------------------------------------------- /images/anon1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/b4shnhawx/Hack-Utils/HEAD/images/anon1.png -------------------------------------------------------------------------------- /images/anon2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/b4shnhawx/Hack-Utils/HEAD/images/anon2.png -------------------------------------------------------------------------------- /images/logo1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/b4shnhawx/Hack-Utils/HEAD/images/logo1.png -------------------------------------------------------------------------------- /images/logo2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/b4shnhawx/Hack-Utils/HEAD/images/logo2.png -------------------------------------------------------------------------------- /images/ovpn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/b4shnhawx/Hack-Utils/HEAD/images/ovpn.png -------------------------------------------------------------------------------- /images/sniff.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/b4shnhawx/Hack-Utils/HEAD/images/sniff.png -------------------------------------------------------------------------------- /images/chkdep.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/b4shnhawx/Hack-Utils/HEAD/images/chkdep.png -------------------------------------------------------------------------------- /images/macman.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/b4shnhawx/Hack-Utils/HEAD/images/macman.png -------------------------------------------------------------------------------- /images/malware.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/b4shnhawx/Hack-Utils/HEAD/images/malware.gif -------------------------------------------------------------------------------- /images/traffic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/b4shnhawx/Hack-Utils/HEAD/images/traffic.png -------------------------------------------------------------------------------- /scripts/hackutils: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | bash /etc/hackutils/hack_utils.sh 2> /dev/null 4 | -------------------------------------------------------------------------------- /images/anon_nord.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/b4shnhawx/Hack-Utils/HEAD/images/anon_nord.gif -------------------------------------------------------------------------------- /images/ip_abuse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/b4shnhawx/Hack-Utils/HEAD/images/ip_abuse.png -------------------------------------------------------------------------------- /images/malware_no.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/b4shnhawx/Hack-Utils/HEAD/images/malware_no.png -------------------------------------------------------------------------------- /images/public_ip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/b4shnhawx/Hack-Utils/HEAD/images/public_ip.png -------------------------------------------------------------------------------- /images/speed_test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/b4shnhawx/Hack-Utils/HEAD/images/speed_test.png -------------------------------------------------------------------------------- /images/banner_menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/b4shnhawx/Hack-Utils/HEAD/images/banner_menu.png -------------------------------------------------------------------------------- /images/malware_yes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/b4shnhawx/Hack-Utils/HEAD/images/malware_yes.png -------------------------------------------------------------------------------- /images/banner_menu_0.6.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/b4shnhawx/Hack-Utils/HEAD/images/banner_menu_0.6.9.png -------------------------------------------------------------------------------- /images/banner_menu_0.7.1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/b4shnhawx/Hack-Utils/HEAD/images/banner_menu_0.7.1.png -------------------------------------------------------------------------------- /scripts/conky/internet_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | output=`ping -W 1 -c 1 8.8.8.8 | grep -o "1 received"` 4 | 5 | if [[ $output == "1 received" ]]; 6 | then 7 | echo -e "Connected" 8 | else 9 | echo -e "Disconnected" 10 | fi 11 | -------------------------------------------------------------------------------- /scripts/conky/Conky.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Encoding=UTF-8 3 | Version=0.9.4 4 | Type=Application 5 | Name=Conky 6 | Comment= 7 | StartupNotify=false 8 | Terminal=false 9 | Exec=conky --quiet --config=$HOME/.conkyrc --daemonize --pause=5 10 | -------------------------------------------------------------------------------- /scripts/installer.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd 4 | sudo mkdir /etc/hackutils/ 5 | cat < $HOME/Hack-Utils/scripts/hack_utils.conf 6 | OVPN_DIR=$HOME/.secret/ovpns/ 7 | HTB_DIR=$HOME/HTB/ 8 | TMP_DIR=/tmp/hackutils/ 9 | CONKY_DIR=$HOME/.config/autostart/ 10 | CONKYRC_DIR=$HOME/ 11 | SCRIPTS_DIR=$HOME/Scripts/ 12 | HTTP_DIR=/var/www/ 13 | HTB_OVPN_NAME=YOUR_HTB_NAME.ovpn 14 | EOF 15 | sudo cp Hack-Utils/scripts/hack_utils.conf /etc/hackutils/ 16 | 17 | sudo cp -r Hack-Utils/scripts/* /etc/hackutils/ 18 | sudo cp Hack-Utils/scripts/hackutils /bin/ 19 | 20 | sudo chmod 700 /bin/hackutils 21 | sudo chmod +x /bin/hackutils 22 | 23 | cd 24 | rm -rf Hack-Utils/ 25 | cd 26 | -------------------------------------------------------------------------------- /scripts/htbMkt.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | dir=`pwd` 4 | 5 | mkdir {"$dir/nmap","$dir/content","$dir/exploits","$dir/scripts","$dir/tmp"} 6 | 7 | #### CHEATSHEET NMAP 8 | cat < "$dir/nmap/cheatsheet_nmap.txt" 9 | CHEATSHEET FOR NMAP 10 | --------------------------------------------- 11 | 12 | namp -p- --open -T5 -v -n %IP% -oG %archivo.txt% 13 | 14 | -p- --> Todos los puertos 15 | --open --> Solo open, no filtered 16 | -T5 --> Modo rapido y agresivo 17 | -v --> verbose, mas info 18 | -n --> No aplique resolucion dns ya que tarda mas 19 | -oG --> Formato grepeable 20 | 21 | --------------------------------------------- 22 | 23 | nmap -sC -sV -p%puerto1,puerto2% %IP% -oN %archivo.txt% 24 | 25 | -sC --> Scripts por defecto de enumeracion 26 | -sV --> Mostrar los servicios corriendo en el puerto 27 | -p --> Los puertos 28 | -oN --> Formato de nmap 29 | 30 | --------------------------------------------- 31 | 32 | locate http-enum 33 | nmap --script http-enum -p80 %IP% -oN webScan 34 | 35 | http-enum --> Fuzzer web para mostrar posibles directorios y recursos en una web. Funciona como whatweb. 36 | 37 | --------------------------------------------- 38 | 39 | EOF 40 | 41 | #### CHEATSHEET 42 | cat < "$dir/cheatsheet.txt" 43 | CHEATSHEET FOR OTHER MIERDAS 44 | --------------------------------------------- 45 | 46 | ping -c %numero_de_paquetes% %IP% -R --> Traceroute guay 47 | 48 | --------------------------------------------- 49 | TTLs: 50 | 64 *nix 51 | 128 Win 52 | 254 Solaris/AIX 53 | 54 | 55 | --------------------------------------------- 56 | 57 | echo "cadena" | base64 --> Codifica a base64 58 | echo "cadena" | base64 -d --> Decodifica base64 59 | 60 | echo "cadena" | xxd --> Codifica a hexadecimal 61 | 62 | EOF 63 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Hack_Utils 2 | 3 |

4 | 5 |

6 | 7 | ## Description 8 | This tool was thought to allow us to manage several programs or third party tools from the same interface in a fast and intuitive way. 9 | 10 | To install the script: 11 | ``` 12 | cd ~ 13 | git clone https://github.com/davidahid/Hack-Utils 14 | cd Hack-Utils/scripts/ 15 | bash installer.sh 16 | ``` 17 | 18 | To use netutils you must run it as root. 19 | ``` 20 | sudo hackutils 21 | ``` 22 | 23 | ## Top tools 24 | 25 | * First of all, you can download all the necessary programs with the ***chckdep*** option (except a couple of programs that must be installed manually). 26 | ![chckdep](https://github.com/davidahid/Hack-Utils/blob/master/images/chkdep.png) 27 | 28 | * We can use the ***anon*** option to anonymize ourselves usin anonsurf to connect to the TOR network, change our MAC or connect to NordVPN servers (account licensed required in NordVPN). 29 | ![anon](https://github.com/davidahid/Hack-Utils/blob/master/images/anon_nord.gif) 30 | 31 | * With the ***malware*** option we can check with the hash of a virus if it is malicious or not and how is acting. 32 | ![malware](https://github.com/davidahid/Hack-Utils/blob/master/images/malware.gif) 33 | 34 | * We can manage various ovpn profiles to connect us to different OpenVPN servers with ***ovpn*** (in this case I only have one profile) 35 | ![ovpn](https://github.com/davidahid/Hack-Utils/blob/master/images/ovpn.png) 36 | 37 | * Never get information about your own IP was so easy!! 38 | ![7](https://github.com/davidahid/Hack-Utils/blob/master/images/public_ip.png) 39 | 40 | * Sniff packets in the terminal an apply filters to sniff only what you want to sniff. 41 | ![sniff](https://github.com/davidahid/Hack-Utils/blob/master/images/sniff.png) 42 | 43 | * I personally love this option - check out the broadband speed provided by our ISP! ( Only 30 Mbps? I thought I had 100 Mbps contracted :/ ) 44 | ![16](https://github.com/davidahid/Hack-Utils/blob/master/images/speed_test.png) 45 | -------------------------------------------------------------------------------- /scripts/conky/.conkyrc: -------------------------------------------------------------------------------- 1 | conky.config = { 2 | use_spacer = 'left', 3 | pad_percents = 3, 4 | background = false, 5 | double_buffer = true, 6 | font = 'DejaVu Sans Mono:size=10', 7 | use_xft = true, 8 | alignment = 'top_right', 9 | gap_x = 10, 10 | gap_y = 40, 11 | own_window_argb_visual = true, 12 | own_window_argb_value = 0, 13 | own_window_type = 'normal', 14 | own_window_hints = 'undecorated,below,skip_taskbar,skip_pager,sticky', 15 | own_window = true, 16 | maximum_width = 800, 17 | minimum_size = 800, 18 | update_interval = 5.0, 19 | } 20 | 21 | conky.text = [[ 22 | ${color red}${exec command cat /etc/os-release | grep ^"NAME=" | cut -f2 -d "=" | tr -d '"' | tr [a-z] [A-Z]} ${exec command cat /etc/os-release | grep ^"VERSION=" | cut -f2 -d "=" | tr -d '"'}${color} 23 | 24 | ${hr} 25 | ${color cyan}Hostname: ${color}${nodename} 26 | ${color cyan}Kernel: ${color}${sysname} ${kernel} on ${machine} 27 | ${color cyan}Uptime: ${color}${uptime} 28 | ${exec /usr/lib/update-notifier/apt-check --human-readable} 29 | ${hr} 30 | ${color cyan}CPU:${color} ${freq_g} GHz 31 | ${color cyan}Total usage:${color} ${cpu cpu0}% ${cpubar cpu0} 32 | #${color cyan}Core 1:${color} ${cpu cpu1}% ${cpubar cpu1} 33 | #${color cyan}Core 2:${color} ${cpu cpu2}% ${cpubar cpu2} 34 | #${color cyan}Core 3:${color} ${cpu cpu3}% ${cpubar cpu3} 35 | #${color cyan}Core 3:${color} ${cpu cpu4}% ${cpubar cpu4} 36 | #${color cyan}Core 3:${color} ${cpu cpu5}% ${cpubar cpu5} 37 | #${color cyan}Core 3:${color} ${cpu cpu6}% ${cpubar cpu6} 38 | #${color cyan}Core 3:${color} ${cpu cpu7}% ${cpubar cpu7} 39 | #${color cyan}Core 3:${color} ${cpu cpu8}% ${cpubar cpu8} 40 | ${cpugraph} 41 | ${color cyan}Name PID CPU% MEM% 42 | ${color lightgrey} ${top name 1} ${top pid 1} ${top cpu 1} ${top mem 1} 43 | ${color lightgrey} ${top name 2} ${top pid 2} ${top cpu 2} ${top mem 2} 44 | ${color lightgrey} ${top name 3} ${top pid 3} ${top cpu 3} ${top mem 3} 45 | ${color lightgrey} ${top name 4} ${top pid 4} ${top cpu 4} ${top mem 4} 46 | ${color lightgrey} ${top name 5} ${top pid 5} ${top cpu 5} ${top mem 5} 47 | ${color cyan}Load average: ${color}${loadavg} 48 | ${color cyan}Processes: ${color}${processes} \ 49 | ${color cyan}Running:${color} ${running_processes} 50 | ${hr} 51 | ${color cyan}RAM: ${color}${mem}/${memmax} 52 | ${memperc}% ${membar 4} 53 | ${color cyan}Swap: ${color}${swap}/${swapmax} 54 | ${swapperc}% ${swapbar 4} 55 | ${memgraph} 56 | ${hr} 57 | ${color cyan}/ ${color}${fs_used /}/${fs_size /} ${fs_bar 6 /} 58 | ${hr} 59 | ${if_existing /proc/net/route wlan0} 60 | ${color cyan}IP: ${color}${addr wlan0}${color cyan} External: ${color red}${exec command curl icanhazip.com}${color} 61 | ${color cyan}Up: ${color lightgreen}${upspeed wlan0} 62 | ${upspeedgraph} 63 | ${color cyan}Down: ${color orange}${downspeed wlan0} 64 | ${downspeedgraph}${color} 65 | ${else}${if_existing /proc/net/route eth0} 66 | ${color cyan}IP: ${color}${addr eth0}${color cyan} External: ${color red}${exec command curl icanhazip.com}${color} 67 | ${color cyan}Up: ${color lightgreen}${upspeed eth0} 68 | ${upspeedgraph} 69 | ${color cyan}Down: ${color orange}${downspeed eth0} 70 | ${downspeedgraph}${color} 71 | ${else} 72 | Network disconnected 73 | ${endif}${endif} 74 | ${color cyan}Internet ${color}${exec command bash /home/b4shnhawx/Scripts/internet_test.sh}${color} 75 | ${hr} 76 | ]] 77 | -------------------------------------------------------------------------------- /scripts/fkap.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ##---------------- FORMATING VARIABLES ------------- 4 | #Here are some variable for the text format. These variables uses escape sequences $ 5 | #In linux the escape sequences are \e, \033, \x1B 6 | BLINK="\e[5m" 7 | BOLD="\e[1m" 8 | UNDERLINED="\e[4m" 9 | INVERT="\e[7m" 10 | HIDE="\e[8m" 11 | 12 | BLACK="\e[30m" 13 | RED="\e[31m" 14 | GREEN="\e[32m" 15 | ORANGE="\e[33m" 16 | BLUE="\e[34m" 17 | PURPLE="\e[35m" 18 | CYAN="\e[36m" 19 | WHITE="\e[37m" 20 | 21 | DARKGREY="\e[1;30m" 22 | LIGHTRED="\e[1;31m" 23 | LIGHTGREEN="\e[1;32m" 24 | LIGHTYELLOW="\e[1;33m" 25 | LIGHTBLUE="\e[1;34m" 26 | LIGHTPURPLE="\e[1;35m" 27 | LIGHTCYAN="\e[1;36m" 28 | LIGHTWHITE="\e[1;37m" 29 | 30 | UNDERRED="\e[41m" 31 | UNDERGREEN="\e[42m" 32 | UNDERWHITE="\e[107m" 33 | UNDERGRAY="\e[47m" 34 | UNDERCYAN="\e[46m" 35 | UNDERYELLOW="\e[103m" 36 | 37 | #Obv we need a control sequence that closes the rest control sequences 38 | END="\e[0m" 39 | 40 | TAB="\t" 41 | 42 | 43 | 44 | ##---------------- VARIABLES ------------- 45 | interface=$1 46 | ip_address=$2 47 | ssid=$3 48 | passwd=$3 49 | interface_nat=$5 50 | network_ip=`echo $ip_address | rev | cut -f2-4 -d"." | rev` 51 | 52 | ##---------------- FUNCTIONS ---------------- 53 | 54 | 55 | ##---------------- SCRIPT ---------------- 56 | #trap programTerminated EXIT 57 | 58 | clear 59 | 60 | if [[ $interface != "wlan"* ]]; 61 | then 62 | echo -e $RED"Not a valid wlan interface selected"$END 63 | 64 | exit 1 65 | fi 66 | 67 | cp /etc/dnsmasq.conf /etc/dnsmasq.conf.bckp 68 | cp /etc/hostapd/hostapd.conf /etc/hostapd/hostapd.conf.bckp 69 | 70 | #Start the AP 71 | echo -e $LIGHTGREEN$BOLD"----------------------------------- START AP --------------------------------------"$END 72 | 73 | echo "" >> /etc/dnsmasq.conf 74 | echo "interface=$interface" >> /etc/dnsmasq.conf 75 | echo "dhcp-range=$network_ip.2,$network_ip.30,255.255.255.0,12h" >> /etc/dnsmasq.conf 76 | echo "dhcp-option=3,$ip_address" >> /etc/dnsmasq.conf 77 | echo "dhcp-option=6,$ip_address" >> /etc/dnsmasq.conf 78 | echo "server=8.8.8.8" >> /etc/dnsmasq.conf 79 | echo "log-queries" >> /etc/dnsmasq.conf 80 | echo "log-dhcp" >> /etc/dnsmasq.conf 81 | echo "listen-address=127.0.0.1" >> /etc/dnsmasq.conf 82 | 83 | echo "interface=$interface" >> /etc/hostapd/hostapd.conf 84 | echo "driver=nl80211" >> /etc/hostapd/hostapd.conf 85 | echo "ssid=$ssid" >> /etc/hostapd/hostapd.conf 86 | echo "hw_mode=g" >> /etc/hostapd/hostapd.conf 87 | echo "channel=8" >> /etc/hostapd/hostapd.conf 88 | echo "macaddr_acl=0" >> /etc/hostapd/hostapd.conf 89 | echo "ignore_broadcast_ssid=0" >> /etc/hostapd/hostapd.conf 90 | echo "auth_algs=1" >> /etc/hostapd/hostapd.conf 91 | 92 | 93 | if [[ -z $passwd ]]; 94 | then 95 | echo "wpa=2" >> /etc/hostapd/hostapd.conf 96 | echo "wpa_key_mgmt=WPA-PSK" >> /etc/hostapd/hostapd.conf 97 | echo "rsn_pairwise=TKIP" >> /etc/hostapd/hostapd.conf 98 | echo "wpa_passphrase=$passwd" >> /etc/hostapd/hostapd.conf 99 | fi 100 | 101 | #Set the APIP IP (like default gateway) 102 | ifconfig $interface $ip_address/24 103 | #Starts the DNS and DHCP server 104 | service dnsmasq restart 105 | #Permits to our device routing the networks 106 | sysctl net.ipv4.ip_forward=1 107 | #Add the route to know how to reach the network 108 | route add -net $network_ip.0 netmask 255.255.255.0 gw $ip_address 109 | #Interface for NATting (translate) the IP's between our wireless interface and the nat interface. 110 | #This allows to all devices connected to our wireless network to get access to internet thanks to 111 | #the nat interface. 112 | iptables -t nat -A POSTROUTING -o $interface_nat -j MASQUERADE 113 | #Permits communication for port 53 (default port for DNS) 114 | iptables -t filter -I INPUT -p udp -m conntrack --ctstate NEW -m udp --dport 53 -j ACCEPT 115 | #Permits all entry communications 116 | iptables -P INPUT ACCEPT 117 | #Sets the AP as the DNS for the wireless network we have created 118 | echo "nameserver $ip_address" >> /etc/resolv.conf 119 | #Initialises the AP. 120 | hostapd /etc/hostapd/hostapd.conf 121 | 122 | 123 | 124 | #Stop the AP: when pressed Ctrl + C 125 | echo -e $LIGHTRED$BOLD"----------------------------------- STOP AP --------------------------------------"$END 126 | #Deletes the firewall rules of the AP. 127 | iptables -D POSTROUTING -t nat -o $interface -j MASQUERADE 128 | iptables -D INPUT ACCEPT 129 | #Disable the routing between interfaces. 130 | sysctl net.ipv4.ip_forward=0 131 | #Stops the DHCP, DNS services and the AP. 132 | service dnsmasq stop 133 | service hostapd stop 134 | 135 | cp /etc/dnsmasq.conf.bckp /etc/dnsmasq.conf 136 | cp /etc/hostapd/hostapd.conf.bckp /etc/hostapd/hostapd.conf 137 | -------------------------------------------------------------------------------- /scripts/bl.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | #################################################################### 4 | # bl - BLACKLIST CHECK UNIX/LINUX UTILITY # 5 | # copyright: (c) 2014 Anders Aarvik # 6 | # author: Anders Aarvik (aarvik92@gmail.com) and contributors # 7 | # license: MIT licensed. See LICENSE # 8 | # description: I was just a bit tired of web interfaces # 9 | #################################################################### 10 | 11 | #---------------- FORMATING VARIABLES ------------- 12 | LIGHTYELLOW="\e[1;33m" 13 | BLACK="\e[30m" 14 | 15 | UNDERYELLOW="\e[103m" 16 | 17 | END="\e[0m" 18 | 19 | 20 | #---------------- VARIABLES ------------- 21 | #### blacklists - grabbed from https://hetrixtools.com/blacklist-check #### 22 | blacklists=" 23 | 0spam.fusionzero.com 24 | access.redhawk.org 25 | all.s5h.net 26 | all.spamrats.com 27 | aspews.ext.sorbs.net 28 | babl.rbl.webiron.net 29 | backscatter.spameatingmonkey.net 30 | b.barracudacentral.org 31 | bb.barracudacentral.org 32 | black.junkemailfilter.com 33 | bl.blocklist.de 34 | bl.drmx.org 35 | bl.konstant.no 36 | bl.mailspike.net 37 | bl.nosolicitado.org 38 | bl.nszones.com 39 | block.dnsbl.sorbs.net 40 | bl.rbl.scrolloutf1.com 41 | bl.scientificspam.net 42 | bl.score.senderscore.com 43 | bl.spamcop.net 44 | bl.spameatingmonkey.net 45 | bl.suomispam.net 46 | bsb.empty.us 47 | cart00ney.surriel.com 48 | cbl.abuseat.org 49 | cbl.anti-spam.org.cn 50 | cblless.anti-spam.org.cn 51 | cblplus.anti-spam.org.cn 52 | cdl.anti-spam.org.cn 53 | combined.rbl.msrbl.net 54 | db.wpbl.info 55 | dnsbl-1.uceprotect.net 56 | dnsbl-2.uceprotect.net 57 | dnsbl-3.uceprotect.net 58 | dnsbl.cobion.com 59 | dnsbl.dronebl.org 60 | dnsbl.justspam.org 61 | dnsbl.kempt.net 62 | dnsbl.net.ua 63 | dnsbl.rv-soft.info 64 | dnsbl.rymsho.ru 65 | dnsbl.sorbs.net 66 | dnsbl.spfbl.net 67 | dnsbl.tornevall.org 68 | dnsbl.zapbl.net 69 | dnsrbl.org 70 | dnsrbl.swinog.ch 71 | dul.dnsbl.sorbs.net 72 | dyna.spamrats.com 73 | dyn.nszones.com 74 | escalations.dnsbl.sorbs.net 75 | fnrbl.fast.net 76 | hostkarma.junkemailfilter.com 77 | http.dnsbl.sorbs.net 78 | images.rbl.msrbl.net 79 | invaluement 80 | ips.backscatterer.org 81 | ix.dnsbl.manitu.net 82 | l1.bbfh.ext.sorbs.net 83 | l2.bbfh.ext.sorbs.net 84 | l4.bbfh.ext.sorbs.net 85 | list.bbfh.org 86 | mail-abuse.blacklist.jippg.org 87 | misc.dnsbl.sorbs.net 88 | multi.surbl.org 89 | netscan.rbl.blockedservers.com 90 | new.spam.dnsbl.sorbs.net 91 | noptr.spamrats.com 92 | old.spam.dnsbl.sorbs.net 93 | pbl.spamhaus.org 94 | phishing.rbl.msrbl.net 95 | pofon.foobar.hu 96 | problems.dnsbl.sorbs.net 97 | proxies.dnsbl.sorbs.net 98 | psbl.surriel.com 99 | rbl2.triumf.ca 100 | rbl.abuse.ro 101 | rbl.blockedservers.com 102 | rbl.dns-servicios.com 103 | rbl.efnet.org 104 | rbl.efnetrbl.org 105 | rbl.interserver.net 106 | rbl.megarbl.net 107 | rbl.realtimeblacklist.com 108 | recent.spam.dnsbl.sorbs.net 109 | relays.dnsbl.sorbs.net 110 | rep.mailspike.net 111 | safe.dnsbl.sorbs.net 112 | sbl.spamhaus.org 113 | smtp.dnsbl.sorbs.net 114 | socks.dnsbl.sorbs.net 115 | spam.dnsbl.anonmails.de 116 | spam.dnsbl.sorbs.net 117 | spamlist.or.kr 118 | spam.pedantic.org 119 | spam.rbl.blockedservers.com 120 | spamrbl.imp.ch 121 | spam.rbl.msrbl.net 122 | spamsources.fabel.dk 123 | spam.spamrats.com 124 | srn.surgate.net 125 | stabl.rbl.webiron.net 126 | st.technovision.dk 127 | talosintelligence.com 128 | torexit.dan.me.uk 129 | truncate.gbudb.net 130 | ubl.unsubscore.com 131 | virus.rbl.msrbl.net 132 | web.dnsbl.sorbs.net 133 | web.rbl.msrbl.net 134 | xbl.spamhaus.org 135 | zen.spamhaus.org 136 | z.mailspike.net 137 | zombie.dnsbl.sorbs.net 138 | " 139 | 140 | #---------------- FUNCTIONS ---------------- 141 | #### main #### 142 | main() { 143 | 144 | trap ctrl_c INT 145 | 146 | [ $# -ne 1 ] && error "Please specify a FQDN or IP as a parameter." 147 | 148 | fqdn=$(echo $1 | grep -P "(?=^.{5,254}$)(^(?:(?!\d+\.)[a-za-z0-9_\-]{1,63}\.?)+(?:[a-za-z]{2,})$)") 149 | 150 | if [[ $fqdn ]] ; then 151 | 152 | domain=$(host $1 | head -n1 | awk '{print $4}') 153 | 154 | reverseit $domain "IP not valid or domain could not be resolved." 155 | 156 | else 157 | reverseit $1 "IP not valid." 158 | 159 | fi 160 | 161 | loopthroughblacklists $1 162 | } 163 | 164 | #### trap ctrl-c and call ctrl_c() #### 165 | ctrl_c(){ 166 | echo "" 167 | echo "" 168 | echo "> Blacklist checker stoped <" 169 | 170 | exit 171 | } 172 | 173 | #### reverseit #### 174 | reverseit() { 175 | 176 | reverse=$(echo $1 | 177 | sed -ne "s~^\([0-9]\{1,3\}\)\.\([0-9]\{1,3\}\)\.\([0-9]\{1,3\}\)\.\([0-9]\{1,3\}\)$~\4.\3.\2.\1~p") 178 | 179 | if [ "x${reverse}" = "x" ] ; then 180 | 181 | error $2 182 | exit 1 183 | fi 184 | } 185 | 186 | #### loopthroughblacklists #### 187 | loopthroughblacklists() { 188 | 189 | reverse_dns=$(dig +short -x $1) 190 | 191 | echo -e $1 name $BLACK$UNDERYELLOW ${reverse_dns:----} $END 192 | 193 | for bl in ${blacklists} ; do 194 | 195 | printf $(env tz=utc date "+%y-%m-%d_%h:%m:%s_%z") 196 | printf "%-40s" " ${reverse}.${bl}." 197 | 198 | listed="$(dig +short -t a ${reverse}.${bl}.)" 199 | 200 | if [[ $listed ]]; then 201 | 202 | if [[ $listed == *"timed out"* ]]; then 203 | 204 | echo "[timed out]" | cecho YELLOW 205 | else 206 | 207 | echo "[blacklisted] (${listed})" | cecho LRED 208 | fi 209 | else 210 | 211 | echo "[not listed]" | cecho LGREEN 212 | fi 213 | done 214 | } 215 | 216 | #### error #### 217 | error() { 218 | 219 | echo $0 error: $1 >&2 220 | exit 2 221 | netutils 222 | } 223 | 224 | #### cecho #### 225 | cecho(){ 226 | LGREEN="\033[1;32m" 227 | LRED="\033[1;31m" 228 | YELLOW="\033[1;33m" 229 | NORMAL="\033[m" 230 | 231 | color=\$${1:-NORMAL} 232 | 233 | echo -ne "$(eval echo ${color})" 234 | cat 235 | 236 | echo -ne "${NORMAL}" 237 | } 238 | 239 | #---------------- SCRIPT ---------------- 240 | ### initiate script ### 241 | main $1 242 | -------------------------------------------------------------------------------- /scripts/dwa.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ##---------------- FORMATING VARIABLES ------------- 4 | #Here are some variable for the text format. These variables uses escape sequences $ 5 | #In linux the escape sequences are \e, \033, \x1B 6 | BLINK="\e[5m" 7 | BOLD="\e[1m" 8 | UNDERLINED="\e[4m" 9 | INVERT="\e[7m" 10 | HIDE="\e[8m" 11 | 12 | BLACK="\e[30m" 13 | RED="\e[31m" 14 | GREEN="\e[32m" 15 | ORANGE="\e[33m" 16 | BLUE="\e[34m" 17 | PURPLE="\e[35m" 18 | CYAN="\e[36m" 19 | WHITE="\e[37m" 20 | 21 | DARKGREY="\e[1;30m" 22 | LIGHTRED="\e[1;31m" 23 | LIGHTGREEN="\e[1;32m" 24 | LIGHTYELLOW="\e[1;33m" 25 | LIGHTBLUE="\e[1;34m" 26 | LIGHTPURPLE="\e[1;35m" 27 | LIGHTCYAN="\e[1;36m" 28 | LIGHTWHITE="\e[1;37m" 29 | 30 | UNDERRED="\e[41m" 31 | UNDERGREEN="\e[42m" 32 | UNDERWHITE="\e[107m" 33 | UNDERGRAY="\e[47m" 34 | UNDERCYAN="\e[46m" 35 | UNDERYELLOW="\e[103m" 36 | 37 | #Obv we need a control sequence that closes the rest control sequences 38 | END="\e[0m" 39 | 40 | TAB="\t" 41 | 42 | 43 | 44 | ##---------------- VARIABLES ------------- 45 | aircrackUpdate=1 46 | interface=$1 47 | wlan_interfaces_extracted=`iw dev | awk '$1=="Interface"{print $2}' | tr '\n' ' '` 48 | 49 | ##---------------- FUNCTIONS ---------------- 50 | programTerminated() 51 | { 52 | #Erases the control sequence ^C when Ctrl+C is pressed 53 | echo -ne "\\r \\n" 54 | 55 | echo "Exiting" 56 | echo "" 57 | 58 | #Stops the interface as monitoring 59 | airmon-ng stop $moninterface > /dev/null 60 | initFunction "Stoping $interface as monitoring interface..." "2" "0.05" 61 | 62 | #Deletes the sniffed packets 63 | rm /tmp/dwa_sniffed_packets* 2> /dev/null 64 | initFunction "Wiping temp files..." "2" "0.05" 65 | 66 | #Finished! 67 | echo "That's all! :)" 68 | } 69 | 70 | #Function for wait 12 seconds 71 | waitFunction() 72 | { 73 | #Hide the cursor to view the waiting bar without the backgorund color of the cursor 74 | tput civis 75 | 76 | #Bucle that repeats 3 times 77 | for count in [ 0..$aircrackUpdate ]; 78 | do 79 | #Print compatible with format (-e) and without new line (-n). 80 | #With the \\r (\r carriage return) we erase the first char of the line, 81 | #so we can write another character in the same line without the prev char. 82 | echo -ne "| \\r" 83 | sleep 0.25 84 | echo -ne "/ \\r" 85 | sleep 0.25 86 | echo -ne "- \\r" 87 | sleep 0.25 88 | echo -ne "\ \\r" 89 | sleep 0.25 90 | done 91 | 92 | #Show again the cursor. 93 | tput cvvis 94 | 95 | #Erase the last character of the waitFunction and then go to the next line 96 | echo -ne " \\r\n" 97 | } 98 | 99 | #Function to show processes with uppers alternatively 100 | initFunction() 101 | { 102 | #Assing each argument to a variable. 103 | string=$1 104 | repeats=$2 105 | wait=$3 106 | 107 | #Sets all upper letters to lower. 108 | string=`echo -ne "$string\\r" | tr [[:upper:]] [[:lower:]]` 109 | 110 | #Hide the cursor 111 | tput civis 112 | 113 | #Repeat this bucle so many times of the value of the variable repeats 114 | for ((repeat=0;repeat<$repeats;repeat++)) 115 | do 116 | #Sets the variable charNum to 0 (so we can enter to the next bucle) 117 | charNum=0 118 | 119 | #Count how many chars are in the variable string 120 | while (( charNum++ < ${#string} )) 121 | do 122 | #Sums une to the charNum variable and saves the result in the upperChars variable 123 | upperChars=`expr $charNum + 1` 124 | #The variable lowerChars will be the same as the variable charNum. 125 | lowerChars=`expr $charNum + 0` 126 | 127 | #So the result in the character five will be: 128 | #charNum: 5 129 | #upperChars: 6 130 | #lowerChars: 5 131 | 132 | 133 | #Repeat the point so many times as the value of the variables upperChars and lowerChars 134 | #The result for the previous example will be: 135 | #upperChars: 6 136 | #lowerChars: 5 137 | #positionUpper: ...... 138 | #positionLower: ..... 139 | positionUpper=`seq -s. $upperChars | tr -d '[:digit:]'` 140 | positionLower=`seq -s. $lowerChars | tr -d '[:digit:]'` 141 | 142 | #First, we pass the string to the first sed. This sed transform all dots in the variable to upper letters. 143 | #Each dot represents one character of the string. 144 | #For example, for the string "barbecue", continuing with the previously example... 145 | #positionUpper: ...... 146 | #string: BARBECue 147 | 148 | #Now we pass these string to the second sed. These sed do the same, but transforming the upper letters to 149 | #lower letters. 150 | #positionLower: ..... 151 | #string: barbeCue 152 | 153 | #Finally colors the string. 154 | echo -ne $LIGHTRED 155 | echo -ne "$string\\r" | sed -e 's/\('"$positionUpper"'\)/\U\1/' | sed -e 's/\('"$positionLower"'\)/\L\1/' 156 | echo -ne $END 157 | 158 | #Time that each character sets to upper 159 | sleep $wait 160 | done 161 | done 162 | 163 | #Color the final string and sets all the string to lower 164 | echo -ne $BLUE 165 | echo -ne "$string\\r" | sed -e 's/\(*\)/\L\1/' 166 | echo -ne $END 167 | echo "" 168 | 169 | #Show the cursor 170 | tput cvvis 171 | } 172 | 173 | ##---------------- SCRIPT ---------------- 174 | #trap programTerminated EXIT 175 | 176 | clear 177 | 178 | #if [[ "$wlan_interfaces_extracted" =~ .*"$interface".* ]]; 179 | #if grep -q "$interface" <<< "$wlan_interfaces_extracted"; 180 | if [[ $wlan_interfaces_extracted != *"$interface"* ]]; 181 | then 182 | echo -e $RED"Not a valid wlan interface selected"$END 183 | 184 | exit 1 185 | fi 186 | 187 | ## --- STEP 1 --- 188 | #Start the interface selected as monitoring interface. The output is discarded 189 | echo -e $CYAN$BOLD"1"$END") Setting the interface as monitor mode..." 190 | 191 | ip link set $interface down 192 | iwconfig $interface mode monitor 193 | ip link set $interface up 194 | 195 | if [[ $(iwconfig $interface | grep -o "Mode:Monitor") == "" ]]; 196 | then 197 | echo -e $RED"The interface could not be set in the monitoring mode properly"$END 198 | 199 | exit 1 200 | fi 201 | 202 | echo "" 203 | echo -e "New monitor interface -> " $CYAN$BOLD$BLINK$interface$END 204 | echo "" 205 | 206 | ## --- STEP 2 --- 207 | tmux select-pane -t 1 208 | 209 | tmux send-keys "airodump-ng --update $aircrackUpdate $interface" C-m 210 | 211 | tmux select-pane -t 0 212 | 213 | echo -e $CYAN$BOLD"2"$END") Type the MAC (BSSID) and the channel that appears in the new window of the router where you want to scan for hosts:" 214 | echo "" 215 | 216 | #Read the MAC that the user want to AUDIT 217 | echo -ne $BLINK" > "$END"BSSID: "$LIGHTYELLOW ; read bssid ; echo -ne "" $END 218 | 219 | check_bssid=`echo -ne "$bssid" | grep -E ^"[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}"$` 220 | 221 | #While the format of the MAC ingressed by the user doesnt match, enter the bucle to repeat the question 222 | while [[ "$bssid" != "$check_bssid" ]] || [[ "$bssid" == "" ]]; 223 | do 224 | #Asks again for a valid MAC 225 | echo -e "Enter a valid MAC address (BSSID). Example of the format: 0A:12:B0:34:3E:F2" 226 | echo "" 227 | echo -ne $BLINK" > "$END"BSSID: "$LIGHTYELLOW ; read bssid ; echo -ne "" $END 228 | 229 | #Re-save the format to identify one MAC address 230 | check_bssid=`echo -ne "$bssid" | grep -E ^"[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}"$` 231 | 232 | #If the pattern match and could be a valid MAC, exit the bucle. 233 | if [[ "$bssid" == "$check_bssid" ]] && [[ "$bssid" != "" ]]; 234 | then 235 | break 236 | fi 237 | done 238 | 239 | #Read the MAC that the user want to AUDIT 240 | echo -ne $BLINK"\b > "$END" CH: "$LIGHTYELLOW ; read channel ; echo -ne "" $END 241 | echo "" 242 | 243 | #While the channel is less than 1 and more than 14, or not contains nothing, enter the bucle to repeat the question 244 | while [[ $channel -lt 1 || $channel -gt 14 || -z $channel || `echo $channel | grep [a-Z]` ]]; 245 | do 246 | #Asks again for a valid channel 247 | echo -e "Enter a valid channel (CH). Remember that the Wi-Fi channels goes between by 1 to 14." 248 | echo "" 249 | echo -ne $BLINK" > "$END" CH: "$LIGHTYELLOW ; read channel ; echo -ne "" $END 250 | 251 | #If the channel goes between 1 and 14 and could be a valid channel, and contain something, exits the bucle. 252 | if [[ $channel -ge 1 && $channel -le 14 && -n $channel ]]; 253 | then 254 | break 255 | fi 256 | done 257 | 258 | echo "" 259 | echo -e "MAC of the target router -> " $CYAN$BOLD$BLINK$bssid$END 260 | echo -e "Channel of the target router -> " $CYAN$BOLD$BLINK$channel$END 261 | echo "" 262 | 263 | ## --- STEP 3 --- 264 | #Now stop de monitoring interface and discard the output. 265 | ip link set $interface down 266 | #Inmediatly, start another time the interface as monitoring but in the same channel that is the router tou audit. 267 | #If the interface is not in the same channel as the router, the interface cant inject packets properly 268 | iwconfig $interface mode Monitor $channel 269 | 270 | tmux select-pane -t 1 271 | 272 | tmux send-keys "qq" 273 | tmux send-keys "airodump-ng $interface --update $aircrackUpdate --bssid $bssid --channel $channel" C-m 274 | 275 | tmux select-pane -t 0 276 | 277 | echo -e $CYAN$BOLD"3"$END") Finally type the MAC of the device that you want to kick out of the wireless network." 278 | echo -e "Press "$LIGHTYELLOW"ENTER"$END" to inject deauth packets to de broadcast MAC ("$CYAN$BOLD"FF:FF:FF:FF:FF:FF"$END"). This affects to all hosts connected to the network." 279 | 280 | echo -ne $BLINK" > "$END"Victim MAC: "$LIGHTYELLOW ; read victimmac ; echo -ne "" $END 281 | echo "" 282 | 283 | #Saves the format to identify a MAC address 284 | checkVictimmac=`echo -ne "$victimmac" | grep -E ^"[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}"$` 285 | 286 | #If the variable is empty (user press enter)... 287 | if [[ $victimmac == "" ]]; 288 | then 289 | victimmac=`echo $victimmac | sed 's/^$/FF:FF:FF:FF:FF:FF/g'` 290 | echo -e $LIGHTRED"Target to kick out -> " $BLINK"All devices (FF:FF:FF:FF:FF:FF)"$END 291 | 292 | else 293 | ############### response checker ############### 294 | #While the format of the MAC ingressed by the user doesnt match, enter the bucle to repeat the question 295 | while [[ $victimmac != $checkVictimmac ]]; 296 | do 297 | #Asks again for a valid MAC 298 | echo "" 299 | echo -e "Enter a valid MAC address (STATION). Example of the format: 0A:12:B0:34:3E:F2" 300 | echo "" 301 | echo -ne $BLINK" > "$END"Victim MAC: "$LIGHTYELLOW ; read victimmac ; echo -ne "" $END 302 | echo "" 303 | 304 | #Re-save the format to identify one MAC address 305 | checkVictimmac=`echo -e "$victimmac" | grep -E ^"[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}"$` 306 | 307 | #If the pattern match and could be a valid MAC, exit the bucle. 308 | if [[ "$victimmac" == "$checkVictimmac" ]]; 309 | then 310 | break 311 | fi 312 | done 313 | 314 | #Print that the attack is going to be done against the specified MAC. 315 | echo -e $LIGHTRED"Target to kick out -> " $BLINK$victimmac$END 316 | fi 317 | 318 | echo "" 319 | initFunction "Initiating attack" "3" "0.1" 320 | echo -e " \\r" 321 | 322 | tmux detach-client 323 | 324 | tmux select-pane -t 1 325 | 326 | tmux send-keys "qq" 327 | tmux send-keys "aireplay-ng --deauth 0 -c $victimmac -a $bssid $interface" C-m 328 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /scripts/hack_utils.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #---------------- FORMATING VARIABLES ------------- 4 | #Here are some variable for the text format. These variables uses escape sequences $ 5 | #In linux the escape sequences are \e, \033, \x1B 6 | BLINK="\e[5m" 7 | BOLD="\e[1m" 8 | UNDERLINED="\e[4m" 9 | INVERT="\e[7m" 10 | HIDE="\e[8m" 11 | 12 | BLACK="\e[30m" 13 | RED="\e[31m" 14 | GREEN="\e[32m" 15 | ORANGE="\e[33m" 16 | BLUE="\e[34m" 17 | PURPLE="\e[35m" 18 | CYAN="\e[36m" 19 | WHITE="\e[37m" 20 | 21 | DARKGREY="\e[1;30m" 22 | LIGHTRED="\e[1;31m" 23 | LIGHTGREEN="\e[1;32m" 24 | LIGHTYELLOW="\e[1;33m" 25 | LIGHTBLUE="\e[1;34m" 26 | LIGHTPURPLE="\e[1;35m" 27 | LIGHTCYAN="\e[1;36m" 28 | LIGHTWHITE="\e[1;37m" 29 | 30 | UNDERRED="\e[41m" 31 | UNDERGREEN="\e[42m" 32 | UNDERWHITE="\e[107m" 33 | UNDERGRAY="\e[47m" 34 | UNDERCYAN="\e[46m" 35 | UNDERYELLOW="\e[103m" 36 | 37 | #Obv we need a control sequence that closes the rest control sequences 38 | END="\e[0m" 39 | 40 | TAB="\t" 41 | 42 | ##---------------- FIRST OF ALL ---------------- 43 | ## Read the config file. Create al directories located in the .conf file and save the directories and the configs in the specified array. 44 | ## ARRAY CONFIG: 45 | ## ${directories_array[0]} OVPN_DIR 46 | ## ${directories_array[1]} HTB_DIR 47 | ## ${directories_array[2]} TMP_DIR 48 | ## ${directories_array[3]} CONKY_DIR 49 | ## ${directories_array[4]} CONKYRC_DIR 50 | ## ${directories_array[5]} SCRIPTS_DIR 51 | ## ${directories_array[6]} HTTP_DIR 52 | ## ${configurations_array[0]} HTB_OVPN_NAME 53 | 54 | while IFS= read -r line 55 | do 56 | config=`echo $line | cut -f2 -d"="` 57 | 58 | if [[ $line == *"HOME"* && $line == *"DIR"* ]]; 59 | then 60 | home=`echo $HOME | rev` 61 | dir=`echo -n $config | cut -c6-100 | rev` 62 | dir=$dir$home 63 | dir=`echo $dir | rev` 64 | 65 | mkdir -p $dir 66 | 67 | directories_array=("${directories_array[@]}" $dir) 68 | 69 | elif [[ "$line" == *"DIR"* ]]; 70 | then 71 | dir=$config 72 | 73 | mkdir -p $dir 74 | 75 | directories_array=("${directories_array[@]}" $dir) 76 | else 77 | configurations_array=("${configurations_array[@]}" $config) 78 | fi 79 | done < /etc/hackutils/hack_utils.conf 80 | 81 | #---------------- VARIABLES ------------- 82 | #Version 83 | version="0.7.3" 84 | last_version=`curl -s https://raw.githubusercontent.com/b4shnhawx/Hack-Utils/master/version.txt` 85 | #All interfaces in used in the system 86 | interfaces_extracted=`ls -1 /sys/class/net` 87 | #All wlanX interfaces in used in the system 88 | wlan_interfaces_extracted=`iw dev | awk '$1=="Interface"{print $2}' | tr '\n' ' '` 89 | #All OVPNS profiles used in the system in one column 90 | ovpns_extracted=`ls --width=1 ${directories_array[0]} | tr '\n' " "` 91 | 92 | 93 | #Transforms the strings into arrays 94 | read -a ifaces_array <<< $interfaces_extracted 95 | read -a wlan_ifaces_array <<< $wlan_interfaces_extracted 96 | read -a ovpns_array <<< $ovpns_extracted 97 | 98 | 99 | programs_array=(rlwrap ping nmcli traceroute telnet iftop iptraf-ng nethogs slurm tcptrack vnstat bwm-ng bmon ifstat speedometer openvpn nmap tcpdump sipcalc nload speedtest-cli lynx elinks macchanger nordvpn anonsurf torctl bc teamviewer jq htbExplorer aircrack-ng tmux conky hostapd dnsmasq netcat) 100 | bandwith_interface_programs_array=(slurm iftop speedometer tcptrack ifstat vnstat nload bwm-ng) 101 | web_terminals_array=(cat elinks lynx) 102 | 103 | #Saves how many interfaces have the system 104 | number_of_interfaces=${#ifaces_array[@]} 105 | #Saves how many wlan interfaces have the system 106 | number_of_wlan_interfaces=${#wlan_ifaces_array[@]} 107 | #Saves how many ovpns profiles have the system 108 | number_of_ovpns=${#ovpns_array[@]} 109 | #Saves how many programs are used in this script 110 | number_of_programs=${#programs_array[@]} 111 | #Saves how many programs to monitor the traffic are used in this script 112 | number_of_bandwith_interface_program=${#bandwith_interface_programs_array[@]} 113 | number_of_web_terminals=${#web_terminals_array[@]} 114 | 115 | #---------------- FUNCTIONS ---------------- 116 | menu() 117 | { 118 | clear 119 | 120 | printf "\n"$RED$BOLD 121 | printf " . ╹┃\n" 122 | printf " #. . ┏━ ╻ ╻┏━┓┏━╸╻┏ ╻ ╻╺┳╸╻╻ ┏━┓ ╻╹\n" 123 | printf " .#|##|. .| ╹ ┣━┫┣━┫┃ ┣┻┓ ┃ ┃ ┃ ┃┃ ┗━┓ ┃╹\n" 124 | printf " .#|#####||.###. ┃╹ ╹ ╹╹ ╹┗━╸╹ ╹╺━╸┗━┛ ╹ ╹┗━╸┗━┛ ━┛ $GREEN v$version $RED\n" 125 | printf " ╹┃ by$PURPLE b4shnhawx $RED\n" 126 | printf "\n" 127 | printf "01111001 01101111 01110101 00100000 01100110 01101111 01110101 01101110 01100100 00100000 01101101 01111001 00100000\n" 128 | printf " 01100101 01100001 01110011 01110100 01100101 01110010 00100000 01100101 01100111 01100111 00100000 00111011 00101001\n" 129 | printf "\n"$END 130 | 131 | echo -e $CYAN$BOLD" >>> MISCELLANEOUS <<< "$END 132 | echo "" 133 | 134 | printf "$LIGHTYELLOW %9s$END%-0s %-29s$END$LIGHTYELLOW%9s$END%-0s %-0s$END " "chckdep" ")" "Check all the dependencies" "up" ")" "Update Hack_Utils"; echo -e "(Last git version:$BOLD$GREEN v$last_version$END)" 135 | printf "$LIGHTYELLOW %9s$END%-0s %-29s$END$LIGHTYELLOW%9s$END%-0s %-29s$END \n" "conf" ")" "Modify Hack_utils config file" "" "" "" 136 | printf "$LIGHTYELLOW %9s$END%-0s %-29s$END$LIGHTYELLOW%9s$END%-0s %-29s$END \n" "0" ")" "Exit" "conky" ")" "Setup conky desktop" 137 | echo "" 138 | 139 | echo -e $CYAN$BOLD" >>> BASICS <<< "$END 140 | echo "" 141 | 142 | printf "$LIGHTYELLOW %9s$END%-0s %-29s$END$LIGHTYELLOW%9s$END%-0s %-29s$END$LIGHTYELLOW%9s$END%-0s %-29s$END \n" "if" ")" "Interfaces info (ifconfig)" "wc" ")" "Connect to Wifi (nmcli)" 143 | printf "$LIGHTYELLOW %9s$END%-0s %-29s$END$LIGHTYELLOW%9s$END%-0s %-29s$END$LIGHTYELLOW%9s$END%-0s %-29s$END \n" "tv" ")" "Teamviewer" "" "" "" 144 | printf "$LIGHTYELLOW %9s$END%-0s %-29s$END$LIGHTYELLOW%9s$END%-0s %-29s$END$LIGHTYELLOW%9s$END%-0s %-29s$END \n" "1" ")" "Ping" "2" ")" "Try internet connection" "3" ")" "Traceroute" 145 | printf "$LIGHTYELLOW %9s$END%-0s %-29s$END$LIGHTYELLOW%9s$END%-0s %-29s$END$LIGHTYELLOW%9s$END%-0s %-29s$END \n" "4" ")" "Whois" "5" ")" "Hops to gateway" "6" ")" "ARP table" 146 | printf "$LIGHTYELLOW %9s$END%-0s %-29s$END$LIGHTYELLOW%9s$END%-0s %-29s$END$LIGHTYELLOW%9s$END%-0s %-29s$END \n" "7" ")" "Public IP" "8" ")" "Traffic monitoring (iptraf)" "9" ")" "Traffic monitoring ($number_of_bandwith_interface_program utilities)" 147 | printf "$LIGHTYELLOW %9s$END%-0s %-29s$END$LIGHTYELLOW%9s$END%-0s %-29s$END$LIGHTYELLOW%9s$END%-0s %-29s$END \n" "10" ")" "Check remote port status" "11" ")" "Ports in use" "12" ")" "Search port info (online)" 148 | printf "$LIGHTYELLOW %9s$END%-0s %-29s$END$LIGHTYELLOW%9s$END%-0s %-29s$END$LIGHTYELLOW%9s$END%-0s %-29s$END \n" "13" ")" "Firewall rules (iptables)" "14" ")" "Route table" "15" ")" "Check IP blacklist / abuse" 149 | printf "$LIGHTYELLOW %9s$END%-0s %-29s$END$LIGHTYELLOW%9s$END%-0s %-29s$END$LIGHTYELLOW%9s$END%-0s %-29s$END \n" "16" ")" "Internet speed test" "" "" "" "" "" "" 150 | echo "" 151 | 152 | echo -e $CYAN$BOLD" >>> ADVANCED <<< "$END 153 | echo "" 154 | 155 | printf "$LIGHTYELLOW %9s$END%-0s %-45s$END$LIGHTYELLOW%9s$END%-0s %-45s$END \n" "advif" ")" "Advanced interfaces info" "sniff" ")" "Sniff packets" 156 | printf "$LIGHTYELLOW %9s$END%-0s %-45s$END$LIGHTYELLOW%9s$END%-0s %-45s$END \n" "ovpn" ")" "Connect to a OVPN server" "anon" ")" "Anonymizer" 157 | printf "$RED %9s$END%-0s %-45s$END$LIGHTYELLOW%9s$END%-0s %-45s$END \n" "sshtun" ")" "SSH tunneling" "pping" ")" "Ping (personalized)" 158 | printf "$LIGHTYELLOW %9s$END%-0s %-45s$END$LIGHTYELLOW%9s$END%-0s %-45s$END \n" "macman" ")" "MAC manufacturer" "cliweb" ")" "Web in CLI (elinks)" 159 | printf "$LIGHTYELLOW %9s$END%-0s %-45s$END$LIGHTYELLOW%9s$END%-0s %-45s$END \n" "malware" ")" "Cyber threats search (Malware Bazaar API)" "conv" ")" "Hexadecimal / Base64 converter" 160 | printf "$LIGHTYELLOW %9s$END%-0s %-45s$END$LIGHTYELLOW%9s$END%-0s %-45s$END \n" "fkap" ")" "Fake Access Point: Evil twin" "dwa" ")" "Deauth Wireless Attack" 161 | printf "$LIGHTYELLOW %9s$END%-0s %-45s$END$LIGHTYELLOW%9s$END%-0s %-45s$END \n" "htb" ")" "Hack The Box" "rev" ")" "Listener for reverse shells connections" 162 | printf "$LIGHTYELLOW %9s$END%-0s %-45s$END$LIGHTYELLOW%9s$END%-0s %-45s$END \n" " " " " "" "http" ")" "Python simple HTTP server" 163 | echo "" 164 | 165 | echo "Use Ctrl+C any time to go back to menu. Type an option:" 166 | # echo -ne $BLINK" > "$END$LIGHTYELLOW ; read option ; echo -ne "" $END 167 | 168 | if [[ $(which rlwrap) == "" ]]; 169 | then 170 | echo -ne $BLINK" > "$END$LIGHTYELLOW ; read option ; echo -ne "" $END 171 | 172 | else 173 | options=(chckdep up conf 0 conky if wc tv 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 advif sniff ovpn anon sshtun pping macman cliweb malware conv fkap dwa htb rev http) 174 | 175 | echo -ne $LIGHTYELLOW 176 | option=$(rlwrap -D 0 -S ' > ' -i -f <(echo -ne "${options[@]}") -o cat) 177 | echo -ne $END 178 | 179 | fi 180 | # option=$(rlwrap -S ' > ' -i -f list.txt) 181 | # option=$(rlwrap -i -f <(echo -ne "$BLINK > ${ynm[@]}") -o cat) 182 | # option=$(rlwrap -i -f <(cat ${ynm[@]}) 183 | # option=$(rlwrap -f <(echo "${ynm[@]}") -o cat) 184 | 185 | # echo "" 186 | } 187 | 188 | #Function for wait 12 seconds 189 | waitFunction() 190 | { 191 | repeats=$1 192 | milisec=$2 193 | #Hide the cursor to view the waiting bar without the backgorund color of the cursor 194 | tput civis 195 | 196 | #Bucle that repeats 3 times 197 | for count in [ 0..$repeats ]; 198 | do 199 | #Print compatible with format (-e) and without new line (-n). 200 | #With the \\r (\r carriage return) we erase the first char of the line, 201 | #so we can write another character in the same line without the prev char. 202 | echo -ne $LIGHTYELLOW"| \\r"$END 203 | sleep $milisec 204 | echo -ne $LIGHTYELLOW"/ \\r"$END 205 | sleep $milisec 206 | echo -ne $LIGHTYELLOW"- \\r"$END 207 | sleep $milisec 208 | echo -ne $LIGHTYELLOW"\ \\r"$END 209 | sleep $milisec 210 | done 211 | 212 | #Show again the cursor. 213 | tput cvvis 214 | 215 | #Erase the last character of the waitFunction and then go to the next line 216 | echo -ne " \\r" 217 | } 218 | 219 | command_for_interfaces() 220 | { 221 | echo -e "Available interfaces:"$CYAN$BOLD ${ifaces_array[@]} 222 | echo "" 223 | 224 | for (( interface_number=0; interface_number<$number_of_interfaces; interface_number++ )); 225 | do 226 | echo -e $CYAN$BOLD" > "${ifaces_array[$interface_number]} $END 227 | $1 ${ifaces_array[$interface_number]} $2 228 | echo "" 229 | done 230 | } 231 | 232 | options_selector() 233 | { 234 | number=$1 235 | declare -n array=$2 236 | array=("Exit" "${array[@]}") 237 | 238 | echo -e "\nOPTIONS:" 239 | 240 | for (( whatever_number=1; whatever_number<=$1; whatever_number++ )); 241 | do 242 | echo -e " " $LIGHTYELLOW$whatever_number$END") "$CYAN$BOLD${array[$whatever_number]}$END | sed ''/inactive/s//`printf "\033[31mdisabled\033[0m"`/'' | sed ''/active/s//`printf "\033[32menabled\033[0m"`/'' | sed ''/Disconnected/s//`printf "\033[31mdisconnected\033[0m"`/'' | sed ''/Connected/s//`printf "\033[32mconnected\033[0m"`/'' 243 | done 244 | 245 | echo "" 246 | echo -e " " $LIGHTYELLOW"0"$END") "$CYAN$BOLD${array[0]}$END 247 | echo "" 248 | echo "Type an option:" 249 | 250 | #Reset the array for no add every time the function is executed a element "Exit" 251 | unset array[0] 252 | 253 | } 254 | 255 | response_checker() 256 | { 257 | selection=$1 258 | number_of_options=$2 259 | number_of_options=$((number_of_options + 1)) 260 | 261 | while true; 262 | do 263 | if [[ "$selection" == "0" || "$selection" == "n" ]]; 264 | then 265 | selection="exit" 266 | invalidoption=true 267 | 268 | ignore_continue_enter=true 269 | 270 | break 271 | 272 | elif [[ "$selection" < $number_of_options || "$selection" == "y" ]]; 273 | then 274 | break 275 | 276 | else 277 | echo "" 278 | echo -e "Type a valid option:" 279 | echo -ne $BLINK" > "$END$LIGHTYELLOW ; read selection ; echo -ne "" $END 280 | echo "" 281 | 282 | ## If selection is 0, exit this option 283 | if [[ $selection == "exit" ]]; then break; fi 284 | fi 285 | done 286 | } 287 | 288 | ip_checker() 289 | { 290 | ip_address=$1 291 | ip_address_format=`echo $ip_address | egrep "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$" ` 292 | 293 | while [ "$ip_address" != "$ip_address_format" ] || [ "$ip_address" == "" ]; 294 | do 295 | echo "" 296 | echo -e "Please, type a valid IP:" 297 | echo -ne $BLINK" > "$END" IP: "$LIGHTYELLOW ; read ip_address ; echo -ne "" $END 298 | 299 | ip_address_format=`echo $ip_address | egrep "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$" ` 300 | done 301 | 302 | exit_selection=false 303 | } 304 | 305 | port_checker() 306 | { 307 | port=$1 308 | 309 | while [[ $port -lt 1 || $port -gt 65535 || $port == *[a-zA-Z]* ]]; 310 | do 311 | echo "Type a valid port number:" 312 | echo -ne $BLINK" > "$END$LIGHTYELLOW ; read port ; echo -ne "" $END 313 | echo "" 314 | done 315 | 316 | exit_selection=false 317 | } 318 | 319 | show_programs() 320 | { 321 | echo -e $LIGHTYELLOW"chckdep"$END")" "Check all the dependencies" 322 | echo "" 323 | 324 | for (( program_number=0; program_number<$number_of_programs; program_number++ )); 325 | do 326 | path_actual_program=`which ${programs_array[$program_number]}` 327 | #program_name=${programs_array[$program_number]} 328 | 329 | if [[ $path_actual_program == '' ]]; 330 | then 331 | printf "%-2s %-20s $UNDERRED$BLACK %-0s $END" " >" "${programs_array[$program_number]}" "UNINSTALLED" 332 | echo "" 333 | else 334 | printf "%-2s %-20s $UNDERGREEN$BLACK %-1s $END %-1s %-1s" " >" "${programs_array[$program_number]}" " INSTALLED " ">>>>>" $path_actual_program 335 | echo "" 336 | fi 337 | 338 | #program_name="" 339 | path_actual_program="" 340 | done 341 | 342 | echo -e "\nList of programs you must install manually:" 343 | echo -e "\ttorctl (only for Arch Linux)" 344 | echo -e "\tkali-anonsurf (only for Kali Linux)" 345 | echo -e "\tnordvpn" 346 | echo -e "\tteamviewer" 347 | echo -e "\thtbExplorer" 348 | } 349 | 350 | install_uninstall_programs_array() 351 | { 352 | option=$3 353 | 354 | clear 355 | show_programs 356 | 357 | for (( program=0; program<$number_of_programs; program++ )); 358 | do 359 | path_actual_program=`which ${programs_array[$program]}` 360 | #program_name=${programs_array[$program_number]} 361 | 362 | echo "" 363 | echo -e $CYAN$BOLD"Checking ${programs_array[$program]} ..."$END 364 | sleep 0.1 365 | 366 | if [[ $path_actual_program == '' && $option == "id" ]]; 367 | then 368 | echo -e $CYAN$BOLD"Installing ${programs_array[$program]} ..."$END 369 | echo "" 370 | 371 | #echo "sudo apt-get --assume-yes $1 ${programs_array[$program]} > /dev/null" 372 | sudo DEBIAN_FRONTEND=noninteractive apt-get --assume-yes $1 $2 ${programs_array[$program]} &> /dev/null 373 | pacman -Sy --noconfirm ${programs_array[$program]} &> /dev/null 374 | 375 | elif [[ ${programs_array[$program]} == "nmcli" ]]; 376 | then 377 | sudo apt-get --assume-yes install network-manager &> /dev/null 378 | pacman -Sy --noconfirm install network-manager &> /dev/null 379 | 380 | elif [[ $path_actual_program == "/"* && $option == "ud" && ${programs_array[$program]} == "ping" || ${programs_array[$program]} == "nmcli" || ${programs_array[$program]} == "traceroute" ]]; 381 | then 382 | echo "Omiting ${programs_array[$program]} ..." 383 | sleep 0.5 384 | 385 | elif [[ $path_actual_program == "/"* && $option == "ud" ]]; 386 | then 387 | echo "Unistalling ${programs_array[$program]} ..." 388 | echo "" 389 | 390 | sudo apt-get --assume-yes $1 $2 ${programs_array[$program]} &> /dev/null 391 | pacman -Rsn --noconfirm ${programs_array[$program]} &> /dev/null 392 | fi 393 | 394 | #program_name="" 395 | path_actual_program="" 396 | 397 | clear 398 | show_programs 399 | done 400 | } 401 | 402 | malware_score_checker() 403 | { 404 | score=$1 405 | 406 | if [ $score == "null" ]; 407 | then 408 | echo -e $GREEN$BOLD"Neutral"$END 409 | 410 | elif [ $score -lt 3 ]; 411 | then 412 | echo -e $GREEN$BOLD"$score / 10"$END 413 | 414 | elif [ $score -lt 8 ]; 415 | then 416 | echo -e $LIGHTYELLOW$BOLD"$score / 10"$END 417 | 418 | elif [ $score -gt 7 ]; 419 | then 420 | echo -e $RED$BOLD"$score / 10"$END 421 | fi 422 | } 423 | 424 | #---------------- SCRIPT ---------------- 425 | while true; 426 | do 427 | #Variables and arrays that must check every time 428 | #Extract the active connections 429 | ovpns_active_extracted=`ps aux | grep openvpn | grep "${directories_array[0]}" | rev | cut -f1 -d "/" | rev | tr '\n' " "` 430 | #Saves the active connectios into array 431 | read -a ovpns_active_array <<< $ovpns_active_extracted 432 | #Saves how many ovpns active connections have the system 433 | number_of_ovpns_active=${#ovpns_active_array[@]} 434 | 435 | echo -e $END 436 | ignore_continue_enter=false 437 | 438 | #Starts the main screen 439 | menu 440 | #When user select an option, sets the parameter for distinguise an invalid option in false 441 | invalidoption=false 442 | 443 | clear 444 | 445 | while [[ $invalidoption == false ]]; 446 | do 447 | #Catch Ctrl+C to break the bucles and go back menu 448 | trap 'invalidoption="ignore"; tput civis; echo -e "\n\n$UNDERGRAY$BLACK Exit signal. Press enter to go back. $END$HIDE"; break; tput cnorm;' INT 449 | 450 | case $option in 451 | chckdep*) 452 | show_programs 453 | echo "" 454 | echo "" 455 | echo -e " " $LIGHTYELLOW" id"$END")" "Install all the dependencies (before install, exit hackutils and type apt-get update && apt-get upgrade)" 456 | echo -e " " $LIGHTYELLOW" ud"$END")" "Uninstall all the dependencies (except ping, nmcli and traceroute)" 457 | echo -e " " $LIGHTYELLOW"man"$END")" "View steps to install the programs that must be installed manually" 458 | echo "" 459 | echo -e " " $LIGHTYELLOW" 0"$END")" "Cancel" 460 | echo "" 461 | echo "" 462 | echo "Type an option:" 463 | echo -ne $BLINK" > "$END$LIGHTYELLOW ; read option ; echo -ne "" $END 464 | echo "" 465 | 466 | case $option in 467 | id) 468 | install_uninstall_programs_array "install" "" "$option" 469 | echo "" 470 | echo -e $CYAN$BOLD"If you have some problems installing some programs, enter --> apt-get install --fix-missing"$END 471 | 472 | invalidoption=false 473 | 474 | ;; 475 | 476 | ud) 477 | install_uninstall_programs_array "" "purge" "$option" 478 | 479 | invalidoption=false 480 | 481 | ;; 482 | 483 | man) 484 | clear 485 | 486 | echo -e $UNDERWHITE$BLACK"\nTORCTL "$END 487 | echo -e $UNDERWHITE$BLACK" Arch distros "$END 488 | echo -e " " 489 | echo -e $CYAN$BOLD"https://github.com/BlackArch/torctl "$END 490 | echo -e " " 491 | echo -e $GREEN"pacman -S torctl "$END 492 | 493 | echo -e $UNDERWHITE$BLACK"\n\nANONSURF "$END 494 | echo -e $UNDERWHITE$BLACK" Kali Linux "$END 495 | echo -e " " 496 | echo -e $CYAN$BOLD"https://github.com/Und3rf10w/kali-anonsurf.git "$END 497 | echo -e " " 498 | echo -e $GREEN"git clone https://github.com/Und3rf10w/kali-anonsurf.git "$END 499 | echo -e $GREEN"cd kali-anonsurf "$END 500 | echo -e $GREEN"sudo bash installer.sh "$END 501 | 502 | echo -e $UNDERWHITE$BLACK"\n\nNORDVPN "$END 503 | echo -e $UNDERWHITE$BLACK" Debian or Ubuntu distros "$END 504 | echo -e " " 505 | echo -e $CYAN$BOLD"https://blog.sleeplessbeastie.eu/2019/02/04/how-to-use-nordvpn-command-line-utility/ "$END 506 | echo -e " " 507 | echo -e $GREEN"sudo apt install wget apt-transport-https " 508 | echo -e "wget --directory-prefix /tmp https://repo.nordvpn.com/deb/nordvpn/debian/pool/main/nordvpn-release_1.0.0_all.deb " 509 | echo -e "sudo apt install /tmp/nordvpn-release_1.0.0_all.deb " 510 | echo -e "sudo apt update " 511 | echo -e "sudo apt install nordvpn "$END 512 | echo -e " " 513 | echo -e " " 514 | echo -e $UNDERWHITE$BLACK" Arch distro "$END 515 | echo -e " " 516 | echo -e $CYAN$BOLD"https://wiki.archlinux.org/index.php/NordVPN "$END 517 | echo -e " " 518 | echo -e $GREEN"pacman -S ca-certificates " 519 | echo -e "pacman -S iproute2 " 520 | echo -e "pacman -S ipset " 521 | echo -e "pacman -S iptables " 522 | echo -e "pacman -S libxslt " 523 | echo -e "pacman -S procps " 524 | echo -e "git clone https://aur.archlinux.org/nordvpn-bin.git " 525 | echo -e "cd nordvpn-bin " 526 | echo -e "makepkg " 527 | echo -e "pacman -U nordvpn-bin-3.8.4-1-x86_64.pkg.tar.zst "$END 528 | 529 | echo -e $UNDERWHITE$BLACK"\n\nTEAMVIEWER "$END 530 | echo -e $UNDERWHITE$BLACK" Kali Linux "$END 531 | echo -e " " 532 | echo -e $CYAN$BOLD"https://newvo.com.au/how-to-install-teamviewer-on-linux-cli/ "$END 533 | echo -e " " 534 | echo -e $GREEN"cd ~/Downloads "$END 535 | echo -e $GREEN"wget https://download.teamviewer.com/download/linux/teamviewer_amd64.deb "$END 536 | echo -e $GREEN"sudo apt install ./teamviewer_amd64.deb "$END 537 | 538 | echo -e $UNDERWHITE$BLACK"\n\htbExplorer "$END 539 | echo -e $UNDERWHITE$BLACK" Any (GitHub) "$END 540 | echo -e " " 541 | echo -e $CYAN$BOLD"https://github.com/s4vitar/htbExplorer.git "$END 542 | echo -e " " 543 | echo -e $GREEN"cd ~/Downloads "$END 544 | echo -e $GREEN"git clone https://github.com/s4vitar/htbExplorer.git "$END 545 | echo -e $GREEN"cd htbExplorer "$END 546 | echo -e $GREEN"cp htbExplorer htbExplorer_tmp"$END 547 | echo -e $GREEN"cat htbExplorer_tmp | sed 's/API_TOKEN=""/API_TOKEN=\""$CYAN$BOLD"YOUR_HTB_API_TOKEN\""$END$GREEN"/g' > htbExplorer "$END 548 | echo -e $GREEN"sudo cp downloadVPN.py /etc/hackutils/ "$END 549 | echo -e $GREEN"sudo cp htbExplorer /etc/hackutils/ "$END 550 | echo -e $GREEN"sudo cp htbExplorer /usr/bin "$END 551 | echo -e $GREEN"sudo chmod +x /usr/bin/htbExplorer "$END 552 | 553 | ;; 554 | 555 | 0) 556 | ignore_continue_enter=true 557 | 558 | ;; 559 | 560 | *) 561 | invalidoption=true 562 | ignore_continue_enter=false 563 | 564 | ;; 565 | esac 566 | 567 | ;; 568 | 569 | if*) 570 | echo -e $LIGHTYELLOW"if"$END")" "Interfaces info (ifconfig)" 571 | echo "" 572 | 573 | #Function First part of the command Second part of the command 574 | #command_for_interfaces "ifconfig " "" 575 | command_for_interfaces "ifconfig " "" 576 | 577 | ;; 578 | 579 | tv*) 580 | echo -e $LIGHTYELLOW"tv"$END")" "Teamviewer" 581 | echo "" 582 | #Function First part of the command Second part of the command 583 | #command_for_interfaces "ifconfig " "" 584 | 585 | echo -e "What you want to do?" 586 | 587 | options_array=("Connect to TeamViewer server" "Setup this TeamViewer server") 588 | options_selector 2 "options_array" 589 | 590 | echo -ne $BLINK" > "$END$LIGHTYELLOW ; read selection ; echo -ne "" $END 591 | echo "" 592 | 593 | ## If selection is 0, exit this option 594 | if [[ $selection == "exit" ]]; then break; fi 595 | 596 | case $selection in 597 | 1) 598 | echo -e $CYAN$BOLD"Killing previous instaces of TeamViewer GUI..."$END 599 | 600 | sudo pklill teamviewer 601 | waitFunction "6" "0.10" 602 | 603 | if [[ $? != 0 ]]; 604 | then 605 | 606 | echo -e $RED "An error was ocurred while try execute TeamViewer (probably related with the user that launch the program)." 607 | 608 | break 609 | fi 610 | 611 | echo -e $CYAN$BOLD"Executing TeamViewer GUI..."$END 612 | 613 | sudo teamviewer daemon start 614 | waitFunction "6" "0.10" 615 | nohup sudo teamviewer & 616 | 617 | ;; 618 | 619 | 2) 620 | sudo teamviewer daemon disable > /dev/null 621 | sudo teamviewer daemon restart > /dev/null 622 | 623 | teamviewer info 624 | echo "" 625 | 626 | output=`teamviewer info | grep "TeamViewer ID:" | egrep -o '[0-9]{7,12}'` 627 | teamviewer info | grep "TeamViewer ID:" | tr -d [[:space:]] | cut -c4-16,20-30 | sed 's/TeamViewerID:/TeamViewer ID: /g' | sed ''/[0-9]*$/s//`printf "$CYAN$BOLD$output$END"`/'' 628 | 629 | echo "You want to setup a new password to this TeamViewer server?" 630 | echo -ne "[ y/n ]"$BLINK" > "$END$LIGHTYELLOW ; read selection ; echo -ne "" $END 631 | echo "" 632 | 633 | response_checker "$selection" "" 634 | 635 | if [[ $selection == "exit" ]]; then break; fi 636 | 637 | echo "Type your new password:" 638 | echo -ne $BLINK" > "$END$LIGHTYELLOW ; read psswd ; echo -ne "" $END 639 | echo "" 640 | 641 | teamviewer passwd $psswd 642 | 643 | ;; 644 | 645 | 0) 646 | ignore_continue_enter=true 647 | 648 | break 649 | 650 | ;; 651 | 652 | *) 653 | invalidoption=true 654 | ignore_continue_enter=false 655 | 656 | ;; 657 | 658 | 659 | esac 660 | 661 | 662 | ;; 663 | 664 | wc*) 665 | echo -e $LIGHTYELLOW"wc"$END")" "Connect to Wifi (nmcli)" 666 | echo "" 667 | 668 | nmcli device wifi rescan 669 | 670 | ## If there is an error executing the last command, will break the case statement. 671 | if [[ $? != 0 ]]; 672 | then 673 | echo -e $RED "An error was ocurred while try to scan the wireless networks (probably not a valid wireless interface detected)." 674 | 675 | break 676 | fi 677 | 678 | nmcli device wifi list 679 | echo "" 680 | 681 | echo -ne "SSID: "$LIGHTYELLOW ; read ssid ; echo -ne $END 682 | echo -ne "Password: "$HIDE ; read psswd ; echo -e $END 683 | echo "" 684 | 685 | nmcli device wifi connect $ssid password $psswd 686 | 687 | ## If there is an error executing the last command, will break the case statement. 688 | if [[ $? != 0 ]]; 689 | then 690 | echo -e $RED "An error was ocurred while try to connect to the AP (probably incorrect password)." 691 | 692 | break 693 | 694 | fi 695 | 696 | waitFunction "5" "0.40" 697 | 698 | echo -e $CYAN$BOLD" > You are now connected to $ssid" $END 699 | echo "" 700 | 701 | echo "You want to test your internet connection?" 702 | echo -ne "[ y/n ]"$BLINK" > "$END$LIGHTYELLOW ; read selection ; echo -ne "" $END 703 | echo "" 704 | 705 | response_checker "$selection" "" 706 | 707 | if [[ "$selection" == "exit" ]]; then break; fi 708 | 709 | ping -c 5 www.google.com 710 | 711 | ;; 712 | 713 | up*) 714 | echo -e $LIGHTYELLOW"up"$END")" "Update Hack_Utils" 715 | echo "" 716 | 717 | echo -e $CYAN$BOLD" > Updating Hack_Utils..." $END 718 | echo "" 719 | 720 | waitFunction "5" "0.40" 721 | 722 | cd 723 | rm -r Hack-Utils/ 724 | mkdir /etc/hackutils/ 725 | 726 | git clone https://github.com/davidahid/Hack-Utils 727 | 728 | mv Hack-Utils/scripts/hack_utils.sh /etc/hackutils/ 729 | mv Hack-Utils/scripts/bl.sh /etc/hackutils/ 730 | #mv /tmp/Network-Utils/scripts/network_utils.sh /etc/hackutils/network_utils.sh 731 | 732 | rm -r Hack-Utils/ 733 | 734 | clear 735 | exit 736 | 737 | ;; 738 | 739 | conky*) 740 | echo -e $LIGHTYELLOW"conky"$END")" "Setup conky desktop" 741 | echo "" 742 | 743 | echo -e "What interface you want to monitor in conky?" 744 | 745 | options_selector $number_of_interfaces "ifaces_array" 746 | 747 | echo -ne $BLINK" > "$END$LIGHTYELLOW ; read selection ; echo -ne "" $END 748 | echo "" 749 | 750 | response_checker "$selection" "$number_of_interfaces" 751 | 752 | ## If selection is 0, exit this option 753 | if [[ $selection == "exit" ]]; then break; fi 754 | 755 | curl https://raw.githubusercontent.com/b4shnhawx/Hack-Utils/master/scripts/conky/.conkyrc > /etc/hackutils/conky/.conkyrc 756 | 757 | waitFunction "5" "0.20" 758 | 759 | rm ${directories_array[3]}Conky.desktop 760 | rm ${directories_array[4]}.conkyrc 761 | rm ${directories_array[5]}internet_test.sh 762 | 763 | echo "Copying: /etc/hackutils/conky/Conky.desktop > ${directories_array[3]}Conky.desktop" 764 | echo "Copying: /etc/hackutils/conky/.conkyrc > ${directories_array[4]}.conkyrc" 765 | echo "Copying: /etc/hackutils/conky/internet_test.sh > ${directories_array[5]}" 766 | 767 | cat /etc/hackutils/conky/Conky.desktop | sed "s|\$HOME/|${directories_array[4]}|g" > ${directories_array[3]}Conky.desktop 768 | cat /etc/hackutils/conky/.conkyrc | sed "s|\$HOME/|${directories_array[5]}|g" | sed "s|\$interface|${ifaces_array[$selection]}|g" > ${directories_array[4]}.conkyrc 769 | 770 | cp /etc/hackutils/conky/internet_test.sh ${directories_array[5]} 771 | 772 | ;; 773 | 774 | conf*) 775 | echo -e $LIGHTYELLOW"conf"$END")" "Modify Hack_utils config file" 776 | echo "" 777 | 778 | sudo nano /etc/hackutils/hack_utils.conf 779 | 780 | ignore_continue_enter=true 781 | 782 | ;; 783 | 784 | 1) 785 | echo -e $LIGHTYELLOW"1"$END")" "Ping" 786 | echo "" 787 | 788 | echo -e "From which interface you want to throw the ping?" 789 | 790 | options_selector $number_of_interfaces "ifaces_array" 791 | 792 | echo -ne $BLINK" > "$END$LIGHTYELLOW ; read selection ; echo -ne "" $END 793 | echo "" 794 | 795 | response_checker "$selection" "$number_of_interfaces" 796 | 797 | ## If selection is 0, exit this option 798 | if [[ $selection == "exit" ]]; then break; fi 799 | 800 | echo -e "Which address you want to ping?" 801 | echo -ne $BLINK" > "$END" IP: "$LIGHTYELLOW ; read ip_address ; echo -ne "" $END 802 | echo "" 803 | 804 | ip_checker $ip_address 805 | 806 | echo -e $CYAN$BOLD" > Pinging to $ip_address..."$END 807 | echo "" 808 | 809 | echo -e $UNDERRED$BLACK"Ctrl+C to cancel"$END 810 | echo "" 811 | 812 | ping -I ${ifaces_array[$selection]} $ip_address 813 | 814 | break 815 | ;; 816 | 817 | 2) 818 | echo -e $LIGHTYELLOW"2"$END")" "Try internet connection" 819 | echo "" 820 | 821 | echo -e $CYAN$BOLD" > Pinging to Google..."$END 822 | echo "" 823 | echo "" 824 | echo "" 825 | 826 | echo -e $UNDERRED$BLACK"Ctrl+C to cancel"$END 827 | echo "" 828 | 829 | ping www.google.es 830 | 831 | ;; 832 | 833 | 3) 834 | echo -e $LIGHTYELLOW"3"$END")" "Traceroute" 835 | echo "" 836 | 837 | 838 | echo -e "From which interface you want to throw the ping?" 839 | 840 | options_selector $number_of_interfaces "ifaces_array" 841 | 842 | echo -ne $BLINK" > "$END$LIGHTYELLOW ; read selection ; echo -ne "" $END 843 | echo "" 844 | 845 | response_checker "$selection" "$number_of_interfaces" 846 | 847 | ## If selection is 0, exit this option 848 | if [[ $selection == "exit" ]]; then break; fi 849 | 850 | echo -e "Which address you want to traceroute?" 851 | echo -ne $BLINK" > "$END" IP: "$LIGHTYELLOW ; read ip_address ; echo -ne "" $END 852 | echo "" 853 | 854 | ip_checker $ip_address 855 | 856 | echo -e $CYAN$BOLD" > Traceroute: Default"$END 857 | traceroute --queries=3 --max-hops=15 --interface=${ifaces_array[$selection]} $ip_address 858 | 859 | echo "" 860 | echo -e $CYAN$BOLD" > Traceroute: ICMP probes"$END 861 | traceroute --icmp --queries=3 --max-hops=15 --interface=${ifaces_array[$selection]} $ip_address 862 | 863 | echo "" 864 | echo -e $CYAN$BOLD" > Traceroute: TCP probes"$END 865 | traceroute --tcp --queries=3 --max-hops=15 --interface=${ifaces_array[$selection]} $ip_address 866 | 867 | echo "" 868 | echo -e $CYAN$BOLD" > Traceroute: UDP probes"$END 869 | traceroute --udp --queries=3 --max-hops=15 --interface=${ifaces_array[$selection]} $ip_address 870 | 871 | ;; 872 | 873 | 4) 874 | echo -e $LIGHTYELLOW"4"$END")" "Whois" 875 | echo "" 876 | 877 | echo -e "Enter the IP address or domain to lookup:" 878 | echo -ne $BLINK" > "$END" IP / Domain: "$LIGHTYELLOW ; read ip_address ; echo -ne "" $END 879 | echo "" 880 | echo "" 881 | echo "" 882 | 883 | #Esto se comenta para hacer el whois a nombres de dominio, no solo a IPs 884 | #ip_checker $ip_address 885 | 886 | echo -e $CYAN$BOLD" ____ ____ __ ______ _____ __ _ ____ ______ _________"$END 887 | echo -e $CYAN$BOLD" / __ \/ __ \/ |/ / | / _/ | / / | | / / / / / __ \/ _/ ___/"$END 888 | echo -e $CYAN$BOLD" / / / / / / / /|_/ / /| | / // |/ / | | /| / / /_/ / / / // / \__ \ "$END 889 | echo -e $CYAN$BOLD" / /_/ / /_/ / / / / ___ |_/ // /| / | |/ |/ / __ / /_/ // / ___/ / "$END 890 | echo -e $CYAN$BOLD"/_____/\____/_/ /_/_/ |_/___/_/ |_/ |__/|__/_/ /_/\____/___//____/ "$END 891 | 892 | 893 | whois $ip_address 894 | 895 | ;; 896 | 897 | 5) 898 | echo -e $LIGHTYELLOW"5"$END")" "Hops to gateway" 899 | echo "" 900 | 901 | echo -e "From which interface you want to reach the gateway?" 902 | 903 | options_selector $number_of_interfaces "ifaces_array" 904 | 905 | echo -ne $BLINK" > "$END$LIGHTYELLOW ; read selection ; echo -ne "" $END 906 | echo "" 907 | 908 | response_checker "$selection" "$number_of_interfaces" 909 | 910 | ## If selection is 0, exit this option 911 | if [[ $selection == "exit" ]]; then break; fi 912 | 913 | gateway_ip=`ip route list | grep $selection | grep default | cut -f 3 -d " " | uniq` 914 | 915 | if [ "$gateway_ip" == '' ]; 916 | then 917 | echo -e $RED"The interface is not connected to the network."$END 918 | else 919 | output=`traceroute --queries=3 --max-hops=10 --interface=${ifaces_array[$selection]} $gateway_ip` 920 | 921 | hops=`echo -e $output "\b" | grep -o "[0-9] $gateway_ip" | cut -f1 -d" " | tail -n1` 922 | 923 | echo -e $CYAN$BOLD" > You have $hops hop(s) until reach your default gateway"$END 924 | echo "" 925 | 926 | ## s --> sustitucion / nueva linea, pero con & se añade, no se sustituye. La g pra todas las coincidencias de " [0-9] " 927 | ## El segundo sed añade a partir del 4 caracter un espacio de mas, y lo hace para todas las lineas entre la 2 y la 9. 928 | echo $output | sed -e 's/ [0-9] / \n &/g' | sed -e '2,9 s/./& /4' 929 | fi 930 | 931 | ;; 932 | 933 | 6) 934 | echo -e $LIGHTYELLOW"6"$END")" "ARP table" 935 | echo "" 936 | 937 | #Function First part of the command Second part of the command 938 | #command_for_interfaces "arp -i " "" 939 | command_for_interfaces "arp -i " "" 940 | 941 | ;; 942 | 943 | 7) 944 | echo -e $LIGHTYELLOW"7"$END")" "Public IP" 945 | echo "" 946 | 947 | ip_address=`curl icanhazip.com` 948 | 949 | echo -e $CYAN$BOLD" > PUBLIC IP"$END 950 | echo -e $UNDERYELLOW$BLACK"$ip_address"$END 951 | echo "" 952 | 953 | whois $ip_address | grep -E 'country:|netname:|descr:|adress:|origin:' 954 | 955 | ;; 956 | 957 | 8) 958 | echo -e $LIGHTYELLOW"8"$END")" "Traffic monitoring (iptraf)" 959 | echo "" 960 | 961 | iptraf-ng 962 | 963 | ignore_continue_enter=true 964 | 965 | ;; 966 | 967 | 9) 968 | echo -e $LIGHTYELLOW"9"$END")" "Traffic by interface" 969 | echo "" 970 | 971 | echo -e "In which interface you want to monitor the traffic?" 972 | 973 | options_selector $number_of_interfaces "ifaces_array" 974 | 975 | echo -ne $BLINK" > "$END$LIGHTYELLOW ; read selection ; echo -ne "" $END 976 | echo "" 977 | 978 | response_checker "$selection" "$number_of_interfaces" 979 | 980 | ## If selection is 0, exit this option 981 | if [[ $selection == "exit" ]]; then break; fi 982 | 983 | 984 | interface=$selection 985 | 986 | echo -e "What program you want to use?" 987 | 988 | echo -ne " " $LIGHTYELLOW"m"$END")" 989 | printf "$CYAN$BOLD %-11s $END" "More info"; echo "" 990 | 991 | options_selector $number_of_bandwith_interface_program "bandwith_interface_programs_array" 992 | echo -ne $BLINK" > "$END$LIGHTYELLOW ; read selection ; echo -ne "" $END 993 | 994 | if [[ $selection == "m" ]]; 995 | then 996 | echo "" 997 | 998 | echo -ne " " $LIGHTYELLOW"1"$END")" 999 | printf "$CYAN$BOLD %-11s $END >> %-1s" "slurm" "Simple live graphical"; echo "" 1000 | echo -ne " " $LIGHTYELLOW"2"$END")" 1001 | printf "$CYAN$BOLD %-11s $END >> %-1s" "iftop" "Bytes Rx and Tx in live to specific destination"; echo "" 1002 | echo -ne " " $LIGHTYELLOW"3"$END")" 1003 | printf "$CYAN$BOLD %-11s $END >> %-1s" "speedometer" "Simple live graphical"; echo "" 1004 | echo -ne " " $LIGHTYELLOW"4"$END")" 1005 | printf "$CYAN$BOLD %-11s $END >> %-1s" "tcptrack" "Speed by each open connections"; echo "" 1006 | echo -ne " " $LIGHTYELLOW"5"$END")" 1007 | printf "$CYAN$BOLD %-11s $END >> %-1s" "ifstat" "Prints every 0.5 sec the bytes Rx and Tx. Nice to capture traffic peaks."; echo "" 1008 | echo -ne " " $LIGHTYELLOW"6"$END")" 1009 | printf "$CYAN$BOLD %-11s $END >> %-1s" "vnstat" "Monitor the bytes Rx and Tx. Can choose in live or background mode."; echo "" 1010 | echo -ne " " $LIGHTYELLOW"7"$END")" 1011 | printf "$CYAN$BOLD %-11s $END >> %-1s" "nload" "Monitor the traffic in all interfaces (Use the arrows to switch). The graph is used to monitor downloads or uploads over a long period of time (average 30 seconds)."; echo "" 1012 | echo -ne " " $LIGHTYELLOW"8"$END")" 1013 | printf "$CYAN$BOLD %-11s $END >> %-1s" "bwm-ng" "Simple monitor traffic live"; echo "" 1014 | echo "" 1015 | 1016 | echo -ne " " $LIGHTYELLOW"0"$END")" 1017 | printf "$CYAN$BOLD %-11s $END" "Exit"; echo "" 1018 | echo "" 1019 | 1020 | echo -e "If you have any problem with the programs, check if they are installed with the option "$LIGHTYELLOW"chckdep"$END 1021 | echo "" 1022 | 1023 | echo "Type an option:" 1024 | echo -ne $BLINK" > "$END$LIGHTYELLOW ; read selection ; echo -ne "" $END 1025 | fi 1026 | 1027 | response_checker "$selection" "$number_of_bandwith_interface_program" 1028 | 1029 | ## If selection is 0, exit this option 1030 | if [[ $selection == "exit" ]]; then break; fi 1031 | 1032 | program_bandwidth_interface=$selection 1033 | 1034 | if [[ ${bandwith_interface_programs_array[$program_bandwidth_interface]} == "slurm" ]]; 1035 | then 1036 | slurm -i ${ifaces_array[$interface]} -z 1037 | 1038 | ignore_continue_enter=true 1039 | 1040 | elif [[ ${bandwith_interface_programs_array[$program_bandwidth_interface]} == "iftop" ]]; 1041 | then 1042 | iftop -i ${ifaces_array[$interface]} 1043 | 1044 | ignore_continue_enter=true 1045 | 1046 | elif [[ ${bandwith_interface_programs_array[$program_bandwidth_interface]} == "speedometer" ]]; 1047 | then 1048 | speedometer -r ${ifaces_array[$interface]} -t ${ifaces_array[$interface]} 1049 | 1050 | ignore_continue_enter=true 1051 | 1052 | elif [[ ${bandwith_interface_programs_array[$program_bandwidth_interface]} == "tcptrack" ]]; 1053 | then 1054 | tcptrack -i ${ifaces_array[$interface]} 1055 | 1056 | ignore_continue_enter=true 1057 | 1058 | elif [[ ${bandwith_interface_programs_array[$program_bandwidth_interface]} == "ifstat" ]]; 1059 | then 1060 | ifstat -t -i ${ifaces_array[$interface]} 0.5 1061 | 1062 | elif [[ ${bandwith_interface_programs_array[$program_bandwidth_interface]} == "vnstat" ]]; 1063 | then 1064 | echo "" 1065 | echo "Select an option to do:" 1066 | 1067 | echo -e " " $LIGHTYELLOW"start"$END")" "Start vnstat in background" 1068 | echo -e " " $LIGHTYELLOW" stop"$END")" "Stop vnstat in background" 1069 | echo -e " " $LIGHTYELLOW" view"$END")" "View the last report" 1070 | echo -e " " $LIGHTYELLOW" live"$END")" "View the traffic Rx and Tx in live" 1071 | echo -e " " $LIGHTYELLOW" calc"$END")" "Calculate the traffic" 1072 | echo "" 1073 | echo -e " " $LIGHTYELLOW" 0"$END")" "Cancel" 1074 | echo "" 1075 | echo "" 1076 | 1077 | echo "Type an option:" 1078 | echo -ne $BLINK" > "$END$LIGHTYELLOW ; read option ; echo -ne "" $END 1079 | echo "" 1080 | echo "" 1081 | echo "" 1082 | 1083 | case $option in 1084 | start) 1085 | echo -e $CYAN$BOLD" > INITIATING THE SERVICE VNSTAT..."$END 1086 | 1087 | systemctl start vnstat 1088 | 1089 | systemctl status vnstat 1090 | 1091 | ;; 1092 | stop) 1093 | echo -e $CYAN$BOLD" > STOPING THE SERVICE VNSTAT..."$END 1094 | 1095 | systemctl stop vnstat 1096 | 1097 | systemctl status vnstat 1098 | 1099 | echo "" 1100 | echo -e $CYAN$BOLD" > REPORT"$END 1101 | vnstat 1102 | 1103 | ;; 1104 | view) 1105 | echo -e $CYAN$BOLD" > LAST REPORT"$END 1106 | vnstat 1107 | 1108 | ;; 1109 | live) 1110 | vnstat --live --iface ${ifaces_array[$interface]} 1111 | 1112 | ;; 1113 | calc) 1114 | echo -e $CYAN$BOLD" > CALCULATING THE TRAFFIC..."$END 1115 | 1116 | command_for_interfaces "vnstat --traffic --iface " "" 1117 | 1118 | ;; 1119 | 0) 1120 | valid_option=true 1121 | 1122 | ;; 1123 | *) 1124 | invalidoption=true 1125 | ignore_continue_enter=false 1126 | 1127 | ;; 1128 | esac 1129 | 1130 | 1131 | elif [[ ${bandwith_interface_programs_array[$program_bandwidth_interface]} == "nload" ]]; 1132 | then 1133 | nload -a 30 1134 | 1135 | ignore_continue_enter=true 1136 | 1137 | elif [[ ${bandwith_interface_programs_array[$program_bandwidth_interface]} == "bwm-ng" ]]; 1138 | then 1139 | bwm-ng bwm-ng --allif 2 1140 | 1141 | ignore_continue_enter=true 1142 | 1143 | fi 1144 | 1145 | ;; 1146 | 1147 | 10) 1148 | echo -e $LIGHTYELLOW"10"$END")" "Check remote port status" 1149 | echo "" 1150 | 1151 | echo -e "From which interface yo want to check de remote port status?" 1152 | options_selector $number_of_interfaces "ifaces_array" 1153 | 1154 | echo -ne $BLINK" > "$END$LIGHTYELLOW ; read selection ; echo -ne "" $END 1155 | echo "" 1156 | 1157 | response_checker "$selection" "$number_of_interfaces" 1158 | 1159 | ## If selection is 0, exit this option 1160 | if [[ $selection == "exit" ]]; then break; fi 1161 | 1162 | echo -e "Type the host and the port." 1163 | echo -ne $BLINK" > "$END" IP: "$END$LIGHTYELLOW ; read ip_address ; echo -ne "" $END 1164 | 1165 | ip_checker $ip_address 1166 | 1167 | echo -ne $BLINK"> "$END"Port: "$END$LIGHTYELLOW ; read port ; echo -ne "\r" $END 1168 | echo "" 1169 | 1170 | telnet_output=`nmap $ip_address -p $port | grep $port | cut -f 2 -d " "` 1171 | 1172 | echo "" 1173 | echo -e $CYAN$BOLD" > PORT STATUS"$END 1174 | 1175 | if [[ "$telnet_output" == "open" ]]; 1176 | then 1177 | echo -ne "$ip_address:$port" $END">>" $UNDERGREEN$BLACK "OPEN" $END 1178 | 1179 | elif [[ "$telnet_output" == "closed" ]]; 1180 | then 1181 | echo -ne "$ip_address" "$port" $UNDERRED$WHITE "CLOSED" $END 1182 | 1183 | else 1184 | echo -ne "$ip_address" "$port" $UNDERYELLOW$BLACK "$telnet_output" $END 1185 | fi 1186 | 1187 | echo "" 1188 | echo "" 1189 | echo "" 1190 | 1191 | ;; 1192 | 1193 | 11) 1194 | echo -e $LIGHTYELLOW"11"$END")" "Ports in use" 1195 | echo "" 1196 | 1197 | echo -e "Enter the port number, IP address or program name. Press "$LIGHTYELLOW"ENTER"$END" to view all connections:" 1198 | echo -ne $BLINK"> "$END"Search: "$LIGHTYELLOW ; read port ; echo -ne "" $END 1199 | echo "" 1200 | 1201 | if [[ $port == '' ]]; 1202 | then 1203 | sudo netstat -pant 1204 | else 1205 | echo "Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name" 1206 | sudo netstat -pant | grep $port 1207 | fi 1208 | 1209 | ;; 1210 | 1211 | 12) 1212 | echo -e $LIGHTYELLOW"12"$END")" "Search port info (online)" 1213 | echo "" 1214 | 1215 | echo -e "Enter the port number:" 1216 | echo -ne $BLINK" > "$END$LIGHTYELLOW ; read port ; echo -ne "" $END 1217 | echo "" 1218 | 1219 | echo -e "How you want to view the port info?" 1220 | options_selector $number_of_web_terminals "web_terminals_array" 1221 | 1222 | echo -ne $BLINK" > "$END$LIGHTYELLOW ; read selection ; echo -ne "" $END 1223 | echo "" 1224 | 1225 | response_checker "$selection" "$number_of_web_terminals" 1226 | 1227 | ## If selection is 0, exit this option 1228 | if [[ $selection == "exit" ]]; then break; fi 1229 | 1230 | program_web_terminals=$selection 1231 | 1232 | if [[ ${web_terminals_array[$program_web_terminals]} == "cat" ]]; 1233 | then 1234 | lynx -accept_all_cookies -dump "https://es.adminsub.net/tcp-udp-port-finder/"$port > ${directories_array[2]}lynx_ports.txt 1235 | 1236 | total_lines=`wc -l ${directories_array[2]}lynx_ports.txt | cut -c1-3` 1237 | lines_below=`cat -n ${directories_array[2]}lynx_ports.txt | cut -c4-100 | grep "squedas Recientes" | cut -c1-3` 1238 | lines_above=`cat -n ${directories_array[2]}lynx_ports.txt | cut -c4-100 | grep "Buscar los resultados de" | cut -c1-3` 1239 | 1240 | lines_below=$((lines_below - 1)) 1241 | lines_above=$(((lines_above + 1) * -1)) 1242 | 1243 | cat ${directories_array[2]}lynx_ports.txt | head -n $lines_below | tac | head -n $lines_above | tac 1244 | 1245 | elif [[ ${web_terminals_array[$program_web_terminals]} == "elinks" ]]; 1246 | then 1247 | elinks "https://es.adminsub.net/tcp-udp-port-finder/"$port 1248 | 1249 | ignore_continue_enter=true 1250 | 1251 | elif [[ ${web_terminals_array[$program_web_terminals]} == "lynx" ]]; 1252 | then 1253 | lynx -accept_all_cookies "https://es.adminsub.net/tcp-udp-port-finder/"$port 1254 | 1255 | ignore_continue_enter=true 1256 | fi 1257 | 1258 | ;; 1259 | 1260 | 13) 1261 | echo -e $LIGHTYELLOW"13"$END")" "Firewall rules (iptables)" 1262 | echo "" 1263 | echo "" 1264 | echo "" 1265 | 1266 | echo -e $CYAN$BOLD" > List of rules"$END 1267 | echo "" 1268 | 1269 | iptables -L 1270 | 1271 | echo "" 1272 | echo -e $CYAN$BOLD" > Rules"$END 1273 | echo "" 1274 | 1275 | iptables -S 1276 | 1277 | ;; 1278 | 1279 | 14) 1280 | echo -e $LIGHTYELLOW"14"$END")" "Route table" 1281 | echo "" 1282 | echo "" 1283 | echo "" 1284 | 1285 | ip route 1286 | 1287 | ;; 1288 | 1289 | 15) 1290 | echo -e $LIGHTYELLOW"15"$END")" "Check IP blacklist / abuse" 1291 | echo "" 1292 | 1293 | echo -e "Enter the IP address to lookup:" 1294 | echo -ne $BLINK" > "$END$LIGHTYELLOW ; read ip_address ; echo -ne "" $END 1295 | echo "" 1296 | echo "" 1297 | echo "" 1298 | 1299 | echo -e $CYAN$BOLD" > AUTONOMOUS SYSTEM"$END 1300 | whois -h whois.cymru.com -- -v "$ip_address" 1301 | 1302 | echo "" 1303 | echo "" 1304 | echo "" 1305 | echo -e $UNDERRED$BLACK"Ctrl+C to cancel"$END 1306 | echo "" 1307 | 1308 | echo -e $CYAN$BOLD" > BLACKLISTS"$END 1309 | bash /etc/hackutils/bl.sh $ip_address 1310 | 1311 | ;; 1312 | 1313 | 16) 1314 | echo -e $LIGHTYELLOW"16"$END")" "Internet speed test" 1315 | echo "" 1316 | 1317 | echo -e $CYAN$BOLD" > INITIATING INTERNET SPEED TEST"$END 1318 | echo "" 1319 | 1320 | waitFunction "5" "0.20" 1321 | 1322 | output=`speedtest | sed 's/$/#/g'` 1323 | 1324 | waitFunction "5" "0.20" 1325 | 1326 | echo -e $output | sed 's/#/\n/g' | sed 's/Testing/\nTesting/g' | sed ''/Download/s//`printf "\033[31m↓Download\033[0m"`/'' | sed ''/Upload/s//`printf "\033[32m↑Upload\033[0m"`/'' | sed 's/↓Download/ ↓ Download/g' | sed 's/↑Upload/ ↑ Upload/g' 1327 | 1328 | ;; 1329 | 1330 | advif*) 1331 | echo -e $LIGHTYELLOW"advif"$END")" "Advanced interface info (nmcli)" 1332 | echo "" 1333 | 1334 | #Function First part of the command Second part of the command 1335 | #command_for_interfaces "ifconfig " "" 1336 | command_for_interfaces "nmcli device show " "" 1337 | 1338 | ;; 1339 | 1340 | sniff*) 1341 | echo -e $LIGHTYELLOW"sniff"$END")" "Sniff packets" 1342 | echo "" 1343 | 1344 | echo -e "From which interface you want to sniff the network?" 1345 | 1346 | options_selector $number_of_interfaces "ifaces_array" 1347 | 1348 | echo -ne $BLINK" > "$END$LIGHTYELLOW ; read selection ; echo -ne "" $END 1349 | 1350 | response_checker "$selection" "$number_of_interfaces" 1351 | 1352 | ## If selection is 0, exit this option 1353 | if [[ $selection == "exit" ]]; then break; fi 1354 | 1355 | filters="" 1356 | 1357 | while [ "$filters" == "" ]; 1358 | do 1359 | echo "" 1360 | echo -e "Type the filters for tcpdump (Press enter = ignore. Type "$LIGHTYELLOW"h"$END" = view some tcpdump help)" 1361 | echo -ne $BLINK" > Filters: "$END$LIGHTYELLOW ; read filters ; echo -ne "" $END 1362 | 1363 | if [[ "$filters" == "h" ]]; 1364 | then 1365 | echo "" 1366 | echo -e $CYAN$BOLD "EXAMPLES" $END 1367 | echo -e "tcpdump -i ${ifaces_array[$selection]} "$LIGHTYELLOW"port 80"$END 1368 | echo -e "tcpdump -i ${ifaces_array[$selection]} "$LIGHTYELLOW"src port 80"$END 1369 | echo -e "tcpdump -i ${ifaces_array[$selection]} "$LIGHTYELLOW"not port 80"$END 1370 | echo -e "tcpdump -i ${ifaces_array[$selection]} "$LIGHTYELLOW"not portrange 50-150"$END 1371 | echo -e "tcpdump -i ${ifaces_array[$selection]} "$LIGHTYELLOW"src host 192.168.2.10"$END 1372 | echo -e "tcpdump -i ${ifaces_array[$selection]} "$LIGHTYELLOW"dst host 192.168.2.10"$END 1373 | echo -e "tcpdump -i ${ifaces_array[$selection]} "$LIGHTYELLOW"host 192.168.2.10"$END 1374 | echo -e "tcpdump -i ${ifaces_array[$selection]} "$LIGHTYELLOW"host 192.168.2.1 and port 443"$END 1375 | echo -e "tcpdump -i ${ifaces_array[$selection]} "$LIGHTYELLOW"less 850 and src host 192.168.2.10"$END 1376 | echo -e "tcpdump -i ${ifaces_array[$selection]} "$LIGHTYELLOW"greater 500 and less 1200"$END 1377 | echo -e "tcpdump -i ${ifaces_array[$selection]} "$LIGHTYELLOW"greater 100 and (src host google.com or src host microsoft.com)"$END 1378 | echo "" 1379 | echo -e $CYAN$BOLD "FLAGS" $END 1380 | echo -e $LIGHTYELLOW"[S]"$END" - SYN. The first step to establish the connection." 1381 | echo -e $LIGHTYELLOW"[F]"$END" - END. Termination of the connection." 1382 | echo -e $LIGHTYELLOW"[.]"$END" - ACK. Acknowledgement package received successfully." 1383 | echo -e $LIGHTYELLOW"[P]"$END" - PUSH. Tells the receiver to process packets instead of buffering them." 1384 | echo -e $LIGHTYELLOW"[R]"$END" - RST. Communication stopped." 1385 | echo -e $LIGHTYELLOW"[F.]"$END" - FIN-ACK. Flags can include more than one value, as in this example. Acknowledgement of the termination of the connection." 1386 | 1387 | filters="" 1388 | 1389 | elif [[ "$filters" == "" ]]; 1390 | then 1391 | break 1392 | 1393 | fi 1394 | done 1395 | 1396 | echo "" 1397 | echo "" 1398 | echo -e $CYAN$BOLD " > SNIFFING PACKETS IN ${ifaces_array[$selection]}" $END 1399 | echo "" 1400 | echo -e $UNDERRED$BLACK"Ctrl+C to cancel"$END 1401 | echo "" 1402 | tcpdump -i ${ifaces_array[$selection]} $filters 1403 | 1404 | ;; 1405 | 1406 | pping*) 1407 | echo -e $LIGHTYELLOW"advping"$END")" "Ping (personalized)" 1408 | echo "" 1409 | 1410 | echo -e "From which interface you want to throw the ping?" 1411 | 1412 | options_selector $number_of_interfaces "ifaces_array" 1413 | 1414 | echo -ne $BLINK" > "$END$LIGHTYELLOW ; read selection ; echo -ne "" $END 1415 | 1416 | response_checker "$selection" "$number_of_interfaces" 1417 | 1418 | ## If selection is 0, exit this option 1419 | if [[ $selection == "exit" ]]; then break; fi 1420 | 1421 | echo -e "Fill the options:" 1422 | echo -ne $BLINK" > IP: "$END$LIGHTYELLOW ; read ip_address ; echo -ne "" $END 1423 | 1424 | ip_checker $ip_address 1425 | 1426 | 1427 | pping_command="ping -I ${ifaces_array[$selection]}" 1428 | 1429 | 1430 | echo -ne $BLINK"> Count (n): "$END$LIGHTYELLOW ; read count ; echo -ne "" $END 1431 | if [[ $count != "" ]]; 1432 | then 1433 | pping_command="${pping_command} -c ${count}" 1434 | fi 1435 | 1436 | echo -ne $BLINK"> Interval (s): "$END$LIGHTYELLOW ; read interval ; echo -ne "" $END 1437 | if [[ $interval != "" ]]; 1438 | then 1439 | pping_command="${pping_command} -i ${interval}" 1440 | fi 1441 | 1442 | echo -ne $BLINK"> Size (b): "$END$LIGHTYELLOW ; read size ; echo -ne "" $END 1443 | if [[ $size != "" ]]; 1444 | then 1445 | pping_command="${pping_command} -s ${size}" 1446 | fi 1447 | 1448 | echo -ne $BLINK"> TTL (n): "$END$LIGHTYELLOW ; read ttl ; echo -ne "" $END 1449 | if [[ $ttl != "" ]]; 1450 | then 1451 | pping_command="${pping_command} -t ${ttl}" 1452 | fi 1453 | 1454 | echo -ne $BLINK"> QoS (tclass): "$END$LIGHTYELLOW ; read qos ; echo -ne "" $END 1455 | if [[ $qos != "" ]]; 1456 | then 1457 | pping_command="${pping_command} -Q ${qos}" 1458 | fi 1459 | 1460 | echo "" 1461 | echo "" 1462 | echo "" 1463 | echo -e $CYAN$BOLD $pping_command $ip_address $END 1464 | echo "" 1465 | 1466 | echo -e $UNDERRED$BLACK"Ctrl+C to cancel"$END 1467 | echo "" 1468 | 1469 | 1470 | $pping_command $ip_address 1471 | 1472 | ;; 1473 | 1474 | ovpn*) 1475 | echo -e $LIGHTYELLOW"ovpn"$END")" "Connect to a OVPN server" 1476 | echo "" 1477 | 1478 | if [[ $number_of_ovpns_active > "0" ]]; 1479 | then 1480 | echo "There is alredy active connections. Do you want to finish it?" 1481 | 1482 | options_selector $number_of_ovpns_active "ovpns_active_array" 1483 | 1484 | echo -ne $BLINK" > "$END$LIGHTYELLOW ; read selection ; echo -ne "" $END 1485 | echo "" 1486 | 1487 | response_checker "$selection" "$number_of_ovpns_active" 1488 | 1489 | ## If selection is 0, exit this option 1490 | if [[ $selection == "exit" ]]; then break; fi 1491 | 1492 | pid=`ps aux | grep ${ovpns_active_array[$selection]} | head -n1 | tr -s [[:space:]] | cut -f2 -d" "` 1493 | 1494 | echo -e $CYAN$BOLD" > Killing the process $pid corresponding to the process ${ovpns_active_array[$selection]}"$END 1495 | 1496 | kill $pid 1497 | 1498 | echo "" 1499 | echo "" 1500 | 1501 | elif [[ $ovpns_extracted == '' ]]; 1502 | then 1503 | echo "There is no OVPN profiles configured in the system." 1504 | echo "You need to export your OVPN profiles from your OVPN Server to the path $HOME/.secret/ovpns/ of this OVPN client and then rerun Hack_Utils." 1505 | 1506 | exit 0 1507 | else 1508 | : 1509 | fi 1510 | 1511 | echo "Select the VPN profile you want to connect to (profiles saves in ${directories_array[0]})" 1512 | options_selector $number_of_ovpns "ovpns_array" 1513 | 1514 | echo -ne $BLINK" > "$END$LIGHTYELLOW ; read selection ; echo -ne "" $END 1515 | echo "" 1516 | 1517 | response_checker "$selection" "$number_of_ovpns" 1518 | 1519 | ## If selection is 0, exit this option 1520 | if [[ $selection == "exit" ]]; then break; fi 1521 | 1522 | echo "" 1523 | echo -ne $CYAN$BOLD" > Connecting to VPN with profile ${ovpns_array[$selection]}\n"$END 1524 | 1525 | sudo openvpn --config ${directories_array[0]}${ovpns_array[$selection]} 2> /dev/null & 1526 | 1527 | waitFunction "6" "0.10" 1528 | 1529 | ;; 1530 | 1531 | cliweb*) 1532 | echo -e $LIGHTYELLOW"cliweb"$END")" "Web in CLI (elinks)" 1533 | echo "" 1534 | 1535 | echo -e "Type the URL of the webpage. Press "$UNDERRED$BLACK"q or Ctrl+C to exit elinks"$END 1536 | echo -ne $BLINK" > "$END$LIGHTYELLOW ; read url ; echo -ne "" $END 1537 | 1538 | elinks $url 1539 | 1540 | ignore_continue_enter=true 1541 | 1542 | ;; 1543 | 1544 | macman*) 1545 | echo -e $LIGHTYELLOW"macman"$END")" "MAC manufacturer" 1546 | echo "" 1547 | 1548 | echo -e "Type the MAC (required internet):" 1549 | echo -ne $BLINK" > "$END$LIGHTYELLOW ; read mac ; echo -ne "" $END 1550 | 1551 | mac=`echo $mac | tr '[a-z]' '[A-Z]' | tr -d ":" | tr -d "." | tr -d [:space:] | cut -c 1-6` 1552 | echo "" 1553 | echo "" 1554 | 1555 | echo "> VENDOR" 1556 | output=`curl https://gist.githubusercontent.com/aallan/b4bb86db86079509e6159810ae9bd3e4/raw/846ae1b646ab0f4d646af9115e47365f4118e5f6/mac-vendor.txt | grep $mac` 1557 | 1558 | echo -e $CYAN$BOLD$output$END 1559 | 1560 | ;; 1561 | 1562 | anon*) 1563 | 1564 | echo -e $LIGHTYELLOW"anon"$END")" "Anonymizer" 1565 | echo "" 1566 | 1567 | while true; 1568 | do 1569 | torctlstatus=`torctl status | grep -w "tor service is:" | rev | cut -f1 -d" " | rev` 1570 | anonsurfstatus=`sudo anonsurf status | grep -w "Active:" | tr -s [:space:] ":" | cut -f3 -d":"` 1571 | nordvpnstatus=`nordvpn status | grep -w "Status:" | rev | cut -f1 -d" " | rev` 1572 | 1573 | options_array=("IP TOR anonymizer for Arch Linux (torctl) (activate / deactivate): $torctlstatus" "IP TOR anonymizer for Kali Linux (anonsurf) (activate / deactivate): $anonsurfstatus" "Change MAC address" "Restore MAC address" "NordVPN (activate / deactivate): $nordvpnstatus") 1574 | options_selector 5 "options_array" 1575 | 1576 | echo -ne $BLINK" > "$END$LIGHTYELLOW ; read option ; echo -ne "" $END 1577 | echo "" 1578 | 1579 | case $option in 1580 | 1) 1581 | clear 1582 | 1583 | #torctlstatus=`torctl status | grep -ow "tor service is: inactive"` 1584 | 1585 | if [[ $torctlstatus == 'inactive' ]]; 1586 | then 1587 | echo -e $GREEN"\n------------- Activating TORCTL -------------\n"$END 1588 | sudo systemctl start tor 1589 | else 1590 | echo -e $RED"\n------------- Deactivating TORCTL -------------\n"$END 1591 | sudo systemctl stop tor 1592 | fi 1593 | 1594 | ;; 1595 | 1596 | 2) 1597 | clear 1598 | 1599 | path=`which anonsurf` 1600 | 1601 | if [[ $path == '' ]]; 1602 | then 1603 | echo -e " " 1604 | echo -e $UNDERRED$BLACK"Anonsurf not installed."$END 1605 | 1606 | else 1607 | if [[ $anonsurfstatus == 'inactive' ]]; 1608 | then 1609 | echo -e $GREEN"\n------------- Activating ANONSURF -------------\n"$END 1610 | anonsurf start 1611 | else 1612 | echo -e $RED"\n------------- Deactivating ANONSURF -------------\n"$END 1613 | anonsurf stop 1614 | fi 1615 | fi 1616 | 1617 | ;; 1618 | 1619 | 3) 1620 | clear 1621 | 1622 | iface=`ip addr | awk '/state UP/ {print $2}' | sed 's/.$//'` 1623 | 1624 | ip link set $iface down 1625 | output=`macchanger --another $iface` 1626 | ip link set $iface up 1627 | 1628 | #echo -e $output | grep -o -E '([[:xdigit:]]{1,2}:){5}[[:xdigit:]]{1,2}' 1629 | echo -e $CYAN$BOLD"\n"$output | sed 's/) /)\n/g'; echo -e $END 1630 | 1631 | #valid_option=true 1632 | 1633 | ;; 1634 | 1635 | 4) 1636 | clear 1637 | 1638 | iface=`ip addr | awk '/state UP/ {print $2}' | sed 's/.$//'` 1639 | 1640 | ip link set $iface down 1641 | output=`macchanger --permanent $iface` 1642 | ip link set $iface up 1643 | 1644 | #echo -e $output | grep -o -E '([[:xdigit:]]{1,2}:){5}[[:xdigit:]]{1,2}' 1645 | echo -e $CYAN$BOLD"\n"$output | sed 's/) /)\n/g'; echo -e $END 1646 | 1647 | ;; 1648 | 1649 | 5) 1650 | clear 1651 | 1652 | path=`which nordvpn` 1653 | 1654 | if [[ $path == '' ]]; 1655 | then 1656 | echo -e " " 1657 | echo -e $UNDERRED$BLACK"NordVPN not installed."$END 1658 | 1659 | else 1660 | if [[ $nordvpnstatus == 'Disconnected' ]]; 1661 | then 1662 | echo -e $GREEN"\n------------- Connecting to NordVPN -------------\n"$END 1663 | 1664 | echo -e $CYAN$BOLD 1665 | nordvpn countries 1666 | echo -e $END 1667 | 1668 | echo -e "\nType the country you want to connect to:" 1669 | echo -ne $BLINK" > "$END$LIGHTYELLOW ; read country ; echo -ne "" $END 1670 | echo "" 1671 | 1672 | nordvpn connect $country 1673 | 1674 | echo -e $CYAN$BOLD 1675 | nordvpn status 1676 | echo -e $END 1677 | else 1678 | echo -e $RED"\n------------- Disconnecting from NordVPN -------------\n"$END 1679 | 1680 | nordvpn disconnect 1681 | 1682 | echo -e $CYAN$BOLD 1683 | nordvpn status 1684 | echo -e $END 1685 | fi 1686 | fi 1687 | 1688 | ;; 1689 | 1690 | 0) 1691 | ignore_continue_enter=true 1692 | break 1693 | 1694 | ;; 1695 | 1696 | *) 1697 | invalidoption=true 1698 | ignore_continue_enter=false 1699 | 1700 | ;; 1701 | esac 1702 | done 1703 | ;; 1704 | 1705 | 1706 | malware*) 1707 | echo -e $LIGHTYELLOW"malware"$END")" "Cyber threats search (Malware Bazaar API)" 1708 | echo "" 1709 | 1710 | echo -e "Enter the hash MD5, SHA1 or SHA256 of the threat (Example):" 1711 | echo -ne $BLINK" > "$END$LIGHTYELLOW ; read hash ; echo -ne "" $END 1712 | echo "" 1713 | 1714 | 1715 | wget --post-data "query=get_info&hash="$hash https://mb-api.abuse.ch/api/v1/ --output-document=${directories_array[2]}malware_bazaar_tmp.json 1716 | sed 's/ANY.RUN/ANYRUN/g' ${directories_array[2]}malware_bazaar_tmp.json > ${directories_array[2]}malware_bazaar.json 1717 | rm ${directories_array[2]}malware_bazaar_tmp.json 1718 | 1719 | if [[ $(cat ${directories_array[2]}malware_bazaar.json | jq -r .query_status) != "ok" ]]; 1720 | then 1721 | echo -e $RED$BOLD "Hash not found in Malware Bazaar" 1722 | echo "" 1723 | 1724 | break 1725 | fi 1726 | 1727 | files_array=( "${directories_array[2]}malware_bazaar_tmp.json" "${directories_array[2]}malware_bazaar.json" "${directories_array[2]}triage_signatures_raw.txt" "${directories_array[2]}triage_scores_raw.txt" ) 1728 | 1729 | for file in "${files_array[@]}" 1730 | do 1731 | touch $file 1732 | chmod 766 $file 1733 | done 1734 | 1735 | echo -e $CYAN$BOLD " > HASHES" $END 1736 | echo -ne "SHA256: " $CYAN$BOLD; jq -r '.data[] | .sha256_hash' ${directories_array[2]}malware_bazaar.json; echo -ne $END 1737 | echo -ne "SHA3_384: " $CYAN$BOLD; jq -r '.data[] | .sha3_384_hash' ${directories_array[2]}malware_bazaar.json; echo -ne $END 1738 | echo -ne "SHA1: " $CYAN$BOLD; jq -r '.data[] | .sha1_hash' ${directories_array[2]}malware_bazaar.json; echo -ne $END 1739 | echo -ne "MD5: " $CYAN$BOLD; jq -r '.data[] | .md5_hash' ${directories_array[2]}malware_bazaar.json; echo -ne $END 1740 | echo "" 1741 | echo -e $CYAN$BOLD " > FILE INFO" $END 1742 | echo -ne "First seen: " $CYAN$BOLD; jq -r '.data[] | .first_seen' ${directories_array[2]}malware_bazaar.json; echo -ne $END 1743 | echo -ne "Last seen: " $CYAN$BOLD; jq -r '.data[] | .last_seen' ${directories_array[2]}malware_bazaar.json; echo -ne $END 1744 | echo -ne "File name: " $CYAN$BOLD; jq -r '.data[] | .file_name' ${directories_array[2]}malware_bazaar.json; echo -ne $END 1745 | echo -ne "File size: " $CYAN$BOLD; output=`jq -r '.data[] | .file_size' ${directories_array[2]}malware_bazaar.json`; echo -ne "0"; echo "scale=3; $output / 1024 /1024" | bc -l | sed "s/$/ MB/g"; echo -ne $END 1746 | echo -ne "File type mime: " $CYAN$BOLD; jq -r '.data[] | .file_type_mime' ${directories_array[2]}malware_bazaar.json; echo -ne $END 1747 | echo -ne "File type: " $CYAN$BOLD; jq -r '.data[] | .file_type' ${directories_array[2]}malware_bazaar.json; echo -ne $END 1748 | echo -ne "Reporter: " $CYAN$BOLD; jq -r '.data[] | .reporter' ${directories_array[2]}malware_bazaar.json; echo -ne $END 1749 | echo -ne "Origin country: " $CYAN$BOLD; jq -r '.data[] | .origin_country' ${directories_array[2]}malware_bazaar.json; echo -ne $END 1750 | echo -ne "Signature: " $CYAN$BOLD; jq -r '.data[] | .signature' ${directories_array[2]}malware_bazaar.json; echo -ne $END 1751 | echo -ne "Code sign: " $CYAN$BOLD; jq -r '.data[] | .code_sign' ${directories_array[2]}malware_bazaar.json; echo -ne $END 1752 | echo -ne "Delivery method: " $CYAN$BOLD; jq -r '.data[] | .delivery_method' ${directories_array[2]}malware_bazaar.json; echo -ne $END 1753 | echo -ne "Comment: " $CYAN$BOLD; jq -r '.data[] | .comment' ${directories_array[2]}malware_bazaar.json; echo -ne $END 1754 | echo "" 1755 | echo -e $CYAN$BOLD " > ANALYSIS" $END 1756 | echo -e $CYAN$BOLD "any.run" $END 1757 | echo -ne "Detection: " $CYAN$BOLD; jq -r '.data[].vendor_intel.ANYRUN[].verdict' ${directories_array[2]}malware_bazaar.json | sed '/Malicious[[:space:]]activity/s//'$(printf "\e[31mMaliciousactivity\033[0m")'/' | sed 's/Maliciousactivity/Malicious activity/g'; echo -ne $END; 1758 | echo -ne "URL: " $BLUE$BOLD; jq -r '.data[].vendor_intel.ANYRUN[].analysis_url' ${directories_array[2]}malware_bazaar.json; echo -ne $END 1759 | echo -e $CYAN$BOLD "cape" $END 1760 | echo -ne "Detection: " $CYAN$BOLD; jq -r '.data[].vendor_intel.CAPE.detection' ${directories_array[2]}malware_bazaar.json; echo -ne $END 1761 | echo -ne "URL: " $BLUE$BOLD; jq -r '.data[].vendor_intel.CAPE.link' ${directories_array[2]}malware_bazaar.json; echo -ne $END 1762 | echo -e $CYAN$BOLD "tria.ge" $END 1763 | echo -ne "Malware family: " $CYAN$BOLD; jq -r '.data[].vendor_intel.Triage.malware_family' ${directories_array[2]}malware_bazaar.json; echo -ne $END 1764 | echo -ne "Score: " $CYAN$BOLD; score=`jq -r '.data[].vendor_intel.Triage.score' ${directories_array[2]}malware_bazaar.json`; malware_score_checker $score; echo -ne $END 1765 | echo -ne "URL: " $BLUE$BOLD; jq -r '.data[].vendor_intel.Triage.link' ${directories_array[2]}malware_bazaar.json; echo -ne $END 1766 | echo -e "Signatures: " 1767 | echo "" 1768 | 1769 | jq -r '.data[].vendor_intel.Triage.signatures[].signature' ${directories_array[2]}malware_bazaar.json > ${directories_array[2]}triage_signatures_raw.txt 1770 | jq -r '.data[].vendor_intel.Triage.signatures[].score' ${directories_array[2]}malware_bazaar.json > ${directories_array[2]}triage_scores_raw.txt 1771 | 1772 | counter=1 1773 | ladder=" " 1774 | 1775 | echo -ne $CYAN$BOLD"$ladder""Init>"$END 1776 | 1777 | while IFS= read -r line 1778 | do 1779 | score=`cat ${directories_array[2]}triage_scores_raw.txt | sed -n $counter\p` 1780 | 1781 | echo -e "┐ " 1782 | echo -ne "$ladder""┌────┴─╢ " 1783 | echo -e $CYAN$BOLD $line $END 1784 | echo -ne "$ladder""├─╢ Score: " 1785 | 1786 | malware_score_checker $score 1787 | 1788 | 1789 | echo -e "$ladder""│" 1790 | echo -ne "$ladder""└───>──" 1791 | 1792 | $((counter++)) 2> /dev/null 1793 | ladder+=" " 1794 | 1795 | sleep 0.1 1796 | 1797 | done < ${directories_array[2]}triage_signatures_raw.txt 1798 | 1799 | echo -e $CYAN$BOLD"\bEnd<" $END 1800 | echo "" 1801 | echo -e $CYAN$BOLD "ReversingLabs" $END 1802 | echo -ne "Threat name: " $CYAN$BOLD; jq -r '.data[].vendor_intel.ReversingLabs.threat_name' ${directories_array[2]}malware_bazaar.json; echo -ne $END 1803 | echo -ne "Status: " $CYAN$BOLD; jq -r '.data[].vendor_intel.ReversingLabs.status' ${directories_array[2]}malware_bazaar.json | sed '/MALICIOUS/s//'$(printf "\e[31mMALICIOUS\033[0m")'/'; echo -ne $END; 1804 | echo -ne "First seen: " $CYAN$BOLD; jq -r '.data[].vendor_intel.ReversingLabs.first_seen' ${directories_array[2]}malware_bazaar.json; echo -ne $END 1805 | echo -ne "Scanner count: " $CYAN$BOLD; jq -r '.data[].vendor_intel.ReversingLabs.scanner_count' ${directories_array[2]}malware_bazaar.json; echo -ne $END 1806 | echo -ne "Scanner match: " $CYAN$BOLD; jq -r '.data[].vendor_intel.ReversingLabs.scanner_match' ${directories_array[2]}malware_bazaar.json; echo -ne $END 1807 | echo -ne "Scanner score: " $CYAN$BOLD; output=`jq -r '.data[].vendor_intel.ReversingLabs.scanner_percent' ${directories_array[2]}malware_bazaar.json`; output=`echo "scale=0; $output / 10" | bc -l`; malware_score_checker $output; echo -ne $END 1808 | echo -e $CYAN$BOLD "UnpacMe" $END 1809 | echo -ne "URL: " $BLUE$BOLD; jq -r '.data[].vendor_intel.UnpacMe[].link' ${directories_array[2]}malware_bazaar.json | uniq; echo -ne $END 1810 | 1811 | for file in "${files_array[@]}" 1812 | do 1813 | rm $file 1814 | done 1815 | 1816 | ;; 1817 | 1818 | conv*) 1819 | echo -e $LIGHTYELLOW"conv"$END")" "Hex / Base64 converter" 1820 | echo "" 1821 | 1822 | options_array=( "Base64" "Hex" "Binary" ) 1823 | options_selector 3 "options_array" 1824 | 1825 | echo -ne $BLINK" > "$END$LIGHTYELLOW ; read selection ; echo -ne "" $END 1826 | echo "" 1827 | 1828 | echo $selection 1829 | 1830 | response_checker "$selection" "3" 1831 | 1832 | ## If selection is 0, exit this option 1833 | if [[ $selection == "0" ]]; then break; fi 1834 | 1835 | string="" 1836 | 1837 | case $selection in 1838 | 1) 1839 | while true; 1840 | do 1841 | clear 1842 | 1843 | if [[ $string == "exit" ]]; 1844 | then 1845 | ignore_continue_enter=true 1846 | break 1847 | fi 1848 | 1849 | echo -e $LIGHTYELLOW"conv"$END")" "Base64 converter" 1850 | echo "" 1851 | 1852 | echo -e $CYAN$BOLD" > DECODE"$END 1853 | echo $string | base64 --decode 2> /dev/null 1854 | 1855 | echo "" 1856 | echo "" 1857 | 1858 | echo -e $CYAN$BOLD" > ENCODE "$END 1859 | echo $string | base64 | sed '/^Cg==$/d' 1860 | 1861 | echo "" 1862 | echo "" 1863 | echo "" 1864 | 1865 | echo -e "Type the string you want to encode / decode (To return to the main menu type "$LIGHTYELLOW"exit"$END"):" 1866 | echo -ne $BLINK" > "$END"Text: "$LIGHTYELLOW ; read string ; echo -ne "" $END 1867 | 1868 | done 1869 | ;; 1870 | 1871 | 2) 1872 | while true; 1873 | do 1874 | clear 1875 | 1876 | if [[ $string == "exit" ]]; 1877 | then 1878 | ignore_continue_enter=true 1879 | break 1880 | fi 1881 | 1882 | echo -e $LIGHTYELLOW"conv"$END")" "Hex converter" 1883 | echo "" 1884 | 1885 | echo -e $CYAN$BOLD" > DECODE"$END 1886 | echo $string | xxd -p -r 1887 | 1888 | echo "" 1889 | echo "" 1890 | 1891 | echo -e $CYAN$BOLD" > ENCODE "$END 1892 | echo $string | xxd -ps | sed '/^0a$/d' 1893 | echo "" 1894 | echo "" 1895 | 1896 | echo -e $CYAN$BOLD" > HEXDUMP "$END 1897 | echo $string | xxd | sed '/^00000000: 0a .$/d' 1898 | 1899 | echo "" 1900 | echo "" 1901 | echo "" 1902 | 1903 | echo -e "Type the string you want to encode / decode (To return to the main menu type "$LIGHTYELLOW"exit"$END"):" 1904 | echo -ne $BLINK" > "$END"Text: "$LIGHTYELLOW ; read string ; echo -ne "" $END 1905 | 1906 | done 1907 | 1908 | ;; 1909 | 1910 | 3) 1911 | while true; 1912 | do 1913 | clear 1914 | 1915 | if [[ $string == "exit" ]]; 1916 | then 1917 | ignore_continue_enter=true 1918 | break 1919 | fi 1920 | 1921 | echo -e $LIGHTYELLOW"conv"$END")" "Binary converter" 1922 | echo "" 1923 | 1924 | echo -e $CYAN$BOLD" > ENCODE"$END 1925 | output=`echo $string | xxd -b -d | sed 's/ /:/g' | sed 's/: /:/g' | cut -f2 -d":"` 1926 | echo $output | sed '/^00001010$/d' 1927 | 1928 | echo "" 1929 | echo "" 1930 | echo "" 1931 | 1932 | echo -e $CYAN$BOLD" > BINARYDUMP "$END 1933 | echo $string | xxd -b -d | sed '/^00000000: 00001010 .$/d' 1934 | echo "" 1935 | echo "" 1936 | 1937 | echo -e "Type the string you want to encode / decode (To return to the main menu type "$LIGHTYELLOW"exit"$END"):" 1938 | echo -ne $BLINK" > "$END"Text: "$LIGHTYELLOW ; read string ; echo -ne "" $END 1939 | 1940 | done 1941 | 1942 | ;; 1943 | 1944 | 1945 | 0) 1946 | ignore_continue_enter=true 1947 | break 1948 | 1949 | ;; 1950 | *) 1951 | invalidoption=false 1952 | ignore_continue_enter=false 1953 | 1954 | ;; 1955 | esac 1956 | 1957 | ;; 1958 | 1959 | sshtun*) 1960 | echo -e $LIGHTYELLOW"sshtun"$END")" "SSH tunneling" 1961 | echo "" 1962 | 1963 | echo "nothing... 4 now..." 1964 | 1965 | ;; 1966 | 1967 | fkap*) 1968 | echo -e $LIGHTYELLOW"fkap"$END")" "Fake Access Point: Evil twin" 1969 | echo "" 1970 | 1971 | echo -e "What you want to do?" 1972 | 1973 | options_array=("Create an Evil Twin" "View the backgrounded Evil Twin") 1974 | options_selector 2 "options_array" 1975 | 1976 | echo -ne $BLINK" > "$END$LIGHTYELLOW ; read selection ; echo -ne "" $END 1977 | echo "" 1978 | 1979 | ## If selection is 0, exit this option 1980 | if [[ $selection == "exit" ]]; then break; fi 1981 | 1982 | case $selection in 1983 | 1) 1984 | 1985 | echo -e "From which wireless interface you want to start the Evil Twin?" 1986 | 1987 | options_selector $number_of_wlan_interfaces "wlan_ifaces_array" 1988 | 1989 | echo -ne $BLINK" > "$END$LIGHTYELLOW ; read selection ; echo -ne "" $END 1990 | echo "" 1991 | 1992 | response_checker "$selection" "$number_of_interfaces" 1993 | 1994 | ## If selection is 0, exit this option 1995 | if [[ $selection == "exit" ]]; then break; fi 1996 | 1997 | selection_interface=$selection 1998 | 1999 | echo -e "What IP address do you want the Evil Twin to have? This address wil be the default GW for the clients." 2000 | echo -e "Press "$LIGHTYELLOW"ENTER"$END" to leave by default ("$CYAN$BOLD"10.10.0.1"$END")." 2001 | echo -ne $BLINK" > "$END" IP: "$LIGHTYELLOW ; read ip_address ; echo -ne "" $END 2002 | echo "" 2003 | 2004 | if [[ -z $ip_address ]]; 2005 | then 2006 | ip_address="10.10.0.1" 2007 | 2008 | else 2009 | ip_checker $ip_address 2010 | 2011 | fi 2012 | 2013 | echo -e "Enter the SSID name for the network:" 2014 | echo -ne $BLINK" > "$END$LIGHTYELLOW ; read ssid ; echo -ne "" $END 2015 | echo "" 2016 | 2017 | echo -e "Enter the password to access the network." 2018 | echo -e "Press "$LIGHTYELLOW"ENTER"$END" to create an open AP:" 2019 | echo -ne $BLINK" > "$END$LIGHTYELLOW ; read passwd ; echo -ne "" $END 2020 | echo "" 2021 | 2022 | echo -e "Which interface you want to use for post-routing (NAT to internet)?" 2023 | 2024 | options_selector $number_of_interfaces "ifaces_array" 2025 | 2026 | echo -ne $BLINK" > "$END$LIGHTYELLOW ; read selection ; echo -ne "" $END 2027 | echo "" 2028 | 2029 | response_checker "$selection" "$number_of_interfaces" 2030 | 2031 | ## If selection is 0, exit this option 2032 | if [[ $selection == "exit" ]]; then break; fi 2033 | 2034 | selection_interface_nat=$selection 2035 | 2036 | time=0.1 2037 | 2038 | active_sessions=`tmux list-sessions | egrep "FKAP-[0-9]{0,1}" | cut -f1 -d":"` 2039 | 2040 | for session in $active_sessions: 2041 | do 2042 | tmux kill-session -t $session && sleep $time 2043 | 2044 | done 2045 | 2046 | tmux new-session -d -t FKAP && sleep $time 2047 | tmux split-window -h && sleep $time 2048 | #tmux resize-pane -t 1 -L 12 && sleep $time 2049 | 2050 | tmux select-pane -t 1 && sleep $time 2051 | tmux send-keys "sudo bash /etc/hackutils/arp_table.sh 2> /dev/null" C-m && sleep $time 2052 | 2053 | tmux select-pane -t 0 && sleep $time 2054 | tmux send-keys "sudo bash /etc/hackutils/fkap.sh ${wlan_ifaces_array[$selection_interface]} $ip_address $ssid $passwd ${ifaces_array[$selection_interface_nat]} 2> /dev/null" C-m && sleep $time 2055 | #tmux list-sessions 2056 | 2057 | echo -e $CYAN$BOLD" > The Evil Twin can be run in the background by pressing "$LIGHTYELLOW"Ctrl + b --> d (detached)"$END 2058 | waitFunction "5" "0.40" 2059 | 2060 | tmux attach-session -t FKAP 2061 | 2062 | echo -e $CYAN$BOLD" > THE EVIL TWIN IS WORKING ON BACKGROUND IN TMUX"$END 2063 | ;; 2064 | 2065 | 2) 2066 | echo "Active tmux sessions:" 2067 | tmux list-sessions | grep "FKAP" 2068 | tmux attach-session -t FKAP 2069 | 2070 | echo "" 2071 | ;; 2072 | 2073 | 0) 2074 | ignore_continue_enter=true 2075 | 2076 | break 2077 | ;; 2078 | 2079 | *) 2080 | invalidoption=true 2081 | ignore_continue_enter=false 2082 | ;; 2083 | 2084 | esac 2085 | ;; 2086 | 2087 | dwa*) 2088 | echo -e $LIGHTYELLOW"dwa"$END")" "Deauth Wireless Attack" 2089 | echo "" 2090 | 2091 | echo -e "What you want to do?" 2092 | 2093 | options_array=("Attack a WiFi network" "View the backgrounded attack" "End the backgrounded attack") 2094 | options_selector 3 "options_array" 2095 | 2096 | echo -ne $BLINK" > "$END$LIGHTYELLOW ; read selection ; echo -ne "" $END 2097 | echo "" 2098 | 2099 | ## If selection is 0, exit this option 2100 | if [[ $selection == "exit" ]]; then break; fi 2101 | 2102 | case $selection in 2103 | 1) 2104 | 2105 | echo -e "From which interface you want to make the attack" 2106 | 2107 | options_selector $number_of_wlan_interfaces "wlan_ifaces_array" 2108 | 2109 | echo -ne $BLINK" > "$END$LIGHTYELLOW ; read selection ; echo -ne "" $END 2110 | echo "" 2111 | 2112 | response_checker "$selection" "$number_of_wlan_interfaces" 2113 | 2114 | ## If selection is 0, exit this option 2115 | if [[ $selection == "exit" ]]; then break; fi 2116 | 2117 | time=0.1 2118 | 2119 | active_sessions=`tmux list-sessions | egrep "DWA-[0-9]{0,1}" | cut -f1 -d":"` 2120 | 2121 | for session in $active_sessions: 2122 | do 2123 | tmux kill-session -t $session && sleep $time 2124 | 2125 | done 2126 | 2127 | tmux new-session -d -t DWA && sleep $time 2128 | tmux split-window -h && sleep $time 2129 | #tmux resize-pane -t 1 -L 12 && sleep $time 2130 | 2131 | tmux select-pane -t 0 && sleep $time 2132 | tmux send-keys "sudo bash /etc/hackutils/dwa.sh ${wlan_ifaces_array[$selection]} 2> /dev/null" C-m && sleep $time 2133 | 2134 | #tmux list-sessions 2135 | tmux attach-session -t DWA 2136 | 2137 | echo -e $CYAN$BOLD" > THE ATTACK IS WORKING ON BACKGROUND IN TMUX"$END 2138 | ;; 2139 | 2140 | 2) 2141 | echo "Active tmux sessions:" 2142 | tmux list-sessions | grep "DWA" 2143 | tmux attach-session -t DWA 2144 | 2145 | echo "" 2146 | ;; 2147 | 2148 | 3) 2149 | echo "Killing tmux session..." 2150 | #tmux kill-session -t DWA 2151 | 2152 | for interface in ${wlan_ifaces_array[@]} 2153 | do 2154 | output=`iwconfig $interface | grep "Mode:Monitor" | egrep -o "wlan[0-9]{1,2}"` 2155 | 2156 | if [[ -n "$output" ]]; 2157 | then 2158 | echo "Setting the $interface as managed mode..." 2159 | ip link set $interface down 2160 | iwconfig $interface mode managed 2161 | ip link set $interface up 2162 | fi 2163 | 2164 | done 2165 | ;; 2166 | 2167 | 2168 | 0) 2169 | ignore_continue_enter=true 2170 | 2171 | break 2172 | ;; 2173 | 2174 | *) 2175 | invalidoption=true 2176 | ignore_continue_enter=false 2177 | 2178 | ;; 2179 | esac 2180 | ;; 2181 | 2182 | htb*) 2183 | echo -e $LIGHTYELLOW"htb"$END")" "Hack The Box" 2184 | echo "" 2185 | 2186 | if [[ $(ls /etc/hackutils | grep htbExplorer) != "" ]]; 2187 | then 2188 | 2189 | echo -e "What you want to do?" 2190 | 2191 | options_array=("Setup the hacking enviroment" "Connect to HTB VPN" "Download my HTB VPN profile") 2192 | options_selector 3 "options_array" 2193 | 2194 | echo -ne $BLINK" > "$END$LIGHTYELLOW ; read selection ; echo -ne "" $END 2195 | echo "" 2196 | 2197 | ## If selection is 0, exit this option 2198 | if [[ $selection == "exit" ]]; then break; fi 2199 | 2200 | case $selection in 2201 | 1) 2202 | echo "Type the name of the machine you want to hack:" 2203 | echo -ne $BLINK" > "$END$LIGHTYELLOW ; read machine ; echo -ne "" $END 2204 | echo "" 2205 | 2206 | sudo htbExplorer -s $machine 2207 | cd ${directories_array[1]} 2208 | mkdir $machine; cd $machine 2209 | bash /etc/hackutils/htbMkt.sh 2210 | 2211 | echo -ne "\n\nDirectory created for $CYAN$BOLD$machine$END -->" $CYAN$BOLD; pwd; echo -e $END 2212 | echo -ne "Directory tree created $CYAN$BOLD$machine$END machine: \n"; tree ${directories_array[1]}$machine 2213 | echo "" 2214 | echo "" 2215 | 2216 | ;; 2217 | 2218 | 2) 2219 | mv ${configurations_array[0]} ${directories_array[0]} 2> /dev/null 2220 | pid=`ps aux | grep davidahid.ovpn | head -n1 | tr -s [[:space:]] | grep /home/b4shnhawx/.secret/ovpns/ | cut -f2 -d" "` 2221 | 2222 | if [[ $(ls ${directories_array[0]} | grep ${configurations_array[0]}) == "" ]]; 2223 | then 2224 | echo -e $LIGHTRED$BOLD"An error was ocurred while trying to connect to the VPN. I couldn't find the profile ${configurations_array[0]} in the directory ${directories_array[0]}"$END 2225 | 2226 | break 2227 | 2228 | elif [[ $pid != "" ]]; 2229 | then 2230 | echo -e $CYAN$BOLD" > It seems that you are already connected to the HTB VPN. If you think you are not, try killing the existing process ($pid) and try again. If it continues to give problems, re-download your HTB VPN profile."$END 2231 | else 2232 | echo "" 2233 | echo -ne $CYAN$BOLD" > Connecting to HTB VPN\n"$END 2234 | echo "" 2235 | echo -e "HTB VPN directory: $CYAN$BOLD${directories_array[0]}${configurations_array[0]}"$END 2236 | nohup openvpn ${directories_array[0]}${configurations_array[0]} 2> /dev/null & 2237 | waitFunction "6" "0.10" 2238 | 2239 | echo -ne $CYAN$BOLD" > When you want to disconnect from the HTB VPN you can use the ovpn) option of Hack_Utils!"$END 2240 | fi 2241 | 2242 | ;; 2243 | 2244 | 3) 2245 | echo -ne $CYAN$BOLD" > Login in HTB\n"$END 2246 | pkill "openvpn" 2247 | 2248 | waitFunction "4" "0.10" 2249 | 2250 | cd /etc/hackutils/ 2251 | 2252 | echo -ne "Email: " 2253 | sudo python /etc/hackutils/htbExplorer/downloadVPN.py ${configurations_array[0]} 2254 | 2255 | if [[ $(ls /etc/hackutils | grep \.ovpn) != ${configurations_array[0]} ]]; 2256 | then 2257 | echo -e $LIGHTRED$BOLD"An error was ocurred while trying to download VPN: " 2258 | echo -e "$TAB - Bad email or password" 2259 | echo -e "$TAB - Bad installation of htbExplorer" 2260 | echo -e "$TAB - Bad configuration in hack_utils.conf" 2261 | echo -e "$TAB - Python request library not installed (apt-get install python-request)"$END 2262 | 2263 | break 2264 | fi 2265 | 2266 | ;; 2267 | 2268 | 0) 2269 | ignore_continue_enter=true 2270 | 2271 | break 2272 | ;; 2273 | 2274 | *) 2275 | invalidoption=true 2276 | ignore_continue_enter=false 2277 | 2278 | ;; 2279 | esac 2280 | 2281 | else 2282 | mkdir /etc/hackutils/ 2> /dev/null 2283 | cd /etc/hackutils/ 2284 | 2285 | echo -e $LIGHTRED$BOLD"htbExplorer is not installed..."$END 2286 | echo -e $CYAN$BOLD" > Downloading repository from github.com/s4vitar..."$END 2287 | 2288 | git clone https://github.com/s4vitar/htbExplorer.git 2289 | cd htbExplorer 2290 | cp htbExplorer htbExplorer_tmp 2291 | 2292 | echo "" 2293 | echo "Type your HTB API token:" 2294 | echo -ne $BLINK" > "$END$LIGHTYELLOW ; read api ; echo -ne "" $END 2295 | echo "" 2296 | 2297 | cat htbExplorer_tmp | sed "s|API_TOKEN=""|API_TOKEN='${api}' #|g" > htbExplorer 2298 | #sudo cp downloadVPN.py /etc/hackutils/ 2299 | #sudo cp htbExplorer /etc/hackutils/ 2300 | sudo cp htbExplorer /usr/bin 2301 | sudo chmod +x /usr/bin/htbExplorer 2302 | 2303 | fi 2304 | 2305 | ;; 2306 | 2307 | http*) 2308 | echo -e $LIGHTYELLOW"http"$END")" "Python simple HTTP server" 2309 | echo "" 2310 | 2311 | echo -e "In which port you want to configure your HTTP server?" 2312 | echo -e "Press "$LIGHTYELLOW"ENTER"$END" to leave by default ("$CYAN$BOLD"8000"$END")." 2313 | echo -ne $BLINK" > "$END" IP: "$LIGHTYELLOW ; read port ; echo -ne "" $END 2314 | echo "" 2315 | 2316 | if [[ -z $port ]]; 2317 | then 2318 | port="8000" 2319 | else 2320 | port_checker "$port" 2321 | fi 2322 | 2323 | echo -e $CYAN$BOLD" > Serving "${directories_array[6]}" in "$port$END 2324 | 2325 | cd ${directories_array[6]}; python -m SimpleHTTPServer $port &> /dev/null & 2326 | cd 2327 | ;; 2328 | 2329 | rev*) 2330 | while true; 2331 | do 2332 | clear 2333 | 2334 | echo -e $LIGHTYELLOW"rev"$END")" "Listener for reverse shells connections" 2335 | echo "" 2336 | 2337 | echo -e "What you want to do?" 2338 | 2339 | options_array=("Start new listener" "View one backgrounded listener" "Terminate all enabled reverse shells") 2340 | options_selector 3 "options_array" 2341 | 2342 | echo -ne $BLINK" > "$END$LIGHTYELLOW ; read selection ; echo -ne "" $END 2343 | echo "" 2344 | 2345 | ## If selection is 0, exit this option 2346 | if [[ $selection == "exit" ]]; then break; fi 2347 | 2348 | case $selection in 2349 | 1) 2350 | echo -e "What interface you want to monitor in conky?" 2351 | 2352 | options_selector $number_of_interfaces "ifaces_array" 2353 | 2354 | echo -ne $BLINK" > "$END$LIGHTYELLOW ; read selection ; echo -ne "" $END 2355 | echo "" 2356 | 2357 | response_checker "$selection" "$number_of_interfaces" 2358 | 2359 | ip_address=`ip addr | grep ${ifaces_array[$selection]} | egrep -o "(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])/[0-9]{2}" | cut -f1 -d"/"` 2360 | 2361 | ## If selection is 0, exit this option 2362 | if [[ $selection == "exit" ]]; then break; fi 2363 | 2364 | 2365 | echo "Type the port you want to use for listen:" 2366 | echo -ne $BLINK" > "$END$LIGHTYELLOW ; read port ; echo -ne "" $END 2367 | echo "" 2368 | 2369 | port_checker "$port" 2370 | 2371 | time=0.1 2372 | 2373 | echo -e $CYAN$BOLD" > Starting new listener in "$RED"$ip_address"":""$port"$END 2374 | 2375 | waitFunction "3" "0.1" 2376 | 2377 | ip_address=`echo $ip_address | tr '.' '-'` 2378 | 2379 | session_name="REV-"$ip_address"_"$port 2380 | 2381 | tmux new-session -d -t $session_name && sleep $time 2382 | #tmux resize-pane -t 1 -L 12 && sleep $time 2383 | tmux select-pane -t 0 && sleep $time 2384 | 2385 | ip_address=`echo $ip_address | tr '-' '.'` 2386 | 2387 | tmux send-keys "stty raw -echo; (stty size; cat) | nc -nlvp $port -s $ip_address" C-m && sleep $time 2388 | 2389 | ;; 2390 | 2391 | 2) 2392 | sessions_extracted=`tmux list-sessions | egrep -o "^REV-(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\-){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])_[0-9]{1,5}-[0-9]{1,2}" | tr '\n' " "` 2393 | 2394 | read -a sessions_array <<< $sessions_extracted 2395 | 2396 | number_of_sessions=${#sessions_array[@]} 2397 | 2398 | if [[ $number_of_sessions > 0 ]]; 2399 | then 2400 | echo "Select the reverse shell:" 2401 | options_selector $number_of_sessions "sessions_array" 2402 | 2403 | echo -ne $BLINK" > "$END$LIGHTYELLOW ; read selection ; echo -ne "" $END 2404 | echo "" 2405 | 2406 | echo -e $CYAN$BOLD" > Remember that if you want to exit but keep the reverse shell in background you must press "$LIGHTYELLOW"Ctrl + b --> d (detached)"$END 2407 | waitFunction "5" "0.20" 2408 | 2409 | tmux attach-session -t ${sessions_array[$selection]} 2410 | 2411 | if [[ $? == 1 ]]; then echo ""; echo ""; echo -e $LIGHTRED$BOLD"Selected invalid reverse shell"$END; sleep 2; fi 2412 | 2413 | else 2414 | echo -e $LIGHTRED$BOLD"No reverse shell available"$END 2415 | 2416 | break 2417 | fi 2418 | ;; 2419 | 2420 | 3) 2421 | active_sessions=`tmux list-sessions | egrep "^REV-(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\-){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])_[0-9]{1,5}-[0-9]{1,2}" | cut -f1 -d":"` 2422 | 2423 | for session in $active_sessions: 2424 | do 2425 | echo "Killing reverse shell $session" 2426 | tmux kill-session -t $session && sleep $time 2427 | waitFunction "3" "0.03" 2428 | done 2429 | ;; 2430 | 2431 | 0) 2432 | ignore_continue_enter=true 2433 | 2434 | break 2435 | 2436 | ;; 2437 | 2438 | *) 2439 | invalidoption=true 2440 | ignore_continue_enter=false 2441 | 2442 | ;; 2443 | 2444 | esac 2445 | done 2446 | ;; 2447 | 2448 | 0) 2449 | exit 2450 | 2451 | ;; 2452 | 2453 | *) 2454 | invalidoption=ignore 2455 | 2456 | #read 2457 | 2458 | ;; 2459 | esac 2460 | 2461 | break 2462 | 2463 | done 2464 | 2465 | #If the user type an invalid option... 2466 | if [[ $ignore_continue_enter == true ]]; 2467 | then 2468 | #...do nothing 2469 | : 2470 | 2471 | #...but if the option is included in the case 2472 | elif [[ $invalidoption == false ]]; 2473 | then 2474 | #Waits for user to press the enter key after he view what he need 2475 | echo "" 2476 | echo "" 2477 | echo -ne $UNDERGRAY$BLACK"Press ENTER to go back to the main menu"$END$HIDE 2478 | tput civis 2479 | read 2480 | tput cnorm 2481 | 2482 | elif [[ $invalidoption == true ]]; 2483 | then 2484 | #Waits for user to press the enter key after he view what he need 2485 | echo "" 2486 | echo "" 2487 | echo -ne $UNDERRED$WHITE"Invalid option... omiting... Press ENTER to go back to the main menu"$END$HIDE 2488 | tput civis 2489 | read 2490 | tput cnorm 2491 | 2492 | elif [[ $invalidoption == error ]]; 2493 | then 2494 | tput civis 2495 | read 2496 | tput cnorm 2497 | 2498 | elif [[ $invalidoption == ignore ]]; 2499 | then 2500 | : 2501 | 2502 | else 2503 | #Waits for user to press the enter key after he view what he need 2504 | echo "" 2505 | echo "" 2506 | echo -ne $UNDERRED$WHITE"error"$END$HIDE 2507 | tput civis 2508 | read 2509 | tput cnorm 2510 | fi 2511 | 2512 | invalidoption=false 2513 | ignore_continue_enter=false 2514 | #Set all control variables to default 2515 | #selected_interface="" 2516 | #option="" 2517 | done 2518 | --------------------------------------------------------------------------------