Skip to content

Instantly share code, notes, and snippets.

View safebuffer's full-sized avatar
🎩
Going to release some tools soon ..

H*s*m safebuffer

🎩
Going to release some tools soon ..
View GitHub Profile
@safebuffer
safebuffer / decorator.py
Created September 22, 2019 13:26
IDOR protection Django
# -*- encoding: utf-8 -*-
from __future__ import unicode_literals
from functools import wraps
from django.core.exceptions import PermissionDenied
from django.core.exceptions import ObjectDoesNotExist
def door_safe(view=None,model=None):
def decorator(func):
@wraps(func)
def inner(request, *args, **kwargs):
@safebuffer
safebuffer / aslr_ck.sh
Created January 29, 2019 08:25
get libc address to check ASLR stuff
Filee=$1
getaddr(){
addr=`ldd $Filee | cut -d " " -f2 | head -n 1|tr -d "(|)" `
echo $addr
}
for i in {1..5}; do
if [ "$( getaddr )" == "$( getaddr )" ]; then
echo "[+] $( getaddr ) == $( getaddr ) "
echo "[+] ASLR disabled ! "
@safebuffer
safebuffer / diss_shellcode.py
Created January 6, 2019 13:46
disassemble shellcode with python
from capstone import *
shellcode_here = ""
def toop(code):
md = Cs(CS_ARCH_X86, CS_MODE_32)
for i in md.disasm(code, 0x1000):
print("0x%x:\t%s\t%s" %(i.address, i.mnemonic, i.op_str))
toop(shellcode_here)
@safebuffer
safebuffer / xml_json.py
Last active March 14, 2023 03:36
Nmap XML output to Json
import json,xmltodict
"""
Nmap XML Output to Json Output in Python
example : data = xml2json('nmap_output.xml')
"""
def xml2json(xml):
xmlfile = open(xml)
xml_content = xmlfile.read()
xmlfile.close()
xmljson = json.dumps(xmltodict.parse(xml_content), indent=4, sort_keys=True)