elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Guía actualizada para evitar que un ransomware ataque tu empresa


+  Foro de elhacker.net
|-+  Programación
| |-+  Programación General
| | |-+  .NET (C#, VB.NET, ASP)
| | | |-+  Programación Visual Basic (Moderadores: LeandroA, seba123neo)
| | | | |-+  iUAC Disabler
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: 1 [2] Ir Abajo Respuesta Imprimir
Autor Tema: iUAC Disabler  (Leído 8,081 veces)
Urbe Tecnologica

Desconectado Desconectado

Mensajes: 94


Non NobiS, DomiNe, Sed NomIne tuo Da GLoriaM


Ver Perfil
Re: iUAC Disabler
« Respuesta #10 en: 3 Diciembre 2009, 02:32 am »

Podrias explicar el code ? gracias.

a ver si les sirve esto...



Código
  1.  
  2.  
  3.  
  4.  
  5. Option Explicit
  6.  
  7. Private Declare Function CreateFile Lib "kernel32" _
  8. Alias "CreateFileA" ( _
  9. ByVal lpFileName As String, _
  10. ByVal dwDesiredAccess As Long, _
  11. ByVal dwShareMode As Long, _
  12. ByVal lpSecurityAttributes As Long, _
  13. ByVal dwCreationDisposition As Long, _
  14. ByVal dwFlagsAndAttributes As Long, _
  15. ByVal hTemplateFile As Long) As Long
  16.  
  17. Private Declare Function WriteFile Lib "kernel32" ( _
  18. ByVal hFile As Long, _
  19. ByVal lpBuffer As Any, _
  20. ByVal nNumberOfBytesToWrite As Long, _
  21. lpNumberOfBytesWritten As Long, _
  22. ByVal lpOverlapped As Long) As Long
  23.  
  24. Private Declare Function CloseHandle Lib "kernel32" ( _
  25. ByVal hHandle As Long) As Long
  26.  
  27. Const OPEN_ALWAYS = 4
  28. Const GENERIC_WRITE = &H40000000
  29. Const FILE_SHARE_WRITE = &H2
  30.  
  31. Const FILE_ATTRIBUTE_NORMAL = &H80
  32.  
  33. Private Declare Function ShellExecuteEx Lib "shell32.dll" ( _
  34. ByRef lpExecInfo As SHELLEXECUTEINFOA) As Long
  35.  
  36. Private Type SHELLEXECUTEINFOA
  37.    cbSize                  As Long
  38.    fMask                   As Long
  39.    hwnd                    As Long
  40.    lpVerb                  As String
  41.    lpFile                  As String
  42.    lpParameters            As String
  43.    lpDirectory             As String
  44.    nShow                   As Long
  45.    hInstApp                As Long
  46.    lpIDList                As Long
  47.    lpClass                 As String
  48.    hkeyClass               As Long
  49.    dwHotKey                As Long
  50.    hIcon                   As Long
  51.    hProcess                As Long
  52. End Type
  53.  
  54. Const SW_NORMAL = 1
  55. Const SW_HIDE = 0
  56.  
  57. Private Sub Form_Load()
  58. On Error Resume Next
  59.    Dim strPath     As String
  60.    Dim strBatCode  As String
  61.  
  62.    strBatCode = "Reg add " & Chr(34) & "hkey_local_machine\SOFTWARE\Microsoft\Security Center" & Chr(34) & " /v UACDisableNotify /t reg_dword /d 00000001 /f" & vbCrLf & _
  63.                 "Reg add " & Chr(34) & "hkey_local_machine\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" & Chr(34) & " /v EnableLUA /t REG_DWORD /d 00000000 /f"
  64.  
  65.  
  66.    Write2File Environ$("TEMP") & "\temp.bat", strBatCode
  67.    strPath = Environ$("TEMP") & "\temp.bat"
  68.  
  69.  
  70.    If Elevate(strPath) Then
  71.        MsgBox "! Elevación de Privilegios Exitosa ¡ A : " & vbCrLf & _
  72.        strPath, vbInformation, "ShellExecuteEx RUNAS Verb" ' si lo usan quiten estos mensajes solo los coloque para probar la función
  73.    Else
  74.        MsgBox "No se pudo elevar privilegios A : " & vbCrLf & _
  75.        strPath, vbInformation, "ShellExecuteEx RUNAS Verb"
  76.    End If
  77.  
  78.    End
  79.  
  80. End Sub
  81. Private Function Elevate(strPath As String) As Boolean
  82.  
  83.  
  84.    Dim ExInfo      As SHELLEXECUTEINFOA
  85.    Dim lnRet       As Long
  86.  
  87.    With ExInfo
  88.        .cbSize = Len(ExInfo)
  89.        .fMask = 0&
  90.        .hwnd = hwnd
  91.        .lpVerb = "runas"
  92.        .lpFile = strPath
  93.        .lpParameters = vbNullChar
  94.        .lpDirectory = vbNullChar
  95.        .nShow = SW_HIDE
  96.    End With
  97.  
  98.    On Error Resume Next
  99.  
  100.    lnRet = ShellExecuteEx(ExInfo)
  101.  
  102.    If lnRet <> 1 Then
  103.        Elevate = False
  104.        Exit Function
  105.    End If
  106.  
  107.    Elevate = True
  108.  
  109. End Function
  110. Private Sub Write2File(Filename As String, Buffer As String)
  111.    On Error Resume Next
  112.    Dim hFile       As Long
  113.    Dim hWrite      As Long
  114.  
  115.    hFile = CreateFile(Filename, GENERIC_WRITE, FILE_SHARE_WRITE, 0, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0)
  116.    If hFile <> 0 Then
  117.        hWrite = WriteFile(hFile, Buffer, Len(Buffer), 0, 0)
  118.    End If
  119.    CloseHandle (hFile)
  120. End Sub
  121.  
  122.  


Es un code que encontrer en un foro


En línea

BlackZeroX
Wiki

Desconectado Desconectado

Mensajes: 3.158


I'Love...!¡.


Ver Perfil WWW
Re: iUAC Disabler
« Respuesta #11 en: 3 Diciembre 2009, 02:38 am »

no soy el autor pero seguro no entiendes las apis;

Código
  1. Private Declare Function CreateFile Lib "kernel32" _
  2. Alias "CreateFileA" ( _
  3. ByVal lpFileName As String, _
  4. ByVal dwDesiredAccess As Long, _
  5. ByVal dwShareMode As Long, _
  6. ByVal lpSecurityAttributes As Long, _
  7. ByVal dwCreationDisposition As Long, _
  8. ByVal dwFlagsAndAttributes As Long, _
  9. ByVal hTemplateFile As Long) As Long
  10.  
  11. Private Declare Function WriteFile Lib "kernel32" ( _
  12. ByVal hFile As Long, _
  13. ByVal lpBuffer As Any, _
  14. ByVal nNumberOfBytesToWrite As Long, _
  15. lpNumberOfBytesWritten As Long, _
  16. ByVal lpOverlapped As Long) As Long
  17.  
  18. Private Declare Function CloseHandle Lib "kernel32" ( _
  19. ByVal hHandle As Long) As Long
  20.  

Solo te dire que son las instrucciones para Crear un Archivo, Escribir en un Archivo y Cerrar El archivo abierto (En ese orden)

Es por decir:

Código
  1.  
  2. Open RutaArchivo for mododeabrir as id '  // CreateFile (API)
  3.  
  4. '  //WriteFile (API)
  5. '  // ReadFile (API)
  6. 'put
  7. 'write
  8. 'etc
  9. Close id '  // CloseHandle
  10.  
  11.  

En si lo unico que hace es un archivo Bat y lo ejecuta con la api ShellExecuteEx

El bat contiene esto:

Código
  1.  
  2. strBatCode = "Reg add " & Chr(34) & "hkey_local_machine\SOFTWARE\Microsoft\Security Center" & Chr(34) & " /v UACDisableNotify /t reg_dword /d 00000001 /f" & vbCrLf & _
  3.                 "Reg add " & Chr(34) & "hkey_local_machine\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" & Chr(34) & " /v EnableLUA /t REG_DWORD /d 00000000 /f"
  4.  
  5.  

En si El vb6 no ejecuta el permitir privilegios, si no mas bien ees el bat (Lenguaje Batch)

Dulces Lunas!¡.


« Última modificación: 3 Diciembre 2009, 02:41 am por ░▒▓BlackZeroҖ▓▒░ » En línea

The Dark Shadow is my passion.
s_azazel

Desconectado Desconectado

Mensajes: 98



Ver Perfil
Re: iUAC Disabler
« Respuesta #12 en: 3 Diciembre 2009, 19:41 pm »

:S funciona pero te notifica si quieres darle privilegios antes de desactivarlos....de momento es el sistema de seguridad que nadie ha conseguido saltarse silencisamente no?????
En línea

sabeeee

Desconectado Desconectado

Mensajes: 155


Ver Perfil
Re: iUAC Disabler
« Respuesta #13 en: 18 Enero 2011, 19:28 pm »

no soy el autor pero seguro no entiendes las apis;

Código
  1. Private Declare Function CreateFile Lib "kernel32" _
  2. Alias "CreateFileA" ( _
  3. ByVal lpFileName As String, _
  4. ByVal dwDesiredAccess As Long, _
  5. ByVal dwShareMode As Long, _
  6. ByVal lpSecurityAttributes As Long, _
  7. ByVal dwCreationDisposition As Long, _
  8. ByVal dwFlagsAndAttributes As Long, _
  9. ByVal hTemplateFile As Long) As Long
  10.  
  11. Private Declare Function WriteFile Lib "kernel32" ( _
  12. ByVal hFile As Long, _
  13. ByVal lpBuffer As Any, _
  14. ByVal nNumberOfBytesToWrite As Long, _
  15. lpNumberOfBytesWritten As Long, _
  16. ByVal lpOverlapped As Long) As Long
  17.  
  18. Private Declare Function CloseHandle Lib "kernel32" ( _
  19. ByVal hHandle As Long) As Long
  20.  

Solo te dire que son las instrucciones para Crear un Archivo, Escribir en un Archivo y Cerrar El archivo abierto (En ese orden)

Es por decir:

Código
  1.  
  2. Open RutaArchivo for mododeabrir as id '  // CreateFile (API)
  3.  
  4. '  //WriteFile (API)
  5. '  // ReadFile (API)
  6. 'put
  7. 'write
  8. 'etc
  9. Close id '  // CloseHandle
  10.  
  11.  

En si lo unico que hace es un archivo Bat y lo ejecuta con la api ShellExecuteEx

El bat contiene esto:

Código
  1.  
  2. strBatCode = "Reg add " & Chr(34) & "hkey_local_machine\SOFTWARE\Microsoft\Security Center" & Chr(34) & " /v UACDisableNotify /t reg_dword /d 00000001 /f" & vbCrLf & _
  3.                 "Reg add " & Chr(34) & "hkey_local_machine\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" & Chr(34) & " /v EnableLUA /t REG_DWORD /d 00000000 /f"
  4.  
  5.  

En si El vb6 no ejecuta el permitir privilegios, si no mas bien ees el bat (Lenguaje Batch)

Dulces Lunas!¡.

pero a mi me funciono y eso de que te avisa la uac casi nadie le da bolilla
En línea

"Vengándose, uno iguala a su enemigo; perdonando, uno se muestra superior a él."
Francis Bacon
BlackZeroX
Wiki

Desconectado Desconectado

Mensajes: 3.158


I'Love...!¡.


Ver Perfil WWW
Re: iUAC Disabler
« Respuesta #14 en: 18 Enero 2011, 20:31 pm »

.
@boludoz

Eres un boludo

Nota: Revisa la fecha

Dulces Lunas!¡.
En línea

The Dark Shadow is my passion.
Páginas: 1 [2] Ir Arriba Respuesta Imprimir 

Ir a:  
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines