From e2c8068e449adf27b23e31a2625a321eaf25bcba Mon Sep 17 00:00:00 2001 From: Cas van Cooten Date: Tue, 28 Feb 2023 19:06:02 +0100 Subject: [PATCH 01/13] Prepare branch with v1.2 tag --- client/NimPlant.nim | 2 +- client/NimPlant.nimble | 2 +- ui/components/MainLayout.tsx | 2 +- ui/package.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/client/NimPlant.nim b/client/NimPlant.nim index 461ea02..82d9820 100644 --- a/client/NimPlant.nim +++ b/client/NimPlant.nim @@ -26,7 +26,7 @@ when defined risky: # Parse the configuration at compile-time let CONFIG : Table[string, string] = parseConfig() -const version: string = "NimPlant v1.1" +const version: string = "NimPlant v1.2" proc runNp() : void = echo version diff --git a/client/NimPlant.nimble b/client/NimPlant.nimble index 5142c26..590c9ce 100644 --- a/client/NimPlant.nimble +++ b/client/NimPlant.nimble @@ -1,6 +1,6 @@ # Package information # NimPlant isn't really a package, Nimble is mainly used for easy dependency management -version = "1.1" +version = "1.2" author = "Cas van Cooten" description = "A Nim-based, first-stage C2 implant" license = "MIT" diff --git a/ui/components/MainLayout.tsx b/ui/components/MainLayout.tsx index fa12fc1..f237057 100644 --- a/ui/components/MainLayout.tsx +++ b/ui/components/MainLayout.tsx @@ -53,7 +53,7 @@ function MainLayout({ children }: ChildrenProps) { v1.1 + style={{textTransform: 'lowercase', cursor: 'pointer' }} >v1.2 diff --git a/ui/package.json b/ui/package.json index 480b820..c76b9ee 100644 --- a/ui/package.json +++ b/ui/package.json @@ -1,6 +1,6 @@ { "name": "nimplant-ui", - "version": "1.1", + "version": "1.2", "private": true, "scripts": { "dev": "next dev", From 1aed773c066d1db8f98ab520b48aa33fdc94251b Mon Sep 17 00:00:00 2001 From: Cas van Cooten Date: Tue, 28 Feb 2023 19:13:53 +0100 Subject: [PATCH 02/13] Bump Python requirement versions --- server/requirements.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/server/requirements.txt b/server/requirements.txt index a4595b6..182093e 100644 --- a/server/requirements.txt +++ b/server/requirements.txt @@ -1,12 +1,12 @@ -cryptography==39.0.0 +cryptography==39.0.1 flask_cors==3.0.10 -Flask==2.2.2 +Flask==2.2.3 gevent==22.10.2 itsdangerous==2.1.2 Jinja2==3.1.2 -prompt_toolkit==3.0.36; sys_platform=="win32" -PyCryptoDome==3.16.0 +prompt_toolkit==3.0.38; sys_platform=="win32" +PyCryptoDome==3.17 pyyaml==6.0 -requests==2.28.1 +requests==2.28.2 toml==0.10.2 -werkzeug==2.2.2 \ No newline at end of file +werkzeug==2.2.3 \ No newline at end of file From 63dfed99724f4f936d97bf7af2a9f6462ac94e93 Mon Sep 17 00:00:00 2001 From: Cas van Cooten Date: Tue, 28 Feb 2023 19:16:30 +0100 Subject: [PATCH 03/13] Improve error handling for 'cleanup' command --- NimPlant.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/NimPlant.py b/NimPlant.py index d021384..5c95939 100644 --- a/NimPlant.py +++ b/NimPlant.py @@ -251,10 +251,14 @@ def compile_nim(binary_type, xor_key, debug=False): if input().lower() == "y": print("Cleaning up...") - os.remove("server/nimplant.db") - rmtree("server/downloads") - rmtree("server/logs") - rmtree("server/uploads") + try: + os.remove("server/nimplant.db") + except OSError: + pass + + rmtree("server/downloads", ignore_errors=True) + rmtree("server/logs", ignore_errors=True) + rmtree("server/uploads", ignore_errors=True) print("Cleaned up NimPlant server files!") else: From 8cce05e4b092877f0cd29aa4c37b7118b6400107 Mon Sep 17 00:00:00 2001 From: Cas van Cooten Date: Wed, 1 Mar 2023 14:04:44 +0100 Subject: [PATCH 04/13] Further improve 'cleanup' error handling --- NimPlant.py | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/NimPlant.py b/NimPlant.py index 5c95939..78f0147 100644 --- a/NimPlant.py +++ b/NimPlant.py @@ -252,15 +252,26 @@ def compile_nim(binary_type, xor_key, debug=False): print("Cleaning up...") try: - os.remove("server/nimplant.db") + # Clean up files + for filepath in ["server/nimplant.db"]: + if os.path.exists(filepath) and os.path.isfile(filepath): + os.remove(filepath) + + # Clean up directories + for dirpath in [ + "server/downloads", + "server/logs", + "server/uploads", + ]: + if os.path.exists(dirpath) and os.path.isdir(dirpath): + rmtree(dirpath) + + print("Cleaned up NimPlant server files!") except OSError: - pass + print( + "ERROR: Could not clean up all NimPlant server files. Do you have the right privileges?" + ) - rmtree("server/downloads", ignore_errors=True) - rmtree("server/logs", ignore_errors=True) - rmtree("server/uploads", ignore_errors=True) - - print("Cleaned up NimPlant server files!") else: print("Aborting...") From 8f407f48fa3113b56a7a66532f693e8fc40e39af Mon Sep 17 00:00:00 2001 From: Cas van Cooten Date: Sat, 4 Mar 2023 13:47:48 +0100 Subject: [PATCH 05/13] Tweak small navbar size to avoid wrapping --- ui/components/MainLayout.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/components/MainLayout.tsx b/ui/components/MainLayout.tsx index f237057..aae2842 100644 --- a/ui/components/MainLayout.tsx +++ b/ui/components/MainLayout.tsx @@ -61,7 +61,7 @@ function MainLayout({ children }: ChildrenProps) { } navbar={ -