From 6d1ca9cf1ea83784a0d70160847b6b0f8da834b9 Mon Sep 17 00:00:00 2001 From: sandb Date: Mon, 28 Dec 2009 20:16:04 +0100 Subject: [PATCH] added bash arp scanner for pamela --- pamela-scanner.sh | 59 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100755 pamela-scanner.sh diff --git a/pamela-scanner.sh b/pamela-scanner.sh new file mode 100755 index 0000000..d419bf8 --- /dev/null +++ b/pamela-scanner.sh @@ -0,0 +1,59 @@ +#!/bin/bash + +<. + +LICENSE + +IF='eth0' +OUT='js/input.php' +SLEEP='60' + +TEMP=$(getopt -o i:o:s:-n "pamela arp scanner" -- "$@") +if [ $? != 0 ] ; then echo "Could not parse parameters..." >&2 ; exit 1 ; fi +eval set "$TEMP" -- +while true +do + case "$1" in + -i) IF="$2"; shift;; + -o) OUT="$2"; shift;; + -s) SLEEP="$2"; shift;; + --) break;; + esac + shift +done + +while true +do + echo $(date)" scanning..." + O=""; + O="$O"' ' + O="$O"' [ ' + O="$O"$(arp-scan -R -i 10 --interface "$IF" --localnet | awk '{ print "\""$2"\", " }' | grep :.*: | sort | uniq) + O="$O"' ] ' + echo "$O" + echo "$O" > "$OUT" + echo $(date)" sleeping..." + sleep "$SLEEP" +done