Solved

running script *inside* telnet

Posted on 1997-08-05
1
310 Views
Last Modified: 2012-08-13
How can I run a script inside telnet?
I don't need to wait for an input, just send some text.
I tried "telnet address < script", where script is the script file, but it's too fast and the connection is lost.
I wrote a tiny filter that copies stdin to stdout after sleeping for a few seconds, but it also fails. I use it like this:
"cat script | delay | telnet address"
What am I doing wrong?
0
Comment
Question by:yairh
1 Comment
 
LVL 1

Accepted Solution

by:
ragnar earned 20 total points
ID: 2006630
Do the following as an example:

cat >> /homepath/telnet.error <<-EOF
telnet [host]
username
password
commands
...
...
...
logout
EOF

it is very important that you put no white spaces in the front or behind the commands or it won't work.  you can declare some of the items to be variables and the shell will expand them for you.  i would reccomend stripping read privs off the script since it must have the username & password in it.  you can do that by typeing chmod g-wrx,o-wrx [filename].

good luck and ask if you have questions!
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now