Skip to content

Instantly share code, notes, and snippets.

View anonyco's full-sized avatar
🐕
I really like dogs. They are so fun to play with, simple to care for, and cute.

Jack anonyco

🐕
I really like dogs. They are so fun to play with, simple to care for, and cute.
  • United States
View GitHub Profile
@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
@anonyco
anonyco / Undo And Redo Mutation Observer Records.js
Last active August 10, 2021 20:00
This sample code snippet demonstrates how to undo and redo a MutationRecord observed by a MutationObserver
//(function(){"use strict";
var Object_freeze = Object.freeze;
/**
* @param {!Array<MutationRecord>} mutationRecords
* @return {undefined}
*/
function redoMutations(undidMutations) {
if (undidMutations) for (var i=undidMutations.length|0, record, type, target, addedNodes, removedNodes, nextSibling, value; i; ) {
@liach
liach / Debate
Created August 24, 2019 03:36
Refute against forge discord's forgevsfabric trick
Minecraft Forge and FabricMC both have similar infrastructures: mod loaders, mod api, gradle build tools, deobuscation tools.
Mod loader: supposed to just load mods in Minecraft and deobfuscate the game.
Mod API: Offer events, loaders, hooks (e.g. model loading systems, config systems, standard energy API)
Gradle build tool: The gradle plugin that is used to build mods
Deobfuscation tool: Converts obfuscated Minecraft to deobfuscated ones so that modders can understand what they are modding
Minecraft Forge:
- Mod loader: Forge (more exactly, fmllauncher source set since 1.13, previously FML)
- Mod API: Forge (previously Forge and part of FML)
@ppoffice
ppoffice / build.sh
Last active March 14, 2023 23:44
Minimal Linux Build Script
#!/bin/sh
# Modified from ivandavidov/minimal-linux-script
# https://github.com/ivandavidov/minimal-linux-script
# This script includes a dynamic linked busybox, openssl, python and
# network support
set -ex
KERNEL_VERSION=4.17.2
BUSYBOX_VERSION=1.28.4
root@Socat-TLS-Client:~/tls13_new/socat-1.7.3.2# diff -uNp sslcls.c.orig sslcls.c
--- sslcls.c.orig 2018-03-17 10:47:30.239634794 -0400
+++ sslcls.c 2018-03-17 04:40:53.144981137 -0400
@@ -147,6 +147,26 @@ const SSL_METHOD *sycTLSv1_2_server_meth
}
#endif
+#if HAVE_TLSv1_3_client_method
+const SSL_METHOD *sycTLSv1_3_client_method(void) {
+ const SSL_METHOD *result;
@fodra
fodra / javascript-encoding-types.md
Created November 15, 2017 23:45
This is a list of possible encoding type values for everything node/javascript.

Javascript encoding type values

The character encodings currently supported by Node.js include:

  • 'ascii' - For 7-bit ASCII data only. This encoding is fast and will strip the high bit if set.

  • 'utf8' - Multibyte encoded Unicode characters. Many web pages and other document formats use UTF-8.

  • 'utf16le' - 2 or 4 bytes, little-endian encoded Unicode characters. Surrogate pairs (U+10000 to U+10FFFF) are supported.

@FZX
FZX / Commands
Last active December 29, 2022 16:38
Terminal commands. Change Cinnamon theme from terminal. Disable cursor blink from terminal. Disabling recent files history from terminal. Setup proxy file with command.
gsettings set org.cinnamon.desktop.privacy remember-recent-files false
gsettings set org.cinnamon.theme name "Mint-Y-Dark"
gsettings set org.cinnamon.desktop.interface gtk-theme "Mint-Y-Dark"
gsettings set org.cinnamon.desktop.wm.preferences theme "Mint-Y-Dark"
gsettings set org.cinnamon.desktop.interface cursor-blink false
gsettings set org.gnome.system.proxy autoconfig-url "http://mediahint.com/default.pac"
gsettings set org.gnome.system.proxy mode auto
gsettings set org.cinnamon enabled-applets "['panel1:left:0:menu@cinnamon.org:0', 'panel1:left:2:panel-launchers@cinnamon.org:2', 'panel1:left:3:window-list@cinnamon.org:3', 'panel1:right:0:notifications@cinnamon.org:4', 'panel1:right:1:user@cinnamon.org:5', 'panel1:right:2:removable-drives@cinnamon.org:6', 'panel1:right:3:keyboard@cinnamon.org:7', 'panel1:right:11:show-desktop@cinnamon.org:1', 'panel1:right:5:network@cinnamon.org:9', 'panel1:right:6:sound@cinnamon.org:10', 'panel1:right:7:power@cinnamon.org:11', 'panel1:right:8:systray@cinnamon.org:12', '
@tsaarni
tsaarni / openssl-notes.txt
Created October 22, 2016 08:50
Generate self-signed certs with different key types
*** RSA
# Generate self-signed certificate with RSA 4096 key-pair
openssl req -x509 -nodes -days 3650 -newkey rsa:4096 -keyout rsakey.pem -out rsacert.pem
# print private and public key
openssl rsa -in rsakey.pem -text -noout
# print certificate
openssl x509 -in rsacert.pem -text -noout
@JavaScript-Packer
JavaScript-Packer / lzw.jz
Created January 9, 2016 23:28
JavaScript LZW Compression (encode and decode functions). Lempel–Ziv–Welch (LZW) is a universal lossless data compression algorithm created by Abraham Lempel, Jacob Ziv, and Terry Welch. It was published by Welch in 1984 as an improved implementation of the LZ78 algorithm published by Lempel and Ziv in 1978. The algorithm is simple to implement,…
function en(c) {
var x = "charCodeAt", b, e = {}, f = c.split(""), d = [], a = f[0], g = 256;
for (b = 1; b < f.length; b++) c = f[b], null != e[a + c] ? a += c :(d.push(1 < a.length ? e[a] :a[x](0)),
e[a + c] = g, g++, a = c);
d.push(1 < a.length ? e[a] :a[x](0));
for (b = 0; b < d.length; b++) d[b] = String.fromCharCode(d[b]);
return d.join("");
}
function de(b) {
@Redchards
Redchards / Platform.hxx
Created November 28, 2015 08:23
Simple definition file to ease multi-platform compilation in C++
#ifndef PLATFORM
#define PLATFORM
#define GCC_COMPILER 1
#define MVSC_COMPILER 2
#define ICC_COMPILER 3
#define BORLAND_COMPILER 4
#define LINUX 1
#define WINDOWS 2