m4dh4v45b1n 0.2.0 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6e6280209d2b172f88c5e8f0c505cb2f2b5a91c6184ff6b942d7482e1634ab52
4
- data.tar.gz: 1a5b08e7c6faa78e56194cc40c356fded1063ff1f64835f5866391b6bfccb080
3
+ metadata.gz: 0e5d58ee3c04f3b84349c34ae8d7d307f87eed26a77b7f0407074fe7a144849d
4
+ data.tar.gz: e945d8aaea8f21a740c0694759885f86b410862231b3c9257e3634e0bbb9f3a8
5
5
  SHA512:
6
- metadata.gz: cb1531739ae7dbedb1d444ce64a0ac9e7d5098438154c12297189cd510da93e97d62c67a00aa2fd084b20cf1693205a0680ff53ca92f114aa15dfb96c3a8d83c
7
- data.tar.gz: 789511ad0a0f8c3ea6f660947d63154933f50218524830ad175e6a53f733bb50ad0baee227560cedf312465f168910f79beafc70108ac177859633953967b27a
6
+ metadata.gz: d31b7b60d8040acbb4e8cc72c9ed2898a11143351672334cf1ee52b819ec38ea983ef7552239231460cd64c6ff0487b7a94545b86f07c36383e278eeeff71e2d
7
+ data.tar.gz: fc8bdeacb2856ce4896f2d5f03d60c3e6a5cf9670ee49ee87f4f6d05839b018e08bc659111818cc56ed99592a4ed50a6b5f2d0907a12aa24144358f75210c211
File without changes
File without changes
data/bin/fuzz-web-dir.rb CHANGED
@@ -10,63 +10,69 @@ def main
10
10
  optp.banner = "\nUsage: fuzz-web-dir.rb [-h] [-w DICT] [-t MAXTHREAD] [..] URL
11
11
  des: Directory fuzzer. (#{VERSION})
12
12
  recomended: ruby-3.x.x otherwise it won't work properly.
13
- Eg: fuzz-web-dir.rb -e php,txt --hc 303,404 https://example.com
14
- fuzz-web-dir.rb -u http://example.com/api/v2/ -D proxy/list.txt -H '{\"foo\":\"bar\"}'\n\n"
13
+ Eg: fuzz-web-dir.rb -e php,txt --hs 303,404 https://example.com
14
+ fuzz-web-dir.rb -u http://example.com/ -w num.txt -H '{\"foo\":\"bar\"}'\n\n"
15
15
  optp.program_name = "fuzz-web-dir"
16
- optp.summary_width = 15
16
+ optp.summary_width = 12
17
17
  optp.program_name = "fuzz-web-dir"
18
18
  optp.version = VERSION
19
19
 
20
- optp.on('-w WORDLIST', "Use custom wordlist. (default:#{FUZZ_WEB_DIR_DICT})") do |w|
20
+ optp.on('-w FILE', "Use custom wordlist. ","(default:#{FUZZ_WEB_DIR_DICT})\n") do |w|
21
21
  init.dict = w
22
22
  end
23
- optp.on('-e EXT', "Add extension.Use comma for multiple value. (default:txt,php,html,xml") do |w|
23
+ optp.on('-e EXT', "Add extension.","Use comma for multiple value.", "(default:txt,php,html,xml") do |w|
24
24
  init.ext = w.split(',')
25
25
  end
26
- optp.on('-p PAUSE', Float, 'Pause the fuzz for N second.') do |p|
26
+ optp.on('-E', "Dissable extension search.") do |e|
27
+ init.use_ext = false
28
+ end
29
+ optp.on('-p INT', Float, 'Pause the fuzz for N second.') do |p|
27
30
  init.wait = p
28
31
  end
29
- optp.on('-d' , "Enable decoy for evate the fire wall. add #{FUZZ_WEB_DIR_PROXY_FILE} for default decoy list. x.x.x.x:p format.") do |d|
32
+ optp.on('-d' , "Enable decoy for evate the fire wall.","add #{FUZZ_WEB_DIR_PROXY_FILE},","for default decoy list. x.x.x.x:p format.") do |d|
30
33
  init.decoy = true
31
34
  end
32
- optp.on('-D DECOY' , "Use decoy file.") do |d|
35
+ optp.on('-D FILE' , "Use decoy file.") do |d|
33
36
  init.decoy = true
34
37
  init.pfile = d
35
38
  end
36
- optp.on('-n', 'Run decoy with out checking it. It may affect the result.') do
39
+ optp.on('-n', 'Run decoy with out checking it.',"It may affect the result.\n") do
37
40
  init.check = false
38
41
  end
39
- optp.on('-t MAXTHREAD', Integer, "Maximum concurrency. (default:#{FUZZ_WEB_DIR_MAX_THREAD})") do |t|
42
+ optp.on('-f', "Follow redirection") do |f|
43
+ init.follow = true
44
+ end
45
+ optp.on('-t INT', Integer, "Maximum concurrency. (default:#{FUZZ_WEB_DIR_MAX_THREAD})\n") do |t|
40
46
  init.max_thread = t
41
47
  end
42
- optp.on('-T TIMEOUT', Float, "Set time out for each try. (default:#{FUZZ_WEB_DIR_TIMEOUT}s)") do|t|
48
+ optp.on('-T INT', Float, "Set time out for each try. (default:#{FUZZ_WEB_DIR_TIMEOUT}s)\n") do|t|
43
49
  init.timeout = t
44
50
  end
45
- optp.on('-u URL', "Target url.")do|u|
51
+ optp.on('-u URL', "Target url or specify without -u flag.\n")do|u|
46
52
  init.url = u
47
53
  end
48
- optp.on('-o OUTPUT', "Write output to the file.")do|f|
54
+ optp.on('-o FILE', "Write output to the file.")do|f|
49
55
  init.out = f
50
56
  end
51
- optp.on('-H HEAD', 'Add header in json format with in apostrophy. eg:\'{"key":29}\' .') do |h|
57
+ optp.on('-H HEAD', 'Add header in json format with in apostrophy.',' eg:\'{"key":29}\' .') do |h|
52
58
  init.header = h
53
59
  end
54
- optp.on('-s STATUS', '--hs', "Hide status code. Use comma for multiple value. (default:404)") do |hc|
60
+ optp.on('-s INT', '--hs', "Hide status code. Use comma for multiple value. ","(default:404)") do |hc|
55
61
  init.hide_code = hc.split(',')
56
62
  end
57
- optp.on('-c CHARS', '--hc', "Hide No.Of.Chars. Use comma for multiple value. ") do |hc|
63
+ optp.on('-c INT', '--hc', "Hide No.Of.Chars. Use comma for multiple value. ") do |hc|
58
64
  init.hide_char = hc.split(',').map {|e| e.to_i}
59
65
  end
60
- optp.on('-l LINES', '--hl', "Hide No.of.Lines. Use comma for multiple value. ") do |hc|
66
+ optp.on('-l INT', '--hl', "Hide No.of.Lines. Use comma for multiple value. ") do |hc|
61
67
  init.hide_line = hc.split(',').map {|e| e.to_i}
62
68
  end
63
- optp.on('-S STATUS', '--ss', "Show status code. Use comma for multiple value.") do |hc|
69
+ optp.on('-S INT', '--ss', "Show status code. Use comma for multiple value.") do |hc|
64
70
  init.show_code = hc.split(',')
65
71
  end
66
- optp.on('-C CHARS', '--sc', "Show No.Of.Chars. Use comma for multiple value. ") do |hc|
72
+ optp.on('-C INT', '--sc', "Show No.Of.Chars. Use comma for multiple value. ") do |hc|
67
73
  init.show_char = hc.split(',').map {|e| e.to_i}
68
74
  end
69
- optp.on('-L LINES', '--sl', "Show No.of.Lines. Use comma for multiple value. ") do |hc|
75
+ optp.on('-L INT', '--sl', "Show No.of.Lines. Use comma for multiple value. ") do |hc|
70
76
  init.show_line = hc.split(',').map {|e| e.to_i}
71
77
  end
72
78
  optp.on('-h', '--help', "Print this help banner.") do |h|
data/bin/m4dh4v45b1n.rb CHANGED
File without changes
@@ -1,3 +1,5 @@
1
+ #!/bin/env ruby
2
+
1
3
  require 'sdcd'
2
4
  require 'digest'
3
5
  require 'net/http'
@@ -29,16 +31,39 @@ URLS = [
29
31
  "SDCD",
30
32
  "@",
31
33
  ","
34
+ ],
35
+ [
36
+ "https://raw.githubusercontent.com/cyb3r-mafia/subdomains/main/assets4/<SDCD>.sdcd",
37
+ "URL",
38
+ "SHA1",
39
+ "SDCD",
40
+ "@",
41
+ ","
42
+ ],
43
+ [
44
+ "https://raw.githubusercontent.com/cyb3r-mafia/subdomains/main/assets5/<SDCD>.sdcd",
45
+ "URL",
46
+ "SHA1",
47
+ "SDCD",
48
+ "@",
49
+ ","
50
+ ],
51
+ [
52
+ "https://raw.githubusercontent.com/cyb3r-mafia/subdomains/main/assets6/<SDCD>.sdcd",
53
+ "URL",
54
+ "SHA1",
55
+ "SDCD",
56
+ "@",
57
+ ","
32
58
  ]
33
59
  ]
34
60
 
35
61
  SORCE_DEPTH = 1
36
- SDCD_DIR = []
37
62
  CONFIG_FILE = ENV["HOME"] + "/.s-pasive.conf"
38
63
 
39
64
  tmp = []
40
-
41
-
65
+ tmp2 = []
66
+ src = ''
42
67
 
43
68
 
44
69
  if !File.exist? CONFIG_FILE
@@ -58,7 +83,16 @@ if File.exist? CONFIG_FILE
58
83
  File.open(CONFIG_FILE, "r") do |f|
59
84
  f.readlines.map do |l|
60
85
  if !l.start_with? "#"
61
- tmp.append(l.chop.split(" "))
86
+ val = l.chop.split(" ")
87
+ if val[1] == "URL"
88
+ tmp.append(val)
89
+ src += "\e[34;1m🌐 #{val[0]}\e[0m\n"
90
+ elsif val[1] == "DIR"
91
+ src += "\e[34;1m #{val[0]}\e[0m\n"
92
+ tmp2.append(val)
93
+ else
94
+ src += "\e[31;1m✘ #{l}\e[0m\n"
95
+ end
62
96
  end
63
97
  end
64
98
  end
@@ -67,6 +101,8 @@ else
67
101
  end
68
102
 
69
103
  SDCD_URL_DIR = tmp
104
+ SDCD_DIR = tmp2
105
+ SRC = src
70
106
 
71
107
  class ReconSubdomain
72
108
 
@@ -96,33 +132,32 @@ class ReconSubdomain
96
132
  @sdcd_dir.map do |templet|
97
133
  if @source_depth != 0
98
134
  if templet[-3] == "SDCD" and templet[1] == "DIR"
99
- hash = hashit(templet[-4], @domain)
100
- end
101
- @depth.times do |d|
102
- if d > 0
103
- hash = hashit(templet[-4], @domain + d.to_s)
104
- end
105
- path = templet[0].gsub("<SDCD>", hash)
106
- puts "\e[34;1m[] #{path}\e[0m"
107
- if File.exist? path
108
- puts "\n\e[32m[+] Data Found at depth\e[0m #{d}.\n\n"
109
- sdcd_dict = SDCD::new.read(path)
110
- sdcd_dict[@domain].map do |us_data|
111
- ips,sdomain = us_data.split(templet[-2])
112
- if !@notin.include? sdomain
113
- @notin.append(sdomain)
114
- puts "[+] \e[36;1m#{sdomain}\e[0m |\e[2;1m#{ips.gsub(templet[-1],"\e[0m|\e[2;1m")}\e[0m|"
115
- if !@out.nil?
116
- File.open(@out, "a") do |l|
117
- l.write(sdomain + "\n")
135
+ hash = hashit(templet[-4], @domain)
136
+ @depth.times do |d|
137
+ if d > 0
138
+ hash = hashit(templet[-4], @domain + d.to_s)
139
+ end
140
+ path = templet[0].gsub("<SDCD>", hash)
141
+ if File.exist? path
142
+ puts "\n\e[32m[+] Data Found at depth\e[0m #{d}.\n\n"
143
+ sdcd_dict = SDCD::new.read(path)
144
+ sdcd_dict[@domain].map do |us_data|
145
+ ips,sdomain = us_data.split(templet[-2])
146
+ if !@notin.include? sdomain
147
+ @notin.append(sdomain)
148
+ puts "[\e[32;1m+\e[0m] \e[36;1m#{sdomain}\e[0m |\e[2;1m#{ips.gsub(templet[-1],"\e[0m|\e[2;1m")}\e[0m|"
149
+ if !@out.nil?
150
+ File.open(@out, "a") do |l|
151
+ l.write(sdomain + "\n")
152
+ end
118
153
  end
119
154
  end
155
+ if @max_res == @notin.length
156
+ exit
157
+ end
120
158
  end
121
- if @max_res == @notin.length
122
- exit
123
- end
159
+ @source_depth -= 1
124
160
  end
125
- @source_depth -= 1
126
161
  end
127
162
  end
128
163
  end
@@ -145,7 +180,6 @@ class ReconSubdomain
145
180
  hash = hashit(templet[-4], @domain + d.to_s)
146
181
  end
147
182
  url = templet[0].gsub("<SDCD>", hash)
148
- puts "\e[1;34m[•] #{url}\e[0m"
149
183
  req = Net::HTTP::get_response(URI url)
150
184
  if req.code == '200'
151
185
  puts "\n\e[32m[+] Data Found at depth\e[0m #{d}.\n\n"
@@ -154,7 +188,7 @@ class ReconSubdomain
154
188
  ips,sdomain = us_data.split(templet[-2])
155
189
  if !@notin.include? sdomain
156
190
  @notin.append(sdomain)
157
- puts "[+] \e[36;1m#{sdomain}\e[0m |\e[2;1m#{ips.gsub(templet[-1],"\e[0m|\e[2;1m")}\e[0m|"
191
+ puts "[\e[32;1m+\e[0m] \e[36;1m#{sdomain}\e[0m |\e[2;1m#{ips.gsub(templet[-1],"\e[0m|\e[2;1m")}\e[0m|"
158
192
  if !@out.nil?
159
193
  File.open(@out, "a") do |l|
160
194
  l.write(sdomain + "\n")
@@ -211,6 +245,7 @@ willing to read my code. :) (#{VERSION})\n\n"
211
245
  init.domain = ARGV[-1]
212
246
  end
213
247
  if !init.domain.nil?
248
+ puts SRC
214
249
  init.scan
215
250
  else
216
251
  puts "Usage: recon-passive-subdomain.rb [ARG] DOMAIN\n use --help for more info."
@@ -14,7 +14,7 @@ def wordlist
14
14
  end
15
15
  FUZZ_WEB_DIR_DICT= wordlist
16
16
  FUZZ_WEB_DIR_HIDE_CODE=['404']
17
- FUZZ_WEB_DIR_EXT = ['php', 'txt', 'html', 'xml']
17
+ FUZZ_WEB_DIR_EXT = ['php', 'txt', 'html', 'db']
18
18
  FUZZ_WEB_DIR_HEADER = '{}'
19
19
  FUZZ_WEB_DIR_TIMEOUT = 3 # SECONDS
20
20
  FUZZ_WEB_DIR_MAX_THREAD = 24
@@ -32,7 +32,7 @@ var.max_thread = 24
32
32
  var.ext = ['php','txt']
33
33
  =end
34
34
  class Fuzz_web_dir
35
- attr_accessor :url,:dict,:hide_code,:hide_line,:hide_char,:show_code,:show_line,:show_char,:timeout,:max_thread,:ext,:out,:wait,:proxy,:decoy,:last_decoy, :pfile,:check,:header
35
+ attr_accessor :url,:dict,:hide_code,:hide_line,:hide_char,:show_code,:show_line,:show_char,:timeout,:max_thread,:ext,:out,:wait,:proxy,:decoy,:last_decoy, :pfile,:check,:header,:follow,:use_ext
36
36
  def initialize()
37
37
  @dict = FUZZ_WEB_DIR_DICT
38
38
  @hide_code = FUZZ_WEB_DIR_HIDE_CODE
@@ -48,12 +48,15 @@ class Fuzz_web_dir
48
48
  @wait = FUZZ_WEB_DIR_WAIT
49
49
  @decoy = false
50
50
  @check = true
51
+ @follow = false
52
+ @use_ext = true
51
53
  @last_decoy = ''
52
54
  @pfile = FUZZ_WEB_DIR_PROXY_FILE
53
55
  end
54
56
  def show_result(url_, try_ = 5)
55
57
  begin
56
58
  @header['User-Agent'] = rand_user_agent
59
+ protocol = URI(url_).scheme
57
60
  if @decoy
58
61
  proxy_ = @last_decoy
59
62
  loop do
@@ -92,7 +95,6 @@ class Fuzz_web_dir
92
95
  if (@show_code.include? code_);put_it = true;end
93
96
  if (@show_char.include? char_);put_it = true;end
94
97
  if (@show_line.include? line_);put_it = true;end
95
- #if (code_ == '301' and char_ == 0 and line_ == 0);url_ += "/";end
96
98
  if put_it
97
99
  finally_ = "\r\e[32m#{url_}\e[0m lines:\e[33m#{line_}\e[0m chrs:\e[35m#{char_}\e[0m status:\e[36m#{code_}\e[0m"
98
100
  if !res_.header['Location'].nil?
@@ -104,6 +106,13 @@ class Fuzz_web_dir
104
106
  @out.write(url_ + "\n")
105
107
  end
106
108
  end
109
+ if (@follow and !res_.header["Location"].nil?)
110
+ tmp = res_.header["Location"]
111
+ if URI.extract(tmp).length == 0
112
+ tmp = url_.sub(URI(url_).path, tmp)
113
+ end
114
+ show_result(tmp, try_)
115
+ end
107
116
  rescue (Errno::ECONNREFUSED) => e
108
117
  print "\r#{' '*50}\r> retrying#{'.'* try_}\r"
109
118
  if (try_ != 0)
@@ -141,22 +150,23 @@ class Fuzz_web_dir
141
150
  end
142
151
  end
143
152
  def print_status(key, val)
144
- puts "\e[32m#{key.upcase}\e[0m: #{val}."
153
+ puts "\e[32m#{key.capitalize.ljust(24).gsub(" ",".").gsub("_", " ")}\e[0m: #{val}"
145
154
  end
146
155
  def print_status_all
147
156
  [
148
157
  ["target", @url],
149
- ["dict", @dict],
150
- ["ext", @ext[0,@ext.length-1].map{|e| e[1,e.length]}],
158
+ ["dictnary", @dict],
159
+ ["file_extension", @ext[0,@ext.length-1].map{|e| e[1,e.length]}],
151
160
  ["header", @header],
152
161
  ["User-agent", "random"],
162
+ ["Follow_redirection", @follow],
153
163
  ["Timeout", "#{@timeout}s"],
154
- ["max-thread", @max_thread],
155
- ["pause", "#{@wait}s"],
156
- ["hide /status/line/char", "#{@hide_code}/#{@hide_line}/#{@hide_char}"],
157
- ["show /status/line/char", "#{@show_code}/#{@show_line}/#{@show_char}"],
158
- ["output", @out],
159
- ["decoy-proxy",
164
+ ["maximum_thread", @max_thread],
165
+ ["pause_request in second", "#{@wait}s"],
166
+ ["hide_[/status/line/char]", "#{@hide_code}/#{@hide_line}/#{@hide_char}"],
167
+ ["show_[/status/line/char]", "#{@show_code}/#{@show_line}/#{@show_char}"],
168
+ ["output_file", @out],
169
+ ["decoy_proxy",
160
170
  if !@proxy.nil?
161
171
  @proxy.length
162
172
  else
@@ -170,8 +180,12 @@ class Fuzz_web_dir
170
180
  if @url[-1] != '/'
171
181
  @url += '/'
172
182
  end
173
- @ext = @ext.map {|i| '.'+i }
174
- @ext.append("")
183
+ if @use_ext
184
+ @ext = @ext.map {|i| '.'+i }
185
+ @ext.append("")
186
+ else
187
+ @ext = [""]
188
+ end
175
189
  @header = JSON::parse(@header)
176
190
  if @decoy
177
191
  @proxy = Pr0xy.new.get_proxies(@pfile, @check)
@@ -184,6 +198,7 @@ class Fuzz_web_dir
184
198
  end
185
199
  def fuzz
186
200
  check_it
201
+ count = 0
187
202
  # read dict file
188
203
  File::open(@dict, "r") do |line|
189
204
  while true
@@ -193,6 +208,7 @@ class Fuzz_web_dir
193
208
  begin
194
209
  Timeout::timeout(@timeout) do
195
210
  if string_line[0] != "#"
211
+ count+= 1
196
212
  show_result(@url+URI::encode_www_form_component(string_line.chomp+ext))
197
213
  end
198
214
  end
@@ -204,9 +220,10 @@ class Fuzz_web_dir
204
220
  while Thread::list.length > @max_thread;end
205
221
  sleep(0.01 + @wait)
206
222
  end
207
- if string_line.length < 20
208
- print "\r#{' '*55}\r> #{string_line.chomp}\r"
223
+ if string_line.length > 20
224
+ string_line = string_line[0,18] + "…"
209
225
  end
226
+ print "\r#{' '*55}\r> #{string_line.chomp}\r"
210
227
  end
211
228
  end
212
229
  end
@@ -1,2 +1,2 @@
1
1
  # frozen_string_literal: true
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.4"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: m4dh4v45b1n
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Madhava-mng
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-07-27 00:00:00.000000000 Z
11
+ date: 2021-08-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sdcd