Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Thomas Darimont thomasdarimont

🏠
Working from home
Block or report user

Report or block thomasdarimont

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@thomasdarimont
thomasdarimont / App.java
Created Jun 20, 2019
Simple example for using custom mime-types with fixed request mappings in Spring REST MVC
View App.java
package demo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@SpringBootApplication
public class App {
@thomasdarimont
thomasdarimont / readme.md
Created May 3, 2019
Generate random data with openssl
View readme.md
openssl rand -hex 128
@thomasdarimont
thomasdarimont / readme.md
Created Apr 26, 2019
JQ Filter & Update Objects
View readme.md
json=$(cat << EOF
{
    "id":"test1234",
    "components": [
        {
            "id":"c1",
            "type":"foo",
            "bubu":1,
            "secret":"****"
@thomasdarimont
thomasdarimont / readme.md
Last active Mar 13, 2019
Example SAML Request Message
View readme.md
<?xml version="1.0" encoding="UTF-8"?>
<saml2p:AuthnRequest xmlns:saml2p="urn:oasis:names:tc:SAML:2.0:protocol" 
                     AssertionConsumerServiceURL="http://localhost:8080/saml/SSO"
                     Destination="http://localhost:8081/auth/realms/demo/protocol/saml" 
                     ForceAuthn="false" 
                     ID="a3j4ga3bjjh4i3ff5c3900ge0ice53i" 
                     IsPassive="false" 
                     IssueInstant="2019-02-24T14:09:32.018Z" 
                     ProtocolBinding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Version="2.0">
@thomasdarimont
thomasdarimont / readme.md
Last active Mar 4, 2019
How to send file contents with whois via network if netcat is not available...
View readme.md

Source-Host

whois -h $(hostname -i) -p 4444 `cat /etc/hosts | base64` 

Target-Host

nc -ln 4444
@thomasdarimont
thomasdarimont / readme.md
Last active Mar 13, 2019
SAML Response example
View readme.md

SAML Response1

<samlp:Response Destination="http://localhost:20005/saml/SSO"
    ID="ID_55bd7886-5258-4111-b9a9-6cca1e2ecf3f" InResponseTo="a1e14i88dh8h56ei32ab6g87ej12heg"
    IssueInstant="2019-02-28T18:04:11.250Z" Version="2.0"
    xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion"
    xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol">
    <saml:Issuer>http://localhost:8080/auth/realms/samldemo</saml:Issuer>
    <dsig:Signature xmlns:dsig="http://www.w3.org/2000/09/xmldsig#">
        <dsig:SignedInfo><dsig:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/><dsig:SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"/>
@thomasdarimont
thomasdarimont / readme.md
Created Feb 23, 2019
Javascript Cookie-Management
View readme.md

Set cookie

document.cookie="test=bubu";

Check for cookie

(document.cookie.match(new RegExp('(^| )' + "test" + '=([^;]+)'))|| ["not found"])[0]
@thomasdarimont
thomasdarimont / readme.md
Created Feb 23, 2019
Build Keycloak Gatekeeper for Windows, Linux and OSX
View readme.md

Build keycloak-gatekeeper

Get the code

git clone https://github.com/keycloak/keycloak-gatekeeper

or 

go get -u github.com/keycloak/keycloak-gatekeeper
@thomasdarimont
thomasdarimont / readme.md
Created Jan 29, 2019
Keycloak local realm config
View readme.md
org.keycloak.testsuite.KeycloakServer
-Dkeycloak.bind.address=0.0.0.0
-Djava.net.preferIPv4Stack=true
-Dkeycloak.connectionsJpa.url=jdbc:postgresql://localhost:5432/keycloak_4_x_master
-Dkeycloak.connectionsJpa.driver=org.postgresql.Driver
-Dkeycloak.connectionsJpa.driverDialect=org.hibernate.dialect.PostgreSQLDialect
@thomasdarimont
thomasdarimont / docker-compose.yml
Created Jan 25, 2019
Docker OpenLDAP + phpldapadmin example
View docker-compose.yml
version: '2'
services:
openldap:
image: osixia/openldap:1.2.3
container_name: openldap
environment:
LDAP_LOG_LEVEL: "256"
LDAP_ORGANISATION: "Example Inc."
LDAP_DOMAIN: "example.org"
LDAP_BASE_DN: ""
You can’t perform that action at this time.