Class: Codesake::Commons::Target
- Inherits:
-
Object
- Object
- Codesake::Commons::Target
- Defined in:
- lib/codesake/commons/target.rb
Instance Attribute Summary collapse
-
#cms ⇒ Object
readonly
Returns the value of attribute cms.
-
#cookies ⇒ Object
readonly
Returns the value of attribute cookies.
-
#language ⇒ Object
readonly
Returns the value of attribute language.
-
#password ⇒ Object
readonly
Returns the value of attribute password.
-
#score ⇒ Object
readonly
Returns the value of attribute score.
-
#site_tree ⇒ Object
readonly
This is the website tree.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
-
#username ⇒ Object
readonly
Returns the value of attribute username.
-
#vulns ⇒ Object
readonly
Returns the value of attribute vulns.
-
#webserver ⇒ Object
readonly
This will be fed by codesake-gengiscan.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Target
constructor
A new instance of Target.
- #is_alive? ⇒ Boolean
Constructor Details
#initialize(options = {}) ⇒ Target
Returns a new instance of Target.
26 27 28 29 30 31 32 33 |
# File 'lib/codesake/commons/target.rb', line 26 def initialize(={}) $logger = Codesake::Commons::Logging.instance @agent = Mechanize.new @url ||= [:url] @username ||= [:username] @password ||= [:password] end |
Instance Attribute Details
#cms ⇒ Object (readonly)
Returns the value of attribute cms.
12 13 14 |
# File 'lib/codesake/commons/target.rb', line 12 def cms @cms end |
#cookies ⇒ Object (readonly)
Returns the value of attribute cookies.
21 22 23 |
# File 'lib/codesake/commons/target.rb', line 21 def @cookies end |
#language ⇒ Object (readonly)
Returns the value of attribute language.
11 12 13 |
# File 'lib/codesake/commons/target.rb', line 11 def language @language end |
#password ⇒ Object (readonly)
Returns the value of attribute password.
6 7 8 |
# File 'lib/codesake/commons/target.rb', line 6 def password @password end |
#score ⇒ Object (readonly)
Returns the value of attribute score.
23 24 25 |
# File 'lib/codesake/commons/target.rb', line 23 def score @score end |
#site_tree ⇒ Object (readonly)
This is the website tree. Fed by codesake-links. Each tree element is an hash like :code, :kind, :dynamic :dynamic is true or false if the page has some dynamic content that needs to be exploited (url parameters, forms, …)
19 20 21 |
# File 'lib/codesake/commons/target.rb', line 19 def site_tree @site_tree end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
4 5 6 |
# File 'lib/codesake/commons/target.rb', line 4 def url @url end |
#username ⇒ Object (readonly)
Returns the value of attribute username.
5 6 7 |
# File 'lib/codesake/commons/target.rb', line 5 def username @username end |
#vulns ⇒ Object (readonly)
Returns the value of attribute vulns.
24 25 26 |
# File 'lib/codesake/commons/target.rb', line 24 def vulns @vulns end |
#webserver ⇒ Object (readonly)
This will be fed by codesake-gengiscan
10 11 12 |
# File 'lib/codesake/commons/target.rb', line 10 def webserver @webserver end |
Instance Method Details
#is_alive? ⇒ Boolean
35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/codesake/commons/target.rb', line 35 def is_alive? return false unless url return false unless @agent begin @agent.get('/') return true rescue Net::HTTP::Persistent::Error=>e return false end end |