Script netscan versi bash

28Apr08

Aplikasi sederhana ini dibuat untuk melakukan scanning file data yang di sharing dalam sebuah jaringan lokal. Untuk membuatnya ikuti langkah2 berikut ini :

1. Jalankan console, kemudian buat file dengan nama netscan dengan editor nano
#nano netscan

2. Isi file tersebut dengan script dibawah ini :

!/bin/sh
binmount=”$(which mount)”
binsmbclient=”$(which smbclient)”
binumount=”$(which umount)”
username=isi_username_elo_lah
password=isi_pass_elo_lah
port=139

while :
do
clear
echo “———————————————-“
echo “Dunno what is it! by Mongkeh, updated by nazor”
echo “———————————————-“
echo “[1] Intip Share”
echo “[2] Mount Share”
echo “[3] Liat Isi Share”
echo “[4] List Mount”
echo “[5] Unmount”
echo “[6] Keluar”
echo “============================”
echo -n “Masukkan pilihan Anda [1-6]: “
read pilihan
case $pilihan in
1) echo “Masukkan IP Target (Intip) : “; read target;
$binsmbclient -L $target -U$username%$password; echo “Tekan tombol return..”; read ;;
2) echo “Masukkan IP Target (Mount) : “; read target;
echo “Masukkan share point:”; read share;
echo “Masukkan mount point:”; read mntpoint;
$binmount -t smbfs -o username=$username,password=$password,port=$port “//$target/$share” “$mntpoint”;
echo “Tekan tombol return…”; read ;;
3) echo “Masukkan mount point:”; read mntpoint;
cd $mntpoint ; ls ; exit 0 ;;
4) df ; echo “Tekan tombol return..”; read ;;
5) echo “Masukkan mount point yg mau diunmount:”; read mntpoint;
$binumount -r -v -f $mntpoint; echo “Tekan tombol return..”; read ;;
6) exit 0 ;;
*) echo “Maaf, masukkan pilihan antara 1 s/d 6”;
echo “Tekan tombol return…”; read ;;
esac
done

3. Tekan Ctrl+x untuk save dan keluar editor nano

4. Copy file tersebut ke /usr/local/bin
#cp ./netscan /usr/local/bin

5. Jalankan aplikasi tersebut dengan mengetik netscan pada console

selamat mencoba ^_^



One Response to “Script netscan versi bash”

  1. 1 hansledjap

    ku coba punyaku error
    ./netscan: 25: Syntax error: “(” unexpected (expecting “;;”)


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: