Skip to content

Instantly share code, notes, and snippets.

@anzz1
anzz1 / prng.c
Created September 3, 2025 01:40
prng.c
// prng.c
/* ********************* */
/* * XORSHIFT798 * */
/* * 16-bit * */
/* ********************* */
static unsigned short x798_s = 0;
static inline void x798_init()
@anzz1
anzz1 / test_ciphers.sh
Created September 2, 2025 21:08
test_ciphers.sh
#!/usr/bin/env bash
# OpenSSL requires the port number.
SERVER=$1
DELAY=1
if [ -z "$SERVER" ]; then
echo Usage: $0 IP:PORT
exit 1
fi
@anzz1
anzz1 / list_ciphers.sh
Created September 2, 2025 21:08
list_ciphers.sh
#!/bin/sh
# All ciphers
openssl ciphers -v "ALL:eNULL"
# Good ciphers
# openssl ciphers -v "aNULL:-aNULL:ALL:!EXPORT:!LOW:+RC4:@STRENGTH"
@anzz1
anzz1 / create_cert.sh
Created September 2, 2025 21:00
create_cert.sh
#!/bin/sh
openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -sha256 -days 10950 -nodes -subj "/C=US/ST=Oregon/L=Portland/O=Company Name/OU=Org/CN=www.example.com"
openssl dhparam -out dh1024.pem 1024
openssl x509 -noout -text -in cert.pem
@anzz1
anzz1 / cave.idc
Created March 26, 2025 17:00
cave.idc
// cave.idc : An IDA IDC script to find alignment blocks
// (also called 'code cave') in an IDA database.
// Useful when you need to add code to a binary file
// Say for example you found an exploitable bug in a program
// and you don't want to wait for the developer to provide a bugfix,
// you can add your own code to the alignment block in order to manually
// fix the bug.
// Code by trapflag
// bugfixed by death
@anzz1
anzz1 / unixlf.cmd
Created March 10, 2025 12:31
unixlf.cmd
<# :
@setlocal disabledelayedexpansion enableextensions
@echo off
powershell -nol -noni -nop -ex bypass -c "&{[ScriptBlock]::Create((cat '%~f0') -join [Char[]]10).Invoke(@(&{$args}%*))}"
exit /b
#>
Write-Host === CRLF -> LF ===`n
$items = dir .\ -recurse | where {$_.extension -in ".sln",".vcproj",".vcxproj",".vcxproj.filters",".md",".cs",".c",".h",".cpp",".inc",".hpp",".txt",".cc",".log",".def",".asm",".mk",".s",".json",".lua",".xml",".ini",".sql",".cfg",".nsh",".nsi",".sma",".php",".sh",".res",".bat",".conf",".js"}
@anzz1
anzz1 / tada.c
Created February 24, 2025 04:44
tada.c
// tada.c
// compile (msvc):
// cl /MD /O2 /Zl /GS- /kernel /D "WIN32" /D "NDEBUG" /D "_WINDOWS" tada.c /link kernel32.lib winmm.lib /entry:main /subsystem:windows /pdb:none /machine:I386 /nodefaultlib /incremental:no /manifest:no /safeseh:no /emitpogophaseinfo /RELEASE /OPT:REF /OPT:ICF
#define WINVER 0x0501
#define _WIN32_WINNT 0x0501
#include <windows.h>
@anzz1
anzz1 / GoldSrc_CVE-2023-35855_RCE_fix.txt
Last active January 1, 2024 22:58
GoldSrc_CVE-2023-35855_RCE_fix
// Half-Life / GoldSrc Engine
// RCE Fix (Buffer Overflow)
//
// CVE: CVE-2023-35855
//
// Module: hw.dll
// Build: Aug 3 2020 (8684)
//
// Original SHA1 : f0f7372692f285154c76be35fc50b89ed0ea2d18
// Fixed SHA1 : 51c2ecb1ab8241b6afeae535a6a66dbd73a00a65
@anzz1
anzz1 / idna.class.php
Created August 8, 2023 12:11
idna.class.php
<?php
class IDNA {
public static function encode($string) {
$parts = explode('.', $string);
foreach ($parts as &$part) {
$part = self::to_ascii($part);
if ($part === false) return false;
}
return implode('.', $parts);
@anzz1
anzz1 / whois.php
Last active October 17, 2024 13:07
whois.php
<?php
/* Simple PHP WHOIS (PHP >= 4.0) */
/* https://gist.github.com/anzz1 */
/* --------------------- CONFIGURATION --------------------- */
// Clean up comments ('#', '%') and empty lines from the response
$NO_COMMENTS = false;