mirror of
https://github.com/github/codeql.git
synced 2025-12-17 09:13:20 +01:00
17 lines
372 B
JavaScript
17 lines
372 B
JavaScript
const cp = require('child_process'),
|
|
http = require('http'),
|
|
url = require('url');
|
|
|
|
function getShell() {
|
|
return "sh";
|
|
}
|
|
|
|
function execSh(command, options) {
|
|
return cp.spawn(getShell(), ["-c", command], options) // $ Alert Sink
|
|
};
|
|
|
|
http.createServer(function (req, res) {
|
|
let cmd = url.parse(req.url, true).query.path; // $ Source
|
|
execSh(cmd);
|
|
});
|