Skip to content

Instantly share code, notes, and snippets.

View jbouwh's full-sized avatar

Jan Bouwhuis jbouwh

View GitHub Profile
@mgeeky
mgeeky / smtpAudit.py
Last active April 2, 2024 09:47
SMTP Black-Box configuration audit / penetration testing tool - able to parse SPF/DKIM/Banner, test for Open-Relaying, test SSL/TLS enforcement and verify other common misconfigurations.
#!/usr/bin/python3
#
# SMTP Server configuration black-box testing/audit tool, capable of auditing
# SPF/Accepted Domains, DKIM, DMARC, SSL/TLS, SMTP services, banner, Authentication (AUTH, X-EXPS)
# user enumerations (VRFY, EXPN, RCPT TO), and others.
#
# Currently supported tests:
# 01) 'spf' - SPF DNS record test
# - 'spf-version' - Checks whether SPF record version is valid
# - 'all-mechanism-usage' - Checks whether 'all' mechanism is used correctly
@void-elf
void-elf / example_verification.py
Created January 27, 2017 23:30
Verifying a certificate's signature matches the CA's public key using python-cryptography.
from cryptography import x509
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.primitives.asymmetric import padding
from cryptography.hazmat.backends import default_backend
cert_file = open('/etc/letsencrypt/live/www.example.com/cert.pem')
cert_data = cert_file.read()
cert = x509.load_pem_x509_certificate(data=cert_data, backend=default_backend())
# chain contains the Let's Encrypt certificate
@DesignA-Electronics
DesignA-Electronics / network-keep-alive.py
Last active December 16, 2018 21:34
Python example of UDP Broadcast packet transmission
#!/usr/bin/env python
import socket
import time
if __name__ == '__main__':
UDP_IP = "10.255.255.255"
UDP_PORT = 12345
MESSAGE = "KEEP ALIVE"
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
@bmaupin
bmaupin / build-openssl.sh
Last active September 17, 2025 17:40
Build openssl (with SSLv2/3 support for security testing)
#!/bin/bash
# Cache sudo password
sudo -v
# Get latest OpenSSL 1.0.2 version from https://openssl.org/source/
# v1.1.0 seems to have removed SSLv2/3 support
openssl_version=1.0.2k
# Install build dependencies