Skip to content

Instantly share code, notes, and snippets.

View aolle's full-sized avatar

Àngel Ollé Blázquez aolle

View GitHub Profile
@aolle
aolle / haproxy-smuggling.md
Created November 23, 2021 22:31 — forked from ndavison/haproxy-smuggling.md
HAProxy HTTP request smuggling

The following describes a technique to achieve HTTP request smuggling against infrastructure behind a HAProxy server when using specific configuration around backend connection reuse. This was tested against HAProxy versions 1.7.9, 1.7.11, 1.8.19, 1.8.21, 1.9.10, and 2.0.5. Of all these tested versions, only 2.0.5 was not vulnerable out of the box, although it is when using the no option http-use-htx configuration, which reverts back to the legacy HTTP decoder. 2.1 removed the legacy decoder so it is not affected.

To actually exploit HTTP smuggling using the issue described in this writeup, the backend server(s) behind HAProxy would also have to be vulnerable in the sense they too would need to suffer from a bug, but one which parses and accepts a poorly formed Transfer-Encoding header (almost certainly violating RFC7230), and allows HTTP keep-alive.

The HAProxy bug - sending both Transfer-Encoding and Content-Length

This is how HAProxy handles a request when Transfer-Encoding and Content-Length is p

@aolle
aolle / convert.py
Created April 18, 2021 17:33 — forked from dogboydog/convert.py
Convert Nimbus Notes HTML to Markdown for Joplin
# -------------------------------------------------------------------------
# Nimbus note HTML export to markdown converter
# Extract all zip files containing 'note.html' and convert to markdown
#
# Setup:
# 1) install python 3 for your OS
# 2) install pandoc https://github.com/jgm/pandoc/releases/tag/2.11.4
# on Windows, the .msi will automatically add pandoc to your $PATH
# otherwise add it to your $PATH.
# 3) save this script in the directory where your HTML exports were
@aolle
aolle / JDK5u22_client.log
Created July 3, 2020 15:52 — forked from rednaxelafx/JDK5u22_client.log
PrintCompilation samples running Groovy shell 1.7.7 on different versions of HotSpot VM
1 b java.lang.String::charAt (33 bytes)
2 b java.lang.Math::max (11 bytes)
3 b java.util.jar.Manifest$FastInputStream::readLine (167 bytes)
4 b sun.nio.cs.UTF_8$Decoder::decodeArrayLoop (553 bytes)
5 b java.util.Properties$LineReader::readLine (383 bytes)
6 b java.lang.String::hashCode (60 bytes)
7 b java.lang.String::indexOf (151 bytes)
8 b sun.nio.cs.ext.DoubleByteDecoder::decodeSingle (10 bytes)
9 b java.lang.String::lastIndexOf (156 bytes)
10 b java.lang.String::replace (142 bytes)
@aolle
aolle / openshift-cheatsheet.md
Created June 10, 2020 16:36 — forked from rafaeltuelho/openshift-cheatsheet.md
My Openshift Cheatsheet

My Openshift Cheatsheet

Openshift build secrets for cloning git repos using SSH Keys

  • To create ssh secret:
oc create secret generic sshsecret \
    --from-file=ssh-privatekey=$HOME/.ssh/id_rsa
@aolle
aolle / cheat_sheet.txt
Created April 7, 2018 23:19
GDB cheat sheet
GDB commands by function - simple guide
---------------------------------------
More important commands have a (*) by them.
Startup
% gdb -help print startup help, show switches
*% gdb object normal debug
*% gdb object core core debug (must specify core file)
%% gdb object pid attach to running process
% gdb use file command to load object
@aolle
aolle / die2.sh
Created August 19, 2016 16:11
own die bash function
die () {
echo "${0}: ${2}" >&2
exit ${1}
}
warn () {
echo "$0:" "$@" >&2
}
die () {
rc=$1
shift
warn "$@"
exit $rc
}
@aolle
aolle / Nc.java
Created August 19, 2016 15:52
Check socket - Java
import java.net.*;
public class Nc {
public static void main(String[] args){
if(args.length < 2)
return;
String host = args[0];
int port = Integer.parseInt(args[1]);
String msg = "Port " + port + " from " + host;
gem: --user-install
@aolle
aolle / run_postfix.sh
Created August 17, 2016 13:32
Docker run script for postfix
#!/bin/bash
docker run -d --name srv01-postfix \
-v ~/docker/postfix/conf/:/etc/postfix/ \
--net=backend \
--net-alias postfix \
--restart on-failure:5 \
custom_img/postfix \
hostname.com