Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am 0xbadjuju on github.
  • I am 0xbadjuju (https://keybase.io/0xbadjuju) on keybase.
  • I have a public key whose fingerprint is 417C 6615 05AC 3D79 778E 61C8 FE58 C646 E956 BA05

To claim this, I am signing this object:

@0xbadjuju
0xbadjuju / swbemlocator.ps1
Created June 9, 2017 17:24
WbemScripting.SWbemLocator
$objWMILocator = new-object -com "WbemScripting.SWbemLocator"
$objWMIService = $objWMILocator.ConnectServer(".","root\cimv2")
$colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_Process")
foreach ($objItem in $colItems)
{
$objItem.GetObjectText_()
}
$objWMILocator = new-object -com "WbemScripting.SWbemLocator"
@0xbadjuju
0xbadjuju / KillETW.ps1
Created November 17, 2017 01:57 — forked from tandasat/KillETW.ps1
Disable ETW of the current PowerShell session
#
# This PowerShell command sets 0 to System.Management.Automation.Tracing.PSEtwLogProvider etwProvider.m_enabled
# which effectively disables Suspicious ScriptBlock Logging etc. Note that this command itself does not attempt
# to bypass Suspicious ScriptBlock Logging for readability.
#
[Reflection.Assembly]::LoadWithPartialName('System.Core').GetType('System.Diagnostics.Eventing.EventProvider').GetField('m_enabled','NonPublic,Instance').SetValue([Ref].Assembly.GetType('System.Management.Automation.Tracing.PSEtwLogProvider').GetField('etwProvider','NonPublic,Static').GetValue($null),0)
@0xbadjuju
0xbadjuju / Get-EmailsHunter.ps1
Last active December 12, 2017 17:27
Get-Emails
Function Get-EmailsHunter()
{
[CmdletBinding()]
Param(
[Parameter(Mandatory=$True, HelpMessage="Domain to harvest.")]
[String]$Domain,
[Parameter(Mandatory=$True, HelpMessage="https://hunter.io/api_keys")]
[string]$ApiKey
)
$offset=0;
$xml = [xml]Get-Content "nexpose_report.xml"
ForEach ($node in $xml.NexposeReport.nodes.node)
{
Write-Host $node.address "- SSLv3 and TLS v1.0 Enabled"
ForEach ($endpoint in $node.endpoints.endpoint)
{
Write-Host $node.address":"$endpoint.port
$xml = [xml]Get-Content "nexpose_report.xml"
ForEach ($node in $xml.NexposeReport.nodes.node)
{
Write-Host $node.address "- Weak Ciphers Supported"
ForEach ($endpoint in $node.endpoints.endpoint)
{
Write-Host $node.address":"$endpoint.port
$output = ForEach($test in $endpoint.services.service.tests.test)
$Win32Native = @"
using Microsoft.Win32;
using System;
using System.Runtime.InteropServices;
public class Kernel32
{
const UInt32 TOKEN_ASSIGN_PRIMARY = 0x0001;
const UInt32 TOKEN_DUPLICATE = 0x0002;
const UInt32 TOKEN_IMPERSONATE = 0x0004;
const UInt32 TOKEN_QUERY = 0x0008;
#!/bin/sh
#
# Encryption algorithms: DES, Triple-DES, AES/128, AES/192 and AES/256
ENCLIST="1 5 7/128 7/192 7/256"
# Hash algorithms: MD5 and SHA1
HASHLIST="1 2"
# Authentication methods: Pre-Shared Key, RSA Signatures, Hybrid Mode and XAUTH
AUTHLIST="1 3 64221 65001"
# Diffie-Hellman groups: 1, 2 and 5
GROUPLIST="1 2 5"
@0xbadjuju
0xbadjuju / Check-ServerStatus.ps1
Created August 21, 2018 15:20
Verify Apache Server-Status is Accessible
add-type @"
using System.Net;
using System.Security.Cryptography.X509Certificates;
public class TrustAllCertsPolicy : ICertificatePolicy {
public bool CheckValidationResult(
ServicePoint srvPoint, X509Certificate certificate,
WebRequest request, int certificateProblem) {
return true;
}
}
@0xbadjuju
0xbadjuju / Check-XssStatus
Created August 22, 2018 21:10
Check if a string exists in a response from a GET request
add-type @"
using System.Net;
using System.Security.Cryptography.X509Certificates;
public class TrustAllCertsPolicy : ICertificatePolicy {
public bool CheckValidationResult(
ServicePoint srvPoint, X509Certificate certificate,
WebRequest request, int certificateProblem) {
return true;
}