cmd script help
Author
Discussion

DaveL485

Original Poster:

2,768 posts

227 months

Monday 22nd March 2010
quotequote all
Had some great tips from here before on cmd scripts so hoping you guys can help again.

I log into a system by using (Windows)

Start>Run (type in box)

Telnet 10.48.xx.xxx <enter>

This pops up the login prompt in the cmd window, to which I log in with

yyy <enter>
zzz <enter>

Is there any way to automate this from a .cmd file? I do this fairly often over a range of the Telnet IP's so it'd make my day a little smoother!

Thanks.

bonsai

2,015 posts

210 months

Monday 22nd March 2010
quotequote all
Does Telnet username:password@IP work? If so, can chuck that into a cmd script.

Edited by bonsai on Monday 22 March 11:25

DaveL485

Original Poster:

2,768 posts

227 months

Monday 22nd March 2010
quotequote all
bonsai said:
Does Telnet username:password@IP work? If so, can chuck that into a cmd script.

Edited by bonsai on Monday 22 March 11:25
Afraid not. It starts the cmd window then drops it again immediately.

Silent1

19,762 posts

265 months

Monday 22nd March 2010
quotequote all
You could create a batch file to do that I suppose.

lestag

4,614 posts

306 months

Monday 22nd March 2010
quotequote all
DaveL485 said:
Had some great tips from here before on cmd scripts so hoping you guys can help again.

I log into a system by using (Windows)

Start>Run (type in box)

Telnet 10.48.xx.xxx <enter>

This pops up the login prompt in the cmd window, to which I log in with

yyy <enter>
zzz <enter>

Is there any way to automate this from a .cmd file? I do this fairly often over a range of the Telnet IP's so it'd make my day a little smoother!

Thanks.
I'll need to double check but create a txt file with the list of commands you use

e.g.

contents of fred.txt
admin
password



then in command prompt

telnet < c:\fred.txt


ETA: ste, just realised i have just given you a FTP script. But hey try the example out the < pipes the contents of fred.txt as if it was keyboard input


Edited by lestag on Monday 22 March 11:56

lestag

4,614 posts

306 months

Monday 22nd March 2010
quotequote all
lestag said:
DaveL485 said:
Had some great tips from here before on cmd scripts so hoping you guys can help again.

I log into a system by using (Windows)

Start>Run (type in box)

Telnet 10.48.xx.xxx <enter>

This pops up the login prompt in the cmd window, to which I log in with

yyy <enter>
zzz <enter>

Is there any way to automate this from a .cmd file? I do this fairly often over a range of the Telnet IP's so it'd make my day a little smoother!

Thanks.
I'll need to double check but create a txt file with the list of commands you use

e.g.

contents of fred.txt
admin
password



then in command prompt

telnet < c:\fred.txt


ETA: ste, just realised i have just given you a FTP script. But hey try the example out the < pipes the contents of fred.txt as if it was keyboard input

ETA2: try this http://puttycm.free.fr/cms/index.php?option=com_co...

Edited by lestag on Monday 22 March 11:56

onomatopoeia

3,526 posts

247 months

Monday 22nd March 2010
quotequote all
DaveL485 said:
Telnet 10.48.xx.xxx <enter>
That IP address is from a private allocation as specified in RFC1918 and so not routeable. There is no need to hide it.

Slinky

15,704 posts

279 months

Monday 22nd March 2010
quotequote all
You should be able to specify the username from a command line, but I'm not sure whether you'll have much luck attempting to script it any further than that without using additional tools to do so..

The switch -l should allow the username to be specified..

Details of that here : http://technet.microsoft.com/en-us/library/cc78740...

If you're in a position to use other tools than those provided by default by MS, have a look at the results of this Google search..
http://www.google.co.uk/search?rlz=1C1CHMA_en-GBGB...

Best of luck..


Xenocide

4,286 posts

238 months

Monday 22nd March 2010
quotequote all
Can you not use SSH and a certificate?

vdubbin

2,175 posts

227 months

Monday 22nd March 2010
quotequote all
Xenocide said:
Can you not use SSH and a certificate?
This.
Secure, and non interactive. Perfect for scripting. I don't know why anyone would use Telnet any more.

Slinky

15,704 posts

279 months

Monday 22nd March 2010
quotequote all
vdubbin said:
Xenocide said:
Can you not use SSH and a certificate?
This.
Secure, and non interactive. Perfect for scripting. I don't know why anyone would use Telnet any more.
What if the server in question isn't running SSH? We have a number of servers here that use telnet and not SSH, and don't need to..

Not all applications require certificate based security..

Xenocide

4,286 posts

238 months

Monday 22nd March 2010
quotequote all
Slinky said:
vdubbin said:
Xenocide said:
Can you not use SSH and a certificate?
This.
Secure, and non interactive. Perfect for scripting. I don't know why anyone would use Telnet any more.
What if the server in question isn't running SSH? We have a number of servers here that use telnet and not SSH, and don't need to..

Not all applications require certificate based security..
Might not require but it's an elegant way of doing it, would you not agree?

Slinky

15,704 posts

279 months

Monday 22nd March 2010
quotequote all
Xenocide said:
Slinky said:
vdubbin said:
Xenocide said:
Can you not use SSH and a certificate?
This.
Secure, and non interactive. Perfect for scripting. I don't know why anyone would use Telnet any more.
What if the server in question isn't running SSH? We have a number of servers here that use telnet and not SSH, and don't need to..

Not all applications require certificate based security..
Might not require but it's an elegant way of doing it, would you not agree?
I totally agree that it would be a much more elegant way of achieving the result, but I can understand the limitations of not being able to configure/install SSH on a production server "at a whim" .. wink

buggalugs

9,285 posts

267 months

Monday 22nd March 2010
quotequote all
If you can, just use a diferent telnet client that has a 'phonebook' facility. I use putty, but that doesn't allow you to save passwords. (no bad thing really but lets not get into that smile)

The Excession

11,669 posts

280 months

Tuesday 23rd March 2010
quotequote all
onomatopoeia said:
DaveL485 said:
Telnet 10.48.xx.xxx <enter>
That IP address is from a private allocation as specified in RFC1918 and so not routeable. There is no need to hide it.
I was going to say just this...

Hey my router is at 192.168.1.254 can you please check if it is hackable, especially because all my pron is 192.168.1.1

hehe

Anyway, windows telnet scripting

^ there is your answer