Skip to content

Instantly share code, notes, and snippets.

@neoKushan
neoKushan / Remove-JndiLookup.ps1
Last active December 17, 2021 17:36
Apache Log4j2 Remote Code Execution (RCE) Vulnerability - CVE-2021-44228 - ESA-2021-31 emergency patch script for Windows
#
# I wrote this powershell script because the example command given only works on Linux.
# Aside from some prompts to make it a bit more user friendly, it should be functionally equivelant to this:
#
# `zip -q -d log4j-core-*.jar org/apache/logging/log4j/core/lookup/JndiLookup`
#
# To run it, ensure your execution policy is set correctly, paste the file anywhere you want it to check for
# log4j (This will check subfolders) and just call Remove-JndiLookup from your favourite powershell window.
#
# Note that the script isn't especially clever, running it on your machine doesn't guarantee that you're no longer
@neoKushan
neoKushan / .editorconfig
Created August 20, 2019 09:31
Editorconfig that's basically Microsoft/Dotnet defined but instead of this., we use _ for private readonly fields
# Version: 1.3.1 (Using https://semver.org/)
# Updated: 2019-08-04
# See https://github.com/RehanSaeed/EditorConfig/releases for release notes.
# See https://github.com/RehanSaeed/EditorConfig for updates to this file.
# See http://EditorConfig.org for more information about .editorconfig files.
##########################################
# Common Settings
##########################################
@neoKushan
neoKushan / BCryptExtensions.cs
Created December 18, 2018 14:12
Extension method to get work factor from a bcrypt hash string
public static class BCryptExtensions
{
private static int MINIMUM_HASH_LENGTH = 6;
private static int WORKFACTOR_START_INDEX = 4;
private static int WORKFACTOR_LENGTH = 2;
public static int GetWorkFactor(this string hash)
{
if(hash.Length < MINIMUM_HASH_LENGTH)
{
@neoKushan
neoKushan / AuthyToOtherAuthenticator.md
Created November 15, 2018 19:59 — forked from gboudreau/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy

Generating Authy passwords on other authenticators


There is an increasing count of applications which use Authy for two-factor authentication. However many users who aren't using Authy, have their own authenticator setup up already and do not wish to use two applications for generating passwords.

Since I use 1Password for all of my password storing/generating needs, I was looking for a solution to use Authy passwords on that. I couldn't find any completely working solutions, however I stumbled upon a gist by Brian Hartvigsen. His post had a neat code with it to generate QR codes (beware, through Google) for you to use on your favorite authenticator.

His method is to extract the secret keys using Authy's Google Chrome app via Developer Tools. If this was not possible, I guess people would be reverse engineering the Android app or something like that. But when I tried that code, nothing appeared on the screen. My gues