I've read that there are keylogger hardware and thought that usb wifi adapter are hardwares and wondered if they can be hacked to work as a keylogger. I'm just worried that my usb wifi adapter might be a keylogger.
It is possible?
It's unlikely. A hardware keylogger would need some kind of storage which a USB wifi adapter is unlikely to have.
USB wifi adapters are specialized devices, they aren't general purpose processors. Some chipsets are so simple that they offload a lot of the WIFI processing to the hosts CPU (the driver does a lot of work).
Hardware keyloggers (ones which have no interaction with the OS) are purpose built devices.
The mire likely scenario would be a device with a modified firmware which attempts to load a software keylogger to your system in a BadUSB style attack. In that case your wifi adapter could set a malicious DNS server (since those settings come from your network if using DHCP). I haven't heard of these types of attacks in the wild though as each attack needs to be custom designed fir the chipset it's targeting.
If anyone else has heard of modified firmware for wifi adapters comment below and I'll edit.
A lot of USB wifi devices are first recognize as a standard USB storage device that store the wifi driver. Only after driver install the device switch to network device.
Usually the storage is read only.
But if a hacker had phisical access to the device it can do what ever he wants.
No, unless you plug your keyboard into the Wifi-Adapter. When the adapter wants to log something, the data must somehow go through it to be logged.
There may still be a way: It could double as a storage device and you could run the autorun content on it (e.g. thinkings you're installing a Wifi driver). The program can then do all sort of software based keylogging and possibly even store the logs on the Adapter (not neccessarily using the USB storage part of it). But from the pure hardware perspective, it is not possible.
I believe it's certainly possible.
In principle, the initial connection of the usb dongle loads key logger software onto your machine along with the code to capture and send keys to remote storage periodically, then switchs modes to become a WiFi.
There are a number of usb devices that support multiple modes and switching modes. I've not seen that particular combination, but it should be possible.