characters displayed after login -- telnet session

I have a program that logs into every device on our network (via telnet) then sends the command “export”. Records the results then compares it to the previous file it captured. Then if it detects a change it sends an e-mail to us.

We are having issues getting the program to work properly I have done a putty capture and I noticed a bunch of characters before the prompt and after the MikroTik logo that I think is causing issues.

Does anybody have any idea what these characters are and why they are there?

If the following is unclear the text file has the raw data

=~=~=~=~=~=~=~=~=~=~=~= PuTTY log 2009.10.16 11:33:14 =~=~=~=~=~=~=~=~=~=~=~=

MikroTik v3.30
Login: admin+c
Password:

MMM MMM KKK TTTTTTTTTTT KKK
MMMM MMMM KKK TTTTTTTTTTT KKK
MMM MMMM MMM III KKK KKK RRRRRR OOOOOO TTT III KKK KKK
MMM MM MMM III KKKKK RRR RRR OOO OOO TTT III KKKKK
MMM MMM III KKK KKK RRRRRR OOO OOO TTT III KKK KKK
MMM MMM III KKK KKK RRR RRR OOOOOO TTT III KKK KKK
MikroTik RouterOS 3.30 (c) 1999-2009 http://www.mikrotik.com/

[9999B
[9999BZ [6n[4l[20l[?47l[?7h[?5l[?25h[H[9999B[6n[H[9999BD[9999A[6n[H[9999C[6n[HěH[6n
[H[9999C[6n [6n [6n[3;5r[H[6n

[6n[9999B[6n[r[1;9999r

›9999B[admin@bb5700-1.twrvwi-3.mercury.net] > 7›r8export

jan/02/1970 11:42:29 by RouterOS 3.30

software id = C127-ENPS

putty.log (979 Bytes)

ANSI or other characters to give you a nice coloured prompt?

Well that was an issue before so I use the login admin+c instead of admin. The +c makes the session have no color coding on anything so it should eliminate color coding characters.

do you log a Telnet session of raw TCP stream? read Telnet RFCs: http://en.wikipedia.org/wiki/Telnet#Related_RFCs

I used Putty and did a log of all data. I am not familiar with the RFC

a PuTTy? how?..

p.s. try ‘admin+ct’ username

I appologize the program that I am trying to use is using +ct not +c although for some reason +c still made the color coding go away, +ct did cause a lot of the junk at the beginning to go away. The Program PuTTY allows you to log to a txt document the raw data that it receives from the session, that is what I have attached.

I think you should look at this differently - this isn’t an issue with RouterOS not giving you the output you want, it’s an issue with your application not accepting and validating input correctly. It’s trivial to just throw away all non-printable characters from a data stream.
If it’s not your own application (you don’t have control over the source code), lobby the programmer to properly validate input.
Even if you succeed in getting RouterOS to give you output the application can use as is, that’s just a bandaid. You can’t rely on whatever feature (admin+c, admin+ct) helping you out not going away in version 4.2, or you might start monitoring other devices that give problematic output. The definitive fix is in the app.

I feel that you are correct in that statement, unfortunately this is one of my final attempts. The company who writes the software has said they won’t support MikroTik devices so I am stuck figuring it out on my own. I am looking for even a bandaid at this point. I understand I should just make the software work, and I am still trying to do that I am just looking down other avenues as well.