Top Banner
Python For Hackers and Penetration Testing
24

Python For Hackers and Penetration Testing · PDF filePython For Hackers and Penetration Testing. A bit about myself ... SET,PDFID,scapy) Or Download Backtrack,Kali Linux and boom.

Mar 21, 2018

Download

Documents

dangdieu
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Python For Hackers and Penetration Testing · PDF filePython For Hackers and Penetration Testing. A bit about myself ... SET,PDFID,scapy) Or Download Backtrack,Kali Linux and boom.

Python For Hackers and PenetrationTesting

Page 2: Python For Hackers and Penetration Testing · PDF filePython For Hackers and Penetration Testing. A bit about myself ... SET,PDFID,scapy) Or Download Backtrack,Kali Linux and boom.

A bit about myself

● Oltjano Terpollari● Email:[email protected]

Page 3: Python For Hackers and Penetration Testing · PDF filePython For Hackers and Penetration Testing. A bit about myself ... SET,PDFID,scapy) Or Download Backtrack,Kali Linux and boom.

Why Python?

● Quick scripts● Multiplatform● Rich in modules● Easy to read code● Interactive shell, a big +

Page 4: Python For Hackers and Penetration Testing · PDF filePython For Hackers and Penetration Testing. A bit about myself ... SET,PDFID,scapy) Or Download Backtrack,Kali Linux and boom.

Set up your development environment

● Download and install Python● Installing Third Party Libraries● Download driven python tools (sqlmap,

SET,PDFID,scapy)● Or Download Backtrack,Kali Linux and boom

Page 5: Python For Hackers and Penetration Testing · PDF filePython For Hackers and Penetration Testing. A bit about myself ... SET,PDFID,scapy) Or Download Backtrack,Kali Linux and boom.

Networking

● Sockets, sockets , sockets …

Page 6: Python For Hackers and Penetration Testing · PDF filePython For Hackers and Penetration Testing. A bit about myself ... SET,PDFID,scapy) Or Download Backtrack,Kali Linux and boom.

Sockets

● What is a socket?● Server● Client

Page 7: Python For Hackers and Penetration Testing · PDF filePython For Hackers and Penetration Testing. A bit about myself ... SET,PDFID,scapy) Or Download Backtrack,Kali Linux and boom.

Sockets

● What is a socket?● Server● Client

Page 8: Python For Hackers and Penetration Testing · PDF filePython For Hackers and Penetration Testing. A bit about myself ... SET,PDFID,scapy) Or Download Backtrack,Kali Linux and boom.

Server

● Bind to interface, s.bind()● Listen for connections, s.listen(13)● Accept connection/connections, s.accept()● Receive data, s.recv()● Send data, s.send()

Page 9: Python For Hackers and Penetration Testing · PDF filePython For Hackers and Penetration Testing. A bit about myself ... SET,PDFID,scapy) Or Download Backtrack,Kali Linux and boom.

Client

● Connect to the server, s.connect((Host,Port))● Receive data● Send data

Page 10: Python For Hackers and Penetration Testing · PDF filePython For Hackers and Penetration Testing. A bit about myself ... SET,PDFID,scapy) Or Download Backtrack,Kali Linux and boom.

Cook Backdoors

● Backdoor in 13 lines● Compile the backdoor ● Upload on virustotal.com and test it

Page 11: Python For Hackers and Penetration Testing · PDF filePython For Hackers and Penetration Testing. A bit about myself ... SET,PDFID,scapy) Or Download Backtrack,Kali Linux and boom.

Next?

Page 12: Python For Hackers and Penetration Testing · PDF filePython For Hackers and Penetration Testing. A bit about myself ... SET,PDFID,scapy) Or Download Backtrack,Kali Linux and boom.

Phishing

Page 13: Python For Hackers and Penetration Testing · PDF filePython For Hackers and Penetration Testing. A bit about myself ... SET,PDFID,scapy) Or Download Backtrack,Kali Linux and boom.

Social Engineering

Page 14: Python For Hackers and Penetration Testing · PDF filePython For Hackers and Penetration Testing. A bit about myself ... SET,PDFID,scapy) Or Download Backtrack,Kali Linux and boom.

SET

● What is SET?● Cool features ● Nice to spread backdoors

Page 15: Python For Hackers and Penetration Testing · PDF filePython For Hackers and Penetration Testing. A bit about myself ... SET,PDFID,scapy) Or Download Backtrack,Kali Linux and boom.

Dictionary Attacks

● What is a Dictionary Attack?● Wordlists● Python makes easy● Open('filename.txt','r')● Unix Password Cracker (demo)● ZipFile password Cracker

Page 16: Python For Hackers and Penetration Testing · PDF filePython For Hackers and Penetration Testing. A bit about myself ... SET,PDFID,scapy) Or Download Backtrack,Kali Linux and boom.

Cracking Hashed Passwords

● Import crypt● Crypt.crypt() function● Password and salt● define crack() function● Main() function

Page 17: Python For Hackers and Penetration Testing · PDF filePython For Hackers and Penetration Testing. A bit about myself ... SET,PDFID,scapy) Or Download Backtrack,Kali Linux and boom.

Crack Zip files

● The concept is the same● The zipfile module● ZipFile class● Extractall() method

Page 18: Python For Hackers and Penetration Testing · PDF filePython For Hackers and Penetration Testing. A bit about myself ... SET,PDFID,scapy) Or Download Backtrack,Kali Linux and boom.

Time is money

Page 19: Python For Hackers and Penetration Testing · PDF filePython For Hackers and Penetration Testing. A bit about myself ... SET,PDFID,scapy) Or Download Backtrack,Kali Linux and boom.

Nmap and Python

● Why using Python with Nmap?● Nmap module● Download and Install nmap module● How to use it?● A simple script (demo)

Page 20: Python For Hackers and Penetration Testing · PDF filePython For Hackers and Penetration Testing. A bit about myself ... SET,PDFID,scapy) Or Download Backtrack,Kali Linux and boom.

python-nmap

● python-nmap-0.2.7.tar.gz – 2013-02-24, python 3.x

● python-nmap-0.1.4.tar.gz, python 2.x● http://xael.org/norman/python/python-nmap/

Page 21: Python For Hackers and Penetration Testing · PDF filePython For Hackers and Penetration Testing. A bit about myself ... SET,PDFID,scapy) Or Download Backtrack,Kali Linux and boom.

Installation

● Uncompress● Run , python setup.py install

Page 22: Python For Hackers and Penetration Testing · PDF filePython For Hackers and Penetration Testing. A bit about myself ... SET,PDFID,scapy) Or Download Backtrack,Kali Linux and boom.

Nmap module

● PortScanner() class● The scan() function

Page 23: Python For Hackers and Penetration Testing · PDF filePython For Hackers and Penetration Testing. A bit about myself ... SET,PDFID,scapy) Or Download Backtrack,Kali Linux and boom.

Sqlmap

● What is Sqlmap?● Download, unpack , run● Basic commands● Waf

Page 24: Python For Hackers and Penetration Testing · PDF filePython For Hackers and Penetration Testing. A bit about myself ... SET,PDFID,scapy) Or Download Backtrack,Kali Linux and boom.

Questions?