Class: Pastenum::Report

Inherits:
Object
  • Object
show all
Defined in:
lib/pastenum/report.rb

Instance Method Summary collapse

Constructor Details

#initialize(dork, addresses_pastie, addresses_pastee, addresses_pastebin, addresses_github, addresses_gist) ⇒ Report

Returns a new instance of Report.



4
5
6
7
8
9
10
11
# File 'lib/pastenum/report.rb', line 4

def initialize(dork,addresses_pastie,addresses_pastee,addresses_pastebin,addresses_github,addresses_gist)
  @dork = dork
  @addresses_pastie = addresses_pastie
  @addresses_pastie = addresses_pastee 
  @addresses_pastebin = addresses_pastebin
  @addresses_github = addresses_github
  @addresses_gist = addresses_gist
end

Instance Method Details

#to_fileObject



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/pastenum/report.rb', line 13

def to_file
  puts "[*] Creating HTML Report".green
  print "[*] Status: ".green
  file = File.open('report.html', 'w') 

  # Header

  file.write("<html><head><title>Pastenum - #{@dork}</title>\n")
  file.write("<style>\n")
  file.write("body{background-color:#931b1c;color:#aaa;font-family:Tahoma,Arial,Helvetica,sans-serif;font-size:.75em}#container{background-color:#000;margin:0 auto;padding:10px;width:90%}#logo{float:left;width:124px}#menu{background-color:#333;float:right;padding:10px;text-align:right;width:70%;height:17px}#footer{background-color:#333;clear:both;font-size:.80em;padding:2px;text-align:center;width:100%}#content{clear:both;padding-top:5px;padding-bottom:10px}img{border:0}#menu li{display:inline;margin-left:10px}#menu ul{margin:0;padding:0;list-style-type:none}#portfolio li{display:inline;margin-right:10px}#portfolio ul{margin:0;padding:0;list-style-type:none;padding-bottom:10px}a:hover{color:#ccc;text-decoration:none}a{color:#888;text-decoration:none}a.on{color:#ccc;text-decoration:none}h1{font-family:Georgia,\"Times New Roman\",Times,serif;font-weight:normal;font-size:1.3em}.center{text-align:center}input{background-color:#000;font-family:Tahoma,Arial,Helvetica,sans-serif;font-size:1em;color:#fff;border-color:#fff;border-width:thin}textarea{background-color:#fff;font-family:Tahoma,Arial,Helvetica,sans-serif;font-size:1em;color:#000;border-color:#fff;border-width:thin}\n")
  
  file.write("</style>\n")
  file.write("</head>\n")

  file.write("<body><div id=\"container\"><div id=\"logo\">")
  file.write("<img alt=\"Corelan Logo\" src=\"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD//gAxSW1hZ2UgUmVzaXplZCBhdCBodHRwOi8vd3d3LnNocmlua3BpY3R1cmVzLmNvbQr/2wBDAAMCAgMCAgMDAwMEAwMEBQgFBQQEBQoHBwYIDAoMDAsKCwsNDhIQDQ4RDgsLEBYQERMUFRUVDA8XGBYUGBIUFRT/2wBDAQMEBAUEBQkFBQkUDQsNFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBT/wAARCABYAFgDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm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ayi8I/2RILeNlaeZJ1jOXWIORGceYSBnOK+bdE0nxH+0r4v+LnjHW/A19reo69ZTW+j77u2tRpsitG0bKLiRC4jRIoyUB4kweXGfnH/hZfi/IP8Awlet5ByP+JjNwf8Avquw8b/tQ/E74jeFYPDviDxVcX2mRhA+Io45pwn3fOlVQ8uCAfnJ5APXmvCq4F08W8ZhacXUmoxlJtq0YttWSWu70ur6XdkrdEaicOSbdlr8z1fw34t8a+Kv2bfEnhySxuo00PTGs9QRrR/tFzb/AGiE2e5iMlIm85NowBuj6k1yPh7w5D4H8IeBfF0WgXGqyslzZ+JdCdHX7ZayTzLGxA55CMpP8LJCepFeSN8R/FrlC3ijWmKHKk6hN8pxjI+b0J/OoP8AhOPEZ1H+0P8AhINU+3+X5P2r7bJ5uzOdu7dnbnnHSvXp0adHm9nFK7u7dW+r8zFyct2ek/ETwPeP8OdF8Q3dld3njLXtXvLzVCsJJt4mjgeCMgD5SwlaX/dljHauT+OilfjP44VgQRrN2CD2/etWFaeOPEdhPczW3iDVLea5fzJ5Ir2RWlbpuYhvmPuax7i4lup5Jp5HmmkYu8kjFmZickknqTWxIyiiigAooooAKKKKACiiigAooooAKKKKACiiigD/2Q==\" />\n")
  
  
  file.write("</div>\n")
  file.write("<div id=\"menu\">Pastenum - Search Results for: '#{@dork}'</div>\n")
  file.write("<div id=\"content\">")
    
  #gist.github.com
  unless @addresses_gist.empty?
    file.write("<br /><h2>Site: Github Gist - Found: #{@addresses_gist.count} Items</h2>\n")
    @addresses_gist.each do |links|
      file.write("<p><script src=\"https://gist.github.com#{links}.js\"></script><p>link: <a href=\"#{links}\" target=\"_blank\">#{links}</a>\n")
      print ".".green
    end
  end
  
  #Github.com
  unless @addresses_github.empty?
    file.write("<br /><h2>Site: Github - Found: #{@addresses_github.count} Items</h2>\n")
    file.write("NOTE: Github passes 'x-frame-options deny' so iframes are useless.\n")
    @addresses_github.each do |links|
      file.write("<p>link: <a href=\"#{links}\" target=\"_blank\">#{links}</a></p>\n")
      print ".".green
    end
  end 

  # Pastebin.com
  unless @addresses_pastebin.empty?         
    file.write("<br /><h2>Site: Pastebin - Found: #{@addresses_pastebin.count} Items</h2>\n")  
    @addresses_pastebin.each do |links|
      file.write("<p><iframe src=\"http://pastebin.com/embed_iframe.php?i=#{links}\" style=\"border:none;width:100%;height:300px\"></iframe><p>link: <a href=\"http://pastebin.com/#{links}\" target=\"_blank\">http://pastebin.com/#{links}</a>\n")
      print ".".green
    end
    file.write("<hr><hr>")
  end

  #Pastie.org
  unless @addresses_pastie.empty?
    file.write("<h2>Search Term: \"#{@dork}\" <br /> Site: Pastie - Found: #{@addresses_pastie.count} Items</h2>\n")
    @addresses_pastie.each do |links|
      file.write("<p><iframe src=#{links}/text style=\"width: 100%; height: 300px; background-color: white\"></iframe><p>link: <a href=\"#{links}\" target=\"_blank\">#{links}</a>\n")
      print ".".green
    end
    file.write("<hr><hr>")
  end
  
  #Pastee.org
  unless @addresses_pastie.empty?
    file.write("<h2>Search Term: \"#{@dork}\" <br /> Site: Pastee - Found: #{@addresses_pastee.count} Items</h2>\n")
    @addresses_pastee.each do |links|
      file.write("<p><iframe src=#{links}/text style=\"width: 100%; height: 300px; background-color: white\"></iframe><p>link: <a href=\"#{links}\" target=\"_blank\">#{links}</a>\n")
      print ".".green
    end
    file.write("<hr><hr>")
  end

  # Footer

  file.write("</div>\n")
  file.write("<div id=\"footer\">&copy; Corelan Team | Written by Nullthreat\n")
  file.write("</div></body></html>\n")
  file.close

  puts "\n[*] HTML Report Created".green
end