enchant 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog CHANGED
@@ -1,8 +1,12 @@
1
- -- 0.3.0 --
1
+ -- 0.4.0 --
2
+ 2010-06-29 Paolo Perego <thesp0nge@gmail.com>
3
+
4
+ * lib/enchant.rb, bin/enchant (none): adding -P option to check if the selected web server is alive
2
5
 
6
+ -- 0.3.0 --
3
7
  2010-06-25 Paolo Perego <thesp0nge@gmail.com>
4
8
 
5
- * lib/enchant.rb, bin/enchant (): adding -H, -p option to override URI parsing that checks TLD sanity
9
+ * lib/enchant.rb, bin/enchant (none): adding -H, -p option to override URI parsing that checks TLD sanity
6
10
 
7
11
  2010-06-24 Paolo Perego <thesp0nge@gmail.com>
8
12
  * bin/enchant (none): adding -f, --flood to perform HTTP HEAD flooding requests
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.0
1
+ 0.4.0
@@ -9,6 +9,7 @@ require 'rdoc/usage'
9
9
  opts = GetoptLong.new(
10
10
  [ '--help', '-h', GetoptLong::NO_ARGUMENT ],
11
11
  [ '--version', '-v', GetoptLong::NO_ARGUMENT ],
12
+ [ '--ping', '-P', GetoptLong::NO_ARGUMENT],
12
13
  [ '--flood', '-f', GetoptLong::REQUIRED_ARGUMENT],
13
14
  [ '--wordlist', '-w', GetoptLong::REQUIRED_ARGUMENT ],
14
15
  [ '--host', '-H', GetoptLong::REQUIRED_ARGUMENT],
@@ -16,6 +17,7 @@ opts = GetoptLong.new(
16
17
  )
17
18
 
18
19
  flood = -1
20
+ ping = -1
19
21
  wordlist = 'basic.txt'
20
22
  host = nil
21
23
  port = nil
@@ -34,6 +36,8 @@ opts.each do |opt, arg|
34
36
  puts 'can\'t flood negative requests'
35
37
  exit 1
36
38
  end
39
+ when '--ping'
40
+ ping = 0
37
41
  when '--host'
38
42
  host = arg
39
43
  when '--port'
@@ -65,11 +69,11 @@ end
65
69
  puts e
66
70
 
67
71
  if flood != -1
68
- puts "Flooding "+e.host+" with #{flood} requests"
69
72
  if (! e.is_sane?)
70
73
  puts 'Automatic url parsing failed, please consider providing such information by hand.'
71
74
  exit 1
72
75
  end
76
+ puts "Flooding "+e.host+" with #{flood} requests"
73
77
 
74
78
  pbar = ProgressBar.new("reqs", flood)
75
79
  start_time = Time.now
@@ -81,7 +85,25 @@ if flood != -1
81
85
  puts "flooed in " + (Time.now - start_time).to_s + "s"
82
86
  exit 0
83
87
  end
88
+
89
+ if ping != -1
90
+ if (! e.is_sane?)
91
+ puts 'Automatic url parsing failed, please consider providing such information by hand.'
92
+ exit 1
93
+ end
94
+ puts "Pinging "+e.host+" onto port " + e.port.to_s
84
95
 
96
+ start_time = Time.now
97
+ e.ping
98
+ if (e.is_alive?)
99
+ puts e.host + " seems to be alive"
100
+ else
101
+ puts e.host + " seems having some trouble ("+e.code+")"
102
+ end
103
+ puts
104
+ puts "pinged in " + (Time.now - start_time).to_s + "s"
105
+ exit 0
106
+ end
85
107
  puts "Sending probe to #{url}"
86
108
  e.list(wordlist)
87
109
  list = e.fuzz()
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{enchant}
8
- s.version = "0.3.0"
8
+ s.version = "0.4.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Paolo Perego"]
12
- s.date = %q{2010-06-25}
12
+ s.date = %q{2010-06-29}
13
13
  s.default_executable = %q{enchant}
14
14
  s.description = %q{Enchant is tool aimed to discover web application directory and pages by fuzzing the requests using a dictionary approach}
15
15
  s.email = %q{paolo@armoredcode.com}
@@ -7,7 +7,7 @@ class Enchant
7
7
  attr_reader :server, :code
8
8
  attr_accessor :host, :port
9
9
 
10
- VERSION = '0.3.0'
10
+ VERSION = '0.4.0'
11
11
 
12
12
  def initialize(*urls)
13
13
  url = urls.pop || ""
@@ -18,7 +18,7 @@ class Enchant
18
18
  @host = tmp.host
19
19
  @port = tmp.port
20
20
 
21
- if @host == nil || @port == nil
21
+ if @host == nil && @port == nil
22
22
  @sane = nil
23
23
  else
24
24
  @sane = 1
@@ -62,6 +62,10 @@ class Enchant
62
62
  end
63
63
  end
64
64
 
65
+ def is_alive?
66
+ (@code == 200)
67
+ end
68
+
65
69
  def ping(*)
66
70
  Net::HTTP.start(host, port) { |http|
67
71
  response = http.head("/")
@@ -70,6 +74,7 @@ class Enchant
70
74
  @server=val
71
75
  end
72
76
  }
77
+ @code = response.code
73
78
 
74
79
  }
75
80
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: enchant
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 15
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 3
8
+ - 4
9
9
  - 0
10
- version: 0.3.0
10
+ version: 0.4.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Paolo Perego
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-06-25 00:00:00 +02:00
18
+ date: 2010-06-29 00:00:00 +02:00
19
19
  default_executable: enchant
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency