using cmd.exe as a telnet client

Eyal Lotem gnupeaker at yahoo.com
Sat Dec 4 06:31:12 EST 2004


I think I have a much simpler solution for you guys..
Assuming you can run arbitrary code on the proprietary
server.

I wrote PyInvoke, and I use it as a much-easier-to-use
replacement for telnet control of computers.

It does require installing Python on the target server
though.

You simple have to run PyInvoke's server.py on the
server, and then in the client, you can Pythonically
control anything on the server:

client = pyinvoke.connect(('some_server', some_port))
client.modules.shutil().rmtree('/tmp/blah')

As easy as that :-)

PyInvoke is at: http://pybuild.sf.net/pyinvoke.html

There are a few improvements I have to put back into
the source, like the ability to run the server on
Windows (currently it depends on fork'ability), but
otherwise it is already very complete and works well.

--- Grant Edwards <grante at visi.com> wrote:
> On 2004-12-03, Donnal Walter <donnal at donnal.net>
> wrote:
> 
> > Several months ago I tried using the telnet module
> (on Windows XP) to 
> > communicate with a proprietary host on our
> network. This was 
> > unsuccessful due to problems with "option
> negotiation", and I gave up on 
> > the project for a while. I still have need for
> this, however, so I 
> > recently started thinking about alternatives. I
> suppose I could dig deep 
> > enough into option negotiation to use the socket
> module (with telnet as 
> > a guide), but I am hoping to find a way to use
> fewer synapses.
> 
> You don't have to start from scratch. The telnet
> module has
> hooks built-into it1 so that you can have it call
> your routines
> to handle option negotiation.  I did it once to
> impliment some
> extra Telnet protocol features, and it wasn't
> difficult.



		
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - now with 250MB free storage. Learn more.
http://info.mail.yahoo.com/mail_250



More information about the Python-list mailing list