telnet a webpage

Can anyone think of a way to do this:

I would like to telnet to a MT box and run ‘something’ that would request a web page and stream the reply. I know that a full featured telnet client should be able to do this with a GET, but the one in MT seems not to work.

Dave

hmmm… what is this for?..

/tool fetch ?

YES! /tool fetch looks like what I need! But my 2.9.48 doesn’t seem to have /tool fetch… :frowning:

Where do I get it?

Dave

Nevermind… my personal MT box didn’t have fetch, but the lab box did… groovy… :smiley:

Syntax question: while the fetch tool does allow for user and pass (kudos!), it seems to have a problem with a $ in the password. What is the proper way to pass a $ in a string like password=“pas$word”

Dave

have you tried escape char like $ to write actual $ to system not implying that following will be variable or anything else like with other special characters?



here is the input script

[admin@Mikrotik] > {
{... :local asdf 1234;
{... :put "asdf$asdf"  
{... :put "asdf\$asdf"
{... }

output:

asdf1234
asdf$asdf

Yes, I tried “pa$sword” as well… no joy…

Dave

While the question about how to send a $ in the password field lingers, I have removed the $ from the password on the device and made it a ‘simple’ password. It still doesn’t work however.

Here is my what I get when I try to use fetch;

tool fetch add=12.34.56.78 path=“apstatus.html” user=“root” password=“simple” mode=http
status: connecting

status: failed
failure: 401 Unauthorized

The un/pw is known to be good by pointing a browser at the device and using them when the auth challenge dialog pops up.

So what’s up? The un/pw is OK when a browser asks for the page on the path, but when fetch uses it, it gets 401.

Dave

if you open this page in normal browser it pops up dialog asking for username and password? or it is php or some kind of login page in html?

if it were login page, it won’t be ‘HTTP 401’, it would be ‘HTTP 200’…

With a normal browser it pops up that standard windows ‘enter a un/pw’ dialog. It is not a php/asp login page like this forum uses.

Dave

something to do with host headers… seems like /tool fetch has to use both the path and the server name - not all part of the same field. if you use IE and http://12.34.56.78/apstatus.html do you get the login, or only with hostname ?

No, that’s not it… the dialog pops up if I use the host name or ip addy…

In fact, I started another thread on this. The device I am trying to contact doesn’t even have a host name, it is a Canopy AP. But that doesn’t seem to be part of the issue. It turns out that fetch isn’t even authenticating against an apache server with basic authentication.

Please see the other thread…
Dave