Showing posts with label C&C. Show all posts
Showing posts with label C&C. Show all posts

Wednesday, 23 October 2013

Reversible Rovnix passwords

I got my hands on Rovnix recently.
Not the one who got leaked with Carberp but the 'ISFB' package part (Core, Interceptor, ATS, VNC modules, etc...):

And the panel..
Who ask for mod_rewrite for an unknown reason (ok the htaccess, but is it really usefull here?)

I've already took some screenshots of inside Rovnix, so let's skip about the screenshots part.
Just check this article if you want see pics from the Rovnix C&C:
http://www.xylibox.com/2012/02/win32rovnix.html?spref=tw

The panel come with a sql dump, and a user/password is already defined inside.
The password look's like a MD5 hash and we know nothing about it.

SQL tables:

By looking the hash on Google we have a correspondence with '21240':

A tool confirm also that the hash is good for '21240'

But.. there is a problem somewhere:

So we have to check the code to see what's going on.

admin/index.php use a function getMyHash()

This small function can be found inside mod/main.php:

We have a salt and they use md5() but we have a huge mistake here:
'+' instead of '.' everywhere.
So if we try to hash a password composed only of numbers, we will have a obvious problem.
Like it's the case for the 'default password' found inside the sql dump.

If you want an example:
310dcbbf4cce62f762a2aaa148d556bd = getMyHash('123')
310dcbbf4cce62f762a2aaa148d556bd = md5('333')
'collision' with 2 algo.

We can obtain the password from the hash easily, PoC:
<?php
        /**
         * Defeat the weak hash function of Rovnix
         * to get password from a hash.
         */

     
        $HASH   = 'fbff791ef0770855e599ea6f87d41653';
     
        $value  = getNumber($HASH);
        $search = search($value, $HASH);
     
        echo('Hash:   ' . $HASH  . '<br />');
        echo('Value:  ' . $value . '<br />');
        echo('Search: ' . $search);
     
        // Search an working (number) password
        function search($value, $hash) {
                $i = 0;
             
                while (true) {
                        if (getHash($i) == $value)
                                return $i;
                     
                        $i++;
                }
        }
     
        // Get the hashed number
        function getNumber($hash) {
                $i = 0;
             
                while (true) {
                        if (md5($i) == $hash)
                                return $i;
                     
                        $i++;
                }
        }
     
        // Hash function without final MD5 (return only numbers)
        function getHash($hash) {
                $salt = 'LKJFDJLJkkljKJKJKJkjkj$i%&@(%jkjJn@@j$r@!cdh*!@#$djl1J$r!j@o*$@duJxlJLEKJkJFKJEJ2$jkeJFJLEJFE';
             
                return $hash + $salt + md5($salt) + md5($hash) + $salt[3];
        }
?>

Output for the unknown hash:

So the unknown password for fbff791ef0770855e599ea6f87d41653 is in reality '21173'.
Let's try..
Excellent, we can't log with '21240' because it will be sent to getMyHash() but it's interesting to see this type of bug and how a bad algorithm implementation can cause a security problem.

Thursday, 27 June 2013

Carberp C&C

And here we go, first Carberp panel i break from the leak, surely a test one, gateway was badly configured like domains.

Login:
To view the login page sometime you need a special key like:
/login/?x=11111111111111111111111111111111

It was not required on this server but if you want an example let's try on another Carberp C&C.
Without:
 With:

Dashboard, License Information:

Statistics:

Bots:

Diagram:

Search:

P2P:

Host:

Tasks:

Add a task:

Links:

Logs:

Filters:

Cab-files:

iBank:

Keylogger:

Add program:

Recycle bin:

AutoSystem:

Add domains:

Builds:

Add builds:

Settings:

Users:

User settings:

User permissions:

Edit user:

User information:

About my previous post, fun fact: in 2011 i've already found traces of logs in a C&C, and mystic compressor was used on the sample.
(14:44:15) Павел: надо в админку добавить
1. смотреть все логи по одному боту!
(14:44:27) Павел: показать всех ботовс RU онлайн чисто! логи по ним
(14:44:30) Павел: чтоб глядеть есть ли баги и тд
(14:45:40) aksoft@188.72.206.204/work: оказать всех ботовс RU онлайн чисто! логи по ним - это уточни
(14:45:57) Павел: ну вот чтобы вывод фильтровало
(14:46:14) Павел: нашло всех ботов у которых такая строка в логах есть:
isOfflineVersion = false isOnlineVersion = true
(14:46:18) Павел: language = RUS
(14:46:30) Павел: и после этого логи по ним всем чисто показала! лог вывела
http://www.kernelmode.info/forum/viewtopic.php?f=16&t=747

Friday, 21 June 2013

Who's behind Alina ?

Alina got a strange update this night, a 5.2 sample that i monitor received an update order for a 5.7 version (75F936A2385D2F26336D6F7410FD80DA)
Nothing really new on this just..:

Of course i don't infect a machine just to monitor Alina activities, i've made a primitive program who run on my VPS.
The app just send POST requests to the C&C like Alina do and grab the response, i do that as well for several others malwares.
It's the best way i've found for the moment to monitors stuff without compromissing a vm just for one malware.
Fun fact: Alina have various feature but i've always see 'Update and 'Download exe' feature used.

Various trash logs from Visual Studio found on the sample:

Maybe it's time
But not 'just' for SpiderLabs, also check out these awesome articles they have do if you want to understand how Alina work:
Alina: Casting a Shadow on POS
Alina: Following The Shadow Part 1
Alina: Following The Shadow Part 2
Because my last post start to be outdated for the actual version pushed by Alina actor(s)
Now for the C&C a new one was made for this update:

Still on the same server various other Alina C&C are or was on it:
I observed that some was moved and back later due to update or to counter brute force attacks, i have no idea..

Alina is also in relation with Citadel, for example the domain zwaonoiy.com got sinkholed.
hxxp://zwaonoiy.com/duck/admin.php
 http://botnetlegalnotice.com/citadel/files/Patel_Decl_Ex02.pdf

But what's mean 'dpt' and why ?
Probably a shortcut to a carding guys know as deputat:
Oh, and deputat: Liberty Reserve is dead, you should update that (just saying)

Who run... a dump shop
I have no idea if grabbed track2 finish inside, but running a POS malware with a dump shop behind is always a good conbination if you feel unable to withdraw money (and it's less risky)

Why did he started to go public with this? i've still no idea, but there is several rumors about a Alina guys that he plan to sell this publicly (according to darkode pm)

Login:

Dashboard:
11260 cards got grabbed but many duplicates just few are unique.
If you have read the part 2 of Spiderlabs, you see that Alina hooks itself to every process, that the reason of duplicates.

Logs:

Logs of one POS:

Settings:
Download/execute feature.

Show stats:
Update feature.

Show bins:
Why bins ?
Sometimes scrapping ram in research of track2 can produce random data, not credit cards.
A bin is the first 6 digits of a credit card, this export filter compare those bins to be sure it's a 'valid' credit card.
Most of POS malware who use the luhn algorithm have this problem: 00000000000000000 or 4444444444444444 who got grabbed because they are luhn valid.
a typical malware who do these false positive and probably the most know: mmon
Alina is one of the most advanced ram scrapper i've see for the moment.
Somone complaining about BlackPOS:


I've more details about why i think deputat is behind, just contact me.