
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@0biwank/gethwid
Advanced tools
Get Hardware ID (HWID) of the machine using a native Node.js addon built with N-API.
A native Node.js module for retrieving hardware identification information on Windows systems. This module uses N-API to access Windows WMI (Windows Management Instrumentation) and system firmware data.
npm install @0biwank/gethwid
import { getCPUSerial, getDiskSerial, getMotherboardSerial, getMacAddress } from '@0biwank/gethwid';
// Get CPU Serial
const cpuSerial = getCPUSerial();
console.log('CPU Serial:', cpuSerial);
// Get Disk Serial
const diskSerial = getDiskSerial();
console.log('Disk Serial:', diskSerial);
// Get Motherboard Serial
const mbSerial = getMotherboardSerial();
console.log('Motherboard Serial:', mbSerial);
// Get MAC Address
const macAddress = getMacAddress();
console.log('MAC Address:', macAddress);
import getHWID from '@0biwank/gethwid';
const cpu = getHWID.getCPUSerial();
const disk = getHWID.getDiskSerial();
const mb = getHWID.getMotherboardSerial();
const mac = getHWID.getMacAddress();
console.log({ cpu, disk, mb, mac });
import { getCPUSerial, getDiskSerial, getMotherboardSerial, getMacAddress } from '@0biwank/gethwid';
const cpuSerial: string = getCPUSerial();
const diskSerial: string = getDiskSerial();
const mbSerial: string = getMotherboardSerial();
const macAddress: string = getMacAddress();
console.log({
cpu: cpuSerial,
disk: diskSerial,
motherboard: mbSerial,
mac: macAddress
});
getCPUSerial(): stringReturns the processor ID from the CPU.
Returns: A string containing the CPU processor ID.
Example:
const cpu = getCPUSerial();
getDiskSerial(): stringReturns the serial number of the primary physical disk/storage device.
Returns: A string containing the disk serial number.
Example:
const disk = getDiskSerial();
getMotherboardSerial(): stringReturns the serial number of the motherboard/baseboard.
Returns: A string containing the motherboard serial number.
Example:
const mb = getMotherboardSerial();
getMacAddress(): stringReturns the MAC (Media Access Control) address of the primary network adapter.
Returns: A string containing the MAC address in standard notation (XX:XX:XX:XX:XX:XX).
Example:
const mac = getMacAddress();
This module uses:
GetSystemFirmwareTable) for system UUID and detailed hardware infoIf you need to rebuild the module:
# Install dependencies
npm install
# Rebuild the native addon
npm run rebuild
Run the test suite:
npm test
This will execute test.js and display hardware information for your system.
Functions return empty strings if hardware information cannot be retrieved:
const cpuSerial = getCPUSerial();
if (!cpuSerial) {
console.warn('Could not retrieve CPU serial');
} else {
console.log('CPU:', cpuSerial);
}
All functions execute synchronously and typically complete quickly by accessing system information through WMI queries.
MIT © Kunal Dubey
Contributions and bug reports are welcome. Please open an issue or submit a pull request on GitHub.
This module retrieves hardware identification information for legitimate purposes such as:
Users are responsible for complying with applicable laws and privacy regulations when using hardware identification data.
FAQs
Get Hardware ID (HWID) of the machine using a native Node.js addon built with N-API.
We found that @0biwank/gethwid demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.