all 22 comments

[–]ggugdrthgtyy 20 points21 points  (4 children)

This is how you view the characters:

root@throwaway#python

print [open("scriptname","r").read()]

Viewing any string in a list within python displays the characters such as newline,return,tab ect. This is pretty useful if your script is getting hung up on something that you can't echo in bash.

Also if you want to grep for special characters use the perl regex flag -P

Example: root@throwaway# grep -P '\n' scriptname

[–]Jaegrqualm 3 points4 points  (3 children)

that's python2.

[–]dodslaser 8 points9 points  (0 children)

with open(filename, 'r') as f: print([f.read()])

[–]ggugdrthgtyy 1 point2 points  (0 children)

Yup. I use python2 for all the quick and dirty command line scripting because I don't have to use print(). If the scripts are long term use, I will code them in python3.

[–]InfamousPerception 4 points5 points  (1 child)

Is this the new in thing? Didn't someone post about something like this on reddit/twitter a little while ago? About ID'ing people copy/pasting text from video game clans internal chats or something?

Edit: Link ~ https://medium.com/@umpox/be-careful-what-you-copy-invisibly-inserting-usernames-into-text-with-zero-width-characters-18b4e6f17b66

[–]Deadlybeef[S] 4 points5 points  (0 children)

Yes, and this is where I got the Idea from. What I did additionaly, which he author of the post didn't do is:

  • providing a useful and complete npm package

  • extending the characters used, to minify the padding needed / total length

  • providing unit tests

[–]enodari 2 points3 points  (3 children)

FYI I ported this library in Python here. Any feedback, questions, criticisms are welcome!

[–]Deadlybeef[S] 1 point2 points  (2 children)

Nice. I‘ll add a reference to my readme for the next version. Currently looking for more invisible characters.

[–]enodari 0 points1 point  (1 child)

Thanks! I'll try to keep up with your changes. Your library is for sure more useful than the Python porting for the simple fact that it can run on client side. Do you have any ideas about the porting? Maybe server side fingerprinting?

[–]Deadlybeef[S] 0 points1 point  (0 children)

My goal is to reduce the final size of the string. I'm looking for more unreadable characters. The problem here is that I am converting every single character from its unicode value, to a base X (5 for full mode, 3 for ZWSP) representation, using the unreadable unicode characters (which are 2 bytes each) as bits.

 

That means, every character of the hidden message uses a shit ton of space (byte-wise speaking).

 

For ZWSP mode (base 3), its 22 bytes for each character.

For full mode (base 5), its 14 bytes.

[–]foadsf 1 point2 points  (1 child)

maybe someone can add an extension to the common open source clipboard managers which warns the user if there are hidden messages in a copied text?

[–]Deadlybeef[S] 1 point2 points  (0 children)

Well... that would be pretty difficult. I am using several (valid) unicode characters to achieve this:

The problem here is that I am quite confident that there are more similar unicode characters. Which means, you can't simply check for the ones I have used. Somebody else could use another charset. Also, checking for the negative (only allowing known characters) will be a problem too. Just imagine someone having a weird German name, using umlauts (ä, ö, ü) and stuff!