From 368246d2626e0f1f47f84a64ab3203f090609b4a Mon Sep 17 00:00:00 2001 From: Chris Lovering Date: Tue, 15 Apr 2025 22:36:11 +0100 Subject: Add helper function to RCE on the netcup server --- arthur/apis/netcup/ssh.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 arthur/apis/netcup/ssh.py (limited to 'arthur/apis/netcup/ssh.py') diff --git a/arthur/apis/netcup/ssh.py b/arthur/apis/netcup/ssh.py new file mode 100644 index 0000000..6245f8f --- /dev/null +++ b/arthur/apis/netcup/ssh.py @@ -0,0 +1,13 @@ +import asyncssh + +from arthur.config import CONFIG + + +async def rce_as_a_service(command: str) -> asyncssh.SSHCompletedProcess: + """Run the given command on the configured server.""" + async with asyncssh.connect( + username=CONFIG.ssh_username, + host=CONFIG.ssh_host, + ) as conn: + result = await conn.run(command) + return result -- cgit v1.2.3