Implement basic telnet shell for both orbic and tplink

This commit is contained in:
Markus Unterwaditzer
2025-11-16 18:39:13 +01:00
committed by Will Greenberg
parent 676cd3c862
commit 5fbc540fa0
6 changed files with 131 additions and 3 deletions
+14 -1
View File
@@ -9,7 +9,7 @@ use tokio::time::sleep;
use crate::orbic_auth::{LoginInfo, LoginRequest, LoginResponse, encode_password};
use crate::output::{eprintln, print, println};
use crate::util::{telnet_send_command, telnet_send_file};
use crate::util::{interactive_shell, telnet_send_command, telnet_send_file};
use crate::{CONFIG_TOML, RAYHUNTER_DAEMON_INIT};
#[derive(Deserialize, Debug)]
@@ -270,3 +270,16 @@ async fn setup_rayhunter(admin_ip: &str) -> Result<()> {
Ok(())
}
/// Root the Orbic device and open an interactive shell
pub async fn shell(
admin_ip: &str,
admin_username: &str,
admin_password: Option<&str>,
) -> Result<()> {
start_telnet(admin_ip, admin_username, admin_password).await?;
eprintln!(
"This terminal is fairly limited. The shell prompt may not be visible, but it still accepts commands."
);
interactive_shell(admin_ip, 24, false).await
}