Skip to content

Instantly share code, notes, and snippets.

@Neo23x0
Neo23x0 / log4j_rce_detection.md
Last active October 4, 2025 08:06
Log4j RCE CVE-2021-44228 Exploitation Detection

log4j RCE Exploitation Detection

You can use these commands and rules to search for exploitation attempts against log4j RCE vulnerability CVE-2021-44228

Grep / Zgrep

This command searches for exploitation attempts in uncompressed files in folder /var/log and all sub folders

sudo egrep -I -i -r '\$(\{|%7B)jndi:(ldap[s]?|rmi|dns|nis|iiop|corba|nds|http):/[^\n]+' /var/log
@psct
psct / dockersetup.yml
Created February 26, 2021 16:44
Debian add docker repository and gpg key and install docker-ce (just for amd64)
---
- name: set up docker & compose
hosts: docker
become: yes
tasks:
- name: update package index
apt:
name: "*"
state: latest
@psct
psct / hostname.yml
Created February 26, 2021 16:41
Debian set hostname and adjust /etc/hosts
---
- name: set name, adjust /etc/hosts
hosts: all
become: yes
# order matters!
tasks:
- name: adjust /etc/hosts
replace:
path: /etc/hosts
@psct
psct / myroot.yml
Created February 26, 2021 16:38
Add ssh key for root access and disable PasswordAuthentication
---
- name: add ssh, deploy root key
hosts: all
become: yes
tasks:
- name: disable password authentication
lineinfile:
path: /etc/ssh/sshd_config
regexp: '^PasswordAuthentication'
@psct
psct / debansstrap.sh
Created February 26, 2021 16:33
Prepare fresh Debian for ansible management by created user "ansible" in sudoers (needs public ssh-Key in PUBKEY)
#!/bin/bash
# enable host for ansible
set -e
PUBKEY=""
id -u ansible > /dev/null 2>&1 || \
adduser ansible --disabled-password \
--gecos "" --quiet
mkdir -p /home/ansible/.ssh
echo "$PUBKEY" \
> /home/ansible/.ssh/authorized_keys
# pretty sudo prompt
read -r -d '' SUDOPROMPT << EOM
πŸŒΊπŸŒ³πŸŒΈπŸŒ·πŸŒ·πŸŒΈπŸŒ»πŸŒ·πŸŒ·πŸŒΈπŸŒΈπŸŒΈπŸŒΈπŸŒ·πŸŒΌπŸŒ·πŸŒ³πŸŒΊπŸŒΌπŸŒΊπŸŒΈπŸŒ»πŸŒΌπŸŒΌπŸŒ³πŸŒ³πŸŒΌπŸŒΊπŸŒ»πŸŒ·πŸ›πŸŒ·πŸŒΌπŸŒ»πŸŒ³πŸŒΈπŸŒ·πŸŒ·πŸŒ»πŸŒΈ
πŸŒΈπŸ¦‰πŸŒ»πŸŒΈπŸŒ³πŸŒ·πŸŒΈπŸŒ·πŸŒΈπŸŒ³πŸŒΈπŸŒ»πŸŒ³πŸŒπŸŒ»πŸŒ·πŸŒ·πŸŒΌπŸŒ»πŸŒΊπŸŒΊπŸŒ»πŸŒΌπŸŒ»πŸŒ»πŸŒΌπŸŒΊπŸŒ»πŸŒ³πŸŒΌπŸŒ³πŸŒΊπŸŒ³πŸŒ·πŸŒ»πŸŒΌπŸŒ·πŸŒΌπŸŒ»πŸŒΈ
🌳🌸🌻🌺🌻🌳🌺🌺🌻🌺🌸🌻🌷🌷🌼🌻🌺🌼🌻🌻🌷🌳🌻🌸🌳🌷🌻🌳🌳🌳🌳🌼🌳🌳🌺🌷🌳🌺🌳🌺
πŸ¦‰πŸŒΈπŸŒ»πŸŒΊπŸŒΊπŸŒ³πŸŒΈπŸŒΈπŸŒΌπŸŒ»πŸŒΊπŸŒΌπŸŒ·πŸŒΈπŸŒ³πŸŒΌπŸŒΊπŸŒΈπŸŒΊπŸŒ·πŸŒ»πŸŒ·πŸŒΊπŸŒΊπŸŒ³πŸŒ·πŸŒ·πŸ°πŸŒΈπŸŒ»πŸŒ³πŸŒΈπŸŒΌπŸŒ·πŸŒΌπŸŒ³πŸŒ·πŸΉπŸŒΌπŸŒΊ
🌷🌳🌻🌸🌸🌼🐰🌷🌺🌷🌺🌻🌷🌸🌺🌻🌳🌻🌷🌻🌻🌺🌸🌸🌺🌻🌸🌻🌳🌳🌻🐦🌻🌼🌼🌻🌻🌺🌳🐰
πŸŒΌπŸ¦πŸŒ»πŸŒ³πŸŒΈπŸŒΈπŸŒ³πŸŒ·πŸŒΊπŸŒΌπŸŒ³πŸŒ·πŸŒΈπŸŒ»πŸŒΌπŸŒ»πŸ›πŸŒ»πŸŒΌπŸŒ·πŸŒΊπŸŒΌπŸŒΊπŸŒΈπŸŒΊπŸ¦”πŸŒ·πŸŒΈπŸŒ·πŸŒ»πŸŒ»πŸŒΊπŸŒΌπŸŒ·πŸŒπŸŒΈπŸŒ·πŸŒΌπŸŒΈπŸΉ
🌸🌳🌻🌼🌻🌳🌸🌷🌺🌷🌷🌼🌻🌷🌻🌺🌼🌼🌳🌸🌻🌻🌸🌼🌼🌸🌳🌺🌻🌻🌳🌺🌷🐰🌻🌼🐹🌷🌷🌳
🌼🌷🌻🌸🌼🌳🌻🌻🌳🌷🌼🌻🌺🌺🌺🌺🌺🌳🌻🌼🌷🌸🌸🌻🌺🌻🌳🌸🌷🌺🌺🌼🌸🌺🌻🌻🌷🌸🌻🌷
@matchilling
matchilling / PageSerializer.kt
Last active December 13, 2023 13:50
REST Pagination in Spring with Link header
package com.matchilling.api.rest.data
import com.fasterxml.jackson.core.JsonGenerator
import com.fasterxml.jackson.databind.JsonSerializer
import com.fasterxml.jackson.databind.SerializerProvider
import org.springframework.boot.jackson.JsonComponent
import org.springframework.data.domain.PageImpl
import java.io.IOException
@JsonComponent
@Andor
Andor / .gitlab-ci.yml
Last active February 28, 2023 15:03
terraform .gitlab-ci.yml
---
variables:
terraform_image: terraform-vault-jq
default:
image:
name: $terraform_image
cache:
key: terraform
paths:
@bgauduch
bgauduch / multiple-repository-and-identities-git-configuration.md
Last active October 11, 2025 08:26
Git config with multiple identities and multiple repositories

Setup multiple git identities & git user informations

/!\ Be very carrefull in your setup : any misconfiguration make all the git config to fail silently ! Go trought this guide step by step and it should be fine πŸ˜‰

Setup multiple git ssh identities for git

  • Generate your SSH keys as per your git provider documentation.
  • Add each public SSH keys to your git providers acounts.
  • In your ~/.ssh/config, set each ssh key for each repository as in this exemple:
@haircut
haircut / Install PIP to user site on macOS.md
Created August 29, 2017 21:50
How to install and use pip without sudo or admin on macOS

Install and use pip on macOS without sudo / admin access

Most recently tested on macOS Sierra (10.12.6)

  1. Download the installation script; curl https://bootstrap.pypa.io/get-pip.py -o ~/Downloads/get-pip.py
  2. Run the installation, appending the --user flag; python ~/Downloads/get-pip.py --user. pip will be installed to ~/Library/Python/2.7/bin/pip
  3. Make sure ~/Library/Python/2.7/bin is in your $PATH. For bash users, edit the PATH= line in ~/.bashrc to append the local Python path; ie. PATH=$PATH:~/Library/Python/2.7/bin. Apply the changes, source ~/.bashrc.
  4. Use pip! Remember to append --user when installing modules; ie. pip install <package_name> --user

Note