Skip to content

Instantly share code, notes, and snippets.

View robertobarreda's full-sized avatar

Roberto Barreda robertobarreda

View GitHub Profile
@robertobarreda
robertobarreda / cinder-storageclass.yaml
Created April 1, 2026 08:08
Cinder default storage class for Magnum K8s cluster
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: cinder
annotations:
storageclass.kubernetes.io/is-default-class: "true"
spec:
provisioner: cinder.csi.openstack.org
parameters:
type: ""
@robertobarreda
robertobarreda / webgoat.js
Last active October 22, 2024 11:40
Calculate SHA256 hash from error message in "Parameter Tampering" > "Bypass Client Side JavaScript Validation" using the browser console
// You need to type in console `allow pasting` and hit enter.
// This is one time thing and will enable the pasting functionality.
// If this code doesn't work on your browser, take the output from:
// document.querySelector("#message.info").innerText.trim()
// and use an online tool like https://emn178.github.io/online-tools/sha256.html
// to get the SHA256 digest
async function sha256(rawData) {
const data = typeof rawData === 'object' ? JSON.stringify(rawData) : String(rawData);
@robertobarreda
robertobarreda / Vagrantfile
Created July 7, 2020 10:06
JEDI SI - CTF juice shop
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "debian/buster64"
config.vm.network "forwarded_port", guest: 3000, host: 3000
# config.vm.synced_folder ".", "/vagrant", disabled: true
config.vm.provider "virtualbox" do |vb|
vb.memory = "256"
end
@robertobarreda
robertobarreda / wireguard-install.sh
Last active July 7, 2020 10:21
wireguard-install.sh
#!/bin/bash
function addClient() {
# Load params
source /etc/wireguard/params
if [[ $SERVER_PUB_IP =~ .*:.* ]]; then
echo "IPv6 Detected"
ENDPOINT="[$SERVER_PUB_IP]:$SERVER_PORT"
else
@robertobarreda
robertobarreda / access.log
Last active October 21, 2024 20:42
JEDI PAC 4 (forensics)
91.237.86.89 - - [21/Aug/2013:15:39:34 +0200] "GET /login.php HTTP/1.1" 200 291 "-" "Opera/9.80 (Macintosh; Intel Mac OS X 10.6.7; U; en) Presto/2.8.131 Version/11.10"
87.217.164.200 - - [21/Aug/2013:15:39:35 +0200] "GET /login.php HTTP/1.1" 200 291 "-" "Mozilla/5.0 (Linux; U; Android 4.0.2; en-us; Galaxy Nexus Build/ICL53F) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30"
176.97.248.131 - - [21/Aug/2013:15:39:38 +0200] "GET /login.php HTTP/1.1" 200 291 "-" "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 SUSE/10.0.626.0 (KHTML, like Gecko) Chrome/10.0.626.0 Safari/534.16"
78.109.24.225 - - [21/Aug/2013:15:39:40 +0200] "GET /login.php HTTP/1.1" 200 291 "-" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-us) AppleWebKit/533.16 (KHTML, like Gecko) Version/5.0 Safari/533.16"
195.88.28.66 - - [21/Aug/2013:15:39:42 +0200] "GET /login.php HTTP/1.1" 200 291 "-" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_7_0; en-US) AppleWebKit/534.21 (KHTML, like Gecko) Chrome/11.0.678.0
@robertobarreda
robertobarreda / 24022007.txt
Last active February 3, 2020 21:23
JEDI SI PAC2 (information gathering)
This file has been truncated, but you can view the full file.
Date flow start Duration Proto Src IP Addr:Port Dst IP Addr:Port Packets Bytes Flows
2007-02-24 04:54:54.917 42.682 UDP 84.77.114.176:57024 -> 10.16.54.6:19522 2 58 1
2007-02-24 04:55:06.552 15.202 UDP 84.77.114.176:57024 -> 10.16.54.6:18278 2 58 1
2007-02-24 04:54:54.806 13.998 UDP 84.77.114.176:57024 -> 10.16.54.6:31991 2 58 1
2007-02-24 04:54:52.434 96.322 UDP 89.106.22.3:54606 -> 10.16.54.6:38662 166 4814 1
2007-02-24 04:55:03.714 72.352 UDP 84.77.114.176:57024 -> 10.16.54.6:34016 2 58 1
2007-02-24 04:54:34.830 91.019 UDP 213.144.110.130:3656 -> 10.16.54.6:4027 160 4640 1
2007-02-24 04:54:54.941 80.638 UDP 84.77.114.176:57024 -> 10.16.54.6:34197 2 58 1
2007-02-24 04:52:22.421 232.040 UDP 207.150.178.78:1225 -> 10.16.54.6:44569 213 6177 1
2007-02-24 04:53:04.149 160.7
@robertobarreda
robertobarreda / Vagrantfile
Last active July 3, 2020 07:16
JEDI SI PAC3 (Web Vulnerabilities)
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "debian/buster64"
config.vm.network "forwarded_port", guest: 9090, host: 9090
# config.vm.synced_folder ".", "/vagrant", disabled: true
config.vm.provider "virtualbox" do |vb|
vb.memory = "256"
end
@robertobarreda
robertobarreda / Vagrantfile
Last active June 27, 2020 15:18
JEDI SI PAC1 (system security)
Vagrant.configure("2") do |config|
config.vm.box = "debian/buster64"
# config.vm.synced_folder ".", "/vagrant", disabled: true
config.vm.provider "virtualbox" do |vb|
vb.memory = "256"
end
config.vm.define :proxy, primary: true do |proxy|
proxy.vm.hostname = "proxy"
@robertobarreda
robertobarreda / tdigest.py
Last active September 29, 2015 12:41
Efficient percentile estimation of streaming or distributed data - https://github.com/CamDavidsonPilon/tdigest
from __future__ import print_function
from random import choice
from bintrees import FastRBTree as RBTree
import pyudorandom
from itertools import chain
class Centroid(object):
def __init__(self, mean, count):
@robertobarreda
robertobarreda / count_min_sketch.py
Created July 22, 2015 13:17
CountMinSketch is an implementation of the count min sketch algorithm that probabilistically counts string frequencies.
from __future__ import division
from xxhash import xxh32
import numpy as np
DTYPE = np.int64
class CountMinSketch(object):