snackhack2 0.6.6 → 0.6.7

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: f24d3c225a7262763bb360b50b139af3d73222abfa7288d1149f5f47a7c837e4
4
+ data.tar.gz: 90f9e49687132acd4930f01ce2d03bd98b1911301d81f26130e253461f94d5a5
5
5
  SHA512:
6
- metadata.gz: ce184f5769d385950ebc9a5824f4788398cf301544eacc0dd59a7b2bd64e100f0b4816db9807e307287e8ef89085d18168a575f9b620177dd3bdac53916bcf49
7
- data.tar.gz: 82efd660a7495c292a45c527cc9e937e73b143c00fb8e36800be34544c9447f3864f07f1d137d351ab2acd70aa126f8d2ace81080acd79cfcbba61a1b6350a54
6
+ metadata.gz: 5c535c224366a2ad8a2ebcb047d47c4157d1fad3a3aa30b782decd5b2291823cd1b0b91043bfd60ab21f3d9c40b66c47e4e85957fb784cd6a0209b3117c6cfa5
7
+ data.tar.gz: 97232dc976b82e3a677d87fda6ea3319fc6ddc09526657d731bf89701b8ccaf70f84b4215977b17cdb7fb2ac05e6143aebf7791ce0488b88e5a0ca5cd7f14e22
@@ -1,5 +1,4 @@
1
1
  # frozen_string_literal: true
2
-
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
@@ -184,16 +184,8 @@ class PhishingTlds < PhishingData
184
184
  # removes ALL chracters ( l )
185
185
  remove_letters_out << new_ds.gsub(l, "")
186
186
  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}"
195
- end
196
- end
187
+ # add tldds to the created list
188
+ domains_with_tlds = add_tlds(remove_letters_out)
197
189
  if array_out
198
190
  domains_with_tlds
199
191
  else
@@ -202,6 +194,18 @@ class PhishingTlds < PhishingData
202
194
  domains_with_tlds.each { |a| puts a }
203
195
  end
204
196
  end
197
+ def add_tlds(list)
198
+ # takes the newly created domains (list)
199
+ # and adds the tlds (domains) to the newly created
200
+ # ones.
201
+ o = []
202
+ list.each do |rr|
203
+ domains.each do |dd|
204
+ o << "#{rr}#{dd}"
205
+ end
206
+ end
207
+ o
208
+ end
205
209
  def combosquatting
206
210
  # where the generated domains will be located.
207
211
  results = []
@@ -232,16 +236,9 @@ class PhishingTlds < PhishingData
232
236
  end
233
237
  end
234
238
  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
239
+ # adds the tlds to the newly created domains
240
+
241
+ add_tlds(results)
245
242
  end
246
243
  def change_tld(no_tld: true)
247
244
  # This method will take the inputted site in @site and
@@ -270,18 +267,74 @@ class PhishingTlds < PhishingData
270
267
  # removes .com, .org, etc
271
268
  ds = remove_tlds
272
269
 
273
- # join the elements together
270
+ # join the elements together with .
274
271
  ds = ds.join(".")
275
272
 
276
-
277
273
  # loops through the tlds
278
274
  domains.each do |tlds|
279
275
  # adds the new domains to the array
280
- list_of_domains << ds + tlds
276
+ list_of_domains << "#{ds}#{tlds}"
277
+ #ds + tlds
281
278
  end
282
279
  list_of_domains
283
280
  end
284
281
  end
282
+ def idn_homograph
283
+ letters = {
284
+ "o" => ["0", "О", "ó", "о","ο","օ","ȯ","ọ","ỏ","ơ","ó","ö"],
285
+ "i" => ["1","ı", "ỉ", "і", "í", "ï"],
286
+ "a" => ["а","α", "ạ"],
287
+ "h" => ["н", "һ", "ĥ"],
288
+ "c" => ["с"],
289
+ "I" => "l",
290
+ "e" => ["е", "℮", "ё", "ė", "ẹ"],
291
+ "b" => [ "þ", "в", "B" ],
292
+ "g" => [ "ɢ"],
293
+ "l" => ["Ɩ", "Ι"],
294
+ "m" => ["m", "ʍ", "м"],
295
+ "t" => ["т", "ţ"],
296
+ "p" => ["р"],
297
+ "y" => ["у", "ý"],
298
+ "k" => ["ķ"],
299
+ "d" => ["ɗ"],
300
+ "z" => ["ź","ʐ", "ż"],
301
+ "s" => ["ś", "ṣ"],
302
+ "u" => ["ų", "υ", "ս","ü","ú","ù"],
303
+ "n" => ["ń", "ñ"],
304
+ "r" => ["ɾ", "R", "r", "ʀ", "Ի", "Ꮢ", "ᚱ", "R", "r"],
305
+ "ll" => ["ǁ"],
306
+ "q" => ["զ"],
307
+ "j" => ["ј", "ʝ"],
308
+ "v" => ["ν", "ѵ"],
309
+ "x" => ["х" "ҳ"]
310
+ }
311
+ tlds = @site.split(".")
312
+ # removes the tlds
313
+ tlds.pop
314
+ # joins back the rest of the site
315
+ tlds = tlds.join(".")
316
+
317
+ new_domains = []
318
+ letters.each do |k, v|
319
+ tlds.split(//).each do |letter|
320
+ # if the letter elements
321
+ # are qual to the key vlaue
322
+ # located in the letters hash
323
+ if letter.eql?(k)
324
+ # find the key and replace it
325
+ # the v ( idn )
326
+ if v.kind_of?(Array)
327
+ # detct if the v ( value )
328
+ # is an array. If it is
329
+ # then it will "randomly" pick an element
330
+ v = v.sample
331
+ end
332
+ new_domains << tlds.gsub(k, v)
333
+ end
334
+ end
335
+ end
336
+ add_tlds(new_domains)
337
+ end
285
338
  private :remove_tlds, :domain_split
286
339
  end
287
340
  end
@@ -0,0 +1,15 @@
1
+ require 'socket'
2
+
3
+ # Grab the banner of a given +ip+ address and +port+
4
+ # to attempt to connect to.
5
+ #
6
+ # @param ip [String] Target IP address.
7
+ # @param port [Integer] Target port.
8
+ #
9
+ # @return [String]
10
+ def grab_banner(ip, port)
11
+ TCPSocket.new(ip, port).recv(1024)
12
+ end
13
+
14
+ # Print the result of the method to STDOUT.
15
+ puts grab_banner('100.106.14.40', 22)
@@ -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.7'
5
5
  end
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.7
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-10-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -99,6 +99,7 @@ files:
99
99
  - lib/snackhack2/robots.rb
100
100
  - lib/snackhack2/screenshots.rb
101
101
  - lib/snackhack2/sitemap.rb
102
+ - lib/snackhack2/ssh.rb
102
103
  - lib/snackhack2/sshbrute.rb
103
104
  - lib/snackhack2/ssrf.rb
104
105
  - lib/snackhack2/subdomains.rb