-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain
executable file
·191 lines (166 loc) · 4.05 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
#!/usr/bin/env bash
# Fix problems of directories
here=`dirname "$0"`
cd "$here"
# colors art
green='\e[32m'
bgred='\e[41m'
red='\e[31m'
# Banner
echo -e """
$red /\ o
o /_ /~/
\ /\/
\ /
\ /
.{{}}}}}}.
{{{{{}}}}}}}.
{{{{ {}{{}}}}
}}}}} _ _ {{{{{
}}}} a a }}}&
{{{{{ ^ {{{&
}}}}}}\ .=. /}}&&&
{{{{{{{;.___.;}}&&&&
'{{{{{{) (}}|//&
´''''': :''''´
[ \e[5m$bgred\033[38;5;232mAt Segmentation Fault\e[m $red]
"""
# ignore lower and uppercase
shopt -s nocasematch
# and colors with dont fuck terminal
printf "\033[0m"
# Vars
help="""
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.
-v, --vulners <url|ip> Get urls that can cause attacks.
-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.
-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: 0:02:30. 0 are default
FILE File, for save the result, get urls or using in
wordlist
Version: 0.50 (Dev)
It's GNU/GPL version 3
Project page: https://github.com/adasecurity/D4N155"""
# All functions
. modules/functions.sh
# menu interative
__interative(){
printf "\033[0m"
PS3="D4N155%#~> "
select option in "Find vulnerabilities" "Make wordlist"
do
case $option in
"Find vulnerabilities")
__vul
;;
"Make wordlist")
__wordlist
;;
*) echo -e "\033[31mRFTM\033[0m";exit ;;
esac
done
printf "\033[0m"
}
# Menu
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"
;;
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))
;;&
--v* | -*v*)
# Exists $narg? Then ok, go go
echo "Find to vulnerabilties"
echo "$narg"
[ "$narg" ] && __vul "$narg" || ( echo -e "\e[33m→ bash main --help\e[m";exit 2 )
util=$(($util+1))
;;&
--b* | -*b*)
echo "Make custom wordlist"
if [ $save ]
then
[ "$narg" ] && __cus "$narg" "$save" || ( echo -e "\e[33m→ bash main --help\e[m";exit 2)
else
[ "$narg" ] && __cus "$narg" || ( echo -e "\e[33m→ bash main --help\e[m";exit 2 )
fi
util=$(($util+1))
;;
--t* | "-t")
echo -e "Targets inputed in \e[33m$narg\e[32m"
__fwordlist "$narg" "" "$time"
util=$(($util+1))
;;
esac
i=$(($i+1))
done
if [ $util == 0 ]
then
echo "Opening to interative mode..."
__interative
fi
fi