Fixes #490. Fixes #497. Fixes #479 (hopefully in all cases). Updates to the cygwin scripts and batch files

git-svn-id: file:///home/svn/framework3/trunk@7475 4d416f70-5f16-0410-b530-b9f4589650da
unstable
HD Moore 2009-11-12 06:18:32 +00:00
parent 63383842e5
commit ab33e5403d
4 changed files with 44 additions and 26 deletions

View File

@ -2,20 +2,13 @@
File.umask(0022)
# Extract the user's Metasploit source tree
msf3 = '/msf3'
if(! (File.directory?(msf3) and File.exists?(File.join(msf3,"_EXTRACTED_"))))
puts "[*] The Metasploit Framework is being installed in:"
puts "[*] - #{msf3}"
puts "[*] This may take a couple minutes..."
Dir.chdir('/')
r = system("tar xf /data/msf3.tar.gz")
if(not r)
puts "[-] Extraction failed"
exec("/bin/bash")
end
system("touch #{msf3}/_EXTRACTED_")
if ! File.directory?(msf3)
puts "[*] This Metasploit Framework installation is corrupted."
exit(1)
end
Dir.chdir(msf3)
targ = ARGV.shift
exec("ruby", targ, *ARGV)

View File

@ -2,25 +2,38 @@
File.umask(0022)
# Extract the user's Metasploit source tree
msf3 = '/msf3'
if(! (File.directory?(msf3) and File.exists?(File.join(msf3,"_EXTRACTED_"))))
puts "[*] The Metasploit Framework is being installed in:"
puts "[*] - #{msf3}"
puts "[*] This may take a couple minutes..."
Dir.chdir('/')
r = system("tar xf /data/msf3.tar.gz")
if(not r)
puts "[-] Extraction failed"
exec("/bin/bash")
end
system("touch #{msf3}/_EXTRACTED_")
if ! File.directory?(msf3)
puts "[*] This Metasploit Framework installation is corrupted."
exit(1)
end
Dir.chdir(msf3)
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
puts "[*] Updating the Metasploit Framework..."
puts ""
system("svn update")
puts ""
puts "[*] Update complete"
$stdin.getc
puts "[*] Update complete, press enter to exit"
$stdin.readline
exit(0)

View File

@ -79,3 +79,4 @@ if [ ! -z "${CHERE_INVOKING}" ]; then
else
cd "${HOME}"
fi

View File

@ -4,6 +4,16 @@
# Reset file permissions to allow other users
#
umask 022
touch /etc/_TESTING_ 2>/dev/null
if [ $? -ne "0" ]; then
echo "[*] This application *MUST* be launched as an administrator the first time"
echo "[*] Press enter to exit"
read BOOM
exit 1
fi
rm -f /etc/_TESTING_
chmod 755 -R /bin /*.bat /lib /usr /var /dev /etc /sbin /msf3 2>/dev/null
if [ $? -ne "0" ]; then
echo "[*] This application *MUST* be launched as an administrator the first time"
@ -15,3 +25,4 @@ fi
chmod 755 /home
chmod 1777 /tmp /var/tmp
touch /etc/_FRIENDLY_