-
Notifications
You must be signed in to change notification settings - Fork 47
/
main
executable file
·204 lines (177 loc) · 4.48 KB
/
main
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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
#!/usr/bin/env bash
# Fix problems of directories
here=`dirname "$0"`
cd "$here"
# colors art
. ./modules/colors.sh
# Banner
echo -e """
$red /\ o
o /_ /~/
\ /\/
\ /
\ /
.{{}}}}}}.
{{{{{}}}}}}}.
{{{{ {}{{}}}}
}}}}} - - {{{{{
}}}} 0 0 }}}&
{{{{{---~^~---{{{&
}}}}}}\ ☭ /}}&&&
{{{{{{{;._ .;}}&&&&
'{{{{{{) \_(}}|//&
´''''': :''''´
[ \e[5m$bgred\033[38;5;232mOWASP D4N155$end $red]
"""
# ignore lower and uppercase
shopt -s nocasematch
# and colors with dont fuck terminal
printf "$end"
# Vars
export aggressive="0"
bug="""
You can report new bug or open a issue
\t$yellow→ $orange https://github.com/owasp/D4N155/issues$end
"""
help="""
Or use the Telegram bot https://t.me/D4N155_bot
D4N155: Tool for smart audit security
Usage: bash main <option> <value>
All options are optionals
Options:
-w, --wordlist <url|ip> Make the smartwordlist based in informations
on website.
-t, --targets <file> Make the smart-wordlist based in your passed
source informations in urls.
-b, --based <file> Analyze texts to generate the
custom wordlist
-r, --rate <time> Defines time interval between requests
-o, --output <file> For to store the all wordlist.
-?a, --aggressive Aggressive reading with headless
-h, --help Show this mensage.
Value: <url | ip | source | file | time>
URL URL target, example: scanme.nmap.org
IP IP address
TIME Time, example: 2.5. I.e: 00:00:02:30. 0 are default
FILE File, for save the result, get urls or using in
wordlist
Version: 1.3
It's GNU/GPL version 3
Project page: https://github.com/owasp/D4N155"""
# All functions
. modules/functions.sh
. modules/load.sh
printf "\033[32m"
trap -- "printf \"\n$bug\";kill $! &> /dev/null;exit 2" "SIGINT"
__compile(){
go build -o modules/GoMutation modules/GoMutation.go && \
echo "$success Compiled GoMutation" || echo "$error Golang dont installed"
}
test -x "modules/GoMutation" || __compile
# Menu
__interative(){
printf "\033[0m"
PS3="D4N155%#~> "
select option in "Make wordlist tradicional" "Make wordlist aggressive"
do
case $option in
"Make wordlist tradicional")
export aggressive="0"
__wordlist
;;
"Make wordlist aggressive")
export aggressive="1"
_checkGecko
__wordlist
;;
*) echo -e "\033[31mRFTM\033[0m";exit ;;
esac
done
printf "\033[0m"
}
if [[ ! "$1" ]]
then
__interative
else
# vars for iterations
i=1
x=1
util=0
save=""
time=""
while [ "$i" -le "$#" ]
do
# arg: argument
# narg: next arg.
# parg: primary arg.
# pvarg: primary value of arg.
eval "arg=\${$i}"
eval "narg=\${$(($i+1))}"
# The block of code are for arguments
# like "-o, --output", for get the arg.
# when will be used.
while [ "$x" -le "$#" ]
do
# para: parameter
# dest: destination
eval "para=\${$x}"
eval "dest=\${$(($x+1))}"
case "$para" in
--o* | "-o")
# export the file for storaged
export save="$dest"
;;
--r* | "-r")
export time="$dest"
;;
--a* | -*a*)
export aggressive="1"
_checkGecko
;;
esac
# For work in loop
x=$(($x+1))
done
case "$arg" in
--h* | "-h")
echo "$help"
exit 0
;;&
--w* | -*w*)
echo "Make the smart wordlist"
if [[ $narg =~ ^- ]]
then
test "$save" == "" && \
__wordlist "" "" "$time"|| \
__wordlist "" "$save" "$time"
else
test "$save" == "" && \
__wordlist "$narg" "" "$time"|| \
__wordlist "$narg" "$save" "$time"
fi
util=$(($util+1))
;;&
--b* | -*b*)
echo "Make custom wordlist"
if [ $save ]
then
[ "$narg" ] && __cus "$narg" "$save" || ( echo -e " $orange → bash main --help$end ";exit 2)
else
[ "$narg" ] && __cus "$narg" || ( echo -e " $orange → bash main --help$end ";exit 2 )
fi
util=$(($util+1))
;;
--t* | -*t*)
echo -e "Targets inputed in $orange $narg $green "
__fwordlist "$narg" "" "$time"
util=$(($util+1))
;;
esac
i=$(($i+1))
done
if [ $util == 0 ]
then
echo "Opening to interative mode..."
__interative
fi
fi