
Research
/Security News
11 Malicious Go Packages Distribute Obfuscated Remote Payloads
Socket uncovered 11 malicious Go packages using obfuscated loaders to fetch and execute second-stage payloads via C2 domains.
paranymph-sync
Advanced tools
JavaScript μ function to execute functions synchronously and return result when all callbacks are done
const paranymphSync = (list, callback) => {
(function loop(list, callback, i, result) {
list[i]((err, data) => {
return list[++i] && !err ? loop(list, callback, i, data) : callback(err, data)
}, result)
})(list, callback, 0)
}
const paranymphSync = (l,c) => (function $(l,c,i,r){l[i]((e,d)=>l[++i]&&!e?$(l,c,i,d):c(e,d),r)})(l,c,0)
Requesting findOne to MongoDB
paranymphSync([
callback => setTimeout(() => callback(null, 1), 500),
(callback, result) => setTimeout(() => callback(500, 'Some error'), 200),
(callback, result) => setTimeout(() => callback(null, result*2), 50)
], (err, data) => console.log('Callback with error: => ', err, data))
Callback with error: => 500 Some error
paranymphSync([
callback => setTimeout(() => callback(null, 1), 500),
(callback, result) => setTimeout(() => callback(null, result*2), 200),
(callback, result) => setTimeout(() => callback(null, result*2), 50)
], (err, data) => console.log('Callback without error: => ', err, data))
Callback without error: => null 4
paranymphSync([
(callback) => {
//Get time
const req = new XMLHttpRequest()
req.onload = () => callback(null, JSON.parse(req.responseText))
req.onerror = () => callback(true, req.status)
req.ontimeout = () => callback(true, req.status)
req.open('GET', 'http://time.jsontest.com/')
req.send()
},
(callback, result) => {
//Hash time
const req = new XMLHttpRequest()
req.onload = () => callback(null, JSON.parse(req.responseText))
req.onerror = () => callback(true, req.status)
req.ontimeout = () => callback(true, req.status)
req.open('GET', 'http://md5.jsontest.com/?text='+result.time)
req.send()
},
(callback, result) => {
//Create value
const req = new XMLHttpRequest()
req.onload = () => callback(null, JSON.parse(req.responseText))
req.onerror = () => callback(true, req.status)
req.ontimeout = () => callback(true, req.status)
req.open('GET', ' http://echo.jsontest.com/hashtime/'+result.md5)
req.send()
}
], (err, data) => console.log(err, data))
null Object {hashtime: "e75923f1ef2977abf5ebc988a40a188b"}
FAQs
JavaScript μ function to execute functions synchronously and return result when all callbacks are done
The npm package paranymph-sync receives a total of 0 weekly downloads. As such, paranymph-sync popularity was classified as not popular.
We found that paranymph-sync demonstrated a not healthy version release cadence and project activity because the last version was released 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.
Research
/Security News
Socket uncovered 11 malicious Go packages using obfuscated loaders to fetch and execute second-stage payloads via C2 domains.
Security News
TC39 advances 11 JavaScript proposals, with two moving to Stage 4, bringing better math, binary APIs, and more features one step closer to the ECMAScript spec.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).