Improved the msfupdate script, retry on dirty svn directories, warn the user if automatic updates are disabled, and indicate the msfconsole is in the system path after the install
git-svn-id: file:///home/svn/framework3/trunk@7437 4d416f70-5f16-0410-b530-b9f4589650da
This commit is contained in:
parent
acea0f87fb
commit
4321b992dc
|
@ -1,6 +1,6 @@
|
|||
#!/bin/sh
|
||||
|
||||
VERSION="3.3-beta"
|
||||
VERSION="3.3-rc1"
|
||||
|
||||
# Grab a fresh copy of Metasploit
|
||||
if [ -f "tmp/msf3/msfconsole" ]; then
|
||||
|
@ -23,6 +23,7 @@ cp tmp/msf3.tar tmp32/
|
|||
cp bin/linux32.tar.bz2 tmp32/metasploit.tar.bz2
|
||||
bunzip2 tmp32/metasploit.tar.bz2
|
||||
cp -a scripts/*.sh tmp32/
|
||||
cp -a scripts/msfupdate tmp32/
|
||||
TMP32=tmp32`date +%s1`
|
||||
mv tmp32 $TMP32
|
||||
makeself $TMP32 ${PATH32} "${NAME32}" ./installer.sh 32
|
||||
|
@ -34,6 +35,7 @@ cp tmp/msf3.tar tmp64/
|
|||
cp bin/linux64.tar.bz2 tmp64/metasploit.tar.bz2
|
||||
bunzip2 tmp64/metasploit.tar.bz2
|
||||
cp -a scripts/*.sh tmp64/
|
||||
cp -a scripts/msfupdate tmp64/
|
||||
TMP64=tmp32`date +%s1`
|
||||
mv tmp64 $TMP64
|
||||
makeself $TMP64 ${PATH64} "${NAME64}" ./installer.sh 64
|
||||
|
|
|
@ -54,6 +54,7 @@ mkdir -p /opt/metasploit3
|
|||
echo "Extracting the Metasploit operating environment..."
|
||||
tar --directory=/opt -xf metasploit.tar
|
||||
cp run.sh env.sh /opt/metasploit3/
|
||||
cp msfupdate /opt/metasploit3/app/
|
||||
echo ""
|
||||
|
||||
echo "Extracting the Metasploit Framework..."
|
||||
|
@ -64,6 +65,7 @@ echo "Installing links into /usr/local/bin..."
|
|||
mkdir -p /usr/local/bin
|
||||
ln -sf /opt/metasploit3/bin/msf* /usr/local/bin/
|
||||
echo ""
|
||||
hash -r
|
||||
|
||||
echo "Installation complete."
|
||||
echo ""
|
||||
|
@ -77,6 +79,11 @@ if [ $? -eq "1" ]; then
|
|||
crontab $CRON
|
||||
rm -f $CRON
|
||||
echo ""
|
||||
else
|
||||
echo ""
|
||||
echo "Warning: Automatic updates are disabled, update manually with:"
|
||||
echo "$ sudo msfupdate"
|
||||
echo ""
|
||||
fi
|
||||
|
||||
echo "Would you like to update Metasploit right now?"
|
||||
|
@ -87,5 +94,7 @@ if [ $? -eq "1" ]; then
|
|||
echo ""
|
||||
fi
|
||||
|
||||
echo "Launch the Metasploit console by running 'msfconsole'"
|
||||
echo ""
|
||||
echo "Exiting the installer..."
|
||||
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
#!/bin/bash
|
||||
|
||||
if [ `id -u -n` != "root" ]; then
|
||||
echo "[*] Error: msfupdate must be run as the root user"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
cd $BASE/msf3
|
||||
REPO=`grep framework3 .svn/entries`
|
||||
echo "Updating Metasploit from ${REPO}..."
|
||||
svn update
|
||||
|
||||
|
||||
|
||||
if [ $? -ne "0" ]; then
|
||||
echo " "
|
||||
echo "Error: cleaning up the SVN directory and retrying..."
|
||||
svn cleanup
|
||||
svn update
|
||||
fi
|
||||
|
||||
if [ $? -ne "0" ]; then
|
||||
echo " "
|
||||
echo "Error: please check connectivity to the following URL:"
|
||||
echo " "`grep framework3 .svn/entries`
|
||||
echo " "
|
||||
fi
|
||||
|
Loading…
Reference in New Issue