Class: URI::HTTP

Inherits:
Generic
  • Object
show all
Defined in:
lib/ronin/php/lfi/extensions/uri/http.rb,
lib/ronin/php/rfi/extensions/uri/http.rb

Instance Method Summary collapse

Instance Method Details

#has_lfi?(options = {}) ⇒ Boolean

Returns:

  • (Boolean)


53
54
55
# File 'lib/ronin/php/lfi/extensions/uri/http.rb', line 53

def has_lfi?(options={})
  !(test_lfi(options).empty?)
end

#has_rfi?(options = {}) ⇒ Boolean

Returns:

  • (Boolean)


49
50
51
# File 'lib/ronin/php/rfi/extensions/uri/http.rb', line 49

def has_rfi?(options={})
  !(test_rfi(options).empty?)
end

#lfi(options = {}) ⇒ Object



49
50
51
# File 'lib/ronin/php/lfi/extensions/uri/http.rb', line 49

def lfi(options={})
  test_lfi(options).first
end

#rfi(options = {}) ⇒ Object



45
46
47
# File 'lib/ronin/php/rfi/extensions/uri/http.rb', line 45

def rfi(options={})
  test_rfi(options).first
end

#test_lfi(options = {}) ⇒ Object



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/ronin/php/lfi/extensions/uri/http.rb', line 29

def test_lfi(options={})
  up = ((options[:up]) || 0..Ronin::PHP::LFI::MAX_UP)
  vulns = []

  query_params.each_key do |param|
    lfi = Ronin::PHP::LFI.new(self,param)

    up.each do |n|
      lfi.up = n

      if lfi.vulnerable?(options)
        vulns << lfi
        break
      end
    end
  end

  return vulns
end

#test_rfi(options = {}) ⇒ Object



30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/ronin/php/rfi/extensions/uri/http.rb', line 30

def test_rfi(options={})
  vulns = []

  query_params.each_key do |param|
    rfi = Ronin::PHP::RFI.new(self,param)

    if rfi.vulnerable?(options)
      vulns << rfi
      break
    end
  end

  return vulns
end