Skip to content

Instantly share code, notes, and snippets.

View scmanjarrez's full-sized avatar
🧠
hungry mind

Sergio C scmanjarrez

🧠
hungry mind
  • Spanish National Research Council (CSIC)
  • Madrid
View GitHub Profile
@scmanjarrez
scmanjarrez / channel_swap.py
Created July 24, 2025 19:31
Channel swap plugin for gimp 3.x (Convert ZBP texture to be compatible with Blender)
#!/usr/bin/env python3
# Store this file in blender plug-ins directory, e.g. /xxx/GIMP/3.0/plug-ins/channel_swap
import sys
import gi
gi.require_version('Gimp', '3.0')
from gi.repository import Gimp
gi.require_version('GimpUi', '3.0')
@scmanjarrez
scmanjarrez / crawl.py
Created June 27, 2025 10:59
Script to gather games from epic game store using burp as proxy to bypass anti-bot measures
import json
import random
import time
import requests
HEADERS = {
"Cookie": "xxxx",
"X-XSRF-TOKEN": "xxxx",
"User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:139.0) Gecko/20100101 Firefox/139.0",
@scmanjarrez
scmanjarrez / interceptor.py
Created June 21, 2025 14:48
Small script to answer any query and dump headers/body of requests
#!/bin/env python3
import argparse
import http.server
import logging
import socketserver
class RequestHandler(http.server.BaseHTTPRequestHandler):
def _set_response(self):
@scmanjarrez
scmanjarrez / port.py
Created March 14, 2025 13:10
Small script to discover output ports open in a fw
import subprocess
from concurrent.futures import ThreadPoolExecutor
from concurrent.futures import wait
def tcp_scan(host):
ports = []
def check_port(port):
proc = subprocess.run(
@scmanjarrez
scmanjarrez / domain.py
Created February 21, 2025 22:11
Small patch for bloodhound-python ce to test resolved IP before choosing blindly
import ldap3
# Convert the hostname to an IP, this prevents ldap3 from doing it
# which doesn't use our custom nameservers
q = self.ad.dnsresolver.query(self.hostname, tcp=self.ad.dns_tcp)
for r in q:
try:
logging.info('Testing resolved hostname connectivity %s' % r.address)
_tmp_serv = ldap3.Server(r.address, connect_timeout=5)
_conn = ldap3.Connection(_tmp_serv)
@scmanjarrez
scmanjarrez / kali_as_router.sh
Last active September 2, 2024 21:31
Script to convert kali into a router for HTB.
#!/bin/env bash
# Route openvpn traffic. Thanks @ippsec!
# 192.168.15.0/24 is the subnet shared betwen my kali and windows box, modify accordingly.
sudo iptables -A FORWARD -i eth0 -o tun0 -j ACCEPT
sudo iptables -A FORWARD -i tun0 -o eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT
sudo iptables -t nat -A POSTROUTING -s 192.168.15.0/24 -o tun0 -j MASQUERADE
# windows
# 192.168.15.134 is the IP of my kali box
@scmanjarrez
scmanjarrez / nmap.sh
Last active August 20, 2024 19:15
Small to script do a first -sS scan and then a version scan based on the results
#!/bin/bash
if [ $# -ne 1 ]; then
echo "Missing IP. Usage: $0 <IP>"
exit
fi
out=$(sudo nmap -sS -Pn -n -T4 --min-parallelism 1000 --min-rate 5000 -p- $1)
syn=$(echo "$out" | awk '/PORT.*STATE.*SERVICE/,/Read data files/' | grep -v 'Read data files')
echo -e "Syn scan:\n$syn"
@scmanjarrez
scmanjarrez / kali_dark_xfce4.theme
Last active August 20, 2024 19:13
Kali-dark theme ported from qterminal
[Scheme]
Name=Kali
ColorForeground=#FFFFFF
ColorBackground=#23252E
ColorCursor=#FFFFFF # or any other preferred color
TabActivityColor=#EC0101 # you can choose a bright color
ColorPalette=#1F2229;#D41919;#5EBDAB;#FEA44C;#367BF0;#9755B3;#49AEE6;#E6E6E6;#198388;#EC0101;#47D4B9;#FF8A18;#277FFF;#962AC3;#05A1F7;#FFFFFF
ColorBold=#FFFFFF
ColorBoldUseDefault=FALSE
@scmanjarrez
scmanjarrez / kali_dark.yaml
Created June 16, 2024 19:13
Kali-dark theme ported from qterminal to Alacritty (yaml)
# 0x From the Kali-dark Qterminal color palette
colors:
# 0x Default colors
primary:
background: '0x23252e' # Converted from Background Color 35,37,46
foreground: '0xffffff' # Converted from Foreground Color 255,255,255
# 0x Colors the cursor will use if `custom_cursor_colors` is true
cursor:
text: '0xbbbbbb' # Assuming the same as given
@scmanjarrez
scmanjarrez / nmapBasic2Full.sh
Last active March 28, 2024 16:26
Small script to generate a list of ports to be scanned from the port detected by nmap
#!/bin/bash
declare -a tcp=()
declare -a udp=()
while IFS= read -r line; do
port=$(echo $line | awk '{print $4}')
[[ "$port" =~ "tcp" ]] && tcp+=("${port%%/*}") || udp+=("${port%%/*}")
done < "${1:-/dev/stdin}"
IFS=,
echo -n "-sS -p "
echo "${tcp[*]}"