This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add-Type -TypeDefinition @' | |
using System.Runtime.InteropServices; | |
[Guid("5CDF2C82-841E-4546-9722-0CF74078229A"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] | |
interface IAudioEndpointVolume | |
{ | |
// f(), g(), ... are unused COM method slots. Define these if you care | |
int f(); int g(); int h(); int i(); | |
int SetMasterVolumeLevelScalar(float fLevel, System.Guid pguidEventContext); | |
int j(); | |
int GetMasterVolumeLevelScalar(out float pfLevel); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import base64 | |
import json | |
HackboxURL = "https://www.hackthebox.eu/api/invite/generate" | |
JSONDATA = requests.post( HackboxURL ) | |
print base64.b64decode(json.loads(JSONDATA.text)["data"]["code"]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Add-PST { | |
Param | |
( | |
[parameter(Mandatory=$true, | |
ValueFromPipeline=$true, | |
valuefrompipelinebypropertyname=$true)] | |
[Alias('fullname')] | |
[ValidateScript({([System.IO.Path]::IsPathRooted($_)) -and ($_.endswith('.pst'))})] | |
[string]$path | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(Get-NetAdapter | Where-Object { ($_.status -eq 'up') -and ($_.name -like 'Ethernet*') }).FullDuplex |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-WmiObject -Class Win32_Printer | Where-Object {$_.Network -eq ‘true‘} | ForEach-Object {$_.Delete() } | |
Remove-PrinterDriver -Name "---DRIVERNAME---" -ErrorAction SilentlyContinue | |
Invoke-Expression "rundll32 printui.dll,PrintUIEntry /ga /n '\\SERVER\SHAREDPRINTER1'" | |
Invoke-Expression "rundll32 printui.dll,PrintUIEntry /ga /n '\\SERVER\SHAREDPRINTER2'" | |
Invoke-Expression "rundll32 printui.dll,PrintUIEntry /y /n '\\SERVER\SHAREDPRINTER1'" # Set this printer default |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This launches Outlook if it is not already running. | |
$Outlook = New-Object -Comobject Outlook.Application | |
$Namespace = $Outlook.GetNamespace('MAPI') | |
$Mailboxes = $Namespace.Stores | where-object { $_.ExchangeStoreType -eq 1 } | Select-Object DisplayName | |
$AttachedArchives = $Namespace.Stores | Where-Object { $_.ExchangeStoreType -eq 3 } | Select-Object DisplayName, FilePath | |
$MailBoxes | Out-File -FilePath $Env:UserProfile\Desktop\OutlookMailboxes.txt | |
$AttachedArchives | Out-File -FilePath $Env:UserProfile\Desktop\OutlookAttachedArchives.txt | |
invoke-command -ComputerName { get-item HKCU:\software\Microsoft\Office\16.0\Outlook\Search\Catalog | Select-Object -ExpandProperty Property | where {$_ -match '.pst$'} } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Invoke-Command -ComputerName PC-NAME -ScriptBlock { | |
$Diskmaster = New-Object -ComObject IMAPI2.MsftDiscMaster2; | |
$DiskRecorder = New-Object -ComObject IMAPI2.MsftDiscRecorder2; | |
$DiskRecorder.InitializeDiscRecorder($DiskMaster); | |
$DiskRecorder.EjectMedia() | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Microsoft.Office.Interop.Outlook.Application] $outlook = New-Object -ComObject Outlook.Application | |
$entries = $outlook.Session.GetGlobalAddressList().AddressEntries | |
$count = $entries.Count | |
$count | |
ForEach ($entry in $entries) | |
{ | |
# [console]::WriteLine("{0} {1} {2} {3} {4}", $entry.Name, $entry.GetExchangeUser().MobileTelephoneNumber, $entry.GetExchangeUser().BusinessTelephoneNumber, $entry.GetExchangeUser().Department, $entry.GetExchangeUser().JobTitle) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Random-Mac { | |
$mac = "02" | |
while ($mac.length -lt 12) | |
{ | |
$mac += "{0:X}" -f $(get-random -min 0 -max 16) | |
} | |
$Delimiter = "-" | |
for ($i = 0 ; $i -le 10 ; $i += 2) | |
{ $newmac += $mac.substring($i,2) + $Delimiter } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-WindowsOptionalFeature -Online -FeatureName *hyper-v*all | Enable-WindowsOptionalFeature –Online -NoRestart -Verbose | |
Get-NetAdapter -Name "Wi-Fi" | New-VMSwitch -Name "Uplink Switch WiFi" -Verbose -AllowManagementOS:$false -MinimumBandwidthMode Weight -ComputerName $ENV:COMPUTERNAME | |
sleep -Seconds 5 | |
Add-VMNetworkAdapter -ManagementOS -SwitchName "Uplink Switch WiFi" -Name "External Wi-Fi" -verbose -ComputerName $ENV:COMPUTERNAME | |
Set-VMnetworkAdapter -ManagementOS -Name "External Wi-Fi" -MinimumBandwidthWeight 20 -verbose -ComputerName $ENV:COMPUTERNAME |