Skip to content

Instantly share code, notes, and snippets.

View pmauduit's full-sized avatar

Pierre Mauduit pmauduit

View GitHub Profile
@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 / 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 / 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 / dump.sql
Last active August 29, 2015 14:09
geOrchestra postgresql db bootstrap
begin;
-- GeoNetwork
CREATE SCHEMA geonetwork;
-- Mapfishapp
create schema mapfishapp;
@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 / 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 / DisableSSLChecks
Created July 29, 2014 13:15
Get rid of SSL checks in Java
// don't really care of SSL issues ...
public static void disableCertificates() {
TrustManager[] trustAllCerts = new TrustManager[]{
new X509TrustManager() {
@Override
public java.security.cert.X509Certificate[] getAcceptedIssuers() {
return null;
}
@pmauduit
pmauduit / Vagrantfile
Created April 25, 2014 12:47
Vagrant provision with puppet
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "debian-7-amd64-c2c"
config.vm.provision "puppet" do |puppet|
puppet.module_path = "modules"
end
end
@pmauduit
pmauduit / gist:9807684
Last active August 29, 2015 13:57
Very useful tricks
## in a maven project:
$ mvn eclipse:eclipse -DdownloadSources=true
## JDWP
-agentlib:jdwp=transport=dt_socket,address=30303,server=y,suspend=n
-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 -Xmx2048M -XX:MaxPermSize=1024M
@pmauduit
pmauduit / osmposter.sh
Created March 4, 2014 07:25
OSM GPX traces retriever - Shell script
#!/bin/sh
set -x
# Chambéry
#CITY=Chambéry
#NORTH=45.5903
#SOUTH=45.5354
#WEST=5.8621
#EAST=5.9755