Nп/п : 9 из 96
 От   : Jakob Bohm                          2:5075/128        17 мар 23 14:23:04
 К    : All                                                   17 мар 23 16:24:13
 Тема : Re: ? Unsafe terminal escape sequences and ANSI codes from decryption
----------------------------------------------------------------------------------
                                                                                 
@MSGID: <3rGdnde40_TK9In5nZ2dnZeNn_pi4p2d@giganews.com>
eec4f9da
@REPLY: 1@tncsrv09.home.tnetconsulting.net>
ec3a2e9c
@REPLYADDR Jakob Bohm
<jb-usenet@wisemo.com.invalid>
@REPLYTO 2:5075/128 Jakob Bohm
@CHRS: CP866 2
@RFC: 1 0
@RFC-References: 1@news.cyber23.de>
1@news.xmission.com> <WnqdnaEQAqGw9Jv5nZ2dnZfqn_adnZ2d@giganews.com>
1@tncsrv09.home.tnetconsulting.net> <EgOdnW4SMPJQG5v5nZ2dnZfqnPWdnZ2d@giganews.com>
1@tncsrv09.home.tnetconsulting.net> <9KqdnbC-6MvWC5v5nZ2dnZfqn_SdnZ2d@giganews.com>
1@tncsrv09.home.tnetconsulting.net>
@RFC-Message-ID:
<3rGdnde40_TK9In5nZ2dnZeNn_pi4p2d@giganews.com>
@TZUTC: 0100
@PID: Mozilla/5.0 (Windows NT 6.3; Win64; x64;
rv:5.2) Goanna/20221030 Epyrus/2.0.0
@TID: FIDOGATE-5.12-ge4e8b94
On 2023-03-07 07:35, Grant Taylor wrote:
> On 3/6/23 6:41 PM, Dennis Boone wrote:
>> I`m envisioning something more like some non-host party injecting 
>> hostile text and control sequences that the host ends up sending to 
>> some legitimate user.

> Hum.

> If I`m understanding you correctly, say someone manages to post a 
> message to an echo -- I think that`s the term I want -- that contains 
> hostile control sequences and the terminal user reads said message, 
> thereby causing their terminal (emulator) to interpret said hostile 
> control sequences.

> I`m eliding how such hostile control sequences make it that point and 
> only focusing on an unwitting user accidentally causing the host to send 
> them.




The OP provided a clear and traditional attack path: Entice the OP to
read a file by passing it to either cat, stdout of a communications
program like PGP, or a non-filtering viewer such as traditional "more"
or some implementations of "less -R".  Ditto could be done over a
traditional teletype remote connection where the OP naively expects
a human typing messages from their end, or an honest service providing
messages such as "newswires" or weather updates.

Note that "less -R and less -r" are mostly useful for viewing files that
contain locally controlled and trusted escape sequences for things like
color highlighting or sequences of self-overwriting progress bars.  Such
files would typically come from capturing stdout from some other locally
trusted program like git.

The easiest way to do safe filtering is to simply drop any bytes in the
ranges 0-31, 127-159 and 255 (decimal), as those are control character
on various ASCII-derived terminal character sets.  If you are certain
the terminal is in UTF-8 or CESU-8 mode, instead apply similar filters
to the decoded UCS-4 codepoints, then reencode the allowed ones.  More
sophisticated filtering could recognize the syntax pattern of ECMA-48
CSI sequences, noting the maximum number of parameters and characters
per parameter in such sequences.

The entire attack category used to be known as an "ANSI Bomb" in
reference to the MS-DOS escape sequence handler known as ANSI.SYS

I fondly remembering trusted DEC systems using these capabilities to
do things like animated login screens on actual DEC VT-xxx terminals.

P.S.

A Handy reference for popular codes is the Linux manual page
console_codes(4).  The manpage viewer itself is a good example of
providing already trusted input to "less -r"

Enjoy

Jakob
-- 
Jakob Bohm, CIO, Partner, WiseMo A/S.  https://www.wisemo.com
Transformervej 29, 2860 S?borg, Denmark.  Direct +45 31 13 16 10
This public discussion message is non-binding and may contain errors.
WiseMo - Remote Service Management for PCs, Phones and Embedded
 --- Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:5.2) Goanna/20221030
Epyrus/2.0.0
 * Origin: WiseMo A/S (2:5075/128)
SEEN-BY: 50/109 301/1 463/68 467/888 4500/1
5001/100 5005/49 5020/715 830 848
SEEN-BY: 5020/1042 4441 12000 5030/49 1081 5054/8
5064/56 5075/35 128 5083/1
SEEN-BY: 5083/444
@PATH: 5075/128 5020/1042 4441



   GoldED+ VK   │                                                 │   09:55:30    
                                                                                
В этой области больше нет сообщений.

Остаться здесь
Перейти к списку сообщений
Перейти к списку эх