-
Notifications
You must be signed in to change notification settings - Fork 1
/
dbuster
90 lines (88 loc) · 2.6 KB
/
dbuster
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
#!/bin/ruby
require_relative "lib/reqs"
require_relative "src/init"
arg_one = ARGV[0]
parse_one = ARGV[1]
arg_two = ARGV[2]
parse_two = ARGV[3]
if(arg_one == "--help" || arg_one == "-h")
puts "Usage: dbuster [-h || --help] To show this message and exit
dbuster [-u || --url] Url to attack"
exit(0)
end
if not arg_one
puts "Invalid args!"
puts "Usage: dbuster [-h || --help] To show this message and exit
dbuster [URL] Url to attack
dbuster [-w || --wordlist] Custom wordlist to use"
exit(0)
end
if(arg_one == "--version" || arg_one =="-v")
puts "Copyright 2021-2022 DioBrando and Josh Wash.
This program are in 0.5v"
exit(0)
end
if(arg_one)
red = "\033[1;31m"
green = "\033[1;32m"
yellow = "\033[1;33m"
cyan = "\033[1;36m"
reset = "\033[0;0m"
init_message()
begin
require_relative "lib/reqs"
rescue LoadError
error_initial()
end
url = arg_one
line = File.readlines('wordlists/common.txt')
for i in line
if not url.end_with? '/' and not url.include? 'https:'
new_url='https://'+url+'/'
begin
current_message(new_url);
if(req(new_url,i.strip()) == 200)
puts(new_url+"#{green}"+i.strip()+"#{reset}")
else
end
rescue Errno::ECONNREFUSED => e
req(new_url,i.strip())
end
end
if url.include? 'https:' and not url.end_with? '/'
new_url=url+'/'
begin
current_message(new_url);
if(req(new_url,i.strip()) == 200)
puts(new_url+"#{green}"+i.strip()+"#{reset}")
else
end
rescue Errno::ECONNREFUSED => e
req(new_url,i.strip())
end
end
if not url.include? "/" and not url.include? "https:"
new_url='https://'+url
begin
current_message(new_url);
if(req(new_url,i.strip()) == 200)
puts(new_url+"#{green}"+i.strip()+ "#{reset}")
else
end
rescue Errno::ECONNREFUSED => e
req(new_url,i.strip())
end
end
begin
req(url, i.strip())
if(req(url, i.strip()) == 200)
puts(url+"#{green}"+i.strip()+"#{reset}")
end
rescue SignalException => e
puts "\n#{reset}[#{red}!#{reset}] Control+C detected!\nQuitting"
exit(0)
rescue => e
req(url,i.strip())
end
end
end