المشاركة الأصلية بواسطة بـركـات مشاهدة المشاركة
السّلام عليكم ورحمة الله وبركاته

سبقّ أن كتبت موضوع عن تنصيب أدوات BackTrack على أيّ توزيعة , لتسهيل الأمور أكثر كتبت سكربت للتنصيب آلياً
ويقوم بالمهمّه نيابه عنك :

كود:
#!/bin/sh
#
#    Copyright 2011 B4r4k47 [Barakat] <b4r4k47[at]hotmail[dot]com>
#
#    This tool is available for free under the GNU General Public License V3 (GPL).
#    To read the full license, please visit: http://www.gnu.org/licenses/lgpl.html
#    I hope you find it useful :)
#
#    Tool to install Backtrack tools on any linux distribution
#    vi Backtrack's ISO.
#
#    [!] Note: This script tested on Backtrack 4 NOT 5!
#

#
# Backtrack ISO file full path should be here :
# ISO='/home/barakat/backtrack4-r2.iso'

ISO='/home/barakat/backtrack4-r2.iso'

#
#

# START:

echo -n "Checking if you're root ..."
if [ $(id -u) != 0 ];
then
    echo "ERROR"
    echo -e "[!] You're not root!\a"
    exit 1
    
fi
echo "OK"

echo -n "Checking if ISO exists ..."

if [ ! -f $ISO ];  then
    echo "ERROR"
    echo -e "[!] File dose not exists!\a"
    exit 1
fi
echo "OK"

which apt-get    > /dev/null 2>&1 ; APTM=$?
which yum    > /dev/null 2>&1 ; YUMM=$?
which pacman    > /dev/null 2>&1 ; PACM=$?

if     [ "$APTM" == "0" ] ; then

    echo -n "Downloading 'squashfs-tools' ..."
    apt-get install squashfs-tools
    echo "Downloading 'squashfs-tools' ... OK"

elif    [ "$YUMM" == "0" ] ; then

    echo -n "Downloading 'squashfs-tools' ..."
    yum install squashfs-tools
    echo "Downloading 'squashfs-tools' ... OK"

elif    [ "$PACM" == "0" ] ; then

    echo -n "Downloading 'squashfs-tools' ..."
    pacman -S squashfs-tools
    echo "Downloading 'squashfs-tools' ... OK"

else
    echo "Downloading 'squashfs-tools' ... ERROR"
    echo -e "[!] Unknown package manager!\a"
    exit 2
fi

ISON=$(basename $ISO)

echo -n "Mounting $ISON ..."
cd $(echo $ISO | sed s/$(echo $ISO | awk 'BEGIN{FS="/"}{print $NF}')//g)
mkdir /mnt/tmpdir
mount -o loop $ISON -t iso9660 /mnt/tmpdir 1>/dev/null
echo "OK"

echo "Extracting filesystem.squashfs files ..."
unsquashfs /mnt/tmpdir/casper/filesystem.squashfs
echo "Extracting filesystem.squashfs files ... OK"

echo -n "Coping Backtrack's pentest folder ..."
mkdir /pentest
cp -R ./squashfs-root/pentest/* /pentest/
echo "OK"

echo -n "Cleaning up ..."
rm -rf ./squashfs-root ./filesystem.squashfs
umount /mnt/tmpdir/
rm -rf /mnt/tmpdir/
echo "OK"

echo "" ; echo ""
echo "[!] Done!"
echo "Check '/pentest' folder :)"

# END.
[ السكربت مرفق ] طريّقة تشغيله , إحفظه بأيّ إسم تريد , مثلاً tool1.sh وعدّل السطر :

كود:
ISO='/home/barakat/backtrack4-r2.iso'
لمسار ملف الـiso الخاص بتوزيعة Backtrack

ولتشغيله لمن يستخدم sudo

كود:
sudo sh tool1.sh
أو من يستخدم su

كود:
su
sh tool1.sh
فقط تأكّد بأنك متصل بالشبكه وستنصّب وتعدّ لك
يتجد الأدوات بالمجلّد :

/pentest

تماماً مثل BackTrack

================================================== =====================

السكربت لن يقوم بتنصيب الـ Metasploit , (وفي حال قام بذلك فلن تكون بآخر إصدار) , لذا هذا سكربت آخر لتنصيب Metasploit :


كود:
#!/bin/sh
#
#    Copyright 2011 B4r4k47 [Barakat] <b4r4k47[at]hotmail[dot]com>
#
#    This tool is available for free under the GNU General Public License V3 (GPL).
#    To read the full license, please visit: http://www.gnu.org/licenses/lgpl.html
#    I hope you find it useful :)
#
#    Download & install Metasploit form the
#     official site.
#
#

echo -ne "\n ============= Metasploit Installer "
echo -ne " ===================================\n"

sleep 1

echo -n "Checking if you're root ..."
if [ $(id -u) != 0 ];
then
    echo "ERROR"
    echo -e "\n[!] You're not root!\a\n"
    exit 1
    
fi
echo "OK"

echo -n "Getting Metasploit download URL ..."

rm /tmp/metaurl.tmp 2>/dev/null

meta='http://www.metasploit.com/download/'

curl -silent --url $meta |\
awk '/linux/&&/run/&&/Download/&&/full/ {print $2}' |\
sed -e s/'href='// -e s/'"'//g > /tmp/metaurl.tmp

if [ $(wc -l /tmp/metaurl.tmp | awk '{print $1}') != 2 ]
then
    echo "ERROR"
    echo -e "\n[!] Sorry, this script looks old!\a\n"
    exit 2
fi
echo "OK"

echo -n "Checking processor architecture ..."
arch=$(arch)
echo "OK"

echo "Downloading Metasploit ..."

case "$arch" in

    "X86_64")
    url=$( grep -ie "x64" /tmp/metaurl.tmp )
    wget -c $url
    ;;


    *)
    url=$( grep -iv "x64" /tmp/metaurl.tmp )
    wget -c $url
    ;;
esac

echo -e "\n\nDone"

echo -n "Checking SHA1SUM ..."

sha=$(curl -silent --url $meta | grep -e "$url" | grep -ie 'sha' | awk '{print $2}' \
| sed -e s/'href="verify-sha-1.jsp?hashcode='//g | cut -d'&' -f1)
fsha=$(sha1sum framework*.run | cut -d' ' -f1)

if [ "$fsha" != "$sha" ]
then
    echo "ERROR"
    echo -e "\n[!] SHA1 have not matched!\a\n"
    exit 3
fi
echo "OK"

echo -n "Starting Metasploit Installation Process ..."

chmod +x framework*.run
./framework*.run

echo "OK"

echo -n "Cleaning up ..."
rm /tmp/metaurl.tmp
echo "OK"

echo -e "\n[*] Finished :) \a\n"
[ السكربت مرفق ] طريّقة تشغيله , إحفظه بأيّ إسم تريد , ولتشغيله لمن يستخدم sudo

كود:
sudo sh tool2.sh
أو من يستخدم su

كود:
su
sh tool2.sh
تأكّد بأنك متصل بالشبكه !

أعتقد أن الأمور سهله ... بس شباب االله يرضى عليكم .. ﻻ أحد ينصب Backtrack ثمّ تقعون بمشاكلها ( وتوقعونا أيضاً )