-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain.sh
180 lines (159 loc) · 4.92 KB
/
Main.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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
#!/bin/bash
app_name=${BASH_SOURCE[0]#*/}
#how to use it is very easy the first step you have to create a file containing a bunch of domain instances domain.txt
#You can also use option by typing bash Main.sh -? or --help
#if you use --file option then there should be --output option
#########################
# code by polygon #
#########################
# percuma kalo gua encode ama jaa gak bisa di git pull
# tinggal make susah amat
# noh wa w : 6285731184377
# chat aja
source $(cd "$(dirname $0)" && pwd)/lib/moduler.sh
Bash.import: text_display/string text_display/colorama
Bash.import: util/type
b=$(mode.bold: biru) cy=$(mode.bold: cyan)
ij=$(mode.bold: hijau) un=$(mode.bold: ungu)
me=$(mode.bold: merah) pu=$(mode.bold: putih)
ku=$(mode.bold: kuning) st=$(default.color)
m=$(mode.bold: pink)
# color translator
##############################################
# ungu = violet
# putih = white
# biru = blue
# hijau = green
# kuning = yellow
# merah = red
##############################################
# to validate the package if the package is not installed it will install it otamtis
if ! command -v resolveip>/dev/null 2>&1; then begin:
apt-get --fix-missing install mariadb>/dev/null 2>&1 || begin:
Tulis.strN "Please turn on your internet (Tolong nyalakan internet anda)"
__bash__
__bash__
fi
DEBUG "if the resolveip package is not found it will automatically install the package but if the install fails it will stop and give a message to turn on the internet"
##################
# valiadasi file #
##################
file:(){
local file=$1; # arguments
# verify the file exists or not if it won't send you a message (memverifikasikan file ada atau tidak jika ada maka akan menmapilkan pesan)
if [[ ! -f "$file" ]]; then
Tulis.strN "${bi}»${ku} File not found ${me}!${st}"
exit 5
fi
e=$(cat $file | wc -l)
# e=$(wc -l $file | cut -d ' ' -f1)
}
resolve.list:(){
local list=${1:-Notfound}
local get
if [[ $list == Notfound ]]; then
Tulis.strN ${list}
exit 2
fi
file: ${1}
list_dom=$(cat $list)
for get in `cat "$list"`; do
resolveip "$get"
# if [[ $count -eq $e ]]; then
# break
# fi
done
# local count
# for((count = 2; count <= $e; count ++)); do
# result=$(cat deb.tmp | tail +$count | head -1)
# done
# @return: result
return 1
}
show.list:(){
local run="$1"
local found=$e
i=0
[[ -z "$run" ]] && { return 2; }
s=$(echo "$1" | wc -l)
while ((i<=100)); do
sleep 0.1
reparse=$(echo "$run" | sort -n)
((i++))
if [[ $i -eq $s ]]; then
break
fi
done
@return: reparse
}
trap "rm -rf deb.tmp;tput cnorm;tput sgr0; exit $?" SIGINT INT
Main.scrap(){
[[ -z "$1" ]] && { usage;exit 4; }
tput civis
rep=$(resolve.list: "$1")
slot=$(show.list: "$rep")
count=$(echo "${slot:-None}" | wc -l)
Tulis.strN "\e[90m-------------------------------${me}[\e[90mAuthor : polygon${me}]\e[90m---------------------------------${st}"
for ((i=0; i<=$count; i++)); do
sleep 0.1s
Tulis.str "${b}[${ij}$(date +%H:%M:%S)${b}]${ku} [${un}Result${ku}]${me}-${ij}>${pu} "
printf "$slot" | tail +$i | head -1
Tulis.str "${st}"
done
if [[ -z "$2" ]]; then
Tulis.strN "Author : Bayu riski (Polygon)
tool: draw ip from domain list (menggambil ip dari beberapa domain list)
data: $(date)
list: $1
__________________________________\n">found.txt
else
Tulis.strN "Author : Bayu riski (Polygon)
tool: draw ip from domain list (menggambil ip dari beberapa domain list)
data: $(date)
list: $1
__________________________________\n">$2
fi
if [[ -z "$2" ]]; then
lokal_found="found.txt"
else
lokal_found="$2"
fi
Tulis.strN "${slot}"> deb.tmp
[[ ! -f $lokal_found ]] && begin: tput cnorm;tput sgr0;return 2; __bash__
[[ -z "$2" ]] && { Tulis.strN "\n\n${cy}[${ku}$(date)${cy}]${pu} Found ${me}$(cat deb.tmp | wc -l) ${pu}File${me}:${pu} Found.txt"; } || { Tulis.strN "\n\n${cy}[${ku}$(date)${cy}]${pu} Found ${me}$(cat deb.tmp | wc -l) ${pu}File${me}:${pu} $2"; }
[[ -z "$2" ]] && { cat deb.tmp>>found.txt; } || { cat deb.tmp>>$2; }
rm -rf deb.tmp
tput cnorm; tput sgr0
}
usage(){
Tulis.strN "usage : bash $(basename $0).sh list.txt [option]
\e[90m---------------------------------------------${st}
-f, --file File
-o, --output save domain result to file (menyimpan hasil domain ke file)
-?, --help display help (menampilkan bantuan)
\e[90m---------------------------------------------${st}
"
exit $?
}
if [[ "$1" == "--file" || "$1" == "-f" ]]; then
[[ -z "$2" ]] && { usage; exit 2; }
domain_list="$2"
fi
if [[ "$3" == "--output" || "$3" == "-o" ]]; then
[[ -z "$4" ]] && { usage; exit 3; }
Main.scrap "$domain_list" "$4"
exit 0
elif [[ "$1" == "-?" || "$1" == "--help" ]]; then
echo
usage
echo
exit 0
elif [[ ! -z "$1" ]]; then
Main.scrap "$1"
exit
else
echo
usage
echo
exit 5
fi