Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- start=$PWD
- fs=${start}/fs
- ARCH="x86_64"
- ARCH2="x86"
- mkdir $fs
- cd $fs
- mkdir -pv bin lib dev etc mnt/root proc root sbin sys usr/bin lib/x86_64-linux-gnu
- mknod -m 666 dev/null c 1 3
- mknod -m 666 dev/tty c 5 0
- mknod -m 666 dev/zero c 1 5
- mknod -m 666 dev/random c 1 8
- echo "nameserver 8.8.8.8" > etc/resolv.conf
- echo "search 8.8.8.8" >> etc/resolv.conf
- cd bin
- wget -c "http://www.busybox.net/downloads/binaries/latest/busybox-$ARCH" -O busybox
- chmod +x busybox
- ./busybox --help | \
- sed -e '1,/^Currently defined functions:/d' \
- -e 's/[ \t]//g' -e 's/,$//' -e 's/,/\n/g' | \
- while read app ; do
- if [ "$app" != "" ]; then
- echo "linking ${app}..."
- ln -sf "./busybox" "$app"
- ls -ld "$app"
- fi
- done
- cd $fs
- progDir="/usr/bin/"
- progs=("nmap" "arp-scan")
- for i in "${progs[@]}"
- do
- ldd ${progDir}$i |cut -d\> -f2|awk '{print $1}'|\
- while read lib
- do
- cp ${progDir}$i usr/bin/
- lib2="$(echo "$lib"|sed s'/\///')"
- lib2="$(dirname "$lib2")"
- mkdir -pv $lib2
- cp -v "$lib" "$lib2"
- done
- done
- #extra files for nmap
- mkdir usr/share/nmap
- cp -v /etc/services etc/
- cp -v /usr/share/nmap/nmap-services usr/share/nmap/
- #extra file for arp-scan
- mkdir -p usr/share/arp-scan/
- cp -v /usr/share/arp-scan/* usr/share/arp-scan/
- clear
- echo "useage:"
- echo "nmap --unprivileged -T4 -v 192.168.1.1-255|grep -v 'host down'"
- echo "arp-scan -l -I eth0"
- echo "===================================="
- echo "WELCOME TO YOUR CHROOT"
- chroot $fs sh
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement