Skip to content

Instantly share code, notes, and snippets.

@turekt
turekt / ansible_crypto.py
Created March 6, 2023 17:40
Minimal Python3 script for ansible vault encryption and decryption
from argparse import ArgumentParser
from binascii import hexlify, unhexlify
from code import InteractiveConsole
from cryptography.hazmat.primitives import hashes, hmac, padding
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
from cryptography.hazmat.primitives.kdf.pbkdf2 import PBKDF2HMAC
from enum import Enum
from os import urandom
from sys import exit, stdin
from textwrap import wrap
@turekt
turekt / java-aes-with-openssl.md
Last active March 24, 2020 19:51
Guide on how to utilize AES encryption with openssl to communicate with java web service

Communicating with service that processes encrypted requests

Intro

Let's assume that there is a hypothetical java service you need to communicate with:

@RestController
@RequestMapping("/serve")
public class ServiceController implements ApplicationContextAware {
@turekt
turekt / pwntools-gdb-docker.md
Last active January 16, 2024 06:43
Running pwntools gdb debug feature inside Docker containers

Running pwnlib gdb (pwntools) feature inside Docker

Intro

When conducting exploit development with pwntools you will often want to utilize the pwnlib gdb feature which will ease the usage of gdb and gdb scripts. Let's look into a simple example.

Assume that you have the following code you are analyzing:

// Compile: gcc -o /tmp/example -no-pie -fno-stack-protector example.c && chmod +x /tmp/example