snackhack2 0.6.6 → 0.6.8

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b016f87e2b46dc87ffab71256f1b5880f3db8b1bf16ccbc35bbe7aeeb0e7fe26
4
- data.tar.gz: 1a9accfc1fe6f09c5d3e5f624eeeb032441f0fac9a25523c0b08f8b34c9963da
3
+ metadata.gz: 0ebd87b5313f0ca67abbb146beb1990b448c4dbe073afbb46122440d35849063
4
+ data.tar.gz: 9ae6115bbe6a97494dab6dfd02acf854abcd4c9acd6b605b3de35103497fd767
5
5
  SHA512:
6
- metadata.gz: ce184f5769d385950ebc9a5824f4788398cf301544eacc0dd59a7b2bd64e100f0b4816db9807e307287e8ef89085d18168a575f9b620177dd3bdac53916bcf49
7
- data.tar.gz: 82efd660a7495c292a45c527cc9e937e73b143c00fb8e36800be34544c9447f3864f07f1d137d351ab2acd70aa126f8d2ace81080acd79cfcbba61a1b6350a54
6
+ metadata.gz: ae1dcbd9a7f7f43f74d37ca079ea24c0693eabd5b8bd0bf5467801341bb50dff9e7fc28a70a4795d45af2d5c3c847578560a7ee86f199edc26d7c35bef50deba
7
+ data.tar.gz: a5a50dd46b6b9870caba17892f620f42212ecada0cb430700184c004b8da2e39d50dbd760049e0a742636495cae3d261c5669e04faf5134913111b489956d428
@@ -0,0 +1,23 @@
1
+ require 'net/http'
2
+ require 'openssl'
3
+ module Snackhack2
4
+ class SSLCert
5
+ attr_accessor :site
6
+
7
+ def initialize
8
+ @site = site
9
+ end
10
+ def get_cert
11
+ begin
12
+ if @site.downcase.include?("https://")
13
+ @site = @site.downcase.gsub("https://", "")
14
+ end
15
+ uri = URI::HTTPS.build(host: @site)
16
+ response = Net::HTTP.start(uri.host, uri.port, :use_ssl => true)
17
+ cert = response.peer_cert
18
+ puts cert.serial
19
+ rescue OpenSSL::SSL::SSLError,Net::OpenTimeout, Errno::EHOSTUNREACH
20
+ end
21
+ end
22
+ end
23
+ end
@@ -1,5 +1,4 @@
1
- # frozen_string_literal: true
2
-
1
+ # frozen_string_literal: true
3
2
  require 'socket'
4
3
  module Snackhack2
5
4
  class BannerGrabber
@@ -15,6 +14,7 @@ module Snackhack2
15
14
  nginx
16
15
  apache2
17
16
  wordpress
17
+ get_ssh_info
18
18
  end
19
19
  def headers
20
20
  @headers = Snackhack2.get(@site).headers
@@ -76,6 +76,15 @@ module Snackhack2
76
76
  # make a request to the site and grab the headers.
77
77
  Snackhack2.get(@site).headers
78
78
  end
79
+
80
+ def get_tcp_info(ports: "")
81
+ ports = 22 if ports.empty?
82
+ begin
83
+ TCPSocket.new(@site, ports).recv(1024)
84
+ rescue => e
85
+ puts "ERROR OCCURRED"
86
+ end
87
+ end
79
88
  def cloudflare(print_status: true)
80
89
  # the purpose of this method is to
81
90
  # check to see if a site has
@@ -19,13 +19,12 @@ module Snackhack2
19
19
  drupal_score = 0
20
20
  d = Snackhack2.get(@site)
21
21
  if d.code == 200
22
- d.headers.each do |k|
23
- drupal_score += 10 if k.include?('drupal')
22
+ d.headers.each do |k,v|
23
+ drupal_score += 10 if k.downcase.include?('drupal')
24
+ drupal_score += 10 if v.downcase.include?('drupal')
24
25
  end
25
26
  end
26
- d.headers.each do |v|
27
- drupal_score += 10 if v.include?('drupal')
28
- end
27
+
29
28
  doc = Nokogiri::HTML(URI.open(@site))
30
29
  posts = doc.xpath('//meta')
31
30
  posts.each do |l|
@@ -6,7 +6,7 @@ module Snackhack2
6
6
  class Email
7
7
  attr_accessor :max_depth
8
8
 
9
- def initialize(site, save_file: true, max_depth: 4)
9
+ def initialize(site, save_file: true, max_depth: 2)
10
10
  @site = site
11
11
  @save_file = save_file
12
12
  @max_depth = max_depth
@@ -167,8 +167,6 @@ class PhishingTlds < PhishingData
167
167
  letters_with_more_than_one << key
168
168
  end
169
169
  end
170
-
171
-
172
170
  ds = remove_tlds
173
171
  new_ds = ds.shift
174
172
 
@@ -184,23 +182,19 @@ class PhishingTlds < PhishingData
184
182
  # removes ALL chracters ( l )
185
183
  remove_letters_out << new_ds.gsub(l, "")
186
184
  end
187
-
188
- domains_with_tlds = []
189
- # adding the TLDS to the 'remove_letter_out' array
190
- domains.each do |d|
191
- remove_letters_out.each do |rl|
192
- # adds the words ( rl ) and the TLDS ( d )
193
- # to the domains_with_tld array.
194
- domains_with_tlds << "#{rl}#{d}"
185
+ add_tlds(remove_letters_out)
186
+ end
187
+ def add_tlds(list)
188
+ # takes the newly created domains (list)
189
+ # and adds the tlds (domains) to the newly created
190
+ # ones.
191
+ o = []
192
+ list.each do |rr|
193
+ domains.each do |dd|
194
+ o << "#{rr}#{dd}"
195
195
  end
196
196
  end
197
- if array_out
198
- domains_with_tlds
199
- else
200
- # will print the contents of the array
201
- # instead of returning the array
202
- domains_with_tlds.each { |a| puts a }
203
- end
197
+ o
204
198
  end
205
199
  def combosquatting
206
200
  # where the generated domains will be located.
@@ -232,16 +226,9 @@ class PhishingTlds < PhishingData
232
226
  end
233
227
  end
234
228
  end
235
- final_results = []
236
-
237
- # Loops through the domains array in the PhishingData class
238
- domains.each do |tlds|
239
- results.each do |r|
240
- new_domain = "#{r}#{tlds}"
241
- final_results << new_domain
242
- end
243
- end
244
- final_results
229
+ # adds the tlds to the newly created domains
230
+
231
+ add_tlds(results)
245
232
  end
246
233
  def change_tld(no_tld: true)
247
234
  # This method will take the inputted site in @site and
@@ -270,18 +257,74 @@ class PhishingTlds < PhishingData
270
257
  # removes .com, .org, etc
271
258
  ds = remove_tlds
272
259
 
273
- # join the elements together
260
+ # join the elements together with .
274
261
  ds = ds.join(".")
275
262
 
276
-
277
263
  # loops through the tlds
278
264
  domains.each do |tlds|
279
265
  # adds the new domains to the array
280
- list_of_domains << ds + tlds
266
+ list_of_domains << "#{ds}#{tlds}"
267
+ #ds + tlds
281
268
  end
282
269
  list_of_domains
283
270
  end
284
271
  end
272
+ def idn_homograph
273
+ letters = {
274
+ "o" => ["0", "О", "ó", "о","ο","օ","ȯ","ọ","ỏ","ơ","ó","ö"],
275
+ "i" => ["1","ı", "ỉ", "і", "í", "ï"],
276
+ "a" => ["а","α", "ạ"],
277
+ "h" => ["н", "һ", "ĥ"],
278
+ "c" => ["с"],
279
+ "I" => "l",
280
+ "e" => ["е", "℮", "ё", "ė", "ẹ"],
281
+ "b" => [ "þ", "в", "B" ],
282
+ "g" => [ "ɢ"],
283
+ "l" => ["Ɩ", "Ι"],
284
+ "m" => ["m", "ʍ", "м"],
285
+ "t" => ["т", "ţ"],
286
+ "p" => ["р"],
287
+ "y" => ["у", "ý"],
288
+ "k" => ["ķ"],
289
+ "d" => ["ɗ"],
290
+ "z" => ["ź","ʐ", "ż"],
291
+ "s" => ["ś", "ṣ"],
292
+ "u" => ["ų", "υ", "ս","ü","ú","ù"],
293
+ "n" => ["ń", "ñ"],
294
+ "r" => ["ɾ", "R", "r", "ʀ", "Ի", "Ꮢ", "ᚱ", "R", "r"],
295
+ "ll" => ["ǁ"],
296
+ "q" => ["զ"],
297
+ "j" => ["ј", "ʝ"],
298
+ "v" => ["ν", "ѵ"],
299
+ "x" => ["х" "ҳ"]
300
+ }
301
+ tlds = @site.split(".")
302
+ # removes the tlds
303
+ tlds.pop
304
+ # joins back the rest of the site
305
+ tlds = tlds.join(".")
306
+
307
+ new_domains = []
308
+ letters.each do |k, v|
309
+ tlds.split(//).each do |letter|
310
+ # if the letter elements
311
+ # are qual to the key vlaue
312
+ # located in the letters hash
313
+ if letter.eql?(k)
314
+ # find the key and replace it
315
+ # the v ( idn )
316
+ if v.kind_of?(Array)
317
+ # detct if the v ( value )
318
+ # is an array. If it is
319
+ # then it will "randomly" pick an element
320
+ v = v.sample
321
+ end
322
+ new_domains << tlds.gsub(k, v)
323
+ end
324
+ end
325
+ end
326
+ add_tlds(new_domains)
327
+ end
285
328
  private :remove_tlds, :domain_split
286
329
  end
287
330
  end
@@ -9,8 +9,9 @@ module Snackhack2
9
9
  def initialize
10
10
  @site = site
11
11
  end
12
-
13
- def ssrf
12
+ def port_scan
13
+ end
14
+ def ssrf_google
14
15
  url = @site.gsub('SSRF', 'http://google.com')
15
16
  ht = HTTParty.get(url)
16
17
  if ht.body.include?("Search the world's information, including webpages, images, videos and more. Google has many special features to help you find exactly what you're looking for.")
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Snackhack2
4
- VERSION = '0.6.6'
4
+ VERSION = '0.6.8'
5
5
  end
data/lib/snackhack2.rb CHANGED
@@ -86,7 +86,17 @@ module Snackhack2
86
86
  File.delete(file)
87
87
  end
88
88
  end
89
-
89
+ def self.read_emails
90
+ email_filter = []
91
+ Dir['*_emails.txt'].each do |file|
92
+ File.readlines(file).each do |k|
93
+ domain = k.split(".")[1].strip
94
+ unless domain.eql?("png")
95
+ puts k
96
+ end
97
+ end
98
+ end
99
+ end
90
100
  def self.read_portscan
91
101
  files = Dir['*_port_scan.txt']
92
102
  files.each do |f|
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: snackhack2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.6
4
+ version: 0.6.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - mike
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-10-19 00:00:00.000000000 Z
11
+ date: 2025-11-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -76,6 +76,7 @@ files:
76
76
  - lib/snackhack2.rb
77
77
  - lib/snackhack2/CVE-2017-9841.rb
78
78
  - lib/snackhack2/Honeywell_PM43.rb
79
+ - lib/snackhack2/SSL.rb
79
80
  - lib/snackhack2/WP_Symposium.rb
80
81
  - lib/snackhack2/bannergrabber.rb
81
82
  - lib/snackhack2/bypass_403.rb