Skip to content

Instantly share code, notes, and snippets.

View olback's full-sized avatar
🦀
https://youtu.be/LDU_Txk06tM

Edwin olback

🦀
https://youtu.be/LDU_Txk06tM
View GitHub Profile
@gnremy
gnremy / CVE-2021-44228_IPs.csv
Last active April 26, 2023 07:01
CVE-2021-44228 Apache Log4j RCE Attempts Dec 20th 9:27PM ET
ip tag_name
162.155.56.106 Apache Log4j RCE Attempt
223.111.180.119 Apache Log4j RCE Attempt
213.142.150.93 Apache Log4j RCE Attempt
211.154.194.21 Apache Log4j RCE Attempt
210.6.176.90 Apache Log4j RCE Attempt
199.244.51.112 Apache Log4j RCE Attempt
199.101.171.39 Apache Log4j RCE Attempt
197.246.175.186 Apache Log4j RCE Attempt
196.196.150.38 Apache Log4j RCE Attempt
@Neo23x0
Neo23x0 / log4j_rce_detection.md
Last active January 28, 2024 08:19
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
@thingsiplay
thingsiplay / rscript
Last active December 1, 2021 15:12
Run Rust source code like a script
#!/bin/sh
# rscript: Rust script interpreter
# Shebang in rust.rscript: #!/usr/bin/env -S rscript 2018
# Directory where compiled binaries are saved to.
# Example: /var/tmp/rscript or /tmp
output_dir=/var/tmp/rscript
# -C panic=abort
# abort, unwind

ZSH CheatSheet

This is a cheat sheet for how to perform various actions to ZSH, which can be tricky to find on the web as the syntax is not intuitive and it is generally not very well-documented.

Strings

Description Syntax
Get the length of a string ${#VARNAME}
Get a single character ${VARNAME[index]}
@christhomas
christhomas / scr_to_gif.sh
Last active May 13, 2020 07:38
Easy script to convert a video into a GIF. Great for screen-recordings that can be shared in bug tickets
#!/usr/bin/env bash
self=$(basename $0)
[ "$1" = "help" ] && [ ! -f "$1" ] \
&& echo -e "scr_to_gif: v1.0" \
&& echo -e "usage: ${self} <filename.mov> <scale> <speed>\n" \
&& echo -e "scale: - Range 100-9999" \
&& echo -e " - A single number to denote the desired width, the height will be automatic. E.g: 300, 500, 640, 800, 1024, 1280, 1600" \
&& echo -e " - Also both dimensions with numbers within range. Separated by a colon. Example: 100:100, 512,512, 800:600" \
@lijikun
lijikun / dkms-kmod-auto-mok-signing.md
Last active April 26, 2024 18:50
Automatic Signing of DKMS-Generated Kernel Modules for Secure Boot

Automatic Signing of DKMS-Generated Kernel Modules for Secure Boot (Nvidia Driver on CentOS 8 as Example)

First I thank Nvidia for sponsoring the video card.

Secure Boot isn't exactly easy to configure to work with Linux and disabling it isn't really a good idea. Many modern Linux distributions provide the Microsoft-signed shim EFI binary to interpose between Secure Boot and the grub2 bootloader, making booting Linux easy enough if you only ever use kernels and drivers from the official repos. Still, enabling Secure Boot prevents the loading of kernel or modules without a proper digital signature. For example, the propriatary Nvidia GPU driver won't work, unless your distro really went to great lengths to distribute a signed version of the kernel module.

To make Secure Boot play nicely with the driver (i.e. to work at all), we can generate and import a Machine Owner Key (MOK)

@william8th
william8th / .tmux.conf
Last active April 21, 2024 02:07
Tmux open new pane in same directory
# Set the control character to Ctrl+Spacebar (instead of Ctrl+B)
set -g prefix C-space
unbind-key C-b
bind-key C-space send-prefix
# Set new panes to open in current directory
bind c new-window -c "#{pane_current_path}"
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
@zaxebo1
zaxebo1 / README.md
Created October 28, 2017 15:28
How to enable SecureBoot with own keys in KVM and on a laptop (T450s)

UEFI SecureBoot on ArchLinux

For KVM and Laptop

Rationale

I want full control what boots the computer to avoid the so called evil maid attack. That requires setting SecureBoot with only my own keys.

Intro

@belst
belst / rocketguide.md
Last active March 13, 2024 22:09
Deploy Rocket in production

Deploy Rocket using Letsencrypt and nginx

Information

This guide uses the domain your-domain.tld and its www. prefixed version. It starts the rocket application on 127.0.0.1:1337 and as the user www-data. The proxy listens on port 80 and 443 though.
If you need other values, update them accordingly in your nginx and systemd configs.

Prerequisites

You need to have nginx, certbot and rust installed.

@ThirdPartyNinjas
ThirdPartyNinjas / PiDay.cs
Last active March 12, 2018 20:52
Calculating Pi from random numbers
using System;
namespace PiDay
{
// The probability of two random numbers to be coprime is P = 6 / Pi^2
// So let's generate a bunch of random numbers. Figure out how often they're coprime.
// Use that percentage as our probabilty and solve for Pi.
// Pi = sqrt(6 / P)
// For more info, watch the video where I stole the idea: https://youtu.be/RZBhSi_PwHU