doorknock 0.1.0 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/doorknock.gemspec +1 -0
- data/lib/doorknock/generator.rb +11 -17
- data/lib/doorknock/monitor.rb +19 -12
- data/lib/doorknock/version.rb +1 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d25dd268540ca72f5803f536e918ac372a49cd1ddc95b08022b29d5823a3c613
|
4
|
+
data.tar.gz: '08943a51bf554653ce5dedb413527fb75aa35914abf215b47fb5820ef942dcc8'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f351a16a266ebf1bfe7cb0e4794f8826e3c85a86480686ce383470d4be654224ac5ecaaf13403c1d03319cc9fe3970baa3405990d51ce317981af090d882a47b
|
7
|
+
data.tar.gz: 25f134409c03d42ee4dc87dfd0d1750d645dc47a33dc5e2290acb0cfcf4562e0df441e11168c62014938f17a7ab0a1958b91bbebad241bec8912d2eededd47e9
|
data/README.md
CHANGED
@@ -14,12 +14,12 @@ A doorknocking tool targeting phishing admin panels.
|
|
14
14
|
## Usage
|
15
15
|
|
16
16
|
```bash
|
17
|
-
|
17
|
+
% doorknock
|
18
18
|
Commands:
|
19
19
|
doorknock help [COMMAND] # Describe available commands or one specific command
|
20
20
|
doorknock knock # knock phishing websites
|
21
21
|
|
22
|
-
|
22
|
+
% doorknock help knock
|
23
23
|
Usage:
|
24
24
|
doorknock knock
|
25
25
|
|
data/doorknock.gemspec
CHANGED
data/lib/doorknock/generator.rb
CHANGED
@@ -5,32 +5,26 @@ require "uri"
|
|
5
5
|
|
6
6
|
module DoorKnock
|
7
7
|
class Generator
|
8
|
-
attr_reader :
|
9
|
-
def initialize(
|
10
|
-
@
|
11
|
-
URI(url)
|
12
|
-
end.compact
|
8
|
+
attr_reader :url
|
9
|
+
def initialize(url)
|
10
|
+
@url = URI(url)
|
13
11
|
end
|
14
12
|
|
15
|
-
def
|
16
|
-
|
17
|
-
"#{url.scheme}://#{url.host}:#{url.port}"
|
18
|
-
end
|
13
|
+
def base_url
|
14
|
+
"#{url.scheme}://#{url.host}:#{url.port}"
|
19
15
|
end
|
20
16
|
|
21
|
-
def
|
22
|
-
|
23
|
-
|
24
|
-
parts.pop if parts.length > 2
|
17
|
+
def second_last_url
|
18
|
+
parts = url.path.split("/")
|
19
|
+
parts.pop if parts.length > 2
|
25
20
|
|
26
|
-
|
27
|
-
end
|
21
|
+
"#{url.scheme}://#{url.host}:#{url.port}" + parts.join("/")
|
28
22
|
end
|
29
23
|
|
30
24
|
def admin_panel_urls
|
31
|
-
|
25
|
+
[base_url, second_last_url].uniq.sort.map do |target_url|
|
32
26
|
paths.map do |path|
|
33
|
-
"#{
|
27
|
+
"#{target_url}/#{path}"
|
34
28
|
end
|
35
29
|
end.flatten.sort
|
36
30
|
end
|
data/lib/doorknock/monitor.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require "parallel"
|
4
|
+
|
3
5
|
module DoorKnock
|
4
6
|
class Monitor
|
5
7
|
def initialize
|
@@ -7,21 +9,26 @@ module DoorKnock
|
|
7
9
|
end
|
8
10
|
|
9
11
|
def check(size = 100)
|
10
|
-
|
11
|
-
|
12
|
+
Parallel.each(Feed.phishy_urls(size)) do |phishy_url|
|
13
|
+
generator = Generator.new phishy_url
|
14
|
+
generator.admin_panel_urls.each do |panel_url|
|
15
|
+
website = Website.new(panel_url)
|
16
|
+
next if marked?(website.url)
|
17
|
+
next unless website.ok? && website.panel?
|
12
18
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
19
|
+
puts [website.url, website.title].join(",")
|
20
|
+
mark(website.url)
|
21
|
+
break
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
17
25
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
].join(",")
|
26
|
+
def mark(url)
|
27
|
+
@memo[url] = true
|
28
|
+
end
|
22
29
|
|
23
|
-
|
24
|
-
|
30
|
+
def marked?(url)
|
31
|
+
@memo.fetch(url, false)
|
25
32
|
end
|
26
33
|
|
27
34
|
def self.check(size = 100)
|
data/lib/doorknock/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: doorknock
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Manabu Niseki
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-03-
|
11
|
+
date: 2019-03-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -136,6 +136,20 @@ dependencies:
|
|
136
136
|
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '2.15'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: parallel
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - "~>"
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '1.14'
|
146
|
+
type: :runtime
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - "~>"
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '1.14'
|
139
153
|
- !ruby/object:Gem::Dependency
|
140
154
|
name: thor
|
141
155
|
requirement: !ruby/object:Gem::Requirement
|