From 382795365110f30c2c94cf51c2c0472ac12bc3f7 Mon Sep 17 00:00:00 2001
From: Anthony Rose <20302208+Cx01N@users.noreply.github.com>
Date: Thu, 22 Feb 2024 01:09:29 -0500
Subject: [PATCH 1/6] Removed extra space being added in front of Task Input
and Output (#185)
* Removed extra space being added in front of Task Input and Output by append/prepend space
* Ran yarn lint
---
CHANGELOG.md | 4 ++++
src/components/agents/AgentTasksTable.vue | 13 +++++++++----
src/components/plugins/PluginTasksTable.vue | 11 +++++++----
3 files changed, 20 insertions(+), 8 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e90fd3e..a3f2db4 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -14,6 +14,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
+### Changed
+
+- Removed extra space being added in front of Task Input and Output by append/prepend new line (@Cx01N)
+
## [2.7.2] - 2024-01-31
### Fixed
diff --git a/src/components/agents/AgentTasksTable.vue b/src/components/agents/AgentTasksTable.vue
index 1352d94..9b8ba16 100644
--- a/src/components/agents/AgentTasksTable.vue
+++ b/src/components/agents/AgentTasksTable.vue
@@ -62,9 +62,9 @@
"
>
{{
- item.expandedInput
- ? expandedTasks[item.uniqueId].full_input
- : item.input
+ addBlankLines(item.expandedInput
+ ?
+ expandedTasks[item.uniqueId].full_input : item.input)
}}
Task Output:
@@ -109,7 +109,9 @@
v-html="expandedTasks[item.uniqueId].htmlOutput"
/>
- {{ item.output }}
+ {{
+ addBlankLines(item.output)
+ }}
@@ -386,6 +388,9 @@ export default {
})
.catch((err) => this.$snack.error(`Error: ${err}`));
},
+ addBlankLines(text) {
+ return `\n${ text }\n`;
+ },
addTag(task, tag) {
agentTaskApi
.addTag(task.agent_id, task.id, tag)
diff --git a/src/components/plugins/PluginTasksTable.vue b/src/components/plugins/PluginTasksTable.vue
index be35d0e..6be2961 100644
--- a/src/components/plugins/PluginTasksTable.vue
+++ b/src/components/plugins/PluginTasksTable.vue
@@ -62,9 +62,9 @@
"
>
{{
- item.expandedInput
- ? expandedTasks[item.uniqueId].full_input
- : item.input
+ addBlankLines(item.expandedInput
+ ?
+ expandedTasks[item.uniqueId].full_input : item.input)
}}
Task Output:
@@ -109,7 +109,7 @@
v-html="expandedTasks[item.uniqueId].htmlOutput"
/>
- {{ item.output }}
+ addBlankLines(item.output)
@@ -349,6 +349,9 @@ export default {
ansiToHtml(output) {
return new AnsiUp().ansi_to_html(output);
},
+ addBlankLines(text) {
+ return `\n${ text }\n`;
+ },
deleteTag(task, tag) {
pluginApi
.deleteTag(task.plugin_id, task.id, tag.id)
From 6dd8b88e96dd4746268e41d7ea550c79ffb1ba09 Mon Sep 17 00:00:00 2001
From: Anthony Rose <20302208+Cx01N@users.noreply.github.com>
Date: Thu, 22 Feb 2024 01:10:53 -0500
Subject: [PATCH 2/6] Added info buttons to agent's view tab (#188)
* Added info buttons to agent's view tab
* Update date format in info tab
---------
Co-authored-by: Vincent Rose
---
CHANGELOG.md | 6 +++++-
src/components/ClickToEdit.vue | 19 ++++++++++++++++++-
src/components/agents/AgentForm.vue | 5 +++++
3 files changed, 28 insertions(+), 2 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a3f2db4..62c0aba 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -14,9 +14,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
+### Added
+
+- Add info button on View tab to clarify what options do
+
### Changed
-- Removed extra space being added in front of Task Input and Output by append/prepend new line (@Cx01N)
+- Removed extra space being added in front of Task Input and Output by append/prepend new line
## [2.7.2] - 2024-01-31
diff --git a/src/components/ClickToEdit.vue b/src/components/ClickToEdit.vue
index 814c187..c44c1d5 100644
--- a/src/components/ClickToEdit.vue
+++ b/src/components/ClickToEdit.vue
@@ -1,7 +1,20 @@
-
+
{{ label }}
+
+
+
+ mdi-information-outline
+
+
+ {{ infoText }}
+
@@ -116,6 +129,10 @@ export default {
type: [String, Number],
default: "",
},
+ infoText: {
+ type: String,
+ default: ""
+ },
dataType: {
type: String,
default: "string",
diff --git a/src/components/agents/AgentForm.vue b/src/components/agents/AgentForm.vue
index 67251ac..a4bdb45 100644
--- a/src/components/agents/AgentForm.vue
+++ b/src/components/agents/AgentForm.vue
@@ -42,6 +42,7 @@
Date: Thu, 22 Feb 2024 01:11:36 -0500
Subject: [PATCH 3/6] Added buttons to reload sysinfo to agents pages (#186)
* Added buttons to reload sysinfo to agents pages
* fixed sysinfo buttons to use agentTaskApi.sysinfo
---------
Co-authored-by: Vincent Rose
---
CHANGELOG.md | 1 +
src/components/agents/AgentsTable.vue | 16 ++++++++++++++++
src/views/AgentEdit.vue | 15 ++++++++++++++-
src/views/PluginEdit.vue | 2 +-
4 files changed, 32 insertions(+), 2 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 62c0aba..05d24cf 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
+- Added buttons to reload sysinfo to agents pages
- Add info button on View tab to clarify what options do
### Changed
diff --git a/src/components/agents/AgentsTable.vue b/src/components/agents/AgentsTable.vue
index b3b99aa..e4a3bc6 100644
--- a/src/components/agents/AgentsTable.vue
+++ b/src/components/agents/AgentsTable.vue
@@ -114,6 +114,13 @@
+
+
+ fa-sync
+ Reload SysInfo
+
+
+
fa-trash-alt
@@ -134,6 +141,7 @@ import TagViewer from "@/components/TagViewer.vue";
import * as agentApi from "@/api/agent-api";
import { useAgentStore } from "@/stores/agent-module";
import { useApplicationStore } from "@/stores/application-module";
+import * as agentTaskApi from "@/api/agent-task-api";
export default {
name: "AgentsTable",
@@ -388,6 +396,14 @@ export default {
getAgents() {
this.agentStore.getAgents();
},
+ async reloadSysInfo(agent) {
+ try {
+ await agentTaskApi.sysinfo(agent.session_id);
+ this.$snack.success(`SysInfo reload queued for ${agent.name}`);
+ } catch (error) {
+ this.$snack.error(`Error reloading SysInfo for ${agent.name}: ${error.message}`);
+ }
+ },
async killAgent(item) {
this.$emit("kill-agent", item);
},
diff --git a/src/views/AgentEdit.vue b/src/views/AgentEdit.vue
index 6db5cb9..2b161ff 100644
--- a/src/views/AgentEdit.vue
+++ b/src/views/AgentEdit.vue
@@ -67,7 +67,7 @@
v-model="isRefreshTasks"
icon="fa-redo"
:button-text="isRefreshTasks ? 'On' : 'Off'"
- text="Auto-refresh tasks"
+ text="Auto-refresh Tasks"
/>
+
95) {
this.paneSize = 50;
diff --git a/src/views/PluginEdit.vue b/src/views/PluginEdit.vue
index f50b405..461f76e 100644
--- a/src/views/PluginEdit.vue
+++ b/src/views/PluginEdit.vue
@@ -27,7 +27,7 @@
v-model="isRefreshTasks"
icon="fa-redo"
:button-text="isRefreshTasks ? 'On' : 'Off'"
- text="Auto-refresh tasks"
+ text="Auto-refresh Tasks"
/>
From fd94090557907fa7bf50ae02434aabb5c5630746 Mon Sep 17 00:00:00 2001
From: Anthony Rose <20302208+Cx01N@users.noreply.github.com>
Date: Thu, 22 Feb 2024 01:16:40 -0500
Subject: [PATCH 4/6] Fixed terminal shell commands (#187)
* updated delay for polling to align with agent delay
* reverted pause changes
* used vince's better code
---
src/components/agents/AgentTerminal.vue | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/components/agents/AgentTerminal.vue b/src/components/agents/AgentTerminal.vue
index 97bfbe2..2abfc57 100644
--- a/src/components/agents/AgentTerminal.vue
+++ b/src/components/agents/AgentTerminal.vue
@@ -621,7 +621,8 @@ export default {
config = { print: true, attempts: 30, delay: 5000 },
) {
if (!config.attempts) config.attempts = 30;
- if (!config.delay) config.delay = 5000;
+ if (!config.delay) config.delay = this.agent.delay != null ? this.agent.delay * 1000 : 5000;
+
let res = null;
let hasPrintedJobStarted = false;
let i = 0;
@@ -670,7 +671,7 @@ export default {
this.getDirectoryCommand(),
);
- const complete = await this.pollForResult(response.id);
+ const complete = await this.pollForResult(response.id, { print: false });
if (complete) {
// eslint-disable-next-line prefer-destructuring
@@ -697,6 +698,7 @@ export default {
if (["cd", "set-location"].includes(stdin.toLowerCase().split(" ")[0])) {
this.updateCurrentDirectory();
+ return;
}
if (complete) {
From 54347a34602351724db8822831cd5243e8d32929 Mon Sep 17 00:00:00 2001
From: Vincent Rose
Date: Wed, 21 Feb 2024 23:29:53 -0700
Subject: [PATCH 5/6] change default sort on agents (#189)
* change default sort on agents
* Update src/components/agents/AgentTerminal.vue
---
.github/workflows/lint-and-test.yml | 2 +-
CHANGELOG.md | 1 +
package.json | 3 ++-
src/components/ClickToEdit.vue | 9 ++-------
src/components/agents/AgentTasksTable.vue | 14 +++++++-------
src/components/agents/AgentTerminal.vue | 4 +++-
src/components/agents/AgentsTable.vue | 6 ++++--
src/components/plugins/PluginTasksTable.vue | 14 +++++++-------
src/views/AgentEdit.vue | 4 +++-
9 files changed, 30 insertions(+), 27 deletions(-)
diff --git a/.github/workflows/lint-and-test.yml b/.github/workflows/lint-and-test.yml
index d178841..51ff5e3 100644
--- a/.github/workflows/lint-and-test.yml
+++ b/.github/workflows/lint-and-test.yml
@@ -27,4 +27,4 @@ jobs:
- name: Run ESLint
run: yarn lint
- name: Run Prettier
- run: yarn format --check
+ run: yarn format:check
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 05d24cf..ffd6fbd 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- Removed extra space being added in front of Task Input and Output by append/prepend new line
+- Changed default sort on agents page to be "first seen" instead of "last seen"
## [2.7.2] - 2024-01-31
diff --git a/package.json b/package.json
index 797e246..074f972 100644
--- a/package.json
+++ b/package.json
@@ -7,7 +7,8 @@
"build": "vite build",
"serve": "vite preview",
"lint": "eslint --ext .js,.vue --ignore-path .gitignore --fix src",
- "format": "prettier . --write"
+ "format": "prettier . --write",
+ "format:check": "prettier . --check"
},
"main": "background.js",
"dependencies": {
diff --git a/src/components/ClickToEdit.vue b/src/components/ClickToEdit.vue
index c44c1d5..367040b 100644
--- a/src/components/ClickToEdit.vue
+++ b/src/components/ClickToEdit.vue
@@ -4,12 +4,7 @@
{{ label }}
-
+
mdi-information-outline
@@ -131,7 +126,7 @@ export default {
},
infoText: {
type: String,
- default: ""
+ default: "",
},
dataType: {
type: String,
diff --git a/src/components/agents/AgentTasksTable.vue b/src/components/agents/AgentTasksTable.vue
index 9b8ba16..e54f7e7 100644
--- a/src/components/agents/AgentTasksTable.vue
+++ b/src/components/agents/AgentTasksTable.vue
@@ -62,9 +62,11 @@
"
>
{{
- addBlankLines(item.expandedInput
- ?
- expandedTasks[item.uniqueId].full_input : item.input)
+ addBlankLines(
+ item.expandedInput
+ ? expandedTasks[item.uniqueId].full_input
+ : item.input,
+ )
}}
Task Output:
@@ -109,9 +111,7 @@
v-html="expandedTasks[item.uniqueId].htmlOutput"
/>
- {{
- addBlankLines(item.output)
- }}
+ {{ addBlankLines(item.output) }}
@@ -389,7 +389,7 @@ export default {
.catch((err) => this.$snack.error(`Error: ${err}`));
},
addBlankLines(text) {
- return `\n${ text }\n`;
+ return `\n${text}\n`;
},
addTag(task, tag) {
agentTaskApi
diff --git a/src/components/agents/AgentTerminal.vue b/src/components/agents/AgentTerminal.vue
index 2abfc57..f4b6c0c 100644
--- a/src/components/agents/AgentTerminal.vue
+++ b/src/components/agents/AgentTerminal.vue
@@ -621,7 +621,9 @@ export default {
config = { print: true, attempts: 30, delay: 5000 },
) {
if (!config.attempts) config.attempts = 30;
- if (!config.delay) config.delay = this.agent.delay != null ? this.agent.delay * 1000 : 5000;
+ if (!config.delay)
+ config.delay =
+ this.agent.delay != null ? this.agent.delay * 1000 : 5000;
let res = null;
let hasPrintedJobStarted = false;
diff --git a/src/components/agents/AgentsTable.vue b/src/components/agents/AgentsTable.vue
index e4a3bc6..ca0584b 100644
--- a/src/components/agents/AgentsTable.vue
+++ b/src/components/agents/AgentsTable.vue
@@ -306,7 +306,7 @@ export default {
},
sortedAgents() {
let sorted = this.agents.slice();
- sorted.sort((a, b) => -a.lastseen_time.localeCompare(b.lastseen_time));
+ sorted.sort((a, b) => a.checkin_time.localeCompare(b.checkin_time));
if (this.hideStaleAgents) {
sorted = sorted.filter((agent) => !agent.stale);
}
@@ -401,7 +401,9 @@ export default {
await agentTaskApi.sysinfo(agent.session_id);
this.$snack.success(`SysInfo reload queued for ${agent.name}`);
} catch (error) {
- this.$snack.error(`Error reloading SysInfo for ${agent.name}: ${error.message}`);
+ this.$snack.error(
+ `Error reloading SysInfo for ${agent.name}: ${error.message}`,
+ );
}
},
async killAgent(item) {
diff --git a/src/components/plugins/PluginTasksTable.vue b/src/components/plugins/PluginTasksTable.vue
index 6be2961..d1862a8 100644
--- a/src/components/plugins/PluginTasksTable.vue
+++ b/src/components/plugins/PluginTasksTable.vue
@@ -62,9 +62,11 @@
"
>
{{
- addBlankLines(item.expandedInput
- ?
- expandedTasks[item.uniqueId].full_input : item.input)
+ addBlankLines(
+ item.expandedInput
+ ? expandedTasks[item.uniqueId].full_input
+ : item.input,
+ )
}}
Task Output:
@@ -108,9 +110,7 @@
v-if="expandedTasks[item.uniqueId].htmlOutput"
v-html="expandedTasks[item.uniqueId].htmlOutput"
/>
-
- addBlankLines(item.output)
-
+ addBlankLines(item.output)
@@ -350,7 +350,7 @@ export default {
return new AnsiUp().ansi_to_html(output);
},
addBlankLines(text) {
- return `\n${ text }\n`;
+ return `\n${text}\n`;
},
deleteTag(task, tag) {
pluginApi
diff --git a/src/views/AgentEdit.vue b/src/views/AgentEdit.vue
index 2b161ff..1d018c6 100644
--- a/src/views/AgentEdit.vue
+++ b/src/views/AgentEdit.vue
@@ -382,7 +382,9 @@ export default {
await agentTaskApi.sysinfo(this.agent.session_id);
this.$snack.success(`SysInfo reload queued for ${this.agent.name}`);
} catch (error) {
- this.$snack.error(`Error reloading SysInfo for ${this.agent.name}: ${error.message}`);
+ this.$snack.error(
+ `Error reloading SysInfo for ${this.agent.name}: ${error.message}`,
+ );
}
},
toggleCollapsePane() {
From a6f3474a84a2ccd786f4adcdd58f21cf187f8d54 Mon Sep 17 00:00:00 2001
From: GitHub Actions
Date: Thu, 22 Feb 2024 06:30:16 +0000
Subject: [PATCH 6/6] Prepare release 2.7.3 private
---
CHANGELOG.md | 6 +++++-
package.json | 2 +-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ffd6fbd..3c454f1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -14,6 +14,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
+## [2.7.3] - 2024-02-22
+
### Added
- Added buttons to reload sysinfo to agents pages
@@ -359,7 +361,9 @@ Including but not limited to:
- Initial Release
-[Unreleased]: https://github.com/BC-SECURITY/Starkiller-Sponsors/compare/v2.7.2...HEAD
+[Unreleased]: https://github.com/BC-SECURITY/Starkiller-Sponsors/compare/v2.7.3...HEAD
+
+[2.7.3]: https://github.com/BC-SECURITY/Starkiller-Sponsors/compare/v2.7.2...v2.7.3
[2.7.2]: https://github.com/BC-SECURITY/Starkiller-Sponsors/compare/v2.7.1...v2.7.2
diff --git a/package.json b/package.json
index 074f972..eaa5e5d 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "starkiller",
- "version": "2.7.2",
+ "version": "2.7.3",
"private": true,
"scripts": {
"dev": "vite",