Skip to content

Latest commit

 

History

History
72 lines (59 loc) · 1.62 KB

File metadata and controls

72 lines (59 loc) · 1.62 KB
name event category description layout
Power Snacks (2021)
Hacky Holidays Space Race CTF 2021
Forensics
Writeup for Power Snacks (Forensics) - Hacky Holidays Space Race CTF (2021) 💜
title description tableOfContents outline pagination
visible
true
visible
true
visible
true
visible
true
visible
true

Power Snacks

Video Walkthrough

VIDEO

Challenge Description

Are you the very best PowerShell user?

Solution

{% code overflow="wrap" %}

# 1
$answer = For ($i=1; $i -le 1337; $i++) {
	if ($i % 42 -eq 0){
		Write-Output("Life, the universe, and everything")
	}else{
		Write-Output($i)
	}
}
$answer | check


# 2
$answer = ForEach($word In $(Get-Content ./dictionary | Sort-Object  {$_.Length}, {$_.ToString()})) {
	 if($word.Length -gt 1){
		$scrabble_chars = "iydhlao"
		$match = 1
		ForEach($char in $word.ToCharArray()){
			if(!($scrabble_chars.Contains($char))){
				$match = 0
			}
			$scrabble_chars = $scrabble_chars -replace $char,""
		}
		if ($match){
			Write-Output([string]$word)
		}
	}
}
$answer | check


# 3
$answer = Import-Csv -Delimiter "`t" ./passwords.tsv | Group-Object category | Sort-Object @{Expression = "Count"; Descending = $True} | Select-Object Count,Name
$answer | check


# 4
$answer  = Import-Csv -Delimiter "`t" ./passwords.tsv | Sort-Object {$_.Password.Length}, {$_.Password} | Where-Object category -EQ "names" | Select-Object Password
$answer | check

{% endcode %}