Telnet proxy

Discussion in 'Perl Misc' started by Shuttermutt, Sep 4, 2003.

  1. Shuttermutt

    Shuttermutt Guest

    Good day all! I'm looking to write a prog that sits in between a
    telnet client and server. In other words, the telnet client of the
    user's choice would connect to my prog which would, in turn, connect
    to the telnet server. My prog would move data back and forth between
    the client and the server without manipulating it.

    I've started playing with Net::Telnet and IO::Socket, but before I go
    too far, I'd like to know if anyone's run across this and/or if
    somebody might have suggestions as to how I might proceed.

    'Mutt
     
    Shuttermutt, Sep 4, 2003
    #1
    1. Advertising

  2. On Thu, 04 Sep 2003 12:03:58 GMT
    "Shuttermutt" <> wrote:
    > Good day all! I'm looking to write a prog that sits in between a
    > telnet client and server. In other words, the telnet client of the
    > user's choice would connect to my prog which would, in turn, connect
    > to the telnet server. My prog would move data back and forth between
    > the client and the server without manipulating it.
    >
    > I've started playing with Net::Telnet and IO::Socket, but before I
    > go too far, I'd like to know if anyone's run across this and/or if
    > somebody might have suggestions as to how I might proceed.


    Don't use telnet :) Use SSH. Unless you're using telnet on the
    client end and then using SSH to communicate with the server. Telnet
    sends everything clear text - SSH does not.

    There is Net::SSH and a few other SSH modules for Perl to aid in
    development.

    HTH
    --
    Jim
    ---
    Copyright notice: all code written by the author in this post is
    released under the GPL. http://www.gnu.org/licenses/gpl.txt
    for more information.
    ---
    a real quote ...
    Linus Torvalids: "They are somking crack ...."
    (http://www.eweek.com/article2/0,3959,1227150,00.asp)
    ---
    a fortune quote ...
    X-rated movies are all alike ... the only thing they leave to the
    imagination is the plot.
     
    James Willmore, Sep 4, 2003
    #2
    1. Advertising

  3. Shuttermutt

    Guest

    Shuttermutt <> wrote:
    > Good day all! I'm looking to write a prog that sits in between a
    > telnet client and server. In other words, the telnet client of the
    > user's choice would connect to my prog which would, in turn, connect
    > to the telnet server. My prog would move data back and forth between
    > the client and the server without manipulating it.


    A simple network proxy, in other words?

    > I'd like to know if anyone's run across this and/or if
    > somebody might have suggestions as to how I might proceed.


    In the general case, google for telnet proxy. In the perl specific case,
    check out the first hit on google for "perl telnet application proxy".

    Chris
    --
    @s=split(//,"Je,\nhn ersloak rcet thuarP");$k=$l=@s;for(;$k;$k--){$i=($i+1)%$l
    until$s[$i];$c=$s[$i];print$c;undef$s[$i];$i=($i+(ord$c))%$l}
     
    , Sep 4, 2003
    #3
  4. Shuttermutt

    Shuttermutt Guest

    wrote:
    > Shuttermutt <> wrote:
    >
    >>Good day all! I'm looking to write a prog that sits in between a
    >>telnet client and server. In other words, the telnet client of the
    >>user's choice would connect to my prog which would, in turn, connect
    >>to the telnet server. My prog would move data back and forth between
    >>the client and the server without manipulating it.

    >
    >
    > A simple network proxy, in other words?
    >
    >
    >>I'd like to know if anyone's run across this and/or if
    >>somebody might have suggestions as to how I might proceed.

    >
    >
    > In the general case, google for telnet proxy. In the perl specific case,
    > check out the first hit on google for "perl telnet application proxy".


    Hmmm... I hadn't seen ip_relay.pl before. It'll be worth taking a look
    at it to see how he's doing things. I've also been playing with
    fwdport.pl from The Cookbook and, while I can get it to work, I'm having
    some trouble with it failing OOTB.

    The real reason for doing this is so that my prog can analyze the data
    moving between the telnet client and server and, when it finds something
    interesting, do something else. Nothing sinister, mind you. I'm trying
    to put together a scripting framework for a telnet-based game.

    Anyway, thanks for the pointer to ip_relay. I googled before I asked, I
    promise!

    'Mutt
     
    Shuttermutt, Sep 4, 2003
    #4
  5. Shuttermutt

    Shuttermutt Guest

    James Willmore wrote:
    > On Thu, 04 Sep 2003 12:03:58 GMT
    > "Shuttermutt" <> wrote:
    >
    >>Good day all! I'm looking to write a prog that sits in between a
    >>telnet client and server. In other words, the telnet client of the
    >>user's choice would connect to my prog which would, in turn, connect
    >>to the telnet server. My prog would move data back and forth between
    >>the client and the server without manipulating it.
    >>
    >>I've started playing with Net::Telnet and IO::Socket, but before I
    >>go too far, I'd like to know if anyone's run across this and/or if
    >>somebody might have suggestions as to how I might proceed.

    >
    >
    > Don't use telnet :) Use SSH. Unless you're using telnet on the
    > client end and then using SSH to communicate with the server. Telnet
    > sends everything clear text - SSH does not.
    >
    > There is Net::SSH and a few other SSH modules for Perl to aid in
    > development.


    Actually, I'm restricted to telnet since I don't have control over the
    server side of things. I don't need a firewall type proxy as much as a
    spy layer between the client of the user's choice and the server. You
    see, I want to analyze the data being sent back and forth, catch what's
    interesting, and use that as a part of a scripting framework for a
    telnet-based game.

    For example, if the server sent "Player Mutt moved from [A] to " to
    the client, I'd like to catch that and then let scripts act on that
    information as they see fit. That way, if someone wanted to write a prog
    that fired when a player moved and acted accordingly, my framework would
    provide the necessary event and data to let them do that.

    I've been playing with fwdport.pl from The Cookbook and I can proxy
    ports, but I'm having trouble with the forking OOTB. If I can get it
    fixed, the next step would be figuring out how to watch the data stream
    between client and server.

    Thanks for the heads up!
    'Mutt
     
    Shuttermutt, Sep 4, 2003
    #5
  6. Shuttermutt

    Tom Feist Guest

    Shuttermutt <> writes:

    > Actually, I'm restricted to telnet since I don't have control over the
    > server side of things. I don't need a firewall type proxy as much as a
    > spy layer between the client of the user's choice and the server. You
    > see, I want to analyze the data being sent back and forth, catch
    > what's interesting, and use that as a part of a scripting framework
    > for a telnet-based game.
    >
    > For example, if the server sent "Player Mutt moved from [A] to " to
    > the client, I'd like to catch that and then let scripts act on that
    > information as they see fit. That way, if someone wanted to write a
    > prog that fired when a player moved and acted accordingly, my
    > framework would provide the necessary event and data to let them do
    > that.


    You could try using POE, specifically something like:
    http://poe.perl.org/?POE_Cookbook/TCP_Forwarding and with the added
    bonus of the event driven POE kernel available for doing the actual
    logic. It really is a very handy framework for lots of common things.
    (Uncommon ones too, I wouldn't doubt)

    --
    Shabble.
    (Whose alarm clock is now running a small perl script)
     
    Tom Feist, Sep 9, 2003
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Shuttermutt

    Perl telnet proxy

    Shuttermutt, Sep 3, 2003, in forum: Perl
    Replies:
    0
    Views:
    2,655
    Shuttermutt
    Sep 3, 2003
  2. vidy5300
    Replies:
    0
    Views:
    872
    vidy5300
    Jun 7, 2004
  3. Jim Isaacson
    Replies:
    5
    Views:
    606
    Default User
    Nov 5, 2004
  4. Carcarius
    Replies:
    0
    Views:
    296
    Carcarius
    Dec 6, 2007
  5. Carcarius

    telnet class - proxy option

    Carcarius, Dec 13, 2007, in forum: Ruby
    Replies:
    0
    Views:
    133
    Carcarius
    Dec 13, 2007
Loading...

Share This Page