Skip to content

Instantly share code, notes, and snippets.

View arget13's full-sized avatar
🙃
nʍn

Yago arget13

🙃
nʍn
View GitHub Profile
@arget13
arget13 / asteroids.c
Last active March 22, 2023 12:17
A simple implementation of asteroids game for modern terminals.
/**
Name : Asteroids
Author : Arget
Version : 1.4
Date : 16/11/2017
Description : A simple implementation of asteroids game for modern terminals.
Notes : Compile with `gcc -o asteroids asteroids.c'
*/
#include <stdio.h> /* printf(), putchar() */
@arget13
arget13 / angletime.c
Last active January 28, 2020 18:20
Have you ever wanted to be a shitty pedant? Now you can tell time in degrees or radians!
#include <stdio.h>
#include <string.h>
#include <math.h>
// 2pi / (1440 / 2)
#define ratiorad 0.0087266 // radians that one minute equals
// 360 / (1440 / 2)
#define ratiodeg 0.5 // degrees that one minute equals
#define PI2 6.2831853
@arget13
arget13 / fsb_download.py
Created March 29, 2020 21:03
Download the binary loaded in memory from a remote process using a format strings vulnerability
from pwn import *
# CONFIG #
## Basic stuff
rhost = "localhost" # Remote host
rport = 1234 # Remote port
fname = "a.bin" # Output filename
## Address where the binary is loaded
@arget13
arget13 / reee.md
Last active May 9, 2020 13:05
PlaidCTF 2020: reee

PlaidCTF 2020 : reee

Reversing (150 pts)

Story

Tired from all of the craziness in the Inner Sanctum, you decide to venture out to the beach to relax. You doze off in the sand only to be awoken by the loud “reee” of an osprey. A shell falls out of its talons and lands right where your head was a moment ago. No rest for the weary, huh? It looks a little funny, so you pick it up and realize that it’s backwards. I guess you’ll have to reverse it.

Problem details

Hint: The flag format is pctf{$FLAG}. This constraint should resolve any ambiguities in solutions.

@arget13
arget13 / worstpacker.py
Last active March 12, 2023 19:29
The worst packer in history. Made just for fun, please don't use in a production environment. The arguments are embedded onto the binary, encrypted. The -n option is to not reuse argv[0].
#!/usr/bin/env python3
from os import *
from mmap import PROT_EXEC, PROT_READ
from sys import argv
key = 0xa3
ELF_READ = 4
ELF_WRITE = 2
ELF_EXEC = 1
@arget13
arget13 / noexec.c
Last active November 26, 2023 21:47
A simple shell which doesn't use execve. Provides support for pipes.
/* Compile with -znow */
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <elf.h>
@arget13
arget13 / bfsmatrix.c
Last active August 18, 2023 16:20
OffensiveCon 2023's kernel pwn chall's solution
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdint.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <err.h>
#include <sys/ioctl.h>
#include <string.h>
@arget13
arget13 / argv.c
Last active September 29, 2023 13:09
A small dumb challenge
#include <stdio.h>
#include <sys/mman.h>
#include <unistd.h>
int main(int _, char** argv)
{
FILE* f;
munmap((void*) ((long)argv[0] & ~0xfff), 1);
if(f = fopen("flag", "rb"))