Skip to content

Instantly share code, notes, and snippets.

View jrelo's full-sized avatar

hed0rah jrelo

View GitHub Profile
#include <stdio.h>
int main() {
int value = 10;
int *pointer = &value;
// print the address of the variable and the pointer value
printf("Address of 'value': %p\n", (void *)&value);
printf("Value of 'pointer': %p\n", (void *)pointer);
@jrelo
jrelo / c-pointers-demo.c
Created July 26, 2024 19:52
C Pointers Demo
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
// demonstrate pointer basics
void pointerBasics() {
int a = 42;
int *ptr = &a;
printf("Pointer Basics:\n");
@jrelo
jrelo / find_large_heap.sh
Created July 25, 2024 18:21
Find processes with large heap regions
#!/bin/bash
get_heap_size() {
local pid=$1
local heap_size=0
# Read the /proc/[pid]/maps file
while read -r line; do
if [[ "$line" == *"heap"* ]]; then
local start_addr=$(echo "$line" | awk '{print $1}' | cut -d'-' -f1)
@jrelo
jrelo / iptables_flush.sh
Created July 21, 2024 19:25
iptables full flush
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
iptables -t nat -F
iptables -t mangle -F
iptables -F
iptables -X
@jrelo
jrelo / tcpdump_stdout_file.sh
Created July 20, 2024 19:39
tcpdump stdout and file simultaneously
tcpdump -i wlan0 host 192.168.1.201 -w - -U | tee tama_`date +%F`.pcap | tcpdump -r -
@jrelo
jrelo / IR_shitscope.ino
Last active July 6, 2024 15:52
shitty arduino IR scope
/*
OLED:
GND -> GND
VCC -> 5v
SCK -> A5
SDA -> A4
IR Receiver:
GND -> GND
VCC -> 5v
@jrelo
jrelo / arp_poison_RPi.sh
Created July 5, 2024 16:36
ARP poison simple example
# clear existing rules
#sudo iptables -F
#sudo iptables -t nat -F
#sudo iptables -X
# allow forwarding for related and established connections
sudo iptables -A FORWARD -i wlan0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT
# allow forwarding from wlan0 to wlan0 (both directions)
sudo iptables -A FORWARD -i wlan0 -o wlan0 -j ACCEPT
@jrelo
jrelo / conversions_bitwise.sh
Last active July 25, 2024 16:52
bash numerical conversion and bitwise functions
#!/bin/bash
# Conversion Functions
hex2dec() {
printf "%d\n" "0x$1"
}
bin2dec() {
echo "$((2#$1))"
}
@jrelo
jrelo / forwarder.py
Created June 23, 2024 18:52 — forked from LiveOverflow/forwarder.py
TCP Forwarder
import socket
import select
from logzero import logger
# python forwarder.py localhost:1337 ipinfo.io:80
# curl -v http://localhost.com:1337 -H "Host: ipinfo.io"
# video: https://www.youtube.com/watch?v=32KKwgF67Ho
class Forwarder:
@jrelo
jrelo / elf_format_cheatsheet.md
Created June 23, 2024 18:45 — forked from x0nu11byt3/elf_format_cheatsheet.md
ELF Format Cheatsheet

ELF Format Cheatsheet

Introduction

Executable and Linkable Format (ELF), is the default binary format on Linux-based systems.

ELF

Compilation