Skip to content

Instantly share code, notes, and snippets.

@kartikeyap
kartikeyap / audit.rules
Created May 4, 2020 08:20 — forked from Neo23x0/audit.rules
Linux Auditd Best Practice Configuration
# IMPORTANT!
# This gist has been transformed into a github repo
# You can find the most recent version there:
# https://github.com/Neo23x0/auditd
# ___ ___ __ __
# / | __ ______/ (_) /_____/ /
# / /| |/ / / / __ / / __/ __ /
# / ___ / /_/ / /_/ / / /_/ /_/ /
# /_/ |_\__,_/\__,_/_/\__/\__,_/
@kartikeyap
kartikeyap / kerberos_attacks_cheatsheet.md
Created August 28, 2019 08:17 — forked from TarlogicSecurity/kerberos_attacks_cheatsheet.md
A cheatsheet with commands that can be used to perform kerberos attacks

Kerberos cheatsheet

Bruteforcing

With kerbrute.py:

python kerbrute.py -domain <domain_name> -users <users_file> -passwords <passwords_file> -outputfile <output_file>

With Rubeus version with brute module:

@kartikeyap
kartikeyap / tmux.conf
Created June 6, 2019 10:49 — forked from markandrewj/tmux.conf
Basic Tmux Status Bar
# ----------------------
# Status Bar
# -----------------------
set-option -g status on # turn the status bar on
set -g status-utf8 on # set utf-8 for the status bar
set -g status-interval 5 # set update frequencey (default 15 seconds)
set -g status-justify centre # center window list for clarity
# set-option -g status-position top # position the status bar at top of screen
# visual notification of activity in other windows
@kartikeyap
kartikeyap / The Technical Interview Cheat Sheet.md
Created April 6, 2019 17:06 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
@kartikeyap
kartikeyap / validate_uuid4.py
Created September 6, 2018 10:00 — forked from ShawnMilo/validate_uuid4.py
Validating a uuid4 with Python.
from uuid import UUID
def validate_uuid4(uuid_string):
"""
Validate that a UUID string is in
fact a valid uuid4.
Happily, the uuid module does the actual
checking for us.
@kartikeyap
kartikeyap / Gopkg.toml
Created July 17, 2018 04:55 — forked from 0xdevalias/Gopkg.toml
Golang application state pattern boilerplate/reference code
[prune]
go-tests = true
unused-packages = true
[[constraint]]
name = "github.com/sirupsen/logrus"
version = "1.0.5"
[[constraint]]
name = "github.com/pkg/errors"
lsof -P -i tcp | awk '{print $2,$4,$9}' | tr -d 'u' | sort -u| grep -v PID | while read pid fd details; do curr_time="$(date +%s)"; birth_time="$(stat --printf "%Z" /proc/${pid}/fd/${fd})"; age=$((curr_time-birth_time)); if (( $age > 0)); then echo "${age} seconds /proc/${pid}/fd/${fd} ${details}" ; fi; done | sort -n -k1
@kartikeyap
kartikeyap / linux_connection_age
Created June 14, 2018 10:13
While conducting DFIR activities in linux environment, I often feel the need for pulling the connection list with an indication of how old that connection is. Following oneliner is a crude attempt at solving that.
lsof -P -i tcp | awk '{print $2,$4,$9}' | tr -d 'u' | sort -u| grep -v PID | while read pid fd details; do curr_time="$(date +%s)"; birth_time="$(stat --printf "%Z" /proc/${pid}/fd/${fd})"; age=$((curr_time-birth_time)); if (( $age > 0)); then echo "${age} seconds /proc/${pid}/fd/${fd} ${details}" ; fi; done | sort -n -k1
@kartikeyap
kartikeyap / README.md
Created November 25, 2017 12:57 — forked from aldur/README.md
OnePlusRoot

Root OnePlus5 without unlocking the bootloader

Gain adb root.

$ adb shell am start -n com.android.engineeringmode/.qualcomm.DiagEnabled --es "code" "angela"

Download Magisk-v14.0 and extract it somewhere. Download MagiskManager.

@kartikeyap
kartikeyap / py_uds_srv.py
Created November 19, 2017 12:06
Python Unix Domain Socket: Server
import socket
import sys
import os
import base64
def prep():
srv_sock = './srv_socket'
try:
os.unlink(srv_sock)
except: