More servicesWindows Live
HomeHotmailSpacesOneCare
 
MSN
Sign in
 
 
Spaces home  Montreal blog on Interne...ProfileFriendsBlogMore Tools Explore the Spaces community

Montreal blog on Internet Security Software

marioc@computer.org

View spaceSend a message
Location:
LinkedIn
http://www.linkedin.com/in/0utlaw

Twitter
http://twitter.com/0utlaw
May 13

Setting privileges on a specific thread

If you've ever needed to set privileges to a specific thread Id only, and not an entire process, you may of visited quite a few MSDN web pages trying to figure out exactly how to achieve this.
 
Here is a function that does this, call it using a format such as:
 
AddThreadPriv(GetCurrentThreadId(), SE_BACKUP_NAME);
 
 
 
 
AddThreadPriv(const DWORD in_tid, const std::string& in_rstrPrivilegeName)
{
 ImpersonateSelf(SECURITY_MAX_IMPERSONATION_LEVEL);
 HANDLE h = OpenThread( TOKEN_ALL_ACCESS, FALSE, in_tid);
 HANDLE hToken = NULL;
 if(h)
  OpenThreadToken(h, TOKEN_ALL_ACCESS, TRUE, &hToken);
 if( hToken )
 {
  TOKEN_PRIVILEGES tpNew = { 1 };
  tpNew.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
  if( ::LookupPrivilegeValue( NULL, in_rstrPrivilegeName.c_str(), &tpNew.Privileges[0].Luid ) )
  {
   VERIFY( ::AdjustTokenPrivileges( hToken, FALSE, &tpNew, 0, NULL, NULL ) );
   CLOSEHANDLE(h);
   CLOSEHANDLE(hToken);
   return (ERROR_SUCCESS == GetLastError());
  }  
 }
 CLOSEHANDLE(h);
 return false;
}
 
Trying to locate the proper documentation shouldn't be this difficult, certainly not for a company that size.
 
May 10

IPv6 is good for business, and will flush out unmaintained crapware

Ipv4 will be out of addresses sooner than most people realize.
 
This will probably occur within 24 months, and will likely cement Vista as the desktop os replacement for Xp, since its stack has IPv6 out-of-the-box.
 
The good news is that this will weed out the smaller software products who do not have the man-power to upgrade their existing applications to this newer reality.
 
We may even see well established products lag behind because they may be dealing with too much legacy Ipv4 code.
 
Time will tell...
May 05

The Race to Zero

The Race to Zero contest is being held during Defcon 16 at the Riviera Hotel in Las Vegas, 8-10 August 2008.

The event involves contestants being given a sample set of viruses and malcode to modify and upload through the contest portal. The portal passes the modified samples through a number of antivirus engines and determines if the sample is a known threat. The first team or individual to pass their sample past all antivirus engines undetected wins that round. Each round increases in complexity as the contest progresses.

 

http://www.racetozero.net/index.html

View more entries