tansaku 1.3.0 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -3
- data/lib/tansaku/crawler.rb +23 -6
- data/lib/tansaku/lists/none.txt +0 -0
- data/lib/tansaku/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8c2340e0208f4ecb9fbbff0d1a866c1e8a5031d0e15f85afafa6ff8c933aa7ba
|
4
|
+
data.tar.gz: d0a4fc5f183f6a51f7a1784afe2b3a5e898383cb8084997d2d4243a594dbe608
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 74cf25e1e3a0553e55627fe26d6c62c1a20d13c2390d1c652a576432673b3fee4cf81f2a0f59c98142ea82679a6ab8c3b8b1e0c3737edaf1d77dad6dfd9e70ce
|
7
|
+
data.tar.gz: 52e4d995e93768c3f3ae6ac892c9c04ecb17215795fbf4897d3b70d02836688b5b70f9e06dd2adc86974eb3891c00080813b96b8b281b861d776285229fa3907
|
data/README.md
CHANGED
@@ -2,7 +2,6 @@
|
|
2
2
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/tansaku.svg)](https://badge.fury.io/rb/tansaku)
|
4
4
|
[![Build Status](https://travis-ci.com/ninoseki/tansaku.svg?branch=master)](https://travis-ci.com/ninoseki/tansaku)
|
5
|
-
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/b8c176423480493182a6d52e56f6fd35)](https://www.codacy.com/app/ninoseki/tansaku)
|
6
5
|
[![Coverage Status](https://coveralls.io/repos/github/ninoseki/tansaku/badge.svg?branch=master)](https://coveralls.io/github/ninoseki/tansaku?branch=master)
|
7
6
|
|
8
7
|
Tansaku is a yet another dirbuster tool.
|
@@ -58,8 +57,10 @@ See [/lib/tansaku/lists/](https://github.com/ninoseki/tansaku/blob/master/lib/ta
|
|
58
57
|
|
59
58
|
## Alternatives
|
60
59
|
|
61
|
-
- [
|
62
|
-
- [
|
60
|
+
- [maurosoria/dirsearch](https://github.com/maurosoria/dirsearch): Web path scanner
|
61
|
+
- [evilsocket/dirsearch](https://github.com/evilsocket/dirsearch): A Go implementation of dirsearch.
|
62
|
+
- [davidtavarez/weblocator](https://github.com/davidtavarez/weblocator): Just a better dirbuster
|
63
|
+
- [stefanoj3/dirstalk](https://github.com/stefanoj3/dirstalk): Modern alternative to dirbuster/dirb
|
63
64
|
|
64
65
|
## License
|
65
66
|
|
data/lib/tansaku/crawler.rb
CHANGED
@@ -11,7 +11,7 @@ require "tansaku/monkey_patch"
|
|
11
11
|
|
12
12
|
module Tansaku
|
13
13
|
class Crawler
|
14
|
-
DEFAULT_USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/
|
14
|
+
DEFAULT_USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36"
|
15
15
|
|
16
16
|
# @return [String]
|
17
17
|
attr_reader :base_uri
|
@@ -51,7 +51,7 @@ module Tansaku
|
|
51
51
|
raise ArgumentError, "Invalid URI" unless valid_uri?
|
52
52
|
|
53
53
|
@additional_list = additional_list
|
54
|
-
raise ArgumentError, "Invalid path"
|
54
|
+
raise ArgumentError, "Invalid path" unless valid_additional_path?
|
55
55
|
|
56
56
|
@method = method.upcase
|
57
57
|
raise ArgumentError, "Invalid HTTP method" unless valid_method?
|
@@ -71,6 +71,8 @@ module Tansaku
|
|
71
71
|
def crawl
|
72
72
|
results = {}
|
73
73
|
|
74
|
+
log_conditions
|
75
|
+
|
74
76
|
Async do |task|
|
75
77
|
barrier = Async::Barrier.new
|
76
78
|
semaphore = Async::Semaphore.new(max_concurrent_requests, parent: barrier)
|
@@ -99,6 +101,17 @@ module Tansaku
|
|
99
101
|
|
100
102
|
private
|
101
103
|
|
104
|
+
def log_conditions
|
105
|
+
Tansaku.logger.info("Start crawling with the following conditions:")
|
106
|
+
Tansaku.logger.info("URLs: #{paths.length} URLs to crawl")
|
107
|
+
Tansaku.logger.info("Method: #{method}")
|
108
|
+
Tansaku.logger.info("Timeout: #{timeout || "nil"}")
|
109
|
+
Tansaku.logger.info("Headers: #{request_headers}")
|
110
|
+
Tansaku.logger.info("Body: #{body}")
|
111
|
+
Tansaku.logger.info("Ignore certificate errors: #{ignore_certificate_errors}")
|
112
|
+
Tansaku.logger.info("Concurrency: #{max_concurrent_requests} requests at max")
|
113
|
+
end
|
114
|
+
|
102
115
|
def online?(status)
|
103
116
|
[200, 204, 301, 302, 307, 401, 403].include? status.to_i
|
104
117
|
end
|
@@ -107,7 +120,9 @@ module Tansaku
|
|
107
120
|
["http", "https"].include? base_uri.scheme
|
108
121
|
end
|
109
122
|
|
110
|
-
def
|
123
|
+
def valid_additional_path?
|
124
|
+
return true if additional_list.nil?
|
125
|
+
|
111
126
|
File.exist?(additional_list)
|
112
127
|
end
|
113
128
|
|
@@ -116,9 +131,11 @@ module Tansaku
|
|
116
131
|
end
|
117
132
|
|
118
133
|
def paths
|
119
|
-
paths
|
120
|
-
|
121
|
-
|
134
|
+
@paths ||= [].tap do |out|
|
135
|
+
paths = Path.get_by_type(type)
|
136
|
+
paths += File.readlines(additional_list) if additional_list
|
137
|
+
out << paths.filter_map(&:chomp)
|
138
|
+
end.flatten.uniq
|
122
139
|
end
|
123
140
|
|
124
141
|
def url_for(path)
|
File without changes
|
data/lib/tansaku/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tansaku
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Manabu Niseki
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-03-
|
11
|
+
date: 2022-03-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -220,6 +220,7 @@ files:
|
|
220
220
|
- lib/tansaku/lists/database.txt
|
221
221
|
- lib/tansaku/lists/etc.txt
|
222
222
|
- lib/tansaku/lists/log.txt
|
223
|
+
- lib/tansaku/lists/none.txt
|
223
224
|
- lib/tansaku/monkey_patch.rb
|
224
225
|
- lib/tansaku/path.rb
|
225
226
|
- lib/tansaku/version.rb
|