Skip to content

Instantly share code, notes, and snippets.

View jrelo's full-sized avatar

hed0rah jrelo

View GitHub Profile
@ntrrgc
ntrrgc / memdump.py
Created March 2, 2014 17:21
Dumps a process' memory to stdout on Linux
#!/usr/bin/env python
from __future__ import print_function
import sys
import os
import re
import ctypes
import argparse
ulseek = ctypes.cdll['libc.so.6'].lseek
ulseek.restype = ctypes.c_uint64
@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active May 14, 2025 04:34
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

@scola
scola / iptable-anti-dns-poison.sh
Created July 12, 2014 13:52
use iptables to anti-dns poison on linux or openwrt
#!/bin/bash
iptables -I INPUT -p udp -m udp --sport 53 -m u32 --u32 "0&0x0F000000=0x05000000 && 22&0xFFFF@16=0x1010101,0xffffffff,0x4a7d7f66,0x4a7d9b66,0x4a7d2766,0x4a7d2771,0xd155e58a,0x42442b2,0x807c62d,0x253d369e" -j DROP
iptables -I INPUT -p udp -m udp --sport 53 -m u32 --u32 "0&0x0F000000=0x05000000 && 22&0xFFFF@16=0x2e52ae44,0x3b1803ad,0x402158a1,0x4021632f,0x4042a3fb,0x4168cafc,0x41a0db71,0x422dfced,0x480ecd68,0x480ecd63" -j DROP
iptables -I INPUT -p udp -m udp --sport 53 -m u32 --u32 "0&0x0F000000=0x05000000 && 22&0xFFFF@16=0x4e10310f,0x5d2e0859,0x80797e8b,0x9f6a794b,0xa9840d67,0xc043c606,0xca6a0102,0xcab50755,0xcba1e6ab,0xcb620741" -j DROP
iptables -I INPUT -p udp -m udp --sport 53 -m u32 --u32 "0&0x0F000000=0x05000000 && 22&0xFFFF@16=0xcf0c5862,0xd0381f2b,0xd1913632,0xd1dc1eae,0xd1244921,0xd155e58a,0xd35e4293,0xd5a9fb23,0xd8ddbcb6,0xd8eab30d" -j DROP
iptables -I INPUT -p udp -m udp --sport 53 -m u32 --u32 "0&0x0F000000=0x05000000 && 22&0xFFFF@16=0xf3b9bb03,0xf3b9bb27,0x807c62d,0xf3b9bb1e,0x9f1803ad
@jaypeche
jaypeche / fanotify-example.c
Created December 20, 2014 10:48
fanotify example
/*
* File: fanotify-example.c
* Date: Fri Nov 15 14:55:49 2013
* Author: Aleksander Morgado <[email protected]>
*
* A simple tester of fanotify in the Linux kernel.
*
* This program is released in the Public Domain.
*
* Compile with:
@vdw
vdw / gist:09efee4f264bb2630345
Last active January 31, 2023 08:55
Kill tcp connection with tcpkill on CentOS

Install tcpkill
yum -y install dsniff --enablerepo=epel

View connections
netstat -tnpa | grep ESTABLISHED.*sshd.

Block with ip tables
iptables -A INPUT -s IP-ADDRESS -j DROP

Kill connection

@Erreinion
Erreinion / Hping3 Packet Grenade
Last active October 30, 2017 07:31
Firewall testing script using hping3
# Packet Grenade
# Feb 13, 2015
# Lists of targets
set pinglist [list www.google.com www.facebook.com]
set httplist [list www.google.com www.facebook.com]
set httpslist [list www.google.com www.facebook.com]
set ftplist [list]
set sshlist [list alt.org thebes.openshells.net]
@kisel
kisel / killcx
Last active March 7, 2024 12:30
killcx
#!/usr/bin/perl
######################################################################
# killcx :
#
# Close a TCP connection under Linux.
#
# (c) Jerome Bruandet - <[email protected]>
#
# version 1.0.3 - 18-May-2011
#
@sh1n0b1
sh1n0b1 / linuxprivchecker.py
Created July 13, 2015 23:36
linuxprivchecker.py -- a Linux Privilege Escalation Check Script
#!/usr/env python
###############################################################################################################
## [Title]: linuxprivchecker.py -- a Linux Privilege Escalation Check Script
## [Author]: Mike Czumak (T_v3rn1x) -- @SecuritySift
##-------------------------------------------------------------------------------------------------------------
## [Details]:
## This script is intended to be executed locally on a Linux box to enumerate basic system info and
## search for common privilege escalation vectors such as world writable files, misconfigurations, clear-text
## passwords and applicable exploits.
@mellinoe
mellinoe / LinearToSRGB_VectorExample.cs
Last active July 15, 2018 01:23
A basic example to show how to vectorize an algorithm
using System;
using System.Diagnostics;
using System.Numerics;
class Program
{
static unsafe void Main(string[] args)
{
Console.WriteLine("Degree of vectorization: " + Vector<float>.Count);
Random rand = new Random();
@alimuldal
alimuldal / recover
Created November 11, 2015 16:18
Python script for automated file recovery using SleuthKit
#!/usr/bin/env python
import argparse
import subprocess
import re
import os
TYPECODES = ['\-', 'r', 'd', 'b', 'l', 'p', 's', 'w', 'v']
DESCRIPTIONS = [
'unknown type',