Skip to content

Instantly share code, notes, and snippets.

View hendrixjoseph's full-sized avatar

Joseph Hendrix hendrixjoseph

View GitHub Profile
@hendrixjoseph
hendrixjoseph / findPassword.js
Created June 24, 2022 14:10
WebGoat SQL Injection Lesson 5 Solution
let findNextLetter = async function(password) {
if(!password) {
password = ""
}
for (let letter = 'a'; letter <= 'z'; letter = String.fromCharCode(letter.charCodeAt(0)+1)) {
let newPassword = password + letter;
let response = await fetch("http://localhost:8080/WebGoat/SqlInjectionAdvanced/challenge", {
@hendrixjoseph
hendrixjoseph / LazyResponseBodyChecker.java
Last active May 25, 2022 17:02
Lazily Check the Body of an HttpServletResponse
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletOutputStream;
import javax.servlet.WriteListener;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServletResponseWrapper;
public class LazyResponseBodyChecker extends HttpServletResponseWrapper {
@hendrixjoseph
hendrixjoseph / LazyRequestBodyChecker.java
Last active May 25, 2022 17:04
Lazily Check the Body of an HttpServletRequest
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.StringReader;
import java.util.stream.Collectors;
import javax.servlet.ReadListener;
import javax.servlet.ServletInputStream;
import javax.servlet.http.HttpServletRequest;
alert("xss from a github gist!");
console.log("xss from a github gist!");
// ==UserScript==
// @name Ancestry.com/AncestryLibrary.com Switcheroo
// @namespace https://www.joehxblog.com/
// @version 0.1
// @description switch between Ancestry.com & AncestryLibary.com while maintaining URL structure
// @author JoeHx
// @match https://www.ancestry.com/*
// @match https://www.ancestrylibrary.com/*
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant none
package com.joehxblog;
import java.io.FileWriter;
import java.io.IOException;
import java.util.function.Consumer;
import org.jsoup.HttpStatusException;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.select.Elements;
@hendrixjoseph
hendrixjoseph / ArrayHolder.java
Created June 14, 2019 00:13
Turn a Stream of Arrays to Single Stream in Java
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class ArrayHolder {
public static void main(final String... args) {
// An array of objects that have an array as a field...
final ArrayHolder[] holders = {new ArrayHolder(), new ArrayHolder(), new ArrayHolder(), new ArrayHolder()};
@hendrixjoseph
hendrixjoseph / NoFollowDoFollowHoverHighlighter.js
Last active January 20, 2021 20:35
Tampermonkey / Greasemonkey Userscript To Easily Identify DoFollow and NoFollow Links
// ==UserScript==
// @name NoFollow / DoFollow Hover-Highlighter
// @namespace https://hendrixjoseph.github.io/
// @version 0.1
// @description To Easily Identify DoFollow and NoFollow Links
// @author JoeHx
// @match *://*/*
// @grant none
// ==/UserScript==