pastenum 0.3.1 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/README.md +15 -8
- data/lib/pastenum.rb +1 -0
- data/lib/pastenum/cli.rb +21 -7
- data/lib/pastenum/json.rb +14 -4
- data/lib/pastenum/report.rb +13 -2
- data/lib/pastenum/targets/pastee.rb +43 -0
- data/lib/pastenum/targets/pastie.rb +2 -2
- data/lib/pastenum/version.rb +1 -1
- metadata +2 -1
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Pastenum is a text dump enumeration tool. It is designed to help find and enumerate datadumps, and doxs posted on public sites.
|
4
4
|
|
5
|
-
It currently searches sites github.com, gist.github.com, pastebin.com, and pastie.org.
|
5
|
+
It currently searches sites github.com, gist.github.com, pastebin.com, pastee.org, and pastie.org.
|
6
6
|
|
7
7
|
Pastenum is a gem rewrite of nullthreat's original [pastenum2](http://redmine.corelan.be/projects/corelan-pastenum) released in 2011.
|
8
8
|
|
@@ -25,17 +25,24 @@ Pastenum is a gem rewrite of nullthreat's original [pastenum2](http://redmine.co
|
|
25
25
|
Usage: pastenum [OPTIONS] "search string"
|
26
26
|
|
27
27
|
Sources::
|
28
|
-
|
28
|
+
--[no-]pastebin
|
29
|
+
Search Pastebin.com (Gscraper)
|
29
30
|
Default: true
|
30
|
-
|
31
|
+
--[no-]gist
|
32
|
+
Search Gist.github.com
|
31
33
|
Default: true
|
32
|
-
|
34
|
+
--[no-]github
|
35
|
+
Search github.com
|
33
36
|
Default: true
|
34
|
-
|
37
|
+
--[no-]pastie
|
38
|
+
Search pastie.org (Gscraper)
|
39
|
+
Default: true
|
40
|
+
--[no-]pastee
|
41
|
+
Search pastee.org (Gscraper)
|
35
42
|
Default: true
|
36
43
|
Report Output:: (Default output to STDOUT)
|
37
|
-
-H, --html-report Create an html iframed (report.html)
|
38
|
-
-J, --json-report Create a JSON file (report.json)
|
44
|
+
-H, --html-report Create an html iframed (report.html)
|
45
|
+
-J, --json-report Create a JSON file (report.json)
|
39
46
|
Options::
|
40
47
|
-r, --[no-]raw use 'raw' urls instead if available
|
41
48
|
Default: false
|
@@ -55,7 +62,7 @@ Options::
|
|
55
62
|
Gist and Github code search for 'shadowbq' skipping ssl cert verfication
|
56
63
|
|
57
64
|
```shell
|
58
|
-
(~)$ pastenum -x --no-pastebin --no-pastie --no-ssl-verify "shadowbq"
|
65
|
+
(~)$ pastenum -x --no-pastebin --no-pastie --no-pastee --no-ssl-verify "shadowbq"
|
59
66
|
https://gist.github.com/shadowbq/325430
|
60
67
|
https://gist.github.com/shadowbq/4556950
|
61
68
|
https://gist.github.com/shadowbq/2718948
|
data/lib/pastenum.rb
CHANGED
data/lib/pastenum/cli.rb
CHANGED
@@ -18,6 +18,7 @@ module Pastenum
|
|
18
18
|
options[:gist] = true
|
19
19
|
options[:github] = true
|
20
20
|
options[:pastie] = true
|
21
|
+
options[:pastee] = true
|
21
22
|
|
22
23
|
options[:raw] = Pastenum::Defaults::Raw
|
23
24
|
options[:onion] = false
|
@@ -32,22 +33,26 @@ module Pastenum
|
|
32
33
|
opt.separator ""
|
33
34
|
opt.separator "Sources::"
|
34
35
|
|
35
|
-
opt.on("
|
36
|
+
opt.on("","--[no-]pastebin","Search Pastebin.com (Gscraper)"," Default: #{options[:pastebin]}") do |value|
|
36
37
|
options[:pastebin] = value
|
37
38
|
end
|
38
39
|
|
39
|
-
opt.on("
|
40
|
+
opt.on("","--[no-]gist","Search Gist.github.com"," Default: #{options[:gist]}") do |value|
|
40
41
|
options[:gist] = value
|
41
42
|
end
|
42
43
|
|
43
|
-
opt.on("
|
44
|
+
opt.on("","--[no-]github","Search github.com"," Default: #{options[:github]}") do |value|
|
44
45
|
options[:github] = value
|
45
46
|
end
|
46
47
|
|
47
|
-
opt.on("
|
48
|
+
opt.on("","--[no-]pastie","Search pastie.org (Gscraper)"," Default: #{options[:pastie]}") do |value|
|
48
49
|
options[:pastie] = value
|
49
50
|
end
|
50
51
|
|
52
|
+
opt.on("","--[no-]pastee","Search pastee.org (Gscraper)"," Default: #{options[:pastie]}") do |value|
|
53
|
+
options[:pastee] = value
|
54
|
+
end
|
55
|
+
|
51
56
|
opt.separator "Report Output:: (Default output to STDOUT)"
|
52
57
|
|
53
58
|
opt.on("-H","--html-report","Create an html iframed (report.html) ") do
|
@@ -144,7 +149,7 @@ module Pastenum
|
|
144
149
|
@github = Pastenum::Github.new(dork)
|
145
150
|
@pastebin = Pastenum::Pastebin.new(dork)
|
146
151
|
@pastie = Pastenum::Pastie.new(dork)
|
147
|
-
|
152
|
+
@pastee = Pastenum::Pastee.new(dork)
|
148
153
|
|
149
154
|
if options[:gist]
|
150
155
|
|
@@ -193,12 +198,21 @@ module Pastenum
|
|
193
198
|
puts @pastie.results if !options[:report] && !options[:json]
|
194
199
|
end
|
195
200
|
|
201
|
+
if options[:pastee]
|
202
|
+
@pastee.verbose = options[:verbose]
|
203
|
+
@pastee.max_pages = 2
|
204
|
+
@pastee.search
|
205
|
+
@pastee.summary
|
206
|
+
puts @pastee.results if !options[:report] && !options[:json]
|
207
|
+
end
|
208
|
+
|
209
|
+
|
196
210
|
if options[:report]
|
197
|
-
Pastenum::Report.new(dork, @pastie.results, @pastebin.results, @github.results, @gist.results).to_file
|
211
|
+
Pastenum::Report.new(dork, @pastie.results, @pastee.results, @pastebin.results, @github.results, @gist.results).to_file
|
198
212
|
end
|
199
213
|
|
200
214
|
if options[:json]
|
201
|
-
Pastenum::JSON.new(dork, @gist, @github, @pastebin, @pastie)
|
215
|
+
Pastenum::JSON.new(dork, [@gist, @github, @pastebin, @pastie, @pastee]).to_file
|
202
216
|
end
|
203
217
|
|
204
218
|
end
|
data/lib/pastenum/json.rb
CHANGED
@@ -1,13 +1,23 @@
|
|
1
1
|
module Pastenum
|
2
2
|
class JSON
|
3
3
|
|
4
|
-
def initialize(dork,
|
4
|
+
def initialize(dork, sites)
|
5
|
+
@data = [{:search => dork}]
|
6
|
+
sites.each do |site|
|
7
|
+
@data << {site.vendor => site.results}
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
def to_s
|
12
|
+
return @data
|
13
|
+
end
|
14
|
+
|
15
|
+
def to_file
|
5
16
|
file = File.open('report.json', 'w')
|
6
|
-
data
|
7
|
-
file.write(data)
|
17
|
+
file.write(data.to_json)
|
8
18
|
file.close
|
9
19
|
|
10
|
-
return data
|
20
|
+
return @data
|
11
21
|
end
|
12
22
|
|
13
23
|
end
|
data/lib/pastenum/report.rb
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
module Pastenum
|
2
2
|
class Report
|
3
3
|
|
4
|
-
def initialize(dork,addresses_pastie,addresses_pastebin,addresses_github,addresses_gist)
|
4
|
+
def initialize(dork,addresses_pastie,addresses_pastee,addresses_pastebin,addresses_github,addresses_gist)
|
5
5
|
@dork = dork
|
6
|
-
@addresses_pastie = addresses_pastie
|
6
|
+
@addresses_pastie = addresses_pastie
|
7
|
+
@addresses_pastie = addresses_pastee
|
7
8
|
@addresses_pastebin = addresses_pastebin
|
8
9
|
@addresses_github = addresses_github
|
9
10
|
@addresses_gist = addresses_gist
|
@@ -69,6 +70,16 @@ module Pastenum
|
|
69
70
|
end
|
70
71
|
file.write("<hr><hr>")
|
71
72
|
end
|
73
|
+
|
74
|
+
#Pastee.org
|
75
|
+
unless @addresses_pastie.empty?
|
76
|
+
file.write("<h2>Search Term: \"#{@dork}\" <br /> Site: Pastee - Found: #{@addresses_pastee.count} Items</h2>\n")
|
77
|
+
@addresses_pastee.each do |links|
|
78
|
+
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")
|
79
|
+
print ".".green
|
80
|
+
end
|
81
|
+
file.write("<hr><hr>")
|
82
|
+
end
|
72
83
|
|
73
84
|
# Footer
|
74
85
|
|
@@ -0,0 +1,43 @@
|
|
1
|
+
#Internal search implementation for pastee.org (Gscraper)
|
2
|
+
# Standard link
|
3
|
+
# https://pastee.org/9gxe6
|
4
|
+
# Raw link
|
5
|
+
# No Raw link available
|
6
|
+
|
7
|
+
# url -> "https://pastee.org/9gxe6"
|
8
|
+
|
9
|
+
module Pastenum
|
10
|
+
class Pastee < Target
|
11
|
+
|
12
|
+
def initialize(dork)
|
13
|
+
@dork = dork
|
14
|
+
@vendor = "https://pastee.org"
|
15
|
+
|
16
|
+
super
|
17
|
+
end
|
18
|
+
|
19
|
+
def search
|
20
|
+
puts "[*] Searching Pastee.org (Limit: First #{@max_pages} Pages)".green if @verbose
|
21
|
+
q = GScraper::Search.query(:query => @dork + " intitle:'Paste' ", :site => 'pastee.org')
|
22
|
+
print "[*] Parsing pages:".green if @verbose
|
23
|
+
begin
|
24
|
+
for i in 1..@max_pages do
|
25
|
+
print ".".green if @verbose
|
26
|
+
page = q.page(i)
|
27
|
+
page.each do |result|
|
28
|
+
if result.url.to_s.match(/[0-9a-zA-Z]+$/)
|
29
|
+
#code = result.url.to_s.split("/").last
|
30
|
+
#code -> "9gxe6"
|
31
|
+
@results << result.url.to_s
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
rescue
|
36
|
+
raise TargetUnreachable, "[!] ERROR: Google search unreachable , Maybe the googles banned you?"
|
37
|
+
end
|
38
|
+
puts "\n" if @verbose
|
39
|
+
return @results.uniq!
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|
43
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# Search implementation for pastie.org (Gscraper)
|
2
2
|
# Standard link
|
3
3
|
# http://pastie.org/pastes/6208073
|
4
4
|
# Raw link
|
@@ -17,7 +17,7 @@ module Pastenum
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def search
|
20
|
-
puts "[*] Searching
|
20
|
+
puts "[*] Searching Pastie.com (Limit: First #{@max_pages} Pages)".green if @verbose
|
21
21
|
q = GScraper::Search.query(:query => @dork + " inurl:pastes -inurl:page", :site => 'pastie.org')
|
22
22
|
print "[*] Parsing pages:".green if @verbose
|
23
23
|
begin
|
data/lib/pastenum/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pastenum
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -35,6 +35,7 @@ files:
|
|
35
35
|
- lib/pastenum/targets/gist.rb
|
36
36
|
- lib/pastenum/targets/github.rb
|
37
37
|
- lib/pastenum/targets/pastebin.rb
|
38
|
+
- lib/pastenum/targets/pastee.rb
|
38
39
|
- lib/pastenum/targets/pastie.rb
|
39
40
|
- lib/pastenum/version.rb
|
40
41
|
- pastenum.gemspec
|