aboutsummaryrefslogtreecommitdiff
path: root/invoke_session_debian
diff options
context:
space:
mode:
Diffstat (limited to 'invoke_session_debian')
-rwxr-xr-xinvoke_session_debian15
1 files changed, 4 insertions, 11 deletions
diff --git a/invoke_session_debian b/invoke_session_debian
index d095dfc..963adf6 100755
--- a/invoke_session_debian
+++ b/invoke_session_debian
@@ -16,7 +16,7 @@ then
fi
# Obtain target IP and Hostname
-ip_addr=$(ifconfig `ip route get $gateway | cut -d ' ' -f3` | grep 'inet addr' |awk -F: '{split($2,a," "); print a[1] }')
+ip_addr=$(ip route get $gateway | awk '/src/{print $NF}')
hostname=$(cat /etc/hostname)
# Set the PATH to use the LAVA api
@@ -45,16 +45,9 @@ EOF
IRC_AVAILABLE=false
if [ ! -z "${IRC_USER}" ]; then
- if apt-get install -qq python-irc; then
- IRC_AVAILABLE=true
- TMP_IRC_USER=hs-${RANDOM}
- # make a unique user
- cat <<EOF | python /usr/share/doc/python-irc/examples/irccat2.py ${IRC_SERVER} ${TMP_IRC_USER} ${IRC_USER}
-Your hacking session is now ready
-Please connect to:
-${SSH_COMMAND}
-EOF
- fi
+ IRC_AVAILABLE=true
+ TMP_IRC_USER=hs-${RANDOM}
+ echo -e "\n\nNICK ${TMP_IRC_USER}\nUSER ${TMP_IRC_USER} 8 * :LAVA Hacking\nPRIVMSG ${IRC_USER} : ${SSH_COMMAND}\nQUIT \n" | nc -i 1 i${IRC_SERVER} 6667
fi
if [ ! -z "${NOTIFY_URL}" ]; then
if apt-get install -qq wget; then