mirror of
https://github.com/Noratrieb/cluelessh.git
synced 2026-01-16 09:25:04 +01:00
improvements
This commit is contained in:
parent
bfcf1120e1
commit
46f73c2de4
4 changed files with 15 additions and 9 deletions
|
|
@ -170,6 +170,10 @@ async fn handle_connection(
|
||||||
// arbitrary limit
|
// arbitrary limit
|
||||||
if total_sent_data.len() < 500_000 {
|
if total_sent_data.len() < 500_000 {
|
||||||
total_sent_data.extend_from_slice(&data);
|
total_sent_data.extend_from_slice(&data);
|
||||||
|
} else {
|
||||||
|
info!(channel = %update.number, "Reached stdin limit");
|
||||||
|
state.do_operation(update.number.construct_op(ChannelOperationKind::Data(b"Thanks Hayley!".to_vec())));
|
||||||
|
state.do_operation(update.number.construct_op(ChannelOperationKind::Close));
|
||||||
}
|
}
|
||||||
|
|
||||||
if is_eof {
|
if is_eof {
|
||||||
|
|
|
||||||
|
|
@ -299,7 +299,7 @@ impl ServerChannelsState {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
_ => {
|
_ => {
|
||||||
todo!("{packet_type}");
|
todo!("unsupported packet: {} ({packet_type})", numbers::packet_type_to_string(packet_type).unwrap_or("<unknown>"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -111,12 +111,14 @@ pub mod auth {
|
||||||
let service_name = auth_req.utf8_string()?;
|
let service_name = auth_req.utf8_string()?;
|
||||||
let method_name = auth_req.utf8_string()?;
|
let method_name = auth_req.utf8_string()?;
|
||||||
|
|
||||||
|
if method_name != "none" {
|
||||||
info!(
|
info!(
|
||||||
%username,
|
%username,
|
||||||
%service_name,
|
%service_name,
|
||||||
%method_name,
|
%method_name,
|
||||||
"User trying to authenticate"
|
"User trying to authenticate"
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if service_name != "ssh-connection" {
|
if service_name != "ssh-connection" {
|
||||||
return Err(client_error!(
|
return Err(client_error!(
|
||||||
|
|
|
||||||
|
|
@ -162,7 +162,7 @@ impl ServerConnection {
|
||||||
|
|
||||||
info!(%reason, %reason_string, %description, "Client disconnecting");
|
info!(%reason, %reason_string, %description, "Client disconnecting");
|
||||||
|
|
||||||
return Ok(());
|
return Err(SshStatus::Disconnect);
|
||||||
}
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue