Skip to content

Instantly share code, notes, and snippets.

View glides's full-sized avatar
🌮
Eating tacos...

glides

🌮
Eating tacos...
  • Glitchware, Inc.
  • Your EIP register
View GitHub Profile
@glides
glides / EtwStartWebClient.cs
Created April 6, 2024 19:28 — forked from klezVirus/EtwStartWebClient.cs
A PoC in C# to enable WebClient Programmatically
using System.Runtime.InteropServices;
using System;
/*
* Simple C# PoC to enable WebClient Service Programmatically
* Based on the C++ version from @tirannido (James Forshaw)
* Twitter: https://twitter.com/tiraniddo
* URL: https://www.tiraniddo.dev/2015/03/starting-webclient-service.html
*
* Compile with:
@glides
glides / Program.cs
Created January 26, 2021 18:35 — forked from tmarkovski/Program.cs
Generate elliptic curve SECP256K1 key pair using Bouncy Castle for .NET
using System;
using System.Linq;
using Org.BouncyCastle.Asn1.X9;
using Org.BouncyCastle.Crypto;
using Org.BouncyCastle.Crypto.Generators;
using Org.BouncyCastle.Crypto.Parameters;
using Org.BouncyCastle.Security;
namespace Program
{
@glides
glides / kerberos_attacks_cheatsheet.md
Created June 10, 2020 00:39 — forked from TarlogicSecurity/kerberos_attacks_cheatsheet.md
A cheatsheet with commands that can be used to perform kerberos attacks

Kerberos cheatsheet

Bruteforcing

With kerbrute.py:

python kerbrute.py -domain <domain_name> -users <users_file> -passwords <passwords_file> -outputfile <output_file>

With Rubeus version with brute module:

@glides
glides / Geo_IP_Audit_O365.ps1
Created February 4, 2020 09:14
Find all out of country logins Office 365 Unified Audit Log
########## Connect to o365 ##########
## Change $username and $pass to match your environment
## See: https://blogs.technet.microsoft.com/robcost/2008/05/01/powershell-tip-storing-and-using-password-credentials/ for how to create a cred file.
$username = "[email protected]"
$pass = gc "F:\PSScripts\Office365-PowershellCreds.txt" | convertto-securestring
$creds = New-Object -typename System.Management.Automation.PSCredential `
-argumentlist $username, $pass
$MESession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $Creds -Authentication Basic -AllowRedirection
Import-PSSession $MESession -AllowClobber
Connect-MsolService -Credential $creds
@glides
glides / o365_enable_user_logging.ps1
Last active May 4, 2021 19:01
Enabled logging for all o365 users.
## There are oneliners that try to enable logging for all users but in a large environment you will run into a data cap for the session - that is why this is split up using a foreach loop
$mailboxes = Get-Mailbox -ResultSize Unlimited -Filter {RecipientTypeDetails -eq "UserMailbox" -or RecipientTypeDetails -eq "SharedMailbox" -or RecipientTypeDetails -eq "RoomMailbox" -or RecipientTypeDetails -eq "DiscoveryMailbox"}
foreach($m in $mailboxes) {
Set-Mailbox $m.Identity.ToString() -AuditEnabled $true -AuditLogAgeLimit 180 -AuditOwner Create,HardDelete,MailboxLogin,Move,MoveToDeletedItems,SoftDelete,Update,UpdateFolderPermissions -AuditDelegate Create,HardDelete,Move,MoveToDeletedItems,SendAs,SendOnBehalf,SoftDelete,Update,UpdateFolderPermissions -AuditAdmin Copy,Create ,HardDelete ,Move,MoveToDeletedItems,SendAs,SendOnBehalf,SoftDelete,Update,UpdateFolderPermissions
Start-Sleep -Milliseconds 75
}
@glides
glides / decrypt.boo
Last active February 4, 2020 09:25
Decrypt AES-256 in Boo
# AES-256 with key decryption function Boo Lang
public static def decrypt(ciphertext as (byte), key as string) as (byte):
using aesAlg = Aes.Create():
salt = array(byte,[0x12,0x35,0x56,0x78,0x90,0xAB,0xAD,0xEF,0xDD,0x31])
rfc = Rfc2898DeriveBytes(key,salt)
aesAlg.Padding = PaddingMode.PKCS7
aesAlg.KeySize = 256
aesAlg.Key = rfc.GetBytes(32)
aesAlg.IV = rfc.GetBytes(16)
@glides
glides / encrypt.boo
Last active February 4, 2020 09:25
Encrypt AES-256 in Boo
# AES-256 with key encryption function Boo Lang
public static def encrypt(cleartext as (byte), key as string) as (byte):
using aesAlg = Aes.Create():
salt = array(byte,[0x12,0x35,0x56,0x78,0x90,0xAB,0xAD,0xEF,0xDD,0x31])
rfc = Rfc2898DeriveBytes(key,salt)
aesAlg.Padding = PaddingMode.PKCS7
aesAlg.KeySize = 256
aesAlg.Key = rfc.GetBytes(32)
aesAlg.IV = rfc.GetBytes(16)
@glides
glides / glider_network.py
Last active December 18, 2015 10:38
Python: Get network interfaces
def all_interfaces():
max_possible = 128
bytes = max_possible * 32
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
names = array.array('B', '\0' * bytes)
outbytes = struct.unpack('iL', fcntl.ioctl(s.fileno(), 0x8912, struct.pack('iL', bytes, names.buffer_info()[0])))[0]
namestr = names.tostring()
lst = []
for i in range(0, outbytes, 40):
name = namestr[i:i + 16].split('\0', 1)[0]