Skip to content

Instantly share code, notes, and snippets.

View malys's full-sized avatar

Malys malys

View GitHub Profile
@malys
malys / docker-compose.yml
Last active November 12, 2019 07:40 — forked from pantsel/docker-compose.yml
[Kong Docker] #kong #docker # docker-compose
# Mount wait-for-it https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh
version: "3"
networks:
kong-net:
driver: bridge
services:
#######################################
# Postgres: The database used by Kong
#######################################
@malys
malys / client.groovy
Created October 25, 2019 14:06
[Client Credentials] #keycloak #client
@Grab('com.github.scribejava:scribejava-apis:6.9.0')
import com.github.scribejava.apis.KeycloakApi;
import com.github.scribejava.core.builder.ServiceBuilder;
import com.github.scribejava.core.model.OAuth2AccessToken;
import com.github.scribejava.core.model.OAuthRequest;
import com.github.scribejava.core.model.Response;
import com.github.scribejava.core.model.Verb;
import com.github.scribejava.core.oauth.OAuth20Service;
import java.io.IOException;
@malys
malys / example.md
Last active December 12, 2019 13:16
[SplitBrain] #docker # docker-compose #failure

Simulate split brain failure on docker-compose using linux routes

  • splitbrain

node splitbrain.js add [2,20] [10,3] true

  • disable splitbrain

node splitbrain.js delete [2,20] [10,3]

@malys
malys / release.sh
Created January 7, 2020 16:04
[Release] maven git flow #maven #bash
#!/bin/bash
#trap "set +x; read -n1 -r -p "." key; set -x" DEBUG
# https://github.com/petergeneric/maven-release-script
function die_with() {
echo "$*" >&2
exit 1
}
function has_command() {
@malys
malys / artilleryFunctions.js
Last active February 13, 2020 14:54
[Artillery] functions #artillery #oauth #openidc
// requestSpec will be the request spec for this response (currently always null)
// response is a Request.js response object
// context is the scenario context containing scenario variables
// ee is an event emitter for this scenario that we can use to add custom stats to the report
// npm install jsonwebtoken
const jwt = require('jsonwebtoken');
const util = require('util');
@malys
malys / jwt_RSA256.js
Last active February 14, 2020 18:44
[JWT] #hack #oauth2 #oidc #rootme #javascript #secLists #bruteforce
const jwt = require('jsonwebtoken');
const request = require('sync-request')
const NodeRSA = require('node-rsa');
const FormData = request.FormData;
/*let token="eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6Imd1ZXN0In0.OnuZnYMdetcg7AWGV6WURn8CFSfas6AQej4V9M13nsk"
console.log(jwt.decode(token, {complete: true}))
console.log( jwt.verify(token, ''))*/
@malys
malys / Dockerfile-server
Created April 30, 2020 06:29
[Openxpki] #keystore #pki #windows #docker #docker-compose
FROM debian:buster
ARG DEBIAN_FRONTEND=noninteractive
ARG OPENXPKI_NOCONFIG=1
RUN apt-get update && \
apt-get install --assume-yes gpg libdbd-mysql-perl libapache2-mod-fcgid apache2 wget locales less gettext
RUN echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && dpkg-reconfigure --frontend=noninteractive locales
RUN wget https://packages.openxpki.org/v3/debian/openxpki.list -O /etc/apt/sources.list.d/openxpki.list
@malys
malys / gitleaks.sh
Created August 4, 2020 14:51
[GitLeaks for user space] #git #gitleaks #security
user=$1
items=$2
depth=$3
curl --silent -kL https://api.github.com/users/$user/repos?per_page=$items |grep "full_name" |awk -v user="$user" -F"\"" '{print "https://github.com/"$4}' > $user-repos.txt
while read in; do
echo $in
gitleaks --repo="$in" --verbose --pretty --depth=$3 --threads=5 --report=$user-gitleaks-result;
done < $user-repos.txt
@malys
malys / oauth2-proxy.yaml
Created October 2, 2020 13:32
[Louketo replacement ] #keycloak #proxy #oauth2-proxy
relypartyadmin:
image: quay.io/oauth2-proxy/oauth2-proxy:latest
hostname: relypartyadmin
depends_on:
- appserver
restart: on-failure
ports:
- "8200:8200"
environment:
- OAUTH2_PROXY_STANDARD_LOGGING=true
@malys
malys / Authorization Code Flow.jmx
Created January 5, 2021 11:04
[Authorization code flow] #keycloak #jmeter
<?xml version="1.0" encoding="UTF-8"?>
<jmeterTestPlan version="1.2" properties="5.0" jmeter="5.2.1">
<hashTree>
<TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Authorization Code Flow" enabled="true">
<stringProp name="TestPlan.comments">add CookieManager.save.cookies=true to user.properties </stringProp>
<boolProp name="TestPlan.functional_mode">false</boolProp>
<boolProp name="TestPlan.serialize_threadgroups">true</boolProp>
<elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
<collectionProp name="Arguments.arguments">
<elementProp name="scheme" elementType="Argument">