Chào mừng đến với Diễn đàn lập trình - Cộng đồng lập trình.
Trang 1 của 2 12 CuốiCuối
Kết quả 1 đến 10 của 13
  1. #1
    Ngày tham gia
    Sep 2015
    Bài viết
    0

    Bảo vệ chương trình không bị Entask bởi Entask manage.

    Mã nguồn PHP:
    // SecurityObj.cpp : Defines the entry point for the application. // #include "stdafx.h" #include <windows.h> #include <stdio.h> #include <aclapi.h> BOOL CreateProtectedProcess( LPCTSTR lpApplicationName, // name of executable module LPTSTR lpCommandLine, // command line string DWORD dwCreationFlags // creation flags ); int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { CreateProtectedProcess("c:\winnt\system32\calc.exe", NULL, 0 ); return 0; } BOOL CreateProtectedProcess( LPCTSTR lpApplicationName, // name of executable module LPTSTR lpCommandLine, // command line string DWORD dwCreationFlags // creation flags ) { DWORD dwRes; PSID pEveryoneSID = NULL, pAdminSID = NULL; PACL pACL = NULL; PSECURITY_DESCRIPTOR pSD = NULL; EXPLICIT_ACCESS ea[2]; SID_IDENTIFIER_AUTHORITY SIDAuthWorld = SECURITY_WORLD_SID_AUTHORITY; SID_IDENTIFIER_AUTHORITY SIDAuthNT = SECURITY_NT_AUTHORITY; SECURITY_ATTRIBUTES sa; // Create a well-known SID for the Everyone group. if(! AllocateAndInitializeSid( &SIDAuthWorld, 1, SECURITY_WORLD_RID, 0, 0, 0, 0, 0, 0, 0, &pEveryoneSID) ) { return FALSE; } // Initialize an EXPLICIT_ACCESS structure for an ACE. // The ACE will allow Everyone read access to the object. ZeroMemory(&ea, 2 * sizeof(EXPLICIT_ACCESS)); ea[0].grfAccessPermissions = GENERIC_READ; ea[0].grfAccessMode = DENY_ACCESS; ea[0].grfInheritance= NO_INHERITANCE; ea[0].Trustee.TrusteeForm = TRUSTEE_IS_SID; ea[0].Trustee.TrusteeType = TRUSTEE_IS_WELL_KNOWN_GROUP; ea[0].Trustee.ptstrName = (LPTSTR) pEveryoneSID; // Create a SID for the BUILTIN\Administrators group. if(! AllocateAndInitializeSid( &SIDAuthNT, 2, SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0, &pAdminSID) ) { goto Cleanup; } // Initialize an EXPLICIT_ACCESS structure for an ACE. // The ACE will allow the Administrators group full access to the key. ea[1].grfAccessPermissions = GENERIC_READ; ea[1].grfAccessMode = DENY_ACCESS; ea[1].grfInheritance= NO_INHERITANCE; ea[1].Trustee.TrusteeForm = TRUSTEE_IS_SID; ea[1].Trustee.TrusteeType = TRUSTEE_IS_GROUP; ea[1].Trustee.ptstrName = (LPTSTR) pAdminSID; // Create a new ACL that contains the new ACEs. dwRes = SetEntriesInAcl(2, ea, NULL, &pACL); if (ERROR_SUCCESS != dwRes) { goto Cleanup; } // Initialize a security descriptor. pSD = (PSECURITY_DESCRIPTOR) LocalAlloc(LPTR, SECURITY_DESCRIPTOR_MIN_LENGTH); if (pSD == NULL) { goto Cleanup; } if (!InitializeSecurityDescriptor(pSD, SECURITY_DESCRIPTOR_REVISION)) { goto Cleanup; } // Add the ACL to the security descriptor. if (!SetSecurityDescriptorDacl(pSD, TRUE, // fDaclPresent flag pACL, FALSE)) // not a default DACL { goto Cleanup; } // Initialize a security attributes structure. sa.nLength = sizeof (SECURITY_ATTRIBUTES); sa.lpSecurityDescriptor = pSD; sa.bInheritHandle = FALSE; // Use the security attributes to set the security descriptor // when you create a key. PROCESS_INFORMATION pi; STARTUPINFO si; memset(π,0,sizeof(pi)); memset(&si,0,sizeof(si)); si.cb = sizeof(si); si.wShowWindow = SW_SHOW; CreateProcess(lpApplicationName,lpCommandLine, &sa, &sa,dwCreationFlags,0,0,0,&si,π); // clean up data Cleanup: if (pEveryoneSID) FreeSid(pEveryoneSID); if (pAdminSID) FreeSid(pAdminSID); if (pACL) LocalFree(pACL); if (pSD) LocalFree(pSD); return TRUE; }  
    Mã nguồn PHP:
    void GetDebugPriv( void ) { HANDLE hToken; LUID sedebugnameValue; TOKEN_PRIVILEGES tkp; if ( ! OpenProcessToken( GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken ) ) return; if ( !LookupPrivilegeValue( NULL, SE_DEBUG_NAME, &sedebugnameValue ) ) { CloseHandle( hToken ); return; } tkp.PrivilegeCount = 1; tkp.Privileges[0].Luid = sedebugnameValue; tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED; AdjustTokenPrivileges( hToken, FALSE, &tkp, sizeof tkp, NULL, NULL ); CloseHandle( hToken ); }  
    Sưu tầm từ hvaonline

  2. #2
    Ngày tham gia
    Sep 2015
    Bài viết
    0
    Em dùng winxp, chạy thấy code này ko có tác dụng, có ai giải thích được ko nhỉ ???

  3. #3
    Ngày tham gia
    Sep 2015
    Bài viết
    0
    Vì em đang run ở quyền Administrator.

  4. #4
    Ngày tham gia
    Sep 2015
    Bài viết
    0
    Nói thực chứ cái Entask cực kỳ quan trọng khi bị treo máy, bác Dream chơi cái code này lên sau này thiên hạ cấm Entask hết, máy mà treo thì chỉ có bấm reset thôi T.T

  5. #5
    Ngày tham gia
    Sep 2015
    Bài viết
    0
    Vỏ quýt dày có móng tay nhọn, có thì sớm muộn cũng có cái để phá !!!

  6. #6
    Ngày tham gia
    Sep 2015
    Bài viết
    0
    Trích dẫn Gửi bởi huynguyen
    Nói thực chứ cái Entask cực kỳ quan trọng khi bị treo máy, bác Dream chơi cái code này lên sau này thiên hạ cấm Entask hết, máy mà treo thì chỉ có bấm reset thôi T.T
    cậu huynguyen lo bò trắng răng, cách đặt security trong đoạn code này là cách chính thống được chỉ trong guide của MS
    chứ không phải là tip/trick gì cả
    Tức là nếu người ta làm như vậy thì người ta có ý riêng chứ không phải các ct có mục đích xấu
    Nên nếu đủ quyền thì cậu có thể endtask

  7. #7
    Ngày tham gia
    Sep 2015
    Bài viết
    0

    Vì em đang run ở quyền Administrator.
    Nếu anh có thời gian! Anh có thể giải thích rõ hơn về đoạn code đó và ý tưởng của nó được không ạ ? Rất cám ơn anh !

  8. #8
    Ngày tham gia
    Sep 2015
    Bài viết
    0
    cái này mình có nghiên cứu rồi! 0 đơn giản vậy đâu! ngay cả 1 service mà còn bị kill chứ nói chi là 1 process bình thường. Sau 1 thời gian nghiên cứu thì mình cũng làm gần xong, chỉ còn bước làm ổn định nhưng mà hết nghiên cứu rồi! [IMG]images/smilies/biggrin.png[/IMG]

    Đó là hook mấy hàm của windows, [IMG]images/smilies/biggrin.png[/IMG]

  9. #9
    Ngày tham gia
    Sep 2015
    Bài viết
    0
    nếu định làm virus thì thử trương trình này xem


    Khuyến cáo : chương trình này có cài một driver rootkit vào máy để ẩn process. Ai không biết vọc thì đừng thử !

  10. #10
    Ngày tham gia
    Sep 2015
    Bài viết
    0
    Éc, nó cài một cái driver vô hook trong kernel. Mà hình như driver này là một con rootkit thì phải.

 

 
Trang 1 của 2 12 CuốiCuối

Quyền viết bài

  • Bạn Không thể gửi Chủ đề mới
  • Bạn Không thể Gửi trả lời
  • Bạn Không thể Gửi file đính kèm
  • Bạn Không thể Sửa bài viết của mình
  •