Skip to content

Instantly share code, notes, and snippets.

View plowsec's full-sized avatar

volodya plowsec

View GitHub Profile
@plowsec
plowsec / ida_decompile.py
Created May 16, 2024 08:25
Use IDA Pro and several threads to analyze all binaries in a folder, run a script on each one and then decompile them
import shutil
import subprocess
import tempfile
import traceback
import json
import os
import typing
import logging
import sys
import pathlib
@plowsec
plowsec / dllmain.cpp
Created April 27, 2024 12:53
PoC for Leaky InsomniHack 2024
#include <winsock2.h>
#define _WIN32_WINNT 0x0600
#include <windows.h>
#include <stdio.h>
#include <Psapi.h>
#include <tlhelp32.h>
#include <winternl.h>
#include <string.h>
#include <stdlib.h>
@plowsec
plowsec / bf_qr.py
Created April 27, 2024 12:42
PoC for Insomni'hack 2024 Puzzled
import tempfile

from pyzbar.pyzbar import decode
from PIL import Image
import random
from tqdm import tqdm

def unshuffle3x3GridImage(shuffled_image_path, output_path, seed):
# Initialize the random seed to match the shuffle
random.seed(seed)
@plowsec
plowsec / ror_cheatsheet.md
Created January 23, 2024 08:49
ruby on rails bug patterns

sql injection from string concatenation

.(delete_all|from|where|find_by)\s*\((?:"[^"]*#\{[^\}]+\}"|'[^']*#\{[^\}]+\}'|:\w+\s*=>\s*[^)]+)\)
@plowsec
plowsec / fix.md
Last active January 3, 2024 12:10
Fix for building tree-sitter-cpp on arm64

Github Actions workflow:

name: Build Tree-sitter Grammar

on:
  workflow_dispatch:

jobs:
  build:
@plowsec
plowsec / setup_vm.sh
Last active December 29, 2023 09:53
Setup Linux VMWare VM
sudo apt install open-vm-tools open-vm-tools-desktop
nohup /usr/bin/vmtoolsd -n vmusr &
vmhgfs-fuse .host:/SHARE_NAME /home/lol/share -o subtype=vmhgfs-fuse
# setup zsh with fish completion
sudo apt install curl zsh
chsh -s $(which zsh)
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
git clone https://github.com/zsh-users/zsh-autosuggestions ~/.zsh/zsh-autosuggestions
@plowsec
plowsec / java_cheatsheet.md
Created November 7, 2023 14:34
Interesting patterns to grep for in java code

SQL Injection

  • jdbcTemplate.query(
  • createStatement(
  • executeQuery(
  • executeUpdate(

Cross-Site Scripting (XSS)

  • .addAttribute(
  • Thymeleaf: ${}
  • JSP: <%= %>
@plowsec
plowsec / gist:868c401c54634a66ca5ec10b896d2483
Last active September 29, 2023 13:00
Useful bash oneliners

recursively download all files matching 2 extensions of a remote machine

rsyc -avz --include='*.pyc' --include='*.cgi' --include='*/' --exclude='*' xxx@xxx:/xxx/ SomeFolderThatWillBeCreatedByRsync

Decompile all pyc in a folder

(Or run a command on all files matching an extension, replacing the extension in the output file)

#!/bin/bash
set -x
set -e
echo "Don't forget to save the credentials that I will generate for you"
# Test to see if user is running with root privileges.
if [[ "${UID}" -ne 0 ]]
@plowsec
plowsec / reactjs_security_cheatsheet.md
Last active August 9, 2023 13:38
Examples of risky code patterns to look for in React-based applications (NextJS included)

Potential Vulnerabilities in Next.js Applications

XSS

1. Embedding Unsanitized Data in JavaScript

<script>
    let username = '{userInput}';
</script>