2009-11-12 05:30:58 +00:00
|
|
|
#!/usr/bin/env ruby
|
|
|
|
|
|
|
|
File.umask(0022)
|
|
|
|
|
|
|
|
msf3 = '/msf3'
|
2009-11-12 06:18:32 +00:00
|
|
|
if ! File.directory?(msf3)
|
|
|
|
puts "[*] This Metasploit Framework installation is corrupted."
|
|
|
|
exit(1)
|
2009-11-12 05:30:58 +00:00
|
|
|
end
|
2009-11-12 06:18:32 +00:00
|
|
|
|
2009-11-12 05:30:58 +00:00
|
|
|
Dir.chdir(msf3)
|
2009-11-12 06:18:32 +00:00
|
|
|
|
|
|
|
allowed = false
|
|
|
|
begin
|
|
|
|
File.open("can_write.txt", "wb") do |fd|
|
|
|
|
fd.write("YES")
|
|
|
|
end
|
|
|
|
File.unlink("can_write.txt")
|
|
|
|
allowed = true
|
|
|
|
rescue ::Exception
|
|
|
|
end
|
|
|
|
|
|
|
|
if(not allowed)
|
|
|
|
puts "[*] Error: msfupdate must be run as an administrative user"
|
|
|
|
$stdin.readline
|
|
|
|
exit(1)
|
|
|
|
end
|
|
|
|
|
2009-11-12 05:30:58 +00:00
|
|
|
puts "[*] Updating the Metasploit Framework..."
|
|
|
|
puts ""
|
|
|
|
|
|
|
|
system("svn update")
|
2009-11-12 06:18:32 +00:00
|
|
|
|
2009-11-12 05:30:58 +00:00
|
|
|
puts ""
|
2009-11-12 06:18:32 +00:00
|
|
|
puts "[*] Update complete, press enter to exit"
|
|
|
|
|
|
|
|
$stdin.readline
|
|
|
|
exit(0)
|
|
|
|
|