Module: Snackhack2

Defined in:
lib/snackhack2.rb,
lib/snackhack2/drupal.rb,
lib/snackhack2/emails.rb,
lib/snackhack2/robots.rb,
lib/snackhack2/tomcat.rb,
lib/snackhack2/sitemap.rb,
lib/snackhack2/version.rb,
lib/snackhack2/comments.rb,
lib/snackhack2/iplookup.rb,
lib/snackhack2/portscan.rb,
lib/snackhack2/sshbrute.rb,
lib/snackhack2/wordpress.rb,
lib/snackhack2/bypass_403.rb,
lib/snackhack2/list_users.rb,
lib/snackhack2/subdomains.rb,
lib/snackhack2/screenshots.rb,
lib/snackhack2/subdomains2.rb,
lib/snackhack2/WP_Symposium.rb,
lib/snackhack2/phone_number.rb,
lib/snackhack2/website_meta.rb,
lib/snackhack2/wpForo_Forum.rb,
lib/snackhack2/bannergrabber.rb,
lib/snackhack2/reverse_shell.rb,
lib/snackhack2/website_links.rb,
lib/snackhack2/Honeywell_PM43.rb,
lib/snackhack2/forward_remote.rb,
lib/snackhack2/cryptoextractor.rb,
lib/snackhack2/google_analytics.rb,
lib/snackhack2/webserver_log_cleaner.rb,
lib/snackhack2/indirect_command_injection.rb

Defined Under Namespace

Classes: BannerGrabber, BypassHTTP, CommandInjection, Comments, CryptoExtractWebsite, Drupal, Email, GoogleAnalytics, HoneywellPM43, IpLookup, ListUsers, PhoneNumber, PortScan, ReverseShell, Robots, SSHBute, SSHForwardRemote, ScreenShot, SiteMap, Subdomains, Subdomains2, TomCat, WPForoForum, WPSymposium, WebServerCleaner, WebsiteLinks, WebsiteMeta, WordPress

Constant Summary collapse

UA =
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36"
VERSION =
'0.6.2'

Class Method Summary collapse

Class Method Details

.clean_portscanObject



67
68
69
70
71
72
# File 'lib/snackhack2.rb', line 67

def self.clean_portscan
  Dir['*_port_scan.txt'].each do |file|
    puts "[+] deleting #{file}..."
    File.delete(file)
  end
end

.clean_serverversionObject



46
47
48
49
50
51
52
53
54
55
# File 'lib/snackhack2.rb', line 46

def self.clean_serverversion
  #  this wil remove all files that have '_serverversion'
  #  in the file name
  Dir['*.txt'].each do |file|
    if file.include?('_serverversion')
      puts "[+] deleting #{file}..."
      File.delete(file)
    end
  end
end

.file_save(site, type, content, ip: false) ⇒ Object



57
58
59
60
61
# File 'lib/snackhack2.rb', line 57

def self.file_save(site, type, content, ip: false)
  hostname = URI.parse(site).host
  File.open("#{hostname}_#{type}.txt", 'w+') { |file| file.write(content) }
  puts "[+] Saving file to #{hostname}_#{type}.txt..."
end

.get(site) ⇒ Object



63
64
65
# File 'lib/snackhack2.rb', line 63

def self.get(site)
  HTTParty.get(site, { headers: { "User-Agent" => UA } })
end

.read_portscanObject



74
75
76
77
78
79
80
# File 'lib/snackhack2.rb', line 74

def self.read_portscan
  files = Dir['*_port_scan.txt']
  files.each do |f|
    read = File.read(f)
    puts "#{f.split('_')[0]}: #{read}"
  end
end

.read_serverversionObject



38
39
40
41
42
43
44
# File 'lib/snackhack2.rb', line 38

def self.read_serverversion
  files = Dir['*.txt']
  files.each do |f|
    read = File.read(f)
    puts "#{f.split('_')[0]}: #{read}"
  end
end