forked from carnal0wnage/maps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdel.rb
61 lines (42 loc) · 853 Bytes
/
del.rb
1
2
3
4
5
6
7
8
9
10
11
12
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
#!/usr/bin/env ruby
require 'json'
require 'anemone'
require 'pry'
class Program
def initialize(hash)
@program_name = hash["program_name"]
#create an array full of targets
@targets = []
hash["scope"].each do |x|
@targets << DnsRecordTarget.new(x) if x["DnsRecord"]
end
@targets
end
def name
@program_name
end
def targets
@targets
end
puts @targets
end
class Target
def initialize(t)
@t = t
end
end
class DnsRecordTarget < Target
def crawl
#create the URI
uri = "https://#{@t["DnsRecord"]}" if @t["DnsRecord"]
Anemone.crawl(uri) do |anemone|
# crawl and do cool shit
anemone.on_every_page do |page|
puts page.url
### do cool shit here
if page.code == 301; puts "REDIRECTING!"; end
end
end
end
end
|t| t.crawl