No ARM Printer Driver? Just Write Your Own

When you think of the small machines that print the sticky labels on packages, you might not expect to find a complex printer with its own programming language (ZPL). However, [Dan Pastusek] was looking around online and found a small label printer on everyone’s favorite online warehouse for a great price that suggested it supported ZPL. Unfortunately, [Dan] had big dreams for creating a Raspberry Pi-based print station and found the drivers packaged for this particular printer were not ARM compatible. Not quite content to leave it there, he began to chip away at the layers until he had a working driver.

ZPL, at its core, is just a language describing ASCII commands transmitted over a serial connection. So while the printer showed up as an endpoint, it wasn’t working as the filters (the part of the driver that knows how to convert from a PNG to ZPL) was x86 only. On Linux, printer drivers also have a PPD file that describes what a printer can handle in paper size and other settings. The PPD file for the little printer gave the first clue. In the ShortNickName field, it identifies itself as HPRT N41, which is a popular HP printer. So this little printer must be a clone of a printer in that family. Notably, they don’t support ZPL. Instead, the HPRT series support TSPL, another printer language developed by TSC.

This presented a problem as the shipping service that provided the labels that [Dan] was using offered labels in three formats: PNG, PDF, and ZPL. Currently, it does seem like there’s a TSPL to ZPL converter out there for use, so rather than write his own, he took a shortcut and wrote a rasterizer instead. Initially, he tried to use some sample code that he found, and while he got something to come out of the printer, it was blank. So the next test was to save the raw TSPL output from a filer and cat directly to the serial port. This worked amazingly. Next, he wrote a converter to take a PNG and convert them into the bitmap format the TSPL has. The converter is in Javascript as it runs as part of the webserver that manages the print station. Could it be faster in a different language? Sure. But a different language wouldn’t make the printer any faster.

With the addition of a wireless barcode scanner, it’s satisfying to see the print station up and running. Here at Hackaday, we’re no stranger to seeing folks take apart printers to peel back the software and physical layers that make them up.

This Week In Security: Geopolitical Hacktivism, Antivirus Mining, And Linux Malware

The CIA Hacktivists have launched a sort of ransomware campaign against the Belarusian rail system, but instead of cryptocurrency, they want the release of political prisoners and removal of Russian soldiers. This could be called an example of cyber-terrorism, though there is a reasonable theory that this is a state-sponsored hack, masquerading as hacktivism. What does seem certain is that something has interrupted rail transit, and a group on Twitter has produced convincing proof of a breach.

Your Antivirus Now Includes a CryptoMiner

Don’t look now, but your latest update of Norton 360 or Avira may have installed a cryptocurrency mining module. The silver lining is that some sanity has been retained, and you have to opt-in to the crypto scheme before your machine starts spending its spare cycles on mining. For users who do, they’re put into a mining pool, making for small payouts for most hardware. Norton, naturally, takes a 15% fee off the top for their trouble.

The State of Linux Malware

There used to be an adage that Linux machines don’t get malware. That’s never really been quite true, but the continued conquest of the server landscape has had the side effect of making Linux malware an even greater danger. Crowdstrike has seen a 35% increase in Linux malware in 2021, with three distinct categories leading the charge: XorDDoS, Mozi, and Mirai. Continue reading “This Week In Security: Geopolitical Hacktivism, Antivirus Mining, And Linux Malware”

SHERLOC And The Search For Life On Mars

Humanity has been wondering about whether life exists beyond our little backwater planet for so long that we’ve developed a kind of cultural bias as to how the answer to this central question will be revealed. Most of us probably imagine that NASA or some other space agency will schedule a press conference, an assembled panel of scientific luminaries will announce the findings, and newspapers around the world will blare “WE ARE NOT ALONE!” headlines. We’ve all seen that movie before, so that’s the way it has to be, right?

Probably not. Short of an improbable event like an alien spacecraft landing while a Google Street View car was driving by or receiving an unambiguously intelligent radio message from the stars, the conclusion that life exists now or once did outside our particular gravity well is likely to be reached in a piecewise process, an accretion of evidence built up over a long time until on balance, the only reasonable conclusion is that we are not alone. And that’s exactly what the announcement at the end of last year that the Mars rover Perseverance had discovered evidence of organic molecules in the rocks of Jezero crater was — another piece of the puzzle, and another step toward answering the fundamental question of the uniqueness of life.

Discovering organic molecules on Mars is far from proof that life once existed there. But it’s a step on the way, as well as a great excuse to look into the scientific principles and engineering of the instruments that made this discovery possible — the whimsically named SHERLOC and WATSON.

Continue reading “SHERLOC And The Search For Life On Mars”

A Zhengbang Pick&Place machine, with a Virustotal 53/69 result and "53 security vendors and 1 sandbox flagged this file as mailcious" crudely overlaid on top of the image

Zhengbang Pick & Places Your Confidential Data In The Bag, Slowly

Isn’t it convenient when your pick-and-place machine arrives with a fully-set-up computer inside of it? Plug in a keyboard, mouse and a monitor, and you have a production line ready to go. Turns out, you can have third parties partake in your convenience by sharing your private information with them – as long as you plug in an Ethernet cable! [Richard] from [RM Cybernetics] has purchased a ZhengBang ZB3245TSS machine, and in the process of setting it up, dutifully backed up its software onto a USB stick – as we all ought to.

This bit of extra care, often missed by fellow hackers, triggered an antivirus scanner alert, and subsequently netted some interesting results on VirusTotal – with 53/69 result for a particular file. That wasn’t conclusive enough – they’ve sent the suspicious file for an analysis, and the test came back positive. After static and dynamic analysis done by a third party, the malware was confirmed to collect metadata accessible to the machine and send it all to a third-party server. Having contacted ZhengBang about this mishap, they received a letter with assurances that the files were harmless, and a .zip attachment with replacement “clean” files which didn’t fail the antivirus checks.

It didn’t end here! After installing the “clean” files, they also ran a few anti-malware tools, and all seemed fine. Then, they plugged the flash drive into another computer again… to encounter even more alerts than before. The malware was equipped with a mechanism to grace every accessible .exe with a copy of itself on sight, infecting even .exe‘s of the anti-malware tools they put on that USB drive. The article implies that the malware could’ve been placed on the machines to collect your company’s proprietary design information – we haven’t found a whole lot of data to support that assertion, however; as much as it is a plausible intention, it could have been a case of an unrelated virus spread in the factory. Surprisingly, all of these discoveries don’t count as violations of Aliexpress Terms and Conditions – so if you’d like to distribute a bunch of IoT malware on, say, wireless routers you bought in bulk, now you know of a platform that will help you!

This goes in our bin of Pretty Bad News for makers and small companies. If you happen to have a ZhengBang pick-and-place machine with a built-in computer, we recommend that you familiarize yourself with the article and do an investigation. The article also goes into details on how to reinstall Windows while keeping all the drivers and software libraries working, but we highly recommend you worry about the impact of this machine’s infection spread mechanisms, first.

Supply chain attacks, eh? We’ve seen plenty of these lately, what’s with communities and software repositories being targeted every now and then. Malware embedded into devices from the factory isn’t a stranger to us, either – at least, this time we have way more information than we did when Supermicro was under fire.

Editor’s Note: As pointed out by our commenters, there’s currently not enough evidence to assert that Zhengbang’s intentions were malicious. The article has been edited to reflect the situation more accurately, and will be updated if more information becomes available.

Editor’s Note Again: A rep from Zhengbang showed up in the comments and claims that this was indeed a virus that they picked up and unintentionally passed on to the end clients.

Painted Over But Not Forgotten: Restoring Lost Paintings With Radiation And Mathematics

An intrinsic property of paintings, that makes them both wonderful and very annoying, is the fact that they are physical objects. Sometimes they survive across the ages as amazing artifacts of their era, but they are also susceptible to being lost and even destroyed. Sometimes this destruction is deliberate, such as when a painting is painted over.

Artists reuse canvas all the time — painting over what was already there. Sometimes they might be coerced by a client into altering a painting, or removing entire elements from a scene. Fortunately, nowadays we have many techniques, involving x-rays and infrared radiation, that can analyze paintings to determine not only the composition of what we can see with the naked eye, but also that what lies underneath.

In some cases, we can then reconstruct what was previously hidden, returning to physical reality paintings and sketches which haven’t seen the light of day for sometimes centuries. Continue reading “Painted Over But Not Forgotten: Restoring Lost Paintings With Radiation And Mathematics”

An Open Source Detector For Identifying Plastics

One of the challenges involved in recycling plastic is determining the specific type of plastic a given item is actually made of. To keep up with demand, large scale recycling centers rely on various automated systems to separate different types of plastic from a stream of incoming material. But in less technologically advanced parts of the world, workers can find themselves having to manually identify plastic objects; a time consuming and error-prone process.

To try and improve on the situation, [Jerry de Vos], [Armin Straller], and [Jure Vidmar] have been working on a handheld open hardware device that they refer to simply enough as the Plastic Scanner. The hope is that their pocket-sized unit could be used in the field to positively identify various types of plastic by measuring its reflectivity to infrared light. The device promises to be very easy to operate, as users simply need to bring the device close to a piece of plastic, push the button, and wait for the information to pop up on the OLED display.

Or at least, that’s the idea. While the team eventually hopes to release a kit to build your own handheld Plastic Scanner, it seems that the hardware isn’t quite ready for production. The most recent work appears to have been put in, not unexpectedly, the development board that lets the team refine their process. The development unit combines an array of IR LEDs with wavelengths ranging from 850 to 1650 nanometers, a InGaAs photodiode connected to an ADS1256 24-bit analog-to-digital converter (ADC), and an Arduino Uno. In comparison, the final hardware uses a Raspberry Pi Zero and a smaller “breakout board” that contains the sensor and IR LEDs.

Browsing through the software repository for the project, we can see the device uses Python, TensorFlow Lite, and a database of IR reflectivity values for known plastics to try and determine the closest match. Obviously the accuracy of such a system is going to be highly dependent on the quantity of known-good data, but at least for now, it appears the user is responsible for building up their own collection or IR values.

As interesting as this project is, we’re a bit skeptical about its purely optical approach to identifying plastics. Automated recycling centers do use infrared spectroscopy, but it’s only one tool of many that are employed. Without additional data points, such as the density or electrostatic properties of the plastic being tested, it seems like the Plastic Scanner would have a fairly high margin of error. Just taking into account the wide array of textures and colors the user is likely to encounter while using the device will be a considerable challenge.

Continue reading “An Open Source Detector For Identifying Plastics”

Cracking The Spotify Code

If you’ve used Spotify, you might have noticed a handy little code that it can generate that looks like a series of bars of different heights. If you’re like [Peter Boone], such an encoding will pique your curiosity, and you might set out to figure out how they work.

Spotify offers a little picture that, when scanned, opens almost anything searchable with Spotify. Several lines are centered on the Spotify logo with eight different heights, storing information in octal. Many visual encoding schemes encode some URI (Uniform Resource Identifier) that provides a unique identifier for that specific song, album, or artist when decoded. Since many URIs on Spotify are pretty long (one example being spotify :show:3NRV0mhZa8xeRT0EyLPaIp which clocks in at 218 bits), some mechanism is needed to compress the URIs down to something more manageable. Enter the media reference, a short sequence encoding a specific URI, generally under 40 bits. The reference is just a lookup in a database that Spotify maintains, so it requires a network connection to resolve. The actual encoding scheme from media reference to the values in the bars is quite complex involving CRC, convolution, and puncturing. The CRC allows the program to check for correct decoding, and the convolution enables the program to have a small number of read errors while still having an accurate result. Puncturing is just removing bits to reduce the numbers encoded, relying on convolution to fill in the holes.

[Peter] explains it all in his write-up helpfully and understandably. The creator of the Spotify codes stopped by in the comments to offer some valuable pointers, including pointing out there is a second mode where the lines aren’t centered, allowing it to store double the bits. [Peter] has a python package on Github with all the needed code for you to start decoding. Maybe you can incorporate a Spotify code scanner into your custom Spotify playing mini computer.