forked from MbahPinguinSakti/simpeAutoPentest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
simpleautopentest.sh
executable file
·140 lines (124 loc) · 4 KB
/
simpleautopentest.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
#!/bin/bash
# Loop while untuk cek koneksi ke google.com
while true; do
# Jalankan ping di background dan tangkap PID-nya
ping -c 1 google.com &>/dev/null &
ping_pid=$!
# Progress bar s
echo -n "Checking host connections: "
for i in {1..15}; do
# Periksa apakah proses ping masih berjalan
if ps -p $ping_pid >/dev/null; then
printf ">"
sleep 0.6
else
break
fi
done
# Tunggu proses ping selesai (pastikan selesai)
wait $ping_pid
# Cek apakah ping berhasil atau gagal
if [ $? -eq 0 ]; then
echo " [Connect]"
sleep 1
break
else
echo " [Failed to connect]"
exit
fi
done
sleep 2
clear
RED="\e[31m"
GREEN="\e[32m"
ENDCOLOR="\e[0m"
# Decorative banner (optional)
echo ""
echo -e "${GREEN} +------------------------------------------------------+ ${ENDCOLOR}"
echo -e "${RED} | _ _ _ _ __ __ _ _ _ | ${ENDCOLOR}"
echo -e "${GREEN} || | | | ___| | | ___ \ \ / /__ _ __| | __| | || ${ENDCOLOR}"
echo -e "${RED} || |_| |/ _ \ | |/ _ \ \ \ /\ / / _ \| '__| |/ _ | || ${ENDCOLOR}"
echo -e "${GREEN} || _ | __/ | | (_) | \ V V / (_) | | | | (_| |_|| ${ENDCOLOR}"
echo -e "${RED} ||_| |_|\___|_|_|\___/ \_/\_/ \___/|_| |_|\__,_(_)| ${ENDCOLOR}"
echo -e "${GREEN} +------------------------------------------------------+ ${ENDCOLOR}"
echo ""
# Define variables
read -p "Masukkan nama target untuk subdomain enum: " namatarget
sublist="subdlist.txt"
domain_target_list="${namatarget}NEW_${sublist}"
new_dir_name="${namatarget}${counter}"
# Create ~/simpleautopentest directory if it doesn't exist
if [ ! -d ~/simpleautopentest ]; then
mkdir -p ~/simpleautopentest
fi
cd ~/simpleautopentest
# Cek apakah direktori target sudah ada
if [ -d "$namatarget" ]; then
# Cek apakah direktori memiliki angka di akhir nama
if [[ "$namatarget" =~ ^(.+?)([0-9]+)$ ]]; then
# Jika ya, ambil bagian nama dan angkanya
base_name="${BASH_REMATCH[1]}"
number="${BASH_REMATCH[2]}"
# Tambahkan angka di akhir
new_number=$((number + 1))
new_dir_name="${base_name}${new_number}"
else
# Jika tidak ada angka di akhir, tambahkan angka 1
new_dir_name="${namatarget}1"
fi
# Loop untuk mengecek apakah direktori dengan nama baru sudah ada
while [ -d "$new_dir_name" ]; do
# Tambahkan angka terus sampai nama yang unik ditemukan
if [[ "$new_dir_name" =~ ^(.+?)([0-9]+)$ ]]; then
base_name="${BASH_REMATCH[1]}"
number="${BASH_REMATCH[2]}"
new_number=$((number + 1))
new_dir_name="${base_name}${new_number}"
fi
done
# Membuat direktori baru dengan nama yang dihasilkan
mkdir -p "$new_dir_name"
echo "Direktori baru bernama: $new_dir_name telah sukses dibuat"
cd "$new_dir_name"
else
echo "Membuat direktori target"
echo -e "\n"
mkdir -p "$namatarget" && cd "$namatarget"
fi
#makeing new file
if [[ -f "${namatarget}.txt" ]]; then
echo "males buat statement lagi jadi langsung timpa ajaa"
for i in {1..10}; do
printf "-"
sleep 0.5
done
echo ""
fi
echo "memulai enumerating subdomain"
for i in {1..20}; do
printf "#"
sleep 0.1
done
echo ""
#enumerate subdomain
subfinder -d $namatarget -o $domain_target_list >/dev/null 2>&1
#!/bin/bash
# Meminta input dari pengguna
read -p "Ingin menemukan unique subdomain, atau vulnscan (1/2): " choice
# Menjalankan case statement berdasarkan pilihan pengguna
case $choice in
1)
echo "Memulai pencarian unique subdomain..."
httpx-toolkit -l "$domain_target_list" -sc -title -cl -wc -td | tee httpx.txt >/dev/null 2>&1
echo "done..."
;;
2)
echo "Memulai vulnscan..."
katana -list "$domain_target_list" -o "${namatarget}urls.txt" >/dev/null 2>&1
nuclei -list "${namatarget}urls.txt"
;;
*)
echo "Pilihan tidak valid. Harap pilih 1 atau 2."
;;
esac
echo "output tersimpan di ${HOME}/simpleautopentest"