Skip to content

Instantly share code, notes, and snippets.

@NiceRath
NiceRath / iptables_tproxy_example.sh
Last active October 13, 2023 20:18
IPTables TPROXY - proxy input and output
#!/bin/bash
# target: squid-openssl 4.13 with listener "http_port 127.0.0.1:3129 tproxy"
# see also:
# https://docs.kernel.org/networking/tproxy.html
# https://blog.cloudflare.com/mmproxy-creative-way-of-preserving-client-ips-in-spectrum/
# https://latest.gost.run/en/tutorials/redirect/#forwarding-chain_1
# you might need to enable some iptables/nftables kernel modules:
@NiceRath
NiceRath / nftables_tproxy_example.nft
Last active March 19, 2024 02:55
NFTables TPROXY - proxy input and output
#!/usr/sbin/nft -f
# see also:
# https://wiki.nftables.org/wiki-nftables/index.php/Netfilter_hooks
# https://docs.kernel.org/networking/tproxy.html
# https://powerdns.org/tproxydoc/tproxy.md.html
# http://git.netfilter.org/nftables/commit/?id=2be1d52644cf77bb2634fb504a265da480c5e901
# http://wiki.squid-cache.org/Features/Tproxy4
# https://serverfault.com/questions/1052717/how-to-translate-ip-route-add-local-0-0-0-0-0-dev-lo-table-100-to-systemd-netw
# https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/net/netfilter/nft_tproxy.c
@D3Ext
D3Ext / amsi-bypass.md
Last active March 30, 2024 02:23
All methods to bypass AMSI (2022)

AMSI Bypass

To perform all this techniques you can simply try them by typing "Invoke-Mimikatz" into your powershell terminal, you'll notice that even if you haven't imported Mimikatz it will detect that as malicious. But if the AMSI is off or you avoid it, it just will say that "it's not recognized as the name of a cmdlet", so you could say that you've bypassed the AMSI

However some methods may be detected by the AV but most of them actually work without problem

Powershell downgrade

The first and worst way to bypass AMSI is downgrading powershell version to 2.0.

@tin-z
tin-z / roadmap_fuzzing.md
Created March 13, 2022 21:51
Roadmap to learn fuzzing

Roadmap to learn fuzzing


Index

1. Sanitizers
2. Intro-to-fuzzing
@n1snt
n1snt / Oh my ZSH with zsh-autosuggestions zsh-syntax-highlighting zsh-fast-syntax-highlighting and zsh-autocomplete.md
Last active May 19, 2024 14:16
Oh my ZSH with zsh-autosuggestions zsh-syntax-highlighting zsh-fast-syntax-highlighting and zsh-autocomplete.md

Oh my zsh.

Oh My Zsh

Install ZSH.

sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh

Install Oh my ZSH.

@djhohnstein
djhohnstein / _notes.md
Created March 12, 2020 02:34
AppDomainManager Injection

Let's turn Any .NET Application into an LOL Bin

We can do this by experimenting with .config files.

Many defenders catch/detect files that are renamed, they do this by matching Original Filename to Process Name

In this example, we don't have to rename anything. We simple coerce a trusted signed app to load our Assembly.

We do this by directing the application to read a config file we provide.

@insdavm
insdavm / WireGuard-site-to-site.md
Last active May 3, 2024 21:19
Accessing a subnet that is behind a WireGuard client using a site-to-site setup

WireGuard Site-to-Site

Accessing a subnet that is behind a WireGuard client using a site-to-site setup

Problem Summary

We want to access a local subnet remotely, but it is behind a NAT firewall and we can't setup port forwarding. Outgoing connections work, but all incoming connections get DROPPED by the ISP's routing policy.

Solution Summary

### hostapd configuration file, loosely based on http://pisarenko.net/blog/2015/02/01/beginners-guide-to-802-dot-11ac-setup/
### for Realtek RTL8812AU via driver https://github.com/abperiasamy/rtl8812AU_8821AU_linux
### and hostap 2.5
### Operates at 135 Mbps in 802.11n/ht mode. iperf measures ~8.00 MBytes/sec 67.1 Mbits/sec
### I was not able to get 802.11ac/vht mode with additional side-channels configured with the driver.
ctrl_interface=/var/run/hostapd
ctrl_interface_group=0
interface=wlan2
driver=nl80211
@robinsmidsrod
robinsmidsrod / pcap_remote.cmd
Last active February 14, 2021 08:50
Capture packets via remote tcpdump using SSH and display in local Wireshark client (Windows batch file)
@echo off
rem Figure out path to plink.exe
set putty_dir_key="HKLM\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\PuTTY_is1"
for /f "tokens=3*" %%x in ('reg query %putty_dir_key% /v "InstallLocation"') do set putty_dir=%%x %%y
if not defined putty_dir (
echo Please install PuTTY using Windows installer from http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
exit /b 1
)
set plink="%putty_dir%\plink.exe"