Author Topic: Get Default Browser Path  (Read 1394 times)

0 Members and 1 Guest are viewing this topic.

xC

  • Guest
Get Default Browser Path
« on: May 07, 2013, 02:05:32 am »
Another code from the archives..

Code: [Select]
printf( "Path: %s", GetBrowserPath( ) );

Code: [Select]
char* GetBrowserPath( )
{
    HKEY hKey;
    char szBuffer[1080];
    unsigned long lSize = sizeof( szBuffer ) + 1;
    if( RegOpenKeyEx( HKEY_CLASSES_ROOT, "http\\shell\\open\\command", 0, KEY_ALL_ACCESS, &hKey ) == 0 ) {
        if( RegQueryValueEx( hKey, NULL, NULL, NULL, (unsigned char*)szBuffer, &lSize ) == 0 ) {
            RegCloseKey( hKey );
            return( strtok( szBuffer, "\"" ) );
        }
        RegCloseKey( hKey );
    }
    return( "Unknown" );
}

Offline Kulverstukas

  • Administrator
  • Zeus
  • *
  • Posts: 6627
  • Cookies: 542
  • Fascist dictator
    • View Profile
    • My blog
Re: Get Default Browser Path
« Reply #1 on: May 07, 2013, 07:58:03 am »
Checking the Application Data for known browsers is a better method than to access registry. And it's much simpler too, less detectable by AV's. I have implemented that in stealthstalker, which I'll post some time when I finish it...

Offline Deque

  • P.I.N.N.
  • Global Moderator
  • Overlord
  • *
  • Posts: 1203
  • Cookies: 518
  • Programmer, Malware Analyst
    • View Profile
Re: Get Default Browser Path
« Reply #2 on: May 07, 2013, 08:39:46 am »
Checking the Application Data for known browsers is a better method than to access registry. And it's much simpler too, less detectable by AV's. I have implemented that in stealthstalker, which I'll post some time when I finish it...

Plus it is more portable. Checking the registry will only work for windows.

xC

  • Guest
Re: Get Default Browser Path
« Reply #3 on: May 08, 2013, 06:21:19 am »
Not familiar with that method.. thanks for the post. I will look into it.