aboutsummaryrefslogtreecommitdiffstats
path: root/arthur
diff options
context:
space:
mode:
Diffstat (limited to 'arthur')
-rw-r--r--arthur/apis/netcup/__init__.py0
-rw-r--r--arthur/apis/netcup/ssh.py13
-rw-r--r--arthur/config.py4
3 files changed, 17 insertions, 0 deletions
diff --git a/arthur/apis/netcup/__init__.py b/arthur/apis/netcup/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/arthur/apis/netcup/__init__.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
diff --git a/arthur/config.py b/arthur/config.py
index b47a77e..0edf30e 100644
--- a/arthur/config.py
+++ b/arthur/config.py
@@ -32,6 +32,10 @@ class Config(
sentry_dsn: str = ""
numbers_url: str = "https://pydis.wtf/numbers"
+ # RCE as a service
+ ssh_username: str = "kingarthur"
+ ssh_host: str = "lovelace.box.pydis.wtf"
+
# LDAP & Directory
#
# FreeIPA accesses are generated off this information