6 ms·
Just tried it out and it does indeed work. curl 'https://pbs.twimg.com/media/DqteCf6WsAAhqwV.jpg' > shakespeare.zip unzip shakespeare.zip unrar e shakesp
by BeefySwain 8y ago
Just tried it out and it does indeed work.
curl 'https://pbs.twimg.com/media/DqteCf6WsAAhqwV.jpg' > shakespeare.zip
unzip shakespeare.zip
unrar e shakespeare.part001.rar
I'm excited for the inevitable curl | unzip | bash method of installing software directly from twitter that is sure to follow.
- fireattack 8y agoInteresting that Winrar seems to have trouble to uncompress the first layer of it (zip to rars). (7-zip works fine.)
- jethro_tell 8y agoWell, if someone out there had paid for winrar, perhaps the support would be better XD
- ty_a 8y agoUnderrated.
- deleted 8y ago[deleted]
- tobyhinloopen 8y ago“I paid for Winrar, AMA”
- rzzzt 8y agohttps://www.reddit.com/r/paidforwinrar https://www.reddit.com/r/paidforwinrar
- HeavyStorm 8y agoWHY????
- theoctopus 8y agoI've been unable to extract the inner rars with 7-zip. Each shakespeare.html just gives a "Data error"
- 0-_-0 8y ago7-zip 16.04 x64 on win10 works
- charonn0 8y agoThere's more than one way to read a zip. 7-zip reads the zip file by scanning from the beginning of the file for the first entry signature (which need not be at the start of the file, which is why this trick works at all.) WinRAR reads the central directory located at the end of the file, which is technically how you're supposed to do it, but entry offsets given in the central directory are messed up by the existence of the JPG data at the beginning of the file. There also appears to be ~61KB of garbage data at the end of the file, which will trip up some zip readers that use the central directory. tl;dr: The zip file technically malformed, whether or not a given archive reader will choke on it depends on which technique they use and how forgiving their implementation is.
- fireattack 8y agoThanks for the detailed explanation.
- dddddaviddddd 8y agoSince the server is probably gzipping the response there's no need for an intermediate unzip step in curl | bash
- palunon 8y agoUnless the server only accept images upload and serves you the original file. This is (or at least used to be) popular to share arbitrary files on imageboards.
- tolnaiz 8y agoOnly if you send 'Accept-Encoding: gzip' or similar header with curl. Which curl doesn't do by default.
- detaro 8y agoImages are generally excluded from gzip transfer server-side, since it's a needless waste of CPU cycles.
- deleted 8y ago[deleted]
- pmontra 8y agounrar didn't work on Ubuntu 16.04, but rar did: $ unrar e shakespeare.part001.rar unknown archive type, only plain RAR 2.0 supported(normal and solid archives), SFX and Volumes are NOT supported! All OK $ sudo apt install rar $ rar x shakespeare.part001.rar ... shakespeare.html OK All OK
- cwt 8y agoit worked for me on ubuntu 16.04 $ unrar e shakespeare.part001.rar UNRAR 5.30 beta 2 freeware Copyright (c) 1993-2015 Alexander Roshal Extracting from shakespeare.part001.rar
- pmontra 8y agoI discovered that there are two versions of unrar: $ dpkg -l "*unrar*" Architecture Description un unrar <none> <none> (no description available) ii unrar-free 1:0.0.1+cvs2014070 amd64 Unarchiver for .rar files un unrar-nonfree <none> <none> (no description available) You probably have the nonfree package. I have no idea about what's the difference between them.
- excalibur 8y agoLooks like the original "unrar" has some licensing restrictions (for compression purposes, not decompression). The "unrar-free" version was created as pure FOSS in response, but the performance isn't quite up to par. If there are any compatibility issues, it's likely the latter version that's having them. No idea what "unrar-nonfree" is, I'm guessing it's just another name for the first "unrar". https://ubuntuforums.org/showthread.php?t=2012979 https://ubuntuforums.org/showthread.php?t=2012979
- deleted 8y ago[deleted]
- tyingq 8y ago"I'm excited for the inevitable curl | unzip | bash method of installing software directly from twitter that is sure to follow." Here you go... $ curl -s https://pbs.twimg.com/media/Dq2sPGNU0AEKyyC.jpg | dd status=none bs=1 skip=599 count=40| sh
- BeefySwain 8y agoVery impressive!
- ZKL0ot 8y agoWe throw ourselves on Termux and in fact it works. This vuln in Tw allows exfiltration methods and we can even try steganography... $curl 'https://pbs.twimg.com/media/DqteCf6WsAAhqwV?format=jpg' https://pbs.twimg.com/media/DqteCf6WsAAhqwV?format=jpg' > output $ file output output: JPEG image data, JFIF standard 1.01, aspect ratio, density 1x1, segment length 16 $ strings output.jpg | grep PK $./binwalk output.jpg $7z x shakespeare.part001.rar $ file shakespeare.html shakespeare.html: XML 1.0 document, UTF-8 Unicode (with BOM) text, with CRLF line terminators