Security News
The Risks of Misguided Research in Supply Chain Security
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Read, Write, List and do all sorts of funky stuff to the windows registry using node.js and windows script host
Read, Write, List and do all sorts of funky stuff to the windows registry using node.js and windows script host.
No pesky native code :-)
npm install --save regedit
var regedit = require('regedit')
regedit.list('HKCU\\SOFTWARE', function(err, result) {
...
})
Every command executes a sub process that runs vbscript code. To boost efficiency, every command supports batching.
Lists the direct content of one or more sub keys. Specify an array instead of a string to query multiple keys in the same run.
Given the command:
regedit.list(['HKCU\\SOFTWARE', 'HKLM\\SOFTWARE', function(err, result) {
...
})
The result will look something like the following:
{
'HKCU\\SOFTWARE': {
keys: [ 'Google', 'Microsoft', ... more direct sub keys ]
values: {
'valueName': {
value: '123',
type: 'REG_SZ'
}
... more direct child values of HKCU\\SOFTWARE
}
},
'HKLM\\SOFTWARE': {
keys: [ 'Google', 'Microsoft', ... more direct sub keys ]
values: {
'valueName': {
value: '123',
type: 'REG_SZ'
}
... more direct child values of HKCU\\SOFTWARE
}
}
}
Creates one or more keys in the registry
Deletes one or more keys in the registry
Put one or more values in the registry. The Object given to this function is almost identical to the result of regedit.list().
Here is an example:
var valuesToPut = {
'HKCU\\Software\\MySoftware': {
'myValue1': {
value: [1,2,3],
type: 'REG_BINARY'
},
'myValue2': {
value: 'aString',
type: 'REG_SZ'
}
},
'HKCU\\Software\\MySoftware\\foo': {
'myValue3': {
value: ['a', 'b', 'c']
type: 'REG_MULTI_SZ'
}
}
}
regedit.putValue(valuesToPut, function(err) {
})
Supported value types are:
When launching a 32bit application in 64bit environment, some of your paths will be relative to wow6432node. Things might get a little unexpected if you expected to find something in HKLM\Software in regedit.exe while in fact it is located at HKLM\Software\wow6432node.
Further reading here
mocha -R spec
set DEBUG=regedit
deleteValue()
FAQs
Read, Write, List and do all sorts of funky stuff to the windows registry using node.js and windows script host
The npm package regedit receives a total of 58,192 weekly downloads. As such, regedit popularity was classified as popular.
We found that regedit demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers 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
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.