Skip to content

Instantly share code, notes, and snippets.

View pmauduit's full-sized avatar

Pierre Mauduit pmauduit

View GitHub Profile
@pmauduit
pmauduit / gdb-cheat-sheet
Last active November 7, 2020 10:07
My gdb cheat sheet
List breakpoints:
i b
Show register state:
i r
Change / relocate sources:
set substitute-path /path/to/a /another/to/a
Conditional breakpoints:
@pmauduit
pmauduit / geohealthcheck.wsgi
Created October 24, 2014 09:05
Flask sample WSGI file for geohealthcheck
activate_this = '/var/www/pmauduit/private/GeoHealthCheck/bin/activate_this.py'
execfile(activate_this, dict(__file__=activate_this))
import sys
sys.stdout = sys.stderr
sys.path.insert(0, '/var/www/pmauduit/private/GeoHealthCheck/GeoHealthCheck/GeoHealthCheck')
from app import APP as application
@pmauduit
pmauduit / dump.sql
Last active August 29, 2015 14:09
geOrchestra postgresql db bootstrap
begin;
-- GeoNetwork
CREATE SCHEMA geonetwork;
-- Mapfishapp
create schema mapfishapp;
@pmauduit
pmauduit / gist:3a81d409e2975fa546f5
Last active May 13, 2019 11:50
Radare2 cheat sheet
encode / decode mnemonics / opcodes:
rasm2 -b 64 'mov dword [rbp-0x1], 0x68' | rasm2 -d -b 64 -
r2 ./file
aa
[analyze all]
i
@pmauduit
pmauduit / sc.c
Last active August 29, 2015 14:11
My first shellcode
#include <stdio.h>
#include <stdlib.h>
/**
*
* ba 0b 00 00 00 ; mov ?, 0b (write ?)
* be 01 00 00 00 ; mov ?,1 (stdout)
* bf cb 06 40 00 ; mov edi, 0x00 40 06 cb (char * helloworld)
* e8 bb fe ff ff ; call fwrite
* 5d
@pmauduit
pmauduit / helloworld.S
Last active August 29, 2015 14:11
Helloworld assembly
section .text
global _start ;must be declared for linker (ld)
_start: ;tell linker entry point
mov edx,len ;message length
mov ecx,msg ;message to write
mov ebx,1 ;file descriptor (stdout)
mov eax,4 ;system call number (sys_write)
int 0x80 ;call kernel
@pmauduit
pmauduit / context.xml
Created December 15, 2014 21:24
context.xml for tomcat, to load a specific classloader
<?xml version='1.0' encoding='utf-8'?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@pmauduit
pmauduit / Main.java
Last active August 29, 2015 14:13
Fiddling with java.lang.reflect.Proxy
import java.lang.reflect.Proxy;
import java.lang.reflect.InvocationHandler;
import java.lang.Throwable;
import java.lang.reflect.Method;
import java.lang.Object;
public class Main {
interface IA {};
@pmauduit
pmauduit / sample_raphink.pp
Created April 22, 2015 14:55
puppet augeas sample (tweaking tomcat config)
define tomcat::property (
$ensure = 'present',
$key = $name,
$target,
$value,
) {
case $ensure {
'present': {
$changes = "set ${key} '${value}'"
}
@pmauduit
pmauduit / main.c
Last active September 12, 2015 10:05
func pointer
#include <stdio.h>
#include <stdlib.h>
void sample() {
int i = 0;
char * test = malloc(10 * sizeof(char));
for (i = 0 ; i < 10 ; i++) {
test[i] = 'a';
}
test[9] = '\0';