Skip to content

Instantly share code, notes, and snippets.

@kecs
kecs / gti.sh
Created March 19, 2013 18:57
For those who always misspell git.
alias gti='git'
@kecs
kecs / fabfile.py
Last active August 29, 2015 13:57
not so good fabfile, we can learn from it
from fabric.api import env, local, run, require, cd, sudo
import os
from fabric.context_managers import cd
env.project_name = 'weight'
def prod():
"Use the actual webserver"
@kecs
kecs / rockyou_stat.py
Created September 6, 2018 11:11
You have a password policy with special chars, you have rate limit, you want to know the most common special chars in passwords.
import re
from collections import defaultdict
d = defaultdict(int)
with open('/usr/share/wordlists/rockyou.txt', 'r') as f:
for l in f:
for c in re.findall('\W', l[:-1]):
d[c] += 1
@kecs
kecs / rockyou_subset_rules.py
Created March 4, 2019 19:29
Password policy says eg. pass must contain 3 chr set from 4
import re
rules = (
re.compile('[a-z]'),
re.compile('[A-Z]'),
re.compile('[1-9]'),
re.compile('[\!\+\-\@\.]'),
)
import os, re, sys
"""
Recursively traverse a php repo, add a line that logs fn calls.
Non overlapping matches!
Arg: output file full path
"""
OUTFILE = sys.argv[1]
import requests, time, os
"""
List all .php files in repo, send GET and POST to live url, print response if it is not 404
Start from repo root dir.
Args: base_url_to_live_server
"""
COOKIES = {'SESSID': '', 'PHPSESSID': ''}
import sys
"""
Recursively traverse a php repo,
add a line that logs fn calls.
Non overlapping matches.
cd into project root.
"""
@kecs
kecs / addJQery.js
Created November 1, 2019 13:44
Add jQuery to any page from console
script=document.createElement('script');document.head.appendChild(script);script.src='https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js';
@kecs
kecs / listLoadedScriptsFromConsole.js
Created November 10, 2019 11:39
List scripts loaded by page from console
for(i=0;i<document.scripts.length;i++)console.log(document.scripts[i].src)
@kecs
kecs / get_scripts.py
Created November 10, 2019 12:21
Download list of scripts loaded by site, greppable.
# pip install jsbeautifier requests
import os
import requests
from jsbeautifier import beautify
try:
os.mkdir('js')
except OSError:
pass