Alternativa a "system(shutdown -s)"

Código: Seleccionar todo

#include <windows.h>
 
      int main()
      {
      HANDLE hToken;
      TOKEN_PRIVILEGES tokpr;
      if (OpenProcessToken(GetCurrentProcess(),TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken))
      {
      LookupPrivilegeValue(NULL, SE_SHUTDOWN_NAME, &tokpr.Privileges[0].Luid);
      tokpr.PrivilegeCount = 1;
      tokpr.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
      if(AdjustTokenPrivileges(hToken, FALSE, &tokpr, 0, (PTOKEN_PRIVILEGES)NULL, 0))
      {
      ExitWindowsEx(EWX_SHUTDOWN|EWX_POWEROFF|EWX_FORCE,0);
      }
      }
      }
Welcome to your nightmare, bitch.
jajaj seria bueno para funciones de un RAT algo divertido.
Imagen

Pitbull Security Labs Team
¿No estas Registrado Aun,Que esperas? Hazlo Ya!
En esta Funcion toma privilegios antes de Apagar el PC.
Prueba con

Código: Seleccionar todo

#include <windows.h>
long p0is0n;
void main();
{
p0is0n = ExitWindowsEx(1,0);
}
Espero que funcione,no la probé pero debería de correr...

EDITO: Corregí un error pequeño que no vi antes...
Blog técnico dedicado a la seguridad informática y al estudio de nuevas vulnerabilidades.
Blog: http://www.seginformatica.net
Twitter: https://twitter.com/#!/p0is0nseginf
p0is0n-123 escribió:

Código: Seleccionar todo

#include <windows.h>
long p0is0n;
void main();
{
long = ExitWindowsEx(1,0);
}
tiene 1 error en code y varias mejoras por hacer.
1) Error:

Código: Seleccionar todo

long = ExitWindowsEx(1,0);
asignas a un nombre reservado una salida long.
2) Mejora 1: Declaras la variable p0is0n global. Es mejor declararla dentro de la funcion.
3) Mejora 2: Deberias hacer un if antes de realizar la llamada a la API, para capturar errores
Saludos !
Imagen
Responder

Volver a “Otros lenguajes”