Update backtrack 3

#!/bin/sh
#
# Avoid using root’s TMPDIR
unset TMPDIR

Nessusplugins() {

read -p “Update Nessus Daemon? <y/n> ”
if [ “$REPLY” = “y” ];then
echo ———————————————
echo Nessus Plugins
echo
KIND=”Nessus Server”
echo -n $”Shutting down $KIND: ”
test -f /opt/nessus/var/nessus/nessus-service.pid && kill `cat /opt/nessus/var/nessus/nessus-service.pid`
RETVAL=$?
sleep 4
if [ “$RETVAL” == “0” ]; then
rm -f /var/lock/subsys/nessusd
echo services stopped successfully
else
echo services were not running…
fi
echo
echo -n “Updating $KIND plugins: ”
/opt/nessus/sbin/nessus-update-plugins
echo $KIND plugins updated successfully
echo -n $”Starting $KIND services: ”
/opt/nessus/sbin/nessus-service -D -a 127.0.0.1 –ipv4-only
echo $KIND services started…
echo
echo ———————————————
sleep 2
else
cancel
fi

}

Openvasplugins() {

read -p “Update Openvas Daemon? <y/n> ”
if [ “$REPLY” = “y” ];then
echo ———————————————
echo Openvas Plugins
echo
KIND=”Openvas”
echo -n $”Shutting down $KIND services: ”
test -f /opt/openvas/var/openvas/openvas-service.pid && kill `cat /opt/openvas/var/openvas/openvas-service.pid`
RETVAL=$?
sleep 4
if [ “$RETVAL” == “0” ]; then
rm -f /var/lock/subsys/openvasd
echo services stopped successfully
else
echo services were not running…
fi
echo -n “Updating $Kind plugins: ”
/opt/openvas/sbin/openvas-nvt-sync
echo $Kind plugins updated successfully
echo -n $”Starting $KIND services: ”
/opt/openvas/sbin/openvasd -D -a 127.0.0.1 -p 1242
echo $KIND services started…
RETVAL=0
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/openvasd
return $RETVAL
return 0
echo
echo ———————————————
sleep 2
else
cancel
fi

}

Saint() {

echo ———————————————
echo Saint Exploit
echo
KIND=”Saint Exploit”
echo -n “Updating $Kind plugins: ”
cd /opt/saint-7.2/
saint -VV
echo $Kind plugins updated successfully
echo
echo ———————————————
sleep 2

}

Nikto() {

echo ———————————————
echo Nikto
echo
KIND=”Nikto”
echo -n “Updating $KIND plugins: ”
nikto.pl -update
echo $KIND plugins updated successfully
echo
echo ———————————————
sleep 2
}

Amap() {

echo ———————————————
echo
echo Amap
echo
KIND=”Amap”
echo Current version:
amap | grep amap | cut -d” ” -f2,1 | tr [‘Syntax: amap is /u r loc l b’] ‘ ‘
echo -n “Updating $KIND plugins: ”
amap -W
echo $KIND plugins updated successfully
echo
echo ———————————————
sleep 2
}

Sqlmap() {

echo ———————————————
echo
echo Sqlmap
echo
KIND=”Sqlmap”
echo -n “Updating $KIND plugins: ”
python /pentest/database/sqlmap/sqlmap.py –update
echo $KIND plugins updated successfully
echo
echo ———————————————
sleep 2
}

Aircrackng() {

echo ———————————————
echo Aircrack-NG
echo
KIND=”Aircrack-NG”
echo Current version:
echo
aircrack-ng | grep Aircrack-ng | cut -d”T” -f0,1 | tr [‘tom’] ‘ ‘
echo
echo -n “Updating $KIND: ”
echo
cd /pentest/wireless/
update-aircrack.sh
airodump-ng-oui-update
echo $KIND plugins updated successfully
echo
echo ———————————————
sleep 2
}

Rkhunter() {

echo ———————————————
echo Rootkit Hunter
echo
KIND=”Rootkit Hunter”
echo Current version:
echo
rkhunter -V | grep Rootkit | cut -d”C” -f1,0 | tr [‘,’] ‘ ‘
echo
echo -n “Updating $KIND database: ”
rkhunter –update
echo $KIND plugins updated successfully
echo
echo ———————————————
sleep 2
}

Metasploit2() {

echo ———————————————
echo Framework Metasploit 2
echo
KIND=”Metasploit 2″
echo Current version:
echo
cd /pentest/exploits/framework2
msfconsole -v
msfcli -v
echo -n “Updating $KIND plugins: ”
cd /pentest/exploits/framework2/
svn update
echo $KIND plugins updated successfully
echo
echo ———————————————
sleep 2
}

Metasploit3() {

echo ———————————————
echo Framework Metasploit 3
echo
KIND=”Metasploit 3″
echo Current version:
cd /pentest/exploits/framework3
msfconsole -v
echo
echo -n “Updating $KIND plugins: ”
cd /pentest/exploits/framework3/
svn update
echo $KIND plugins updated successfully
echo
echo ———————————————
sleep 2
}

Milworm() {

echo ———————————————
echo Milw0rm Exploits
echo
KIND=”Milworm exploits”
echo -n “Updating $KIND plugins: ”
echo
cd /pentest/exploits/
update-milw0rm
echo $KIND plugins updated successfully
echo
echo ———————————————
sleep 2
}

Exploitdb() {

echo ———————————————
echo The Exploit Database
echo
KIND=”The Exploit Database”
echo -n “Updating $KIND plugins: ”
echo
cd /pentest/exploits/
svn co svn://devel.offensive-security.com/exploitdb
echo $KIND plugins updated successfully
echo
echo ———————————————
sleep 2
}

Pirana() {

echo ———————————————
echo Pirana Exploits “metasploit database”
echo
KIND=”Pirana exploits”
echo Current version:
echo
cd /pentest/fuzzers/pirana/framework-2.5/
msfconsole -v
msfcli -v
echo -n “Updating $KIND: ”
echo
svn update
echo $KIND plugins updated successfully
echo
echo ———————————————
sleep 2
}

all() {
Nessusplugins
Openvasplugins
Saint
Nikto
Amap
Sqlmap
Aircrackng
Rkhunter
Metasploit2
Metasploit3
Milworm
Exploitdb
Pirana
}

case “$1” in
Nessus)
Nessusplugins
;;
Openvas)
Openvasplugins
;;
Saint)
Saint
;;
Nikto)
Nikto
;;
Amap)
Amap
;;
Sqlmap)
Sqlmap
;;
Aircrackng)
Aircrackng
;;
Rkhunter)
Rkhunter
;;
Metasploit2)
Metasploit2
;;
Metasploit3)
Metasploit3
;;
Milworm)
Milworm
;;
Exploitdb)
Exploitdb
;;
Pirana)
Pirana
;;
all)
all
;; *)
echo “Usage: rc.updates {Nessus|Openvas|Saint|Nikto|Amap|Sqlmap|Aircrackng |Rkhunter|Metasploit2|Metasploit3|Milworm|Exploitd b|Pirana|all)”
exit 1
esac
exit $?

save as update.sh

Advertisements
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: