Jump to content
Sign in to follow this  

Automated & minimized/hided TELNET login with AutoIT (without using third party programs)

Recommended Posts

I'm searching a way to make a script for a simple TELNET login in my router, it would send username and password then would send a command and finally close telnet session, ALL of that using only AutoIT and without user interaction (AUTOMATED & HIDED).

If anyone wants to help me thanks in advance!


What I want to automate? This:

(It's for reconnect to change IP, for the router of the ISP Arnet Discus DRG A112)

Start Menu > Run..: telnet

Username: admin

Password: alvlgeddl

Command 1: ppp config 0.0.33 down

Command 2: ppp config 0.0.33 up

Command 3: logout



I made it!! YEAH! works fine full-auto.

But... have some problems because of my router, if session was not closed correctly or opens sessions too fast, it locks and not permit any more connections, even worse don't returns any error, just close your telnet session instantly after send "Start > Run..: telnet".

TcpStartUp ()
$RouterIP = tcpconnect("", "23")

Until $RouterIP <> "-1"
While 1

$TCPRecv = TCPRecv($RouterIP,"5000")

;~ ConsoleWrite($TCPRecv) ;for debug test
;~ MsgBox("","",$TCPRecv) ;for debug test

If StringInStr($TCPRecv, "Login:") > 0 Then
TCPSend($RouterIP, "admin" & @crlf)
ElseIf StringInStr($TCPRecv, "Password:") > 0 Then
TCPSend($RouterIP, "alvlgeddl" & @crlf)
TCPSend($RouterIP, "ppp config 0.0.33 down" & @crlf)
TCPSend($RouterIP, "ppp config 0.0.33 up" & @crlf)
TCPSend($RouterIP, "logout" & @crlf)
ElseIf StringInStr($TCPRecv, "have a nice day") > 0 Then
Edited by DarkBlood

Share this post

Link to post
Share on other sites

Thanks a lot man.. Saved a lot of nerves for me.. needed general idea how to go about implementing similar thing for SpeedTouch 780WL

Edited by shaqan

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...