Passing Special Characters into telnet Unix

大城市里の小女人 提交于 2019-12-04 13:49:38

Have you tried encoding the message first? You can do this using base64 in UTF-8 charset:- e.g. Convert: msg="£1234" To: msg="wqMxMjM0"

NOTE:Try testing encoding/decoding using the online converter - https://www.base64encode.org/

Once you have encoded your text you can send the message via telnet by adding the MIME details after the DATA command in telnet by specifying MIME types, example script below:-

telnet localhost 0000 <<-EOF 
helo x
MAIL FROM: Test
RCPT TO: 447999999999
DATA
Subject: Test
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: base64

${msg}
.
logout
quit
EOF

Hope that helps.

In some installations, telnet is not 8-bit clean by default (It does not recognize 8-bit character encodings such as Unicode). In order to be able to send Unicode keystrokes to the remote host, you need to set telnet into "outbinary" mode. There are two ways to do this:

$ telnet -L <host>

and

$ telnet

telnet> set outbinary

telnet> open <host>

Source

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!