Obfuscated bash script by Akamai being supplied to consumers via retail stores
Obfuscated bash script by Akamai being supplied to consumers via retail stores
Obfuscated, self-evaluating bash script by CDN Akamai being supplied to consumers via retail stores
当我的妻子对我说“让我给你看一件我看到的T恤……”时,我并不确定会看到什么,但绝对没想到会是一段印在背面、旨在打印出一段快乐彩蛋信息的混淆 Bash 脚本。我并没有写标题党的习惯(我完全不知道这个网站每月的访问量有多少,但我敢打赌连两位数的人类都不到),但我能理解为什么编辑们那么喜欢写标题党。严格来说,上面的标题完全准确,但可能和你想象的不一样。
The title above is, strictly speaking, entirely accurate, but probably not what you think. The obfuscated code in question is actually an easter egg, it’s being supplied via Uniqlo stores on an excellent t-shirt designed by Akamai in support of their Peace for All campaign. And it’s very cool!
上述标题严格来说完全准确,但可能与你所想的有所出入。这个所谓的混淆代码实际上是一个彩蛋,它出现在优衣库(Uniqlo)门店销售的一件精美 T 恤上,由 Akamai 设计,旨在支持他们的“和平为了所有人”(Peace for All)活动。而且它非常酷!
The front has a heart in curly braces: While the back has a big alphanumeric block: Is that … a shebang?! My wife was right that I’d want to see it. Was that… a shebang? Take a closer look at the text block: Yes, a shebang! On a t-shirt sold in a high street store, no less. And it is clearly a base64 encoded Here string being fed to eval via base64 —decode. Interesting. I told my wife “that’s basically how people ship viruses’ and bought it.
T 恤正面有一个花括号包裹的心形图案,而背面则是一个巨大的字母数字块:那是……Shebang(#!)吗?!我妻子说得对,我确实想看看。那真的是 Shebang 吗?仔细观察那个文本块:没错,就是 Shebang!而且还是印在街头商店销售的 T 恤上。这显然是一个通过 base64 --decode 传给 eval 的 Base64 编码 Here 字符串。很有意思。我告诉妻子:“这基本上就是人们传播病毒的方式”,然后就买下了它。
OCR was cumbersome. There was good news and bad news: The bad news was that base64 hasn’t got error correction, meaning that the transcription would need to be perfect. Sigh. The good news was that the string seemed to be intact - at least, it terminated with the expected padding and had matching quotes and braces.
OCR(光学字符识别)过程很麻烦。有好消息也有坏消息:坏消息是 Base64 没有纠错功能,这意味着转录必须完美无缺。唉。好消息是字符串看起来是完整的——至少它以预期的填充字符结尾,并且引号和括号都是匹配的。
This is a good thing because Uniqlo x Akamai sells another design of shirt in the same range which is plainly incomplete. For example, its imports are truncated and it ends “retu” instead of “return”. This is a pity, because it’s a really nice colour combination and contains the highly idiomatic instruction go doStuff(msg, work… which anyone can relate to., a truncated crop from a wider text block which could never compile.
这是一件好事,因为优衣库与 Akamai 合作的同一系列中还有另一款设计,明显是不完整的。例如,它的导入语句被截断了,结尾是“retu”而不是“return”。这很可惜,因为那件衣服的配色非常漂亮,而且包含了一个非常地道的指令 go doStuff(msg, work...(这引起了所有人的共鸣),但这只是从一段无法编译的更长文本块中截取出来的片段。
I ran OCR in a few ways: First, using the built-in OCR of the circle-to-search feature on Android, which is often very good. Second, by using Tesseract with a few options and tweaks. And third by running it through Claude. After diffing the three to look for mismatches and getting Claude to output a table of locations for quick scanning, it became trivial but time-consuming to tidy up the remainder.
我通过几种方式运行了 OCR:首先,使用 Android 系统内置的“圈选搜索”(circle-to-search)功能,它通常效果很好。其次,使用带有特定选项和调整的 Tesseract。第三,通过 Claude 进行识别。在对比这三种结果以查找差异,并让 Claude 输出一个位置表格以便快速扫描后,清理剩余部分变得简单但耗时。
The decoded script: After Base64 decoding, the resulting script is a welcoming and nicely commented Easter egg. The result is a continuous happy sine-wave loop of the campaign message, Peace for All.
解码后的脚本:经过 Base64 解码后,得到的脚本是一个充满欢迎意味且注释良好的彩蛋。最终效果是活动口号“Peace for All”以正弦波形式循环显示的快乐动画。