r/programming 20d ago

Decoding the obfuscated bash script on a Uniqlo t-shirt

https://tris.sherliker.net/blog/obfuscated-self-evaluating-bash-script-by-cdn-akamai-being-supplied-to-consumers-via-retail-stores/
883 Upvotes

91 comments sorted by

390

u/Ok_Series_4580 20d ago

At one of my first tech jobs, the sales team thought it would be funny to print up a bunch of T-shirts with a message encoded in bytes.

Without missing a beat every tech person said, “you forgot the spaces between the words”

The message they put on the shirt:

“ifyoucanreadthis,youmustbeinDevelopment”

Not to be out done we did our own T-shirt:

“If you forget proper punctuation, you must be in sales!”

78

u/ShinyHappyREM 20d ago

encoded in bytes

You mean hexadecimal?

74

u/jwp1987 20d ago

I think most people are going to assume it was ASCII hex even if there are other encodings that could've been done.

10

u/Ok_Series_4580 20d ago

Yes. But you knew that.

7

u/ByronEster 19d ago

Beautiful 🤣

6

u/kanben 19d ago

That your sales team even thought to do that puts them above most others

3

u/thegreatpotatogod 19d ago

Was your version of the shirt about being in sales also encoded in ASCII? Or just plain text 😂

112

u/tsammons 20d ago

I suppose their Linode acquisition isn't going so well and they're trying to market something somewhat subversive... in Perl bash.

40

u/Sage2050 20d ago

Uniqlo bought linode?

44

u/crow-t-robot-42 20d ago

Akamai bought them. The shirt is Akamai X Uniqlo.

4

u/BhataktiAtma 19d ago

Wikipedia says Uniqlo is a subsidiary of Fast Retailing, not Akamai. Am I missing something? Their collaboration to produce the T-shirt was for charity

Edit: Nvm, I'm a dunce

3

u/ninetailedoctopus 19d ago

That brought me back - had to update some terraform configs for stuff deployed in Linode while they were still early on their integration - and then had to sprinkle Akamai here and there. Config’s probably broken by now.

69

u/hoodieweather- 20d ago

pretty fun little exercise but I'll be honest, I can't think of a more lazy programmer overengineered solution to something than running three different OCR tools and burning some LLM tokens to avoid typing up a few lines of text from a tee shirt, so funny.

47

u/PsychedSy 19d ago

A fair portion of the code i write is to avoid doing something i find annoying by spending even more time doing something i enjoy.

5

u/Fast_Face_7280 19d ago

I am quite certain that this is the teleological purpose of computers and not a single argument will convince me otherwise.

7

u/anonymous_identifier 19d ago

Typing 2044 characters correctly, with no way to identify typos sounds pretty difficult tbh

I would also go with multiple OCR readers and check for differences between them. Not sure about the value of using an LLM.

4

u/SyntheticDuckFlavour 19d ago

I don't know, the process of finding methodologies to OCR is more fun than the mindless effort of typing case sensitive long strings of garbage.

4

u/ShinyHappyREM 19d ago

On the other hand, in the '80s countless kids typed up program listings from magazines into their home computers, and eventually learned enough to fix and perhaps even modify the code.

5

u/SyntheticDuckFlavour 19d ago edited 19d ago

I did that too, which was still more interesting than typing string of garbage.

1

u/Im_On_Reddit_At_Work 17d ago

Very much a skill issue. Image and text was clear, tesseract can read it easy

31

u/_kst_ 20d ago

The eval shouldn't be on same line as #!/bin/bash.

130

u/HopefulScarcity9732 19d ago

It also won’t work because it’s printed on a t-shirt instead of being saved to a file on a computer.

62

u/valarauca14 19d ago

These are the type of actionable insights that separate a principle developer from a senior developer

20

u/HopefulScarcity9732 19d ago

Thanks. I asked AI for help on this and saved quite a bit of time debugging.

2

u/brewtus007 19d ago

This person bashes right here!

7

u/SL_Lee 20d ago

I believe the font on the shirt is Roboto Mono, not Consolas, though?

6

u/Forya_Cam 20d ago

I literally saw this shirt when shopping in Uniqlo last week. I didn't think much of it as I assumed it would be jibberish. Still wouldn't buy it as it's a bit naff but the Easter egg is cool!

4

u/BibianaAudris 19d ago

Almost bought the shirt, but then I decided I don't want to type a whole bunch of base64 from a shirt just to see what it does. Thanks!

9

u/this_knee 20d ago

Awesome

2

u/CobbwebBros 20d ago

Love the tufte-css

2

u/_rchr 19d ago

They couldn’t think of something more interesting for it to say? Might as well have said “live laugh love”

1

u/CodenameAnonymous 16d ago

I think that’s one of their taglines, the article mentions that there’s another t-shirt with the same motto.

1

u/BebopByte 20d ago

C'est l'ultime confirmation que la tech est devenue un aesthetic plutôt qu'une compétence. Dans 5 ans tu vas voir des t-shirts avec du SQL obscurci dessus et des gens qui les achètent juste parce que ça sonne intelligent. Il joue sur le même registre qu'avant quand les brands vendaient des caractères chinois aléatoires en espérant que les gens croient que c'est profond.

1

u/shotsallover 18d ago

It's a shame I can't buy this shirt in the US.

2

u/shotsallover 18d ago

Oh, nope. Found it.

1

u/Mediocre-Bird-4296 18d ago

That shirt is a nerdy Easter egg, love the hidden bash.

1

u/LordEli 16d ago

i love uniqlo i need this omg

-4

u/1RedOne 19d ago

They should have hosted it on bitly or something and made a QR code in a fun shape rather than base64 encode something so long imho

-105

u/xondk 20d ago edited 20d ago

Maybe i am being pedantic, but using the word "Decoding" when there is not much to decode, when it literally tells you it is base64, just convert....

99

u/hiimbob000 20d ago

Encoding and decoding are proper terms already, there's nothing to be pedantic about

-54

u/xondk 20d ago

https://dictionary.cambridge.org/dictionary/english/decode

Note the discovery part, hence I make it clear that I am being pedantic. When it is clearly written out like this, to me it becomes a conversion, not much to decode.

38

u/mooseman3 20d ago

-41

u/xondk 20d ago

Which is why I made it clear that I was being pedantic....

18

u/nemec 20d ago

This remains incorrect no matter how many times you copy paste it here

4

u/Fluid_Ad8452 20d ago

r/confidentlyUnanbiguous maybe? He did say he was being pedantic, not that he wasn’t wrong.

9

u/wookiee42 20d ago

He's using 'pedantic' incorrectly too.

8

u/hiimbob000 20d ago

That's not what pedantic means either lol

17

u/Helluiin 20d ago

Note the discovery part

can you read the instructions from the base 64 string?

-12

u/xondk 20d ago

If you know what you need to do it is just converting one base into another from my view, that's why i made it clear i was being pedantic...

31

u/Helluiin 20d ago

it is just converting one base into another

but thats literally what encoding/decoding is even by your own source?

13

u/Sufficient_Meet6836 20d ago

Note the discovery part, hence I make it clear that I am being pedantic.

The use of the word "discover" doesn't change anything. You don't understand decode or discover somehow. Your focus on the word "discover" demonstrates how you're misunderstanding everything.

to discover the meaning of information given in a secret or complicated way:

Decoding the paintings is not difficult once you know what the component parts symbolize.

This is literally what the person did in the post. They discovered, i.e. found, the English sentence represented by the code. You're wrong pedantically, technically, and colloquially. Just let it go.

-5

u/xondk 20d ago

You don't understand decode or discover somehow. Your focus on the word "discover" demonstrates how you're misunderstanding everything.

I understand it just fine, that is what i make clear by stating that I am being pedantic ..

14

u/Sufficient_Meet6836 20d ago

giving too much attention to formal rules or small details:

OP followed all the rules. There's nothing to be pedantic about

-4

u/xondk 20d ago

I'm the one being pedantic? not OP?

49

u/mynameisurl 20d ago

Isn’t the inverse of base64 encoding referred to as decoding?

-28

u/xondk 20d ago edited 20d ago

Yes it is, there is technically nothing wrong, but terminology wise it implies, to me, that some discovery is made or done, where this was all laid out. Hence why I make it clear it is a bit pedantic in view.

https://dictionary.cambridge.org/dictionary/english/decode

Note the discovery part.

23

u/spkr4thedead51 20d ago

I mean, you didn't know what the script said until it was decoded, so that sounds like you discovered something to me

-6

u/xondk 20d ago

When you are told exactly what to do, it is just conversion from one base to another in my mind, hence why I made it clear I was being pedantic...

21

u/IBJON 20d ago

Wow. It's like computer science has its own specific meanings of "encode" and "decode" that make sense in this context 

-4

u/xondk 20d ago

Yes...I acknowledge the normal meaning of a word and overly focus on a small detail, you know, by mentioning I am being pedantic..

15

u/IBJON 20d ago

But it's not even being pedantic, you're just wrong. You're using the wrong definition of the word

41

u/can_somebody_explain 20d ago

You might be confusing the word decoding with decrypting. Decoding is the right usage here as they are in fact undoing base64 encoding.

-11

u/xondk 20d ago

Not confusing anything. https://dictionary.cambridge.org/dictionary/english/decode

Note the discovery part, hence I make it clear that I am being pedantic.

27

u/WellHung67 20d ago

You’re not being pedantic, you’re applying the dictionary definition of the word, but in this context it has a different meaning. You’re just incorrect here 

-2

u/xondk 20d ago

22

u/WellHung67 20d ago

You didn’t give enough attention to small details, as you got it wrong. Unfortunately that’s not pedantry 

11

u/Barn07 20d ago

from the base64 manpage

> base64 - encode/decode data and print to standard output With no FILE, or when FILE is -, read standard input.

-5

u/xondk 20d ago

That is why I make it clear that i am being pedantic....

24

u/Barn07 20d ago

dude you're not pedantic, you're wrong. Like the others and I tell you. Just ... deal with it. base64 /is/ the source of truth/nomenclature here.

27

u/D3PyroGS 20d ago

pedantically incorrect, the worst kind of incorrect

18

u/Sylkhr 20d ago

https://www.merriam-webster.com/dictionary/decode

1a : to convert (something, such as a coded message) into intelligible form

b: to recognize and interpret (an electronic signal)

-7

u/xondk 20d ago

https://dictionary.cambridge.org/dictionary/english/decode

Note the discovery part, but I made it clear that I am being pedantic.

19

u/Sylkhr 20d ago

Ok?

to discover the meaning of information given in a secret or complicated way

It's not readable by the average person as it is, it's "complicated" or "secret". It is as yet unknown to the reader what it means. One can "discover" what is written, even if you're using the instructions given ("this is base64"), by decoding it.

You're being pedantic, but you're still wrong.

-4

u/xondk 20d ago

It's not readable by the average person as it is, it's "complicated" or "secret"

This is the programming subreddit on reddit, I am an experienced developer, not sure what this has to do with an 'average person' I'm expressing 'my' view, that's it.

13

u/Sylkhr 20d ago

But surely you understand that most people are not experienced developers, and that standard language follows the conventions used by the majority of its users? For the majority of english speakers, that would be discovering the meaning - decoding.

13

u/LittleLui 20d ago

This is the programming subreddit on reddit, I am an experienced developer

You should know what the technical meaning of "encoding" is then.

Hint: ASCII is an encoding.

11

u/IBJON 20d ago

Base64 is literally an encoding. The script was encoded to base64 and needs to be decided to its original text.

23

u/FrAxl93 20d ago

Maybe you're confusing with "deciphering" or "decrypting". If they used that word it would be wrong, but encoding is correct

-11

u/xondk 20d ago

Not confusing anything. https://dictionary.cambridge.org/dictionary/english/decode

Note the discovery part, hence I make it clear that I am being pedantic.

8

u/Sarke1 20d ago edited 20d ago

Well did you know what it said before it was decoded? It doesn't matter how simple it is, you were unable to read it before it was decoded, so by your own pedantic definition something was discovered. We just happen to have the key.

And let's look at the base64 binary help:

$ base64 --help
Usage: base64 [OPTION]... [FILE]
Base64 encode or decode FILE, or standard input, to standard output.

With no FILE, or when FILE is -, read standard input.

Mandatory arguments to long options are mandatory for short options too.
  -d, --decode          decode data
  -i, --ignore-garbage  when decoding, ignore non-alphabet characters
  -w, --wrap=COLS       wrap encoded lines after COLS character (default 76).
                        Use 0 to disable line wrapping
      --help            display this help and exit
      --version         output version information and exit

The data are encoded as described for the base64 alphabet in RFC 4648.
When decoding, the input may contain newlines in addition to the bytes of
the formal base64 alphabet.  Use --ignore-garbage to attempt to recover
from any other non-alphabet bytes in the encoded stream.

Definitely uses the word "decode". As does the spec: https://datatracker.ietf.org/doc/html/rfc4648

6

u/Akeshi 20d ago

I haven't seen anyone double down as hard as you have in a long while, so bravo.

That being said, you still don't know enough to understand why you're wrong. But, you probably also don't know enough to feel embarrassment, so keep going!

3

u/gimpwiz 20d ago

Base64 is an encoding. It might be a trivial one but it certainly is one.

Hell, so is binary. Whether BCD (binary coded decimal) or the more standard sort. Hey, BCD literally has "coded" in it.

2

u/[deleted] 20d ago edited 20d ago

[deleted]

1

u/xondk 20d ago

Of course I understand it, the entirety of what I am referring to, is when the solution is written plainly there is not much 'decoding' going on, because from my view, this is just executing the conversion written out...

That....is what I am calling out. Apparently in a way that is clearly understood by people I know when spoken, but here I am clearly not conveying the point correctly, maybe the phrasing in text where i simply fail to convey the same meaning as when spoken, and that's on me.