Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/python3
import xmltodict
import sys
import requests
import argparse
import re
from xml.parsers.expat import ExpatError
from requests.exceptions import Timeout, ConnectionError
from requests.packages.urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
@nopslider
nopslider / process.ps1
Created March 17, 2016 09:42
List all processes with path
Get-Process | Select-Object -Property Path | where {$_ -ne ""}
@nopslider
nopslider / search.ps1
Last active February 10, 2017 23:40
Find interesting stuff via PowerShell
# Powershell script designed to be run on Windows 7 workstations and above.
# Gets the following information which is useful in a pentest:
# * A list of domain users (useful for finding intersting comments
# * A list of shares in the domain (typically includes all Windows workstations/servers connected to the domain)
# * A list of ACLs for each share, in a nice HTML table that can be copy/pasted into Word
# * A list of files/directories in the root of each share
# * A full recursive directory listing of each share (useful for finding interesting file names)
# * A search for files containing specific strings. This often takes a long long time, hence is optional
@nopslider
nopslider / gist:2a35eda7864005670fef
Created September 30, 2015 15:56
Reset computer password in AD (Powershell cmd)
Reset-ComputerMachinePassword -Credential <DOMAIN>\<ADMINUSER>
#!/bin/bash
COLLECTIONDIR=~/collection/
USER=XXXX
PASS=YYYY
DOMAIN=ZZZZ
while read HOST
do
@nopslider
nopslider / auditAD.ps1
Created February 17, 2015 16:44
Find Privileged Accounts in an AD forest, showing accounts with old and non-expiring passwords
<#
This script will create a report of users that are members of the following
privileged groups:
- Enterprise Admins
- Schema Admins
- Domain Admins
- Cert Publishers
- Administrators
- Account Operators
- Server Operators
@nopslider
nopslider / modsec.rules
Created February 11, 2015 14:11
ModSec Rule Examples
# Redirect to a different page when a PHP file is uploaded
SecRule FILES "(?i)\.php$" "t:none,log,redirect:http://cyberis.co.uk,msg:'PHP file upload blocked',id:1"
# Deny when a semi-colon is found in the 'ip' parameter
SecRule ARGS:ip ";" "t:none,log,deny,msg:'semi colon test',id:2"
# Disable ModSecurity for a given page - NOTE THE ESCAPE OF THE '?'
SecRule REQUEST_URI "/joomla/index.php/component/users/\?task=registration.register" "allow,id:3"
@nopslider
nopslider / gist:c8db16d30339faaa12ac
Created December 10, 2014 15:19
Find users that haven't changed their password in the last year
Get-ADUser -Filter * -Properties * `
| where {($_.enabled -eq $true) -and ($_.lockedout -eq $false)} `
| where {$_.passwordlastset -lt (Get-Date).AddYears(-1)} `
| select SamAccountName, passwordlastset `
| sort passwordlastset
@nopslider
nopslider / gist:45575d43fdf96119ee7f
Created December 10, 2014 15:10
Find active user accounts with passwords that never expire
Get-ADUser -Filter * -Properties * `
| where {($_.enabled -eq $true) -and ($_.lockedout -eq $false)} `
| where {$_.passwordneverexpires -eq $true} `
| select SamAccountName
@nopslider
nopslider / gist:30b7b2589d1da49c5588
Created December 10, 2014 15:02
MBSA scan with different credentials
runas.exe /netonly /user:DOMAIN\username mbsa.exe