Skip to content

Instantly share code, notes, and snippets.

@dmknght
dmknght / webmap.py
Last active October 18, 2019 22:10
Map Broken Access Control web page to local directory to exploit it easier
#!/usr/bin/env python3
import sys, re, requests
from urllib.parse import urljoin
if len(sys.argv) == 1:
print("Give me URL")
sys.exit(1)
else:
url = sys.argv[1]
@dmknght
dmknght / yara_section_scan.md
Last active September 29, 2021 01:36
Defeat metasploit's binaries with yara and section scan

I. Tool used

II. Must know

1. Staged and stageless payloads

@dmknght
dmknght / pasre_hashes.nim
Last active August 18, 2021 00:02
Quick and ugly script to parse section hashes from rizin's rz-bin and get same hashes
import json
import osproc
import os
import strutils
import sequtils
const
whitelisted_hashes_db_name = "whitelisted_hashes"
@dmknght
dmknght / yara_section_scan_2.md
Last active August 18, 2021 00:59
Real world challenge with Mirai and its variants
@dmknght
dmknght / shellcode_excutor_detection_and_bypass.md
Last active October 11, 2021 11:04
shellcode_excutor_detection_and_bypass.md

I. Info

  • Analysis shellcode execution (excutor?) samples and try to create effectives rules to detect them
  • Understand the method and bypass Before we start:
  1. Backend knowledge
  1. Tools:
  • Rizin and Rizin cutter
@dmknght
dmknght / pkgbuild.sh
Last active October 24, 2021 17:01
Quick script to build debianized pkg
#!/bin/bash
# Quick pkg build scripts to handle automation build
# Depends: gbp-buildpackage (gbp)
# Depends: dpkg-dev (dpkg-source)
# Depends: devscripts (mk-build-deps, debuild)
# Depends: apt, grep, cut
function apt_install_deps() {
@dmknght
dmknght / parrotos_on_hackerhouse.md
Last active October 25, 2021 18:35
Note of using tools on ParrotOS with hackerHouse labs. This is the result of testing pentest tools quality

I. OSINT

1. recon-ng

  • [recon-ng][default] > workspaces create hackerhouse
  • Error: [*] No modules enabled/installed.

2. The harvester

$theHarvester -d parrotsec.org -b google
@dmknght
dmknght / clamav_yara.md
Last active October 30, 2021 01:20
Try to make ClamAV engine uses Yara pattern matching engine

C code. Compile gcc <filename>.c -o run -lclamav -lyara Problems:

  1. Scanner sometime doesn't run. Possibly threading problem of scan engine
  2. Zip file interrupts when first file is matched as malware. It is possibly to bypass other files in archive file. We can solve it by change CL_VIRUS to CL_CLEAN in scan callback.
  3. No method to get file_path (full file path) yet
#include "clamav.h"
#include "yara.h"
#include <stdio.h>
#include <unistd.h>
@dmknght
dmknght / metasploit_config
Last active November 1, 2021 02:07
Config for Metasploit_Prompt on parrot
path `~/.msf4/config`
Variables: `Prompt`, `PromptChar`, `MeterpreterPrompt`
Config
```
[framework/core]
Prompt=[%grnmsf%clr][%bld%yelJobs%clr:%whi%J%clr][%bld%cyaAgents%clr:%whi%S%clr]
PromptChar=%yel$%clr
MeterpreterPrompt=[ID:%S][%M][%H_%A][%U](%D)
```
- Jobs %J: How many jobs are running in background
@dmknght
dmknght / sublimetext_3211_crack.py
Created November 7, 2021 13:05
A short python script (no functions at all) to patch lincense check for sublime_text build 3211 Linux x64
import os
#sublime_binary_path = "/opt/sublime_text/sublime_text_b3211"
sublime_binary_path = "/tmp/sublime_text_3211/sublime_text"
version_magic_string = "/updates/3/stable/updatecheck?version=3211&platform=linux&arch=x64"
sz_magic_string = 66
#version_magic_string_offset = 0x00209ee0 # Offset from disassembler
version_magic_string_offset = 0x00009ee0 # (Real offset from xxd)