Академический Документы
Профессиональный Документы
Культура Документы
Intrusion Detection
Ali Al-Shemery
(aka: B!n@ry)
arabnix
arabnix at
at gmail
gmail dot
dot com
com
All materials is licensed under a Creative
Commons Share Alike license.
http://creativecommons.org/licenses/by-sa/3.0/
2
Writing Basic Security
Tools using Python
Special lecture
>>> import
antigravity
Cited [1]
Cited
[2]
Outline
About Python
Python Basics
Types
Controls
Python Functions and Modules
Python Tips and Tricks
Coding for Penetration Testers
6
binary-zone.com 6
About Python
Python is an open source programming language.
Development started by Guido van Rossum in
December 1989.
Conceived
Conceived in
in the
the late
late 1980s
1980s
Python
Python 2.0
2.0 was
was release
release on
on October
October 16th,
16th, 2000
2000
Python
Python 3.0
3.0 was
was released
released on
on December
December 2008
binary-zone.com 7
About Python Cont.
Python is cross platform
Linux
Linux (shipped out of the box)
Windows
Windows (easy
(easy to
to install)
install)
Mac
Mac
Even
Even work on your Droid!
etc
etc
binary-zone.com 8
Why Learn Python?
Lot of people always ask me Why learn Python?
The answer is simple:
Simple
Simple and
and easy
easy to
to learn
learn
Free
Free and
and Open
Open Source
Source
Powerful
Powerful high-level
high-level programming
programming language
language
Widely
Widely used (Google,
(Google, NASA,
NASA, Yahoo,
Yahoo, etc)
etc)
Portable
Portable
HUGE
HUGE number
number of Extensive Libraries!
Libraries!
binary-zone.com 9
What is Python Good for?
Ideal language for scripting and rapid application
development in many areas on most platforms.
All computer related subjects (IMO except system
programming)
Performing System Administration Tasks
Encouraging and Helping Children start
programming
binary-zone.com 10
What About Security?
Extensive use in theinformation securityindustry
Exploit
Exploit Development
Networking
Networking
Debugging
Debugging
Encryption/Decription
Encryption/Decription
Reverse
Reverse Engineering
Engineering
Fuzzing
Fuzzing
Web
Web
Forensics
Forensics
Malware
Malware analysis
analysis
Text Editors
Vim,
Vim, Nano,
Nano,
Geany
Geany (was
(was my
my favorite),
favorite),
PyCharm
PyCharm (favorite),
Gedit,
Gedit, Kate,
Kate,
Notepad++,
Notepad++, etc
binary-zone.com 12
Python Basics
Integers (int)
>>>
>>> httpPort=80
httpPort=80
>>>
>>> Subnet=24
Subnet=24
Strings (str)
>>>
>>> url=http://www.linuxac.org/
url=http://www.linuxac.org/
binary-zone.com 13
Playing with Strings
One of the most powerful capabilities of Python
String Slicing
>>> logFile=/var/log/messages
>>> logFile[0]
/
/
>>> logFile[1:4]
var
var
>>> logFile[-8:]
'messages'
>>> logFile.split("/")
['',
['', 'var',
'var', 'log',
'log', 'messages']
'messages']
binary-zone.com 14
Playing with Strings Cont.
String Concatenation
>>>
>>> userName
userName = ali
>>>
>>> domainName
domainName = ashemery.com
>>>
>>> userEmail
userEmail = userName
userName + @
@ +
+ domainName
>>>
>>> userEmail
userEmail
'ali@ashemery.com
'ali@ashemery.com
>>>
>>> website="http://www.ashemery.com/"
website="http://www.ashemery.com/"
>>>
>>> param="?p=123"
param="?p=123"
>>>
>>> urlurl = "".join([website,param])
>>>
>>> urlurl
'http://www.ashemery.com/?p=123'
'http://www.ashemery.com/?p=123'
binary-zone.com 15
Python Lists
Python lists are very useful when you have a
collection of elements
>>>
>>> portList
portList = [21,22,25,80]
>>>
>>>
>>> portList[0]
portList[0]
portList.insert(1,22)
21
21
>>> portList
>>>
[21, 22, 25, 80, 443]
>>> portList.append(443)
portList.append(443)
>>>
>>> portList
portList
[21,
>>> portList = []
[21, 22,
22, 25,
25, 80,
80, 443]
443]
>>> portList
>>>
>>> portList.remove(22)
portList.remove(22)
[]
Lists in Python can be of
>>>
>>> portList
portList any mixed type, even list of
[21,
[21, 25,
25, 80,
80, 443]
443] variables!!!
binary-zone.com 16
Python Controls - Decisions
binary-zone.com 18
Python Tips and Tricks
Changing and checking data types
>>>
>>> httpPort=80
httpPort=80
>>>
>>> httpPort
httpPort
80
80
>>>
>>> type(httpPort)
type(httpPort)
<type
<type 'int'>
'int'>
>>>
>>> httpPort
httpPort = str(httpPort)
str(httpPort)
>>>
>>> type(httpPort)
type(httpPort)
<type
<type 'str'>
'str'>
>>>
>>> httpPort
httpPort
'80
'80
binary-zone.com 19
Python Tips and Tricks Cont.
String formatting
>>>
>>> pList
pList = [21,22,25,80]
>>>
>>> forfor member in pList:
pList:
...
... print
print "This
"This is
is port
port number
number %d"
%d" %
% member
member
...
...
This
This is port number 21
This
This is port number 22
This
This is port number 25
This
This is port number 80
binary-zone.com 20
Python Tips and Tricks Cont.
The
The gateway
gateway has the
the following
following IP: 192.168.1.1 and MAC:
MAC:
AA:BB:CC:DD:EE:FF
AA:BB:CC:DD:EE:FF addresses
addresses
binary-zone.com 21
Python Tips and Tricks Cont.
binary-zone.com 23
Python User Input Cont.
Directly from the user using raw_input
>>>
>>> userEmail
userEmail = raw_input("Please enter
enter your
your email
email
address:
address: ")
")
Please
Please enter
enter your email address: ali@ashemery.com
>>>
>>> userEmail
userEmail
'ali@ashemery.com'
'ali@ashemery.com'
>>>
>>> type(userEmail)
type(userEmail)
<type
<type 'str'>
'str'>
binary-zone.com 24
Python User Input Cont.
From Text Files
>>>
>>> ff == open("./services.txt",
open("./services.txt", "r")
"r")
>>>
>>> for
for line in f:
...
... print
print line
line
...
...
HTTP
HTTP 80
80
SSH
SSH 22
22
FTP
FTP 21
21 Other common file
HTTPS
HTTPS 443
443 functions:
SMTP
SMTP 2525 write
POP
POP 110 read
readline
>>>
>>> f.close()
f.close()
binary-zone.com 25
Creating Functions
Whenever you need to repeat a block of code,
functions comes helpful
Creating a Python Function (syntax)
binary-zone.com 26
Creating Functions Cont.
Basic function to check for valid port numbers
def
def checkPortNumber(port):
checkPortNumber(port):
if
if port
port > 65535 or port < 0:
return
return False
False
else:
else:
return
return True
True
binary-zone.com 28
Common Used Modules
The most commonly used modules with security
coding are:
string,
string, re
os,
os, sys,
sys, socket
socket
hashlib
hashlib
httplib,
httplib, urllib2
urllib2
Others?
Others? Please
Please add
binary-zone.com 29
Modules and Examples
Module sys
Check Python path, and count them
import
import sys
sys
print
print "path
"path has", len(sys.path), "members
print
print "The
"The members
members are:
are:
for
for member
member inin sys.path:
sys.path:
print
print member
member
binary-zone.com 31
Module sys Cont.
Check application name, and list number of
passed arguments
import
import sys
sys
print
print The
The application
application name
name is:",
is:", sys.argv[0]
sys.argv[0]
if
if len(sys.argv)
len(sys.argv) > 1:
print
print You
You passed",
passed", len(sys.argv)-1,
len(sys.argv)-1, "arguments.
"arguments. They
They are:"
for
for arg
arg in
in sys.argv[1:]:
sys.argv[1:]:
print arg
else:
else:
print
print No
No arguments
arguments passed!
passed!
binary-zone.com 32
Module sys Cont.
Check the Python working version
>>>
>>> sys.version
sys.version
binary-zone.com 33
Module os
import os
binary-zone.com 36
Module os Cont.
os.system()
os.system() #
# Executing
Executing a a shell
shell command
command
os.stat()
os.stat() #
# Get
Get thethe status of a file
os.environ()
os.environ() #
# Get
Get thethe users environment
os.chdir()
os.chdir() #
# Move
Move focus
focus to to a
a different
different directory
directory
os.getcwd()
os.getcwd() #
# Returns
Returns the the current
current working
working directory
directory
os.getgid()
os.getgid() #
# Return
Return the real real group
group id of
of the
the current
current
process
process
os.getuid()
os.getuid() #
# Return
Return the current
current processs
processs user
user id
id
os.getpid()
os.getpid() #
# Returns
Returns the the real
real process
process ID of the
current
current process
process
os.getlogin()
os.getlogin() #
# Return
Return the name name of of the
the user
user logged
logged
os.access()
os.access() #
# Check
Check read read permissions
permissions
os.chmod()
os.chmod() #
# Change
Change the mode of path to the
numeric
numeric mode
mode
binary-zone.com 37
os.chown() # Change the owner and group id
Module os Cont.
os.path.getmtime()
os.path.getmtime() #
# Last
Last time
time a
a given
given directory was
modified
modified
os.path.getatime()
os.path.getatime() #
# Last
Last time
time a
a given
given directory was
accessed
accessed
os.environ()
os.environ() #
# Get
Get the
the users environment
os.uname()
os.uname() #
# Return
Return information about the current
OS
OS
os.chroot(path)
os.chroot(path) #
# Change
Change the root directory
directory of
of the
the
current
current process
process to
to path
os.listdir(path)
os.listdir(path) #
# List
List of
of the
the entries
entries in
in the
the directory
directory given
given
by
by path
path
os.getloadavg()
os.getloadavg() #
# Show
Show queue
queue averaged
averaged over the last 1,
5,
5, and
and 15
15 minutes
minutes
binary-zone.com 38
Module os Cont.
os.mkdir(path)
os.mkdir(path) #
# Create
Create a
a directory
directory named
named path
path with
numeric
numeric mode
mode mode
os.makedirs(path)
os.makedirs(path) #
# Recursive
Recursive directory
directory creation
creation
function
function
os.remove(path)
os.remove(path) #
# Remove
Remove (delete)
(delete) the
the file
file path
path
os.removedirs(path)
os.removedirs(path) #
# Remove
Remove directories
directories recursively
recursively
os.rename(src,
os.rename(src, dst)
dst) #
# Rename
Rename the
the file
file or directory src to
dst
dst
os.rmdir(path)
os.rmdir(path) #
# Remove
Remove (delete)
(delete) the
the directory
directory path
path
binary-zone.com 39
Execute External Programs
http://helloacm.com/execute-external-programs-the-python-ways/
binary-zone.com 40
Execute External Programs
Cont.
The easy was is to import the os module
Provides:
Provides: popen(),
popen(), system(),
system(), startfile()
startfile()
>>> import os
>>> print os.popen("echo Hello, World!").read()
binary-zone.com 41
Execute External Programs
Cont.
The os.system() is also synchronous, and could
returns the exit-status
>>> import os
>>> print os.system('notepad.exe')
binary-zone.com 42
Execute External Programs
Cont.
By acting like double-click in the file explorer, you
can use os.startfile() to launch external program
that is associated with this file
This
This is an asynchronous
asynchronous method
method
>>> import os
>>> os.startfile('test.txt')
binary-zone.com 43
Execute External Programs
Cont.
If you install the win32api package (not shipped
by default), you can use the following
asynchronous method:
import win32api
try:
win32api.WinExec('notepad.exe')
except:
pass
binary-zone.com 44
Execute External Programs
Cont.
The subprocess package provides a syncrhonous
and an asynchronous methods namely call and
Popen
Both methods take the first parameter as a list
import
import subprocess
subprocess
subprocess.call(['notepad.exe',
subprocess.call(['notepad.exe', 'abc.txt'])
subprocess.Popen(['notepad.exe'])
subprocess.Popen(['notepad.exe'])
#
# thread
thread continues
continues ...
...
p.terminate()
p.terminate()
binary-zone.com 45
Execute External Programs
Cont.
You can use wait() to synchronous the processes
import
import subprocess
subprocess
p
p== subprocess.Popen('ls',
subprocess.Popen('ls', shell=True,
shell=True,
stdout=subprocess.PIPE,
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
for
for line
line in
in p.stdout.readlines():
p.stdout.readlines():
print
print line
line
retval
retval = = p.wait()
p.wait()
print
print retval
retval
binary-zone.com 46
Module socket
import socket
binary-zone.com 47
Module socket Cont.
Create TCP Socket, then send and receive data
from website using the socket
import
import socket
ss =
= socket.socket(socket.AF_INET,
socket.socket(socket.AF_INET, socket.SOCK_STREAM)
socket.SOCK_STREAM)
s.connect(("www.ashemery.com",
s.connect(("www.ashemery.com", 80))
80))
s.send('GET
s.send('GET // HTTP/1.1\r\nHost:
HTTP/1.1\r\nHost: www.ashemery.com\r\n\r\n')
data
data == s.recv(2048)
s.recv(2048)
s.close()
s.close()
print
print data
data
binary-zone.com 50
urllib vs urllib2
Both modules do URL request related stuff, but
they have different functionality.
urllib2 can accept a Request object to set the
headers for a URL request, urllib accepts only a
URL.
urllib provides the urlencode method which is
used for the generation of GET query strings,
urllib2 doesn't have such a function.
Because of that urllib and urllib2 are often used
together.
binary-zone.com Cited 53
[3]
Base64 & ROT13 Encoders
Base64
#!/usr/bin/python
#!/usr/bin/python
code
code == raw_input("Enter
raw_input("Enter the data you wish to be encoded to
Base64")
Base64")
answer=code.encode('base64','strict')
answer=code.encode('base64','strict')
print
print answer
answer
ROT13
#!/usr/bin/python
#!/usr/bin/python
code = raw_input("Enter the data you wish to apply ROT13
on")
on")
answer=code.encode(rot13','strict')
print
print answer
binary-zone.com Cited [2]
54
Packet Crafting with
Scapy
Scapy Overview
Scapy is a Python program that enables the user
to send, sniff and dissect and forge network
packets
This capability allows construction of tools that
can probe, scan or attack networks
It can replace hping, arpspoof, arp-sk, arping, p0f
and even some parts of Nmap, tcpdump, and
tshark
binary-zone.com 56
Scapy Overview Cont.
Scapy was created by Philippe Biondi and runs in
Python:
Can
Can be
be used
used interactively
interactively at
at a
a Python
Python prompt
prompt
Included
Included within
within Python
Python scripts
scripts for more complex
interactions
interactions
binary-zone.com 57
Scapy Basics - 1
Supported protocols:
>>>
>>> ls()
ls()
Available commands/functions:
>>>
>>> lsc()
lsc()
binary-zone.com 58
Scapy Basics - 2
Crafting a SYN/ACK Packet
>>>
>>> pkt
pkt =
= IP(dst="192.168.122.101")
>>>
>>> pkt
pkt /=
/= TCP(dport=80,
TCP(dport=80, flags="SA")
flags="SA")
binary-zone.com 59
Scapy Basics - 3
Single Line:
ICMP echo request Packet
>>>
>>> mypkt
mypkt =
= IP(dst="192.168.122.101")
IP(dst="192.168.122.101")
/ICMP(code=0,type=8)
/ICMP(code=0,type=8)
binary-zone.com 60
Sending and Receiving
Packets @L3
Send packet at layer 3
>>>
>>> send(packet)
send(packet)
binary-zone.com 61
Sending and Receiving
Packets @L2
Send packet at layer 2
>>>
>>> sendp(Ether()/packet)
sendp(Ether()/packet)
binary-zone.com 62
Displaying Packets
Get a summary of each packet:
>>>
>>> pkts.summary()
pkts.summary()
binary-zone.com 63
Scapy Host Discovery
>>> ans,unans =
srp(Ether(dst="ff:ff:ff:ff:ff:ff")/ARP(pdst="192.168
.122.0/24"),timeout=2)
binary-zone.com 64
Scapy Port Scanning
TCP SYN Scanner
>>>
>>> sr1(IP(dst="192.168.122.101")
sr1(IP(dst="192.168.122.101")
/TCP(dport=90,flags="S"))
/TCP(dport=90,flags="S"))
>>>
>>> a,u
a,u =
= sr(IP(dst="192.168.122.101")
sr(IP(dst="192.168.122.101")
/TCP(dport=(80,100),flags="S"))
/TCP(dport=(80,100),flags="S"))
>>>
>>> a.summary(lambda(s,r):
a.summary(lambda(s,r): r.sprintf("Port: %TCP.sport% \t\t
Flags:
Flags: %TCP.flags%"))
binary-zone.com 65
Scapy Sniffing - 1
Scapy has powerful capabilities to capture and
analyze packets.
Configure the network interface to sniff packets
from:
>>>
>>> conf.iface="eth0
conf.iface="eth0
Configure
Configure the scapy sniffer to sniff only 20 packets
>>>
>>> pkts=sniff(count=20)
pkts=sniff(count=20)
binary-zone.com 66
Scapy Sniffing - 2
Sniff packets and stop after a defined time:
>>>
>>> pkts=sniff(count=100,timeout=60)
pkts=sniff(count=100,timeout=60)
binary-zone.com 67
Scapy Sniffing - 3
>>> pkts = sniff(count=10,prn=lambda
x:x.sprintf("SrcIP={IP:%IP.src% -> DestIP=%IP.dst
%} | Payload={Raw:%Raw.load%\n}"))
binary-zone.com 68
Exporting Packets
Sometimes it is very useful to save the captured
packets in a PCAP file for future work:
>>>
>>> wrpcap(file1.cap",
wrpcap(file1.cap", pkts)
binary-zone.com 69
Importing Packets
To import from a PCAP file:
>>>
>>> pkts
pkts =
= rdpcap(file1.cap")
rdpcap(file1.cap")
binary-zone.com 70
Create your own tools
>>> def handler(packet):
hexdump(packet.payload)
binary-zone.com 71
Yesman
#!/usr/bin/env
#!/usr/bin/env python python
import
import sys sys
from
from scapy.all
scapy.all import
import **
def
def findSYN(p):
findSYN(p): sniff(prn=find
flags
flags = = p.sprintf("%TCP.flags%")
p.sprintf("%TCP.flags%") SYN)
ifif flags
flags ==== "S":
"S": #
# Only
Only respond
respond to to SYN
SYN Packets
Packets
ip
ip == p[IP]
p[IP] #
# Received
Received IPIP Packet
Packet
tcp
tcp == p[TCP]
p[TCP] # # Received
Received TCP
TCP Segment
Segment
ii =
= IP()
IP() #
# Outgoing
Outgoing IPIP Packet
Packet
i.dst
i.dst == ip.src
ip.src
i.src
i.src == ip.dst
ip.dst
tt =
= TCP()
TCP() #
# Outgoing
Outgoing TCP
TCP Segment
Segment
t.flags
t.flags == "SA"
"SA"
t.dport
t.dport = = tcp.sport
tcp.sport
t.sport
t.sport = = tcp.dport
tcp.dport
t.seq
t.seq = = tcp.ack
tcp.ack
new_ack
new_ack = = tcp.seq
tcp.seq +
+ 11
print
print ("SYN/ACK
("SYN/ACK sent
sent to
to ",i.dst,":",t.dport)
",i.dst,":",t.dport)
send(i/t)
send(i/t)
binary-zone.com 72
Others (not categorized
yet!)
Adding Time Delay
Delay for 5 seconds
>>>
>>> import
import time
time
>>>
>>> time.sleep(5)
time.sleep(5)
http://stackoverflow.com/questions/510348/how-can-i-make-a-time-delay-in-python
binary-zone.com 74
Exploit Development
#!/usr/bin/python
#!/usr/bin/python
import
import socket
socket
host
host == target
target
port
port == <port#>
<port#>
cmd
cmd = = initial
initial command
command
ss =
= socket.socket(socket.AF_INET,
socket.socket(socket.AF_INET, socket.SOCK_STREAM)
socket.SOCK_STREAM)
buffer
buffer == buffer
buffer to
to send
send
shellcode
shellcode = = shellcode
shellcode
Payload
Payload = = cmd
cmd ++ buffer
buffer +
+ shellcode
shellcode
print
print "\n
"\n Any
Any status
status message
message \n
\n
s.connect((host,port))
s.connect((host,port))
data
data == s.recv(1024)
s.recv(1024)
s.send(payload
s.send(payload +\n)
+\n)
s.close
s.close
binary-zone.com 75
Python Tools for
Penetration Testers
Network Tools
Scapy:
Scapy: send,
send, sniff
sniff and
and dissect
dissect and
and forge
forge network
network packets.
packets. Usable
Usable
interactively
interactively or or as
as aa library
library
pypcap,
pypcap, Pcapy
Pcapy and
and pylibpcap:
pylibpcap: several
several different
different Python
Python bindings
bindings for
for libpcap
libpcap
libdnet:
libdnet: low-level
low-level networking
networking routines,
routines, including
including interface
interface lookup
lookup and
and
Ethernet
Ethernet frame
frame transmission
transmission
dpkt:
dpkt: fast,
fast, simple
simple packet
packet creation/parsing,
creation/parsing, with with definitions
definitions for
for the
the basic
basic
TCP/IP
TCP/IP protocols
protocols
Impacket:
Impacket: craftcraft and
and decode
decode network
network packets.
packets. Includes
Includes support
support for
for higher-
higher-
level
level protocols
protocols suchsuch asas NMB
NMB andand SMB
SMB
pynids:
pynids: libnids
libnids wrapper
wrapper offering
offering sniffing,
sniffing, IP
IP defragmentation,
defragmentation, TCP TCP stream
stream
reassembly
reassembly and and port
port scan
scan detection
detection
Dirtbags
Dirtbags py-pcap:
py-pcap: read
read pcap
pcap files
files without
without libpcap
libpcap
flowgrep:
flowgrep: grepgrep through
through packet
packet payloads
payloads using
using regular
regular expressions
expressions
Knock
Knock Subdomain
Subdomain Scan, Scan, enumerate
enumerate subdomains
subdomains on on aa target
target domain
domain
through
through aa wordlist
wordlist
Mallory,
Mallory, extensible
extensible TCP/UDP
TCP/UDP man-in-the-middle
man-in-the-middle proxy,proxy, supports
supports modifying
modifying
non-standard
non-standard protocols
protocols onon the
the fly
fly
Pytbull:
Pytbull: flexible
flexible IDS/IPS
IDS/IPS testing
testing framework
framework (shipped
(shipped with
with more
more than
than 300
300
tests)
tests)
binary-zone.com Cited [5] 77
Debugging and Reverse
Engineering Tools
Paimei:
Paimei: reverse engineering framework,
framework, includes
includes PyDBG,
PyDBG,
PIDA,
PIDA, pGRAPH
pGRAPH
Immunity
Immunity Debugger:
Debugger: scriptable
scriptable GUI and
and command
command line
debugger
debugger
mona.py:
mona.py: PyCommand
PyCommand for ImmunityImmunity Debugger
Debugger that
that
replaces
replaces and
and improves
improves on on pvefindaddr
pvefindaddr
IDAPython:
IDAPython: IDAIDA Pro plugin that integrates the Python
programming
programming language,
language, allowing
allowing scripts to run
run in
in IDA
IDA Pro
Pro
PyEMU:
PyEMU: fully
fully scriptable
scriptable IA-32
IA-32 emulator,
emulator, useful
useful for
for malware
malware
analysis
analysis
pefile:
pefile: read and work with Portable Executable (aka PE)
files
files
pydasm:
pydasm: Python
Python interface
interface to
to the
the libdasm
libdasm x86
x86
disassembling
disassembling library
library
binary-zone.com Cited [5] 78
Debugging and Reverse
Engineering Tools Cont.
PyDbgEng:
PyDbgEng: Python
Python wrapper
wrapper for for the
the Microsoft
Microsoft Windows
Windows
Debugging
Debugging Engine
Engine
uhooker:
uhooker: intercept
intercept calls
calls toto API calls inside DLLs, and also
arbitrary
arbitrary addresses within the the executable
executable filefile in
in memory
memory
diStorm:
diStorm: disassembler
disassembler library
library for
for AMD64,
AMD64, licensed
licensed under
under
the
the BSD
BSD license
python-ptrace:
python-ptrace: debugger
debugger usingusing ptrace
ptrace (Linux,
(Linux, BSDBSD and
and
Darwin
Darwin system
system call
call to trace
trace processes)
processes) written in Python
vdb
vdb // vtrace:
vtrace: vtrace
vtrace isis a cross-platform
cross-platform process
process debugging
debugging
API
API implemented
implemented in python, and vdb is a debugger which
uses
uses it
Androguard:
Androguard: reverse
reverse engineering
engineering and and analysis
analysis of of Android
Android
applications
applications
binary-zone.com 89
Citation of Used Work
[1]
[1] Keith Dixon, @Tazdrumm3r,
http://tazdrumm3r.wordpress.com/
http://tazdrumm3r.wordpress.com/
[2]
[2] Python
Python Comic,
Comic, http://xkcd.com/353/,
http://xkcd.com/353/,
[3]
[3] Live Packet
Packet Capture
Capture in Python
Python with
with pcapy,
pcapy,
http://snipplr.com/view/3579/live-packet-capture-in-python-
http://snipplr.com/view/3579/live-packet-capture-in-python-
with-pcapy/
with-pcapy/
[4]
[4] How
How toto use
use urllib2
urllib2 in
in Python,
Python,
http://www.pythonforbeginners.com/python-on-the-
http://www.pythonforbeginners.com/python-on-the-
web/how-to-use-urllib2-in-python/
web/how-to-use-urllib2-in-python/
[5]
[5] Python
Python tools
tools for
for penetration
penetration testers,
testers,
http://www.dirk-loss.de/python-tools.htm
http://www.dirk-loss.de/python-tools.htm
binary-zone.com 90
References
[1]
[1] Coding
Coding for
for Penetration
Penetration Testers
Testers Book,
Book,
[2]
[2] Violent
Violent Python
Python Book,
Book,
[3]
[3] Scapy
Scapy Documentation,
Documentation, http://www.secdev.org/projects/scapy/doc/
http://www.secdev.org/projects/scapy/doc/
[4]
[4] Python,
Python, http://www.python.org/
http://www.python.org/
[5]
[5] Python
Python Infosec
Infosec tools,
tools, http://www.dirk-loss.de/python-tools.htm
http://www.dirk-loss.de/python-tools.htm
[6]
[6] Grow
Grow Your
Your Own
Own Forensic
Forensic Tools:
Tools: A
A Taxonomy
Taxonomy of
of Python
Python Libraries
Libraries
Helpful
Helpful for
for Forensic
Forensic Analysis,
Analysis,
http://www.sans.org/reading_room/whitepapers/incident/grow-foren
http://www.sans.org/reading_room/whitepapers/incident/grow-foren
sic-tools-taxonomy-python-libraries-helpful-forensic-analysis_33
sic-tools-taxonomy-python-libraries-helpful-forensic-analysis_33
453
453
[7]
[7] Python
Python Docs,
Docs, http://docs.python.org/
http://docs.python.org/
[8]
[8] Python
Python Tutorial,
Tutorial, http://www.tutorialspoint.com/python/index.htm
http://www.tutorialspoint.com/python/index.htm
[9]
[9] pcapy,
pcapy,
http://corelabs.coresecurity.com/index.php?module=Wiki&acti
http://corelabs.coresecurity.com/index.php?module=Wiki&acti
on=view&type=tool&name=Pcapy
on=view&type=tool&name=Pcapy
[10]
[10] Basic
Basic Authentication
Authentication Authentication
Authentication with
with Python,
Python,
http://www.voidspace.org.uk/python/articles/authentication.shtml
http://www.voidspace.org.uk/python/articles/authentication.shtml
[11]
[11] Justin
Justin Searle,
Searle, Python
Python Basics
Basics for
for Web
Web App
App Pentesters,
Pentesters,
InGuardians
InGuardians IncInc
binary-zone.com 91