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.
@@ -1,64 +1,64 @@
1
- # frozen_string_literal: true
2
-
3
- require 'httparty'
4
- require 'uri'
5
- module Snackhack2
6
- class CryptoExtractWebsite
7
- attr_accessor :save_file
8
-
9
- def initialize(site, save_file: true)
10
- @http = Snackhack2::get(site).body
11
- @site = site
12
- @save_file = save_file
13
- end
14
-
15
- def all
16
- addresses = []
17
- addresses << monero unless monero.nil?
18
- addresses << bitcoin unless bitcoin.nil?
19
- addresses << dash unless dash.nil?
20
- addresses << ethereum unless ethereum.nil?
21
- addresses << bitcoincash unless bitcoincash.nil?
22
- addresses << litecoin unless litecoin.nil?
23
- addresses << dogecoin unless dogecoin.nil?
24
- addresses << stellar unless stellar.nil?
25
- if @save_file
26
- Snackhack2::file_save(@site, "cryptoaddresses", addresses.uniq.join("\n"))
27
- else
28
- puts addresses.join("\n")
29
- end
30
- end
31
-
32
- def monero
33
- @http.scan(/([48][0-9AB][1-9A-HJ-NP-Za-km-z]{93})/)
34
- end
35
-
36
- def bitcoin
37
- @http.scan(/(bc(0([ac-hj-np-z02-9]{39}|[ac-hj-np-z02-9]{59})|1[ac-hj-np-z02-9]{8,87})|[13][a-km-zA-HJ-NP-Z1-9]{25,35})/)
38
- end
39
-
40
- def dash
41
- @http.scan(/(X[1-9A-HJ-NP-Za-km-z]{33})/)
42
- end
43
-
44
- def stellar
45
- @http.scan(/(G[A-Z0-9]{55}$)/)
46
- end
47
-
48
- def litecoin
49
- @http.scan(/([LM3][a-km-zA-HJ-NP-Z1-9]{26,33})/)
50
- end
51
-
52
- def dogecoin
53
- @http.scan(/(D{1}[56789ABCDEFGHJKLMNPQRSTU]{1}[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{32}$)/)
54
- end
55
-
56
- def ethereum
57
- @http.scan(/(0x[a-fA-F0-9]{40})/)
58
- end
59
-
60
- def bitcoincash
61
- @http.scan(/([13][a-km-zA-HJ-NP-Z1-9]{33})/)
62
- end
63
- end
64
- end
1
+ # frozen_string_literal: true
2
+
3
+ require 'httparty'
4
+ require 'uri'
5
+ module Snackhack2
6
+ class CryptoExtractWebsite
7
+ attr_accessor :save_file
8
+
9
+ def initialize(site, save_file: true)
10
+ @http = Snackhack2.get(site).body
11
+ @site = site
12
+ @save_file = save_file
13
+ end
14
+
15
+ def all
16
+ addresses = []
17
+ addresses << monero unless monero.nil?
18
+ addresses << bitcoin unless bitcoin.nil?
19
+ addresses << dash unless dash.nil?
20
+ addresses << ethereum unless ethereum.nil?
21
+ addresses << bitcoincash unless bitcoincash.nil?
22
+ addresses << litecoin unless litecoin.nil?
23
+ addresses << dogecoin unless dogecoin.nil?
24
+ addresses << stellar unless stellar.nil?
25
+ if @save_file
26
+ Snackhack2.file_save(@site, 'cryptoaddresses', addresses.uniq.join("\n"))
27
+ else
28
+ puts addresses.join("\n")
29
+ end
30
+ end
31
+
32
+ def monero
33
+ @http.scan(/([48][0-9AB][1-9A-HJ-NP-Za-km-z]{93})/)
34
+ end
35
+
36
+ def bitcoin
37
+ @http.scan(/(bc(0([ac-hj-np-z02-9]{39}|[ac-hj-np-z02-9]{59})|1[ac-hj-np-z02-9]{8,87})|[13][a-km-zA-HJ-NP-Z1-9]{25,35})/)
38
+ end
39
+
40
+ def dash
41
+ @http.scan(/(X[1-9A-HJ-NP-Za-km-z]{33})/)
42
+ end
43
+
44
+ def stellar
45
+ @http.scan(/(G[A-Z0-9]{55}$)/)
46
+ end
47
+
48
+ def litecoin
49
+ @http.scan(/([LM3][a-km-zA-HJ-NP-Z1-9]{26,33})/)
50
+ end
51
+
52
+ def dogecoin
53
+ @http.scan(/(D{1}[56789ABCDEFGHJKLMNPQRSTU]{1}[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{32}$)/)
54
+ end
55
+
56
+ def ethereum
57
+ @http.scan(/(0x[a-fA-F0-9]{40})/)
58
+ end
59
+
60
+ def bitcoincash
61
+ @http.scan(/([13][a-km-zA-HJ-NP-Z1-9]{33})/)
62
+ end
63
+ end
64
+ end
@@ -0,0 +1,99 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'resolv'
4
+ module Snackhack2
5
+ class Dns
6
+ attr_accessor :site
7
+
8
+ def initialize()
9
+ @site = site
10
+ end
11
+
12
+ def all_dns
13
+ nameserver
14
+ soa
15
+ txt
16
+ aaaa
17
+ mx
18
+ end
19
+
20
+ def a
21
+ a = []
22
+ Resolv::DNS.open do |dns|
23
+ ress = dns.getresources @site.to_s, Resolv::DNS::Resource::IN::A
24
+ ress.each do |l|
25
+ a << l.address.to_s
26
+ end
27
+ end
28
+ a
29
+ end
30
+
31
+ def nameserver
32
+ ns = []
33
+ Resolv::DNS.open do |dns|
34
+ ress = dns.getresources @site.to_s, Resolv::DNS::Resource::IN::NS
35
+ ress.each do |l|
36
+ ns << l.name.to_s
37
+ end
38
+ end
39
+ ns
40
+ end
41
+
42
+ def soa
43
+ soa = []
44
+ Resolv::DNS.open do |dns|
45
+ ress = dns.getresources @site.to_s, Resolv::DNS::Resource::IN::SOA
46
+ ress.each do |l|
47
+ soa << l.rname
48
+ soa << l.mname
49
+ soa << l.ttl
50
+ end
51
+ end
52
+ soa
53
+ end
54
+
55
+ def txt
56
+ txt = []
57
+ Resolv::DNS.open do |dns|
58
+ ress = dns.getresources @site.to_s, Resolv::DNS::Resource::IN::TXT
59
+ ress.each do |l|
60
+ txt << l.strings.to_s
61
+ end
62
+ end
63
+ txt
64
+ end
65
+
66
+ def aaaa
67
+ aaaa = []
68
+ Resolv::DNS.open do |dns|
69
+ ress = dns.getresources @site.to_s, Resolv::DNS::Resource::IN::AAAA
70
+ ress.each do |l|
71
+ aaaa << l.address
72
+ end
73
+ end
74
+ aaaa
75
+ end
76
+
77
+ def hinfo
78
+ hinfo = []
79
+ Resolv::DNS.open do |dns|
80
+ ress = dns.getresources @site.to_s, Resolv::DNS::Resource::IN::HINFO
81
+ ress.each do |l|
82
+ hinfo << l.exchange.to_s
83
+ end
84
+ end
85
+ hinfo
86
+ end
87
+
88
+ def mx
89
+ mx = []
90
+ Resolv::DNS.open do |dns|
91
+ ress = dns.getresources @site.to_s, Resolv::DNS::Resource::IN::MX
92
+ ress.each do |l|
93
+ mx << l.exchange.to_s
94
+ end
95
+ end
96
+ mx
97
+ end
98
+ end
99
+ end
@@ -1,49 +1,47 @@
1
- require 'nokogiri'
2
- require 'open-uri'
3
- module Snackhack2
4
- class Drupal
5
- def initialize(site)
6
- @site = site
7
- end
8
-
9
- def all
10
- drupal_score
11
- user_brute
12
- end
13
-
14
- def drupal_score
15
- drupal_score = 0
16
- d = Snackhack2::get(@site)
17
- if d.code == 200
18
- d.headers.each do |k|
19
- if k.include?("drupal")
20
- drupal_score += 10
21
- end
22
- end
23
- end
24
- d.headers.each do |v|
25
- if v.include?("drupal")
26
- drupal_score += 10
27
- end
28
- end
29
- doc = Nokogiri::HTML(URI.open(@site))
30
- posts = doc.xpath('//meta')
31
- posts.each do |l|
32
- if l.attributes['content'].to_s.include?("Drupal")
33
- puts "[+] Drupal Version: #{l.attributes['content']}\n"
34
- end
35
- end
36
- puts "Drupal Score: #{drupal_score}"
37
- end
38
-
39
- def user_brute
40
- for user in 1..1000 do
41
- u = Snackhack2::get(File.join(@site, "user", user.to_s)).body
42
- if u.include?("Page not found")
43
- puts "User count: #{user - 1}"
44
- break
45
- end
46
- end
47
- end
48
- end
49
- end
1
+ # frozen_string_literal: true
2
+
3
+ require 'nokogiri'
4
+ require 'open-uri'
5
+ module Snackhack2
6
+ class Drupal
7
+ attr_accessor :site
8
+
9
+ def initialize
10
+ @site = site
11
+ end
12
+
13
+ def all
14
+ drupal_score
15
+ user_brute
16
+ end
17
+
18
+ def drupal_score
19
+ drupal_score = 0
20
+ d = Snackhack2.get(@site)
21
+ if d.code == 200
22
+ d.headers.each do |k|
23
+ drupal_score += 10 if k.include?('drupal')
24
+ end
25
+ end
26
+ d.headers.each do |v|
27
+ drupal_score += 10 if v.include?('drupal')
28
+ end
29
+ doc = Nokogiri::HTML(URI.open(@site))
30
+ posts = doc.xpath('//meta')
31
+ posts.each do |l|
32
+ puts "\n\n[+] Drupal Version: #{l.attributes['content']}\n" if l.attributes['content'].to_s.include?('Drupal')
33
+ end
34
+ puts "\nDrupal Score: #{drupal_score}\n"
35
+ end
36
+
37
+ def user_brute
38
+ (1..1000).each do |user|
39
+ u = Snackhack2.get(File.join(@site, 'user', user.to_s)).body
40
+ if u.include?('Page not found')
41
+ puts "\nUser count: #{user - 1}\n"
42
+ break
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end
@@ -1,35 +1,31 @@
1
- require 'httparty'
2
- require 'spidr'
3
- module Snackhack2
4
- class Email
5
- attr_accessor :max_depth
6
-
7
- def initialize(site, save_file: true, max_depth: 4)
8
- @site = site
9
- @save_file = save_file
10
- @max_depth = max_depth
11
- end
12
-
13
- def max_depth
14
- @max_depth
15
- end
16
-
17
- def run
18
- found_emails = []
19
- Spidr.start_at(@site, max_depth: @max_depth) do |agent|
20
- agent.every_page do |page|
21
- body = page.to_s
22
- if body.scan(/[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}/)
23
- email = body.scan(/[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}/).uniq
24
- if !email.include?(found_emails)
25
- if !email.empty?
26
- found_emails << email
27
- end
28
- end
29
- end
30
- end
31
- end
32
- Snackhack2::file_save(@site, "emails", found_emails.uniq.join("\n")) if @save_file
33
- end
34
- end
35
- end
1
+ # frozen_string_literal: true
2
+
3
+ require 'httparty'
4
+ require 'spidr'
5
+ module Snackhack2
6
+ class Email
7
+ attr_accessor :max_depth
8
+
9
+ def initialize(site, save_file: true, max_depth: 4)
10
+ @site = site
11
+ @save_file = save_file
12
+ @max_depth = max_depth
13
+ end
14
+
15
+ attr_reader :max_depth
16
+
17
+ def run
18
+ found_emails = []
19
+ Spidr.start_at(@site, max_depth: @max_depth) do |agent|
20
+ agent.every_page do |page|
21
+ body = page.to_s
22
+ if body.scan(/[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}/)
23
+ email = body.scan(/[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}/).uniq
24
+ found_emails << email if !email.include?(found_emails) && !email.empty?
25
+ end
26
+ end
27
+ end
28
+ Snackhack2.file_save(@site, 'emails', found_emails.uniq.join("\n")) if @save_file
29
+ end
30
+ end
31
+ end
@@ -1,24 +1,26 @@
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
+ # frozen_string_literal: true
2
+
3
+ require 'net/ssh'
4
+ module Snackhack2
5
+ class SSHForwardRemote
6
+ attr_accessor :site, :user, :pass, :key, :lport, :lsite, :rport
7
+
8
+ def initialize
9
+ @site = site
10
+ @user = user
11
+ @pass = pass
12
+ @key = key
13
+ @lport = lport
14
+ @lsite = lsite
15
+ @rport = rport
16
+ end
17
+
18
+ def run
19
+ Net::SSH.start(@site, @user, password: @pass, keys: @key) do |ssh|
20
+ ssh.forward.remote(@lport, @lsite, @rport)
21
+ puts '[+] Starting SSH remote forward tunnel'
22
+ ssh.loop { true }
23
+ end
24
+ end
25
+ end
26
+ end
@@ -1,28 +1,30 @@
1
- # frozen_string_literal: true
2
-
3
- require 'httparty'
4
- module Snackhack2
5
- class GoogleAnalytics
6
- attr_accessor :site
7
-
8
- def initialize
9
- @site = site
10
- end
11
-
12
- def run
13
- a = Snackhack2::get(@site).body
14
- case a
15
- when /UA-\d{8}-\d/
16
- puts a.match(/UA-\d{8}-\d/)
17
- when /GTM-[A-Z0-9]{7}/
18
- puts a.match(/GTM-[A-Z0-9]{7}/)
19
- when /G-([0-9]+([A-Za-z]+[0-9]+)+)/
20
- puts a.match(/G-([0-9]+([A-Za-z]+[0-9]+)+)/)
21
- when /G-[A-Za-z0-9]+/
22
- puts a.match(/G-[A-Za-z0-9]+/)
23
- else
24
- puts '[+] No Google Analytics found :('
25
- end
26
- end
27
- end
28
- end
1
+ # frozen_string_literal: true
2
+
3
+ require 'httparty'
4
+ module Snackhack2
5
+ class GoogleAnalytics
6
+ attr_accessor :site
7
+
8
+ def initialize
9
+ @site = site
10
+ end
11
+
12
+ def run
13
+ a = Snackhack2.get(@site).body
14
+ case a
15
+ when /UA-\d{8}-\d/
16
+ puts a.match(/UA-\d{8}-\d/)
17
+ when /GTM-[A-Z0-9]{7}/
18
+ puts a.match(/GTM-[A-Z0-9]{7}/)
19
+ when /G-([0-9]+([A-Za-z]+[0-9]+)+)/
20
+ puts a.match(/G-([0-9]+([A-Za-z]+[0-9]+)+)/)
21
+ when /G-[A-Za-z0-9]+/
22
+ puts a.match(/G-[A-Za-z0-9]+/)
23
+ when /GT-[A-Za-z0-9]+/
24
+ puts a.match(/GT-[A-Za-z0-9]+/)
25
+ else
26
+ puts '[+] No Google Analytics found :('
27
+ end
28
+ end
29
+ end
30
+ end
@@ -1,32 +1,34 @@
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
1
+ # frozen_string_literal: true
2
+
3
+ module Snackhack2
4
+ class CommandInjection
5
+ attr_accessor :exe, :title, :prompt
6
+
7
+ def initialize(exe, title, prompt)
8
+ @exe = 'calc.exe'
9
+ @title = 'Click me!'
10
+ @prompt = 'To run calculator'
11
+ end
12
+
13
+ def wlrmdr_With_prompt
14
+ Process.spawn("wlrmdr.exe -s 3600 -f 0 -t #{title} -m #{@prompt} -a 10 -u #{@exe}")
15
+ end
16
+
17
+ def wlrmdr_without_prompt
18
+ Process.spawn("wlrmdr.exe -s 3600 -f 0 -t _ -m _ -a 11 -u #{@exe}")
19
+ end
20
+
21
+ def conhost
22
+ Process.spawn("conhost.exe #{@exe}")
23
+ end
24
+
25
+ def conhost_hide
26
+ # Specify --headless parameter to hide child process window (if applicable)
27
+ Process.spawn("conhost.exe --headless #{@exe}")
28
+ end
29
+
30
+ def ssh
31
+ Process.spawn("ssh -o ProxyCommand=#{@exe} .")
32
+ end
33
+ end
34
+ end
@@ -1,45 +1,52 @@
1
- # frozen_string_literal: true
2
- require 'socket'
3
- module Snackhack2
4
- class IpLookup
5
- attr_accessor :site
6
- def initialize
7
- @site = site
8
- end
9
-
10
- def run
11
- get_ip
12
- nslookup
13
- socket
14
- end
15
-
16
- def get_ip
17
- ips = []
18
- ip = `ping -c 2 #{@site.gsub('https://', '')}`.lines
19
- ip.each do |l|
20
- new_ip = l.match(/(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/)
21
- ips << new_ip.to_s unless ips.include?(new_ip)
22
- end
23
- puts "IP via ping: #{ips.shift}\n\n\n\n"
24
- end
25
-
26
- def nslookup
27
- ips = []
28
- ns = `nslookup #{@site.gsub('https://', '')}`.lines
29
- ns.each do |ip|
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
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://", ""))
43
- end
44
- end
45
- end
1
+ # frozen_string_literal: true
2
+
3
+ require 'socket'
4
+ require 'colorize'
5
+ module Snackhack2
6
+ class IpLookup
7
+ attr_accessor :site
8
+
9
+ def initialize(file_save: false)
10
+ @file_save = file_save
11
+ @site = site
12
+ end
13
+
14
+ def run
15
+ get_ip
16
+ nslookup
17
+ socket
18
+ end
19
+
20
+ def get_ip
21
+ ips = []
22
+ ip = `ping -c 2 #{@site.gsub('https://', '')}`.lines
23
+ ip.each do |l|
24
+ new_ip = l.match(/(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/)
25
+ ips << new_ip.to_s if !new_ip.to_s.empty? && !ips.include?(new_ip)
26
+ end
27
+ ips
28
+ end
29
+
30
+ def nslookup
31
+ ips = []
32
+ ns = `nslookup #{@site.gsub('https://', '')}`.lines
33
+ ns.each do |ip|
34
+ new_ip = ip.gsub('Address: ', '').strip if ip.include?('Address')
35
+ if !ips.include?(new_ip) && !new_ip.nil?
36
+
37
+ ips << new_ip.split('Addresses: ')[1].to_s
38
+ end
39
+ end
40
+
41
+ if @file_save
42
+ Snackhack2.file_save(@site, 'ip_lookup', ips.to_a.drop(1).join("\n"))
43
+ else
44
+ ips
45
+ end
46
+ end
47
+
48
+ def socket
49
+ puts IPSocket.getaddress(@site.gsub('https://', ''))
50
+ end
51
+ end
52
+ end