Skip to content

Instantly share code, notes, and snippets.

View EdoardoVignati's full-sized avatar

Edoardo Vignati EdoardoVignati

View GitHub Profile
@EdoardoVignati
EdoardoVignati / cookies_info_popup.php
Created May 1, 2017 18:32
Simple cookie policy popup in php & js
<html>
<head>
<!--
Simple cookie info popup
Semplice popup di informativa per l'utilizzo dei cookies
Ti ringrazio se lasci qui questo commento.
Thanks for keeping here this comment.
@EdoardoVignati
EdoardoVignati / tokenizer.c
Created August 27, 2017 18:13
Tokenize a string in c
#include <string.h>
#include <stdio.h>
int main()
{
char str[100] = "Try to token , this is a token , another token";
const char s[2] = ",";
char *token;
/* Get the first token */
@EdoardoVignati
EdoardoVignati / tmux.conf
Last active July 13, 2018 09:47
Tmux config file
# mv ./tmux.conf ./.tmux.conf
# cat << EOF > /dev/null
# https://github.com/gpakosz/.tmux
# (‑●‑●)> dual licensed under the WTFPL v2 license and the MIT license,
# without any warranty.
# Copyright 2012— Gregory Pakosz (@gpakosz).
#-- Added by EdoardoVignati ----------------------------------------------------
set -g mouse on
@EdoardoVignati
EdoardoVignati / PS1
Last active February 11, 2019 13:37
Simple custom bash colours
#Put this into your .bashrc
export PS1="\[\033[35m\]\t\[\033[m\]-\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h:\[\033[33;1m\]\w\[\033[m\]$"
#Then run "source .bashrc"
@EdoardoVignati
EdoardoVignati / Pretty-hexdump
Last active February 11, 2019 13:36
Pretty and simple hexdump command
#Credits: https://brendanzagaeski.appspot.com/0006.html
hexdump -v -e '"%010_ad |" 16/1 "%_p" "|\n"' hexdump.txt
@EdoardoVignati
EdoardoVignati / subprocess.py
Last active October 4, 2019 13:47
Simple Python subprocess
import subprocess
bashCommand="mypipeline"
process=subprocess.Popen(bashCommand, shell=True, executable="/bin/bash")
process.kill()
@EdoardoVignati
EdoardoVignati / getShellcode.sh
Created September 20, 2018 09:03
Get shellcode from objdump
objdump -d $1 | grep '[0-9a-f]:' | grep -v 'file' | cut -f2 -d: | cut -f1-6 -d ' '| tr -s ' '| tr '\t' ' '| sed 's/ $//g' | sed 's/ /\\x/g' | paste -d '' -s | sed 's/^/"/' | sed 's/$/"/g'
@EdoardoVignati
EdoardoVignati / disable-enable-ASLR
Last active September 20, 2018 09:07
Disable/Enable ASLR (Address space layout randomization)
# Disable #
echo 0 | sudo tee /proc/sys/kernel/randomize_va_space
# Enable #
echo 2 | sudo tee /proc/sys/kernel/randomize_va_space
@EdoardoVignati
EdoardoVignati / read.s
Created October 25, 2018 07:24
Read from stdin and print input - AT&T assembly
#################
# How to run #
#################
# $ as --gstabs read.s -o read.o
# $ ld read.o -o read
# $ ./read
################
.text
@EdoardoVignati
EdoardoVignati / execve.c
Created October 25, 2018 08:37
Simple execve example
#include <stdio.h>
int main(){
char *cmd[]={"/bin/sh", NULL};
execve(cmd[0], cmd, NULL);
return 1;
}