Skip to content

Instantly share code, notes, and snippets.

View blurayne's full-sized avatar

Markus Geiger blurayne

View GitHub Profile
@blurayne
blurayne / log4j_rce_detection.md
Created January 31, 2023 21:43 — forked from Neo23x0/log4j_rce_detection.md
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
@blurayne
blurayne / install-ssm-agent.sh
Last active July 5, 2022 19:03
AWS Helpers
#!/bin/bash
set -eEuo pipefail
ARCH="$(arch)"
PACKAGE_ARCH="${ARCH/x86_64/amd64}"
PACKAGE_ARCH="${PACKAGE_ARCH/aarch64/arm64}"
PACKAGE_URL=""
PACKAGE_FILE=""
@blurayne
blurayne / README.md
Last active March 26, 2021 13:59
Did CodeCentric censor me?

In response to: https://blog.codecentric.de/en/2021/03/github-actions-nextgen-cicd/

GitLab CI has templates you could use. Only bad thing is they did is they way they launch their job containers (defaulting to BASH/SH interpreter and preprocessing script section). This is a bit limiting in using custom containers for integration. But you can do as well.

GitHub actions do have their action params which make them nice for for validation, also they focused more on the API but I do see actions also as way of monetizing integration which is the cloud's OpenSource business model.

And here we are with Tekton or even AWS CodePipeline which could be more seen as CloudPipeline. The questions is how a CICD becomes cloud native? And one part of the answer is integration with Cloud and Services API. That's more about the paradigm shift of the "third" wave.

Also a simple CICD became now a build platform that integrate into the layers of the cloud, mainly orchestrators and solve the problems of how artifacts and data fl

@blurayne
blurayne / confluence.lua
Created March 18, 2021 13:57
Pandoc Converters
-- This is a sample custom writer for pandoc. It produces output
-- that is very similar to that of pandoc's HTML writer.
-- There is one new feature: code blocks marked with class 'dot'
-- are piped through graphviz and images are included in the HTML
-- output using 'data:' URLs.
--
-- Invoke with: pandoc -t sample.lua
--
-- Note: you need not have lua installed on your system to use this
-- custom writer. However, if you do have lua installed, you can
@blurayne
blurayne / ui-widget-select.sh
Last active December 17, 2024 18:22
Pure BASH interactive CLI/TUI menu (single and multi-select/checkboxes)
#!/bin/bash
##
# Pure BASH interactive CLI/TUI menu (single and multi-select/checkboxes)
#
# Author: Markus Geiger <mg@evolution515.net>
# Last revised 2019-09-11
#
# ATTENTION! TO BE REFACTORED! FIRST DRAFT!
#
@blurayne
blurayne / 1-README.md
Last active September 11, 2019 16:52
Variable types in BASH (typeof implementation)

Myth about associative arrays in BASH

To be clear: It's possible to pass associative arrays in BASH.

TL;DR you probably didn't RTFM so please njoy following session!

CODE

Pass an associative array the correct-BASH way

@blurayne
blurayne / ssh-copy-key
Last active July 1, 2022 23:01
ssh-copy-key
#!/bin/bash
# vim:tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab
# vim:syntax=sh
##
# ssh-copy-key - a better ssh-copy-id
#
# - have a different identify file to copy to remote host (and just one!)
# - (infrastructure where you don't own private key but wanna role out your private key –like it should be done ;)
# - automatically generates public key if not yet given
@blurayne
blurayne / snowflake-reconnaisance.md
Created June 7, 2019 11:43
Snowflake reconnaisance

Snowflake Reconnaissance

About

This page will assist you in retrieving important information from so called Snowflake Server which exist in your infrastructure unversioned and with unknown status. The basic idea is that system files in a modern system are under packages control, which enables us to do following:

  • verify files and look for changed and missing files and other diversions
  • identify files that do not belong to the system
  • enable you to do a proper backup of the important (changed) files only
  • and effectively transform a snowflake to become part of your fleet (IaC)
@blurayne
blurayne / cb.sh
Last active August 3, 2022 07:27
SSH Remote Forwarded Clipboard
##
# SSH Remote Forwarded Clipboard
#
# Advantages
# You can copy stuff on a remote machine to your local clipboard (e.g. you could use the script in a shell theme)
# It is not intended to do it the other way round (makes no sense since you usually will use your local clipboard)
#
# Security Concerns
# Someone else on the remote host could spam or exploit your clipboard exploit it (xsel, xclipbaord, parcellite etc.)
#
@blurayne
blurayne / ssh-aws-ec2-instance
Last active February 13, 2019 20:10
SSH to EC2 using peco and awless
#!/bin/bash
###
# SSH to AWS EC2 instances using peco and awless
#
# - Generate a cache of AWS instances
# - Open peco to select one or more server and either open ssh or tmux-css
# - Does not use `awless ssh` since prefererence on ‘security by obscurity’
#
# Dependencies