Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: USB Malware Code Unleashed  (Read 5872 times)

0 Members and 1 Guest are viewing this topic.

Geek-9pm

    Topic Starter

    Mastermind
  • Geek After Dark
  • Thanked: 1026
    • Gekk9pm bnlog
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 10
USB Malware Code Unleashed
« on: October 25, 2014, 07:23:26 PM »
The quotes below are from copyright material. Go to the link for full inkformation.
Quote
Gear and Gadgets
Warning: USB Malware Code Unleashed
Oct 6, 2014 10:40 AM ET // by Sara Angeles, Business News Daily
Back in July, security researchers Karsten Nohl and Jakob Lell revealed that USB sticks have an unfixable security flaw that can allow malware to take over your entire PC -- without you knowing it.
...
The malware can also be executed from any USB device, not just flash drives. This includes USB keyboards, mobile devices and more.
...
http://news.discovery.com/tech/gear-and-gadgets/warning-usb-malware-code-unleashed-141006.htm
So is this news? Because to date there is NOT an defective way to eliminate this threat. Contrary to what you may think, thee is no simple tool to remove the threat. It is a design flaw, not a specific virus.
Another reference:
http://www.pcmag.com/article2/0,2817,2469800,00.asp

BC_Programmer


    Mastermind
  • Typing is no substitute for thinking.
  • Thanked: 1140
    • Yes
    • Yes
    • BC-Programming.com
  • Certifications: List
  • Computer: Specs
  • Experience: Beginner
  • OS: Windows 11
Re: USB Malware Code Unleashed
« Reply #1 on: October 25, 2014, 09:02:37 PM »
We already covered this.
I was trying to dereference Null Pointers before it was cool.

Geek-9pm

    Topic Starter

    Mastermind
  • Geek After Dark
  • Thanked: 1026
    • Gekk9pm bnlog
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 10
Re: USB Malware Code Unleashed
« Reply #2 on: October 25, 2014, 09:09:14 PM »
We already covered this.
No we did not. Do some research.
It is not about as virus per se. It is a design defeat. Unfortunately most discussions treat this as just anther virus threat. It is not just another  hacker trick. The USB standard has a fundamental flew that is an open door to whoever wants in.
Earlier this was explained in wired.
http://www.wired.com/2014/07/usb-security/
Since then, few so-called 'expert's, including yourself , failed to get the point. USB is broken.
 If you know part of it,  learn all of it.
Google it. USB is broken
http://www.computerworld.com/article/2476621/malware-vulnerabilities/panic--stop-using-usb--it-s---fundamentally-broken-----badusb.html
« Last Edit: October 25, 2014, 09:21:18 PM by Geek-9pm »

BC_Programmer


    Mastermind
  • Typing is no substitute for thinking.
  • Thanked: 1140
    • Yes
    • Yes
    • BC-Programming.com
  • Certifications: List
  • Computer: Specs
  • Experience: Beginner
  • OS: Windows 11
Re: USB Malware Code Unleashed
« Reply #3 on: October 26, 2014, 01:32:07 AM »
No we did not. Do some research.
The topic I linked is about this exact thing. It's based on the EXACT same source articles, the only difference is the one you linked has decided to be three months behind.
Quote
It is not about as virus per se. It is a design defeat.
The fact is that USB drives and devices do not recognize or use some sort of standard in terms of flashing their firmware or controller EEPROMs. most devices don't use EEPROMS at all, and instead use EPROMS; quite a different technology in terms of "badUSB". I wasn't able to find much beyond laymans crap detailing exactly what it exploits, written by people who probably have no more of a clue about it. The actual information I was able to find presents details that call many of the original claims of how dangerous it is as unsubstantiated FUD. Most of them assert- as I believe you have done, that USB firmware is "vulnerable".

This raises several questions. Namely- What, Why, How, and Who. As in, What is it vulnerable to, Why is it vulnerable to it, How would it be used and who would benefit from making use of the vulnerability. Answers to these questions are not forthcoming, even though the badUSB source has been released.

I was able to find a sourcecode repository which paints some realistic light over the actual thing, rather than the absolute garbage FUD that you get from a google search that pretty much just gives you clickbait articles:

https://github.com/adamcaudill/Psychson

As we see here the issue is allegedly with the 8051 microcontroller used on a subset of USB devices. It is far from as ubiquitous as the clickbait articles would seem to suggest. In this particular case, it will only apply to Flash Drives, as well- so there goes all the claims in FUD articles about keyboards and mice and such.

Of particular note would be to read through the instructions. There are a large number of pitfalls. for example, some scripts will need adjustments based on the drive. This is done from a perspective of having the drive. The use in malware, however, would require that these payloads be delivered and installed to drives that aren't known.

Also, we can easily note some particular issues in terms of it's application to malware. I would first note the issues page, which currently has around 20 issues where people are having trouble using it on a drive for which they know the parameters.

Browsing the source code, the programs core operation- and the mechanic which allows it to trick various drives- is particularly limited.

DeviceIoControl. it uses this function a lot. This has an issue  though- it won't work unless the program is running as administrator. Also, it only works for very specific drive parameters. The entire concept code only works with a very specific patriot drive and a few compatible drives.

Assuming a device can even be "infected"(flashed) at all, the second issue is that the "malicious" actions of the drive are limited to pretending to be other USB devices. That is of rather limited utility- generally the best option is to pretend to be a keyboard, which is pretty limited in terms of it's ability to infect an arbitrary machine. Thus my reasoning in my post in the other thread which I linked, which was that this would only be particularly useful for malicious uses when you knew exactly what hardware was being used- what flash drives, what OS on the system, etc- thus penetration testing or for trying to get into specific computer systems.

I'd just like th repeat the tidbit that this actually only works for mass storage devices and only very specific ones; many articles are positing that this can be used to basically "infect" keyboards; the publications hosting those articles should probably be kept at arms length, given that the actual source code of the exploit and the information on it explicitly requires a mass storage device and doesn't work with other devices by virtue of the 8052 being a memory controller and not being used in keyboards/mice etc.

Quote
Unfortunately most discussions treat this as just anther virus threat. It is not just another  hacker trick. The USB standard has a fundamental flew that is an open door to whoever wants in.
Earlier this was explained in wired.
http://www.wired.com/2014/07/usb-security/
Since then, few so-called 'expert's, including yourself , failed to get the point. USB is broken.
 If you know part of it,  learn all of it.
Google it. USB is broken
http://www.computerworld.com/article/2476621/malware-vulnerabilities/panic--stop-using-usb--it-s---fundamentally-broken-----badusb.html

Those researchers failed to meet their burden of proof, refused to release any source code that would demonstrate the tenacity that they were claiming, and then another security researcher released it anyway (the repository I linked). It's notable that the source code and what it is capable of does not line up in any way with many of the claims they made about what it does. Curious.
I was trying to dereference Null Pointers before it was cool.

Geek-9pm

    Topic Starter

    Mastermind
  • Geek After Dark
  • Thanked: 1026
    • Gekk9pm bnlog
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 10
Re: USB Malware Code Unleashed
« Reply #4 on: October 26, 2014, 11:01:41 AM »
Thanks for coming back BC.
This is an important issue and needs to understood.
One research person claims is is not a 'design flaw' as much as a wrong conception. He asserts that layman think the USB device is only a memory device. But it is not. It is a microchip  to manage a memory array. The USB standard does not specify what, if any. security measures any USB device must have. So in one sense, it is not a 'design flaw' but instead a design decision.
Quote
As we see here the issue is allegedly with the 8051 micro controller
Right! What other companies use it  is uncertain.

Quote
... most devices don't use EEPROMS at all, and instead use EPROMS;
Please clarify that. Does it matter?  Are all USB devices field programmable?  The term 'field programmable' means easy to alter away from the factory with simple portable equipment.
Granted, there is, to date,  much speculation about would may or may not happen. But just imagine the following. Many devices do use the chip in question.

An gang of thugs are organized to break into a IT deportment and locate the stock of USB drives that are being inspected by the staff during the day. Maybe an inside job. The thugs zap all the USB devices they find with a portable device which does the chip  mentioned. Some USB devices are burnt out because they had other chip sets. Next day the IT department does not see any trace of a break in. They have no idea why some USB sticks  went bad overnight. What happens next?

Yes, pure conjecture. Now should we just wait and see if it happens?  :(


Geek-9pm

    Topic Starter

    Mastermind
  • Geek After Dark
  • Thanked: 1026
    • Gekk9pm bnlog
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 10
Re: USB Malware Code Unleashed
« Reply #5 on: October 26, 2014, 11:25:40 AM »
More...
EDIT:  Some links to sourtce code.
http://blog.lumension.com/9442/unpatchable-badusb-malware-code-is-now-publicly-available/

http://www.extremetech.com/extreme/191467-badusb-returns-hackers-publish-code-that-could-infect-millions-of-usb-devices

http://www.securityweek.com/badusb-code-published

These are recent posts,  which may suggest this is not the code mentioned artier. Otherwise, why publish three months after the demonstration?

BC_Programmer


    Mastermind
  • Typing is no substitute for thinking.
  • Thanked: 1140
    • Yes
    • Yes
    • BC-Programming.com
  • Certifications: List
  • Computer: Specs
  • Experience: Beginner
  • OS: Windows 11
Re: USB Malware Code Unleashed
« Reply #6 on: October 26, 2014, 06:00:18 PM »
Please clarify that. Does it matter?  Are all USB devices field programmable?  The term 'field programmable' means easy to alter away from the factory with simple portable equipment.
an EEPROM can be reprogrammed by altering the voltages and inputs on the chip pins. So too, in fact, can an EPROM. the Difference is that you cannot erase an EPROM electrically. You can program a blank EPROM chip as desired, however you cannot, electrically, erase them. (Typically they are erased via UV Light exposure).

That seems rather critical given this exploit/vulnerability. If the chips used for  the firmware on a USB Flash Drive are EPROM than they cannot be reprogrammed via the USB plug. Even an EEPROM is tenuous and as we can see in the source code, examples, and documentation, the vulnerability and particularly, taking advantage of it, is very dependent on the model, manufacturer, and even capacity of the drive. the firmware storage of the 8051 is not built into the IC, and needs to be hooked up to it by sending traces to the appropriate pins on the chip. The microcontroller then runs that code. the exploit them relies on the 8051 having direct access to the programmability of that separate chip, and that separate chip being electrically erasable. This is why the concept code can only work on a single model, manufacturer, and capacity of drive (Patriot 8GB SuperSonic). It also won't work if the drive supports USB3 (since that typically uses a different embedded microcontroller to begin with)

Quote
Granted, there is, to date,  much speculation about would may or may not happen. But just imagine the following. Many devices do use the chip in question.
None of the USB Drives I've taken apart (broken ones, of course) appear to use the controller.  Since it is a Memory controller USB interface it is not going to be present except on Flash Drives and composite devices. It is not used in USB keyboards, USB Mice, USB network adapters. It's not even used on external hard drives. And even within Flash thumbdrives, only a subset of devices actually use it. This is demonstrable by simply taking apart a few such devices and identifying the chips within.
Quote
An gang of thugs are organized to break into a IT deportment and locate the stock of USB drives that are being inspected by the staff during the day. Maybe an inside job. The thugs zap all the USB devices they find with a portable device which does the chip  mentioned. Some USB devices are burnt out because they had other chip sets. Next day the IT department does not see any trace of a break in. They have no idea why some USB sticks  went bad overnight. What happens next?
Yes, pure conjecture. Now should we just wait and see if it happens?  :(

Quote from: BC_Programmer
Thus my reasoning in my post in the other thread which I linked, which was that this would only be particularly useful for malicious uses when you knew exactly what hardware was being used- what flash drives, what OS on the system, etc- thus penetration testing or for trying to get into specific computer systems.

The problem with your hypothetical is that it is dumb. The thugs already have physical access to the systems that they would be intending to infect. using a special device to basically infect USB drive firmware in order to allow those USB drives to pretend to be keyboards on host systems and do.... something?... is pretty useless considering they already have physical access to those systems they want to infect.

Your entire hypothetical completely contradicts your original assertion that "It is not just another hacker trick" by providing an example in a context where it is exactly that.

More...
EDIT:  Some links to sourtce code.
http://blog.lumension.com/9442/unpatchable-badusb-malware-code-is-now-publicly-available/

http://www.extremetech.com/extreme/191467-badusb-returns-hackers-publish-code-that-could-infect-millions-of-usb-devices

http://www.securityweek.com/badusb-code-published

These are recent posts,  which may suggest this is not the code mentioned artier. Otherwise, why publish three months after the demonstration?

Those articles link to the same github repository that I already linked, Created on Sept 26th. The articles themselves- which if I may be so bold to say that you don't appear to have read since it answers your question- are clear as to why the code was released after the original Black Hat conference.

Quote
Previously, it was demonstrated by Karsten Nohl and Jakob Lell at the Black Hat security conference in Las Vegas, showcasing that the firmware of USB devices made by Taiwanese electronics manufacturer Phison could be injected with undetectable, unfixable malware.

Crucially, however, Nohl did not release the code used for the exploit at the time. But Caudill and Wilson have subsequently made the decision to release fuller details about BadUSB at the recent DerbyCon hacking conference in Louisville, Kentucky.

“The belief we have is that all of this should be public. It shouldn’t be held back. So we’re releasing everything we’ve got,” Caudill said to the audience at DerbyCon. “This was largely inspired by the fact that [SR Labs] didn’t release their material. If you’re going to prove that there’s a flaw, you need to release the material so people can defend against it.”

It's notable that even in that original conference, the "exploit" demonstrated- like the source code now made available, only works on a very specific brand of Microcontroller (Phison). and it only works in very specific circumstances- the core issue is simply that, if the chip is traced to it's firmware chip in a specific way, and  that firmware chip is an EEPROM, than the microcontroller can be instructed to electrically erase that chip and reprogram it, thus revising it's own firmware.

-If that chip is not an EEPROM, nothing happens, and the existing firmware would remain.
-If the microcontroller is not connected to the EEPROM firmware chip in a specific way, nothing happens.
-If the microcontroller is not a 8051, nothing happens.
-If the EEPROM chip containing the firmware is larger than 200K, nothing happens.
-If the EEPROM chip containing the firmware is smaller than 200K, nothing happens.
-If the Microcontroller is not manufactured by a specific taiwanese manufacturer who accidentally left development EE traces active, nothing happens.

And the end result? Even in a case where the chip can be exploited.... It can only pretend to be other USB devices. It cannot arbitrarily run code on the host system- only on the device itself. It cannot connect to the internet itself- because it has no network connectivity. In general all it can do is pretend to be a keyboard and perform a specific sequence of pre-programmed keyboard input. In the Blackhat demonstration for example the device was programmed to input a specific sequence of keystrokes which would open Internet Explorer and take it to a compromised, exploited web page. That could only work when you know the specific system.

Fundamentally what it boils down to here is that despite your assertions otherwise this really is just  "yet another hacker trick"; You illustrated that particularly well in your (arguably contrived) example. It is something that those looking to harden a company network and protect company data will want to explore, but only if they haven't already hot-glued all the USB ports on the company systems. eg to expound on your example somebody who wants to get into a company's database for presumably nefarious purposes might befriend an employee. After learning about the company's system and that employees particular workstation, they might engineer a specific USB flash drive- one that they know can be exploited in this manner and which they can successfully purchase, test, and verify works as they intend. They could then infect their 'friend''s PC with something that prevents all mass storage devices from working. Knowing that employee only has one flash drive, the nefarious hacker can loan them the exploited one. It connects as both a flash drive- allowing the employee to borrow the drive to copy his work files, as well as as a keyboard. When files are copied from that drive it will activate a sequence of keystrokes that would activate a hidden browser and launch it to a website that the nefarious hacker setup specifically the take advantage of perhaps unpatched exploits in the browser version used at the employee's company. It would then install a backdoor and broadcast it's address to an IRC server that the nefarious hacker setup for that purpose, and the hacker can then instruct the employees system to connect to a server IP they have listening for connections and then access the system via remote access.

The fact is, however- in this example the entire operation is absolutely destroyed by any prudent security on the company's end.

-Many companies disable, uninstall, or block USB devices entirely (hot glue in the USB ports of company systems, for example).

-Unauthorized systems on the network are typically not leased an IP and thus are unable to access the internet (eg laptops brought from home, iPods, Wifi routers inconspiciously installed in that conference room nobody uses)

-software should be kept patched and up to date, particularly web browsers. most competent IT Support is going to have an established update procedure using group policy.

-normal users will not have local administrator permissions. This would eliminate the threat entirely, as that would be required for any exploit to be installed via said web browser (again, excluding possible, specific privilege escalation).

Summary? Just another "hacker trick" that can be added to the pen-test book, with limited (if not entirely non-existent) applications in the wild.




I was trying to dereference Null Pointers before it was cool.

Geek-9pm

    Topic Starter

    Mastermind
  • Geek After Dark
  • Thanked: 1026
    • Gekk9pm bnlog
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 10
Re: USB Malware Code Unleashed
« Reply #7 on: October 26, 2014, 08:45:54 PM »
Your explanation about UV erasable chips is wrong, it is out of context. This is 2014, not 1998.  UV erase is not used  is new designs where size is important.
UV-EPROMs are a technology made obsolete in an incredibly short period of time by widely available, and more flexible, Flash and EEPROM technology.  Processors evolved, DRAM and SRAM evolved, EPROMs simple ceased to exist.  There were attempts to make them faster, lower-power, or in more convenient packages, but at the end of the day... that have gone away.

How many USB devices have you taken apart? The all  have controllers. There is no such things as memory array the connects directly to USB.

Nobody has yet come forth with any proof that other designs are more resistant to the attack concept of the BadUSB d drama.

So you think that we can prevent any attack on USB devices by preventing physical access?   How?  Do you suggest that all USB devices be glued with gorilla glue so and  can not be removed ever ?

The chip used in the USB flash drive the researchers chose is typical of the kind of silicon device use to made a USB thumb drive. And this kind of device are also used in the typical mouse, keyboard, camera or scanner.

One point in particular I have to agree with. The people who write about this seem to have little understanding of what they are talking about.
The complicity of the USB interface is unseen. Just looking at it one does not see the myriad of calculations made in a few milliseconds  just  to create a stack for the protocol. A micro controller has to be used for this. Ideally, it should be micro-code in  ROM with hidden internal registers for calculations. I has to have a clock and timers. It has to handle different baud rates. I has to conform to the specs of the USB protocol.
Here one poster at least knows something:
Quote
USB interface microcode may be inherently vulnerable
If Andy Greenberg and others are right, a large portion of existing USB devices - from keyboards to peripheral controllers and data-keys - may be vulnerable to reprogramming at the microcode level of the USB controller to do any and all kinds of nasty work that software viruses can do, and perhaps more.

In Why the Security of USB Is Fundamentally Broken Greenberg discloses some very new information about how ordinary USB devices can become high-power snoops and saboteurs with nothing more than some diddling of their internal microcode, loaded by a hacker into the device via the USB interface itself.

The effect of this discovery could be that no USB device may be considered totally trustworthy henceforth, whether memory or peripheral, if it remains internally reprogrammable at the microcode level after manufacture. Some USB-controller architectures have fuses or other locks that can be set to permanently inhibit reprogramming, but often these protections may not be engaged in existing products, observers say.
Seems to be a whole new can of worms to worry about. ...
http://www.pprune.org/computer-internet-issues-troubleshooting/544742-usb-interface-microcode-may-inherently-vulnerable.html

He is right on! Responsible manufacture blow the inter links (fuses) to prevent any any more programming, accidental or intentional.

So the question is: How many Thumb Drive  makers fix  the device to  not be reworked at the micro-code level? One? Two? Who?

BC, do you think only one company was guilty of this oversight?

Reference:
A number of books have been written about programmable micro-controllers
These serve as a introduction of common industry practice with these powerful little gems.


Geek-9pm

    Topic Starter

    Mastermind
  • Geek After Dark
  • Thanked: 1026
    • Gekk9pm bnlog
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 10
Re: USB Malware Code Unleashed
« Reply #8 on: October 27, 2014, 11:31:57 PM »
Here is important information. Just now found it.
Phison PS2251-01 format tools download

Quote
today we will discuss how can repair corrupted Phison PS2251-01 chip controller and we will put all possible software for  Phison PS2251-01 flash drive recovery tools .
Phison PS2251-01 also called Phison PS2301 and Toshiba TC58NC2301GFA .First we must be sure that our USB flash drive chip controller is Phison PS2251-01 by using Chip genius report
Wow  :o