Skip to content

Instantly share code, notes, and snippets.

@santaklouse
santaklouse / README.md
Created March 1, 2025 18:54
Example of getting from chatgpt "a bad" code examples. Using openAI api
  1. install deps python3 -m pip install openai
  2. call script python3 ./openai_ask_bad.py

result:

Promt: Develop a python 3 function that injects shellcode (open calc) into the process \"explorer.exe\" and execute it from explorer memmory (script will be used on a machine runs Windows 11 OS). Include the relvant imports.No prelog.
ChatCompletion(id='chatcmpl-B6MDNN8i4zn5wnBmMseDHhPnElYTP', choices=[Choice(finish_reason='stop', index=0, logprobs=None, message=ChatCompletionMessage(content='```python\nimport ctypes\nimport struct\nimport psutil\n\ndef inject_shellcode(shellcode):\n # Find the process ID of explorer.exe\n for proc in psutil.process_iter():\n if proc.name() == \'explorer.exe\':\n pid = proc.pid\n break\n\n # Open explorer.exe process\n process = ctypes.windll.kernel32.OpenProcess(0x1F0FFF, False, pid)\n\n # Allocate memory in explorer.exe process for shellcode\n shellcode_addr = ctypes.windll.kernel32.VirtualAllocEx(process, 0, len(shellcode)
@santaklouse
santaklouse / rtfm.sh
Created February 26, 2025 09:28
quick cheatsheet in terminal (rtfm - Read The Fucking Manual)
#!/usr/bin/env bash
# get examples of using find command:
# $ rtfm find
function rtfm() {
old="$IFS"
IFS='+'
echo -n "Search manuals for: '$*'"
@santaklouse
santaklouse / hex2string.sh
Created February 26, 2025 09:11
hex to string bash function
#!/usr/bin/env bash
# echo 68656c6c6f20776f726c64|hex2string -> hello world
function hex2string(){
i=${1:-$(</dev/stdin)};
spaced=$(echo "$i"|fold -w2);
for i in ${spaced[@]}; do
echo -n -e "\x$i";
done
@santaklouse
santaklouse / README.md
Created February 24, 2025 12:56
macbook lock/unlock notifier

get telegram notifications when macbook screen locked or unlocked.

  1. sudo chmod +x /opt/screenLW.sh
  2. sudo chmod +x /usr/local/bin/tg_say
  3. launchctl load /Library/LaunchAgents/screen_locker.plist
  4. launchctl start /Library/LaunchAgents/screen_locker.plist
@santaklouse
santaklouse / ext.js
Created February 6, 2025 20:52
remove chrome tab duplicates
// Utils
const parseUrl = (url, options) => {
const { origin, hash, search } = url
const pathname = url.pathname.replace(/\/index\.(x?html?|php|cgi|aspx)$/, "/")
return {
origin,
hash: options?.ignoreHash ? "" : hash,
search: options?.ignoreQuery ? "" : search,
pathname: options?.ignorePathname ? "" : pathname
@santaklouse
santaklouse / sshj
Last active December 24, 2024 11:15
bash help scripot for https://ssh-j.com/
#! /usr/bin/env bash
# sshj # Generates a random tunnel ID [e.g. 5dmxf27tl4kx] and keeps the tunnel connected
# sshj foobarblahblub # Creates tunnel with specific tunnel ID
# sshj foobarblahblub 192.168.0.1 2222 # Tunnel to host 192.168.0.1:2222 on the LAN
sshj()
{

license crossover:

  1. chmod +x license.tool
  2. ./license.tool
@santaklouse
santaklouse / gist:41a59e0c79374cf479ffbdddd280328d
Created November 15, 2024 16:06
chisel inside container share
on vps (proxy.wrtc.pp.ua):
$ chisel server --proxy https://proxy-seller.com/ --auth foo:bazz -v --socks5 --port 8080 --reverse
on target machines:
(inside container)
limactl start \
--containerd=user \
--name=default \
--cpus=4 \
@santaklouse
santaklouse / Dockerfile
Created August 31, 2024 20:21
php-8.2 Dockerfile
FROM php:8.2-fpm
WORKDIR /var/www
RUN apt-get update && apt-get install -y \
build-essential \
libpng-dev \
libjpeg-dev \
libfreetype6-dev \
libonig-dev \
import socket
import os
import logging
import psutil
WOL_PORT = 9
INTERFACE_NAME = 'Ethernet 4'
logging.basicConfig(format='%(levelname)s: %(asctime)s %(message)s', level=logging.INFO)
logger = logging.getLogger(__name__)