Skip to content

Commit 24d2efe

Browse files
committed
add the new alive method
1 parent 3eae866 commit 24d2efe

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

rust/crates/greenbone-scanner-framework/src/models/target.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ pub enum AliveTestMethods {
4646
Arp = 0x04,
4747
ConsiderAlive = 0x08,
4848
TcpSyn = 0x10,
49+
HostDiscoveryIpv6 = 0x20,
4950
}
5051

5152
#[derive(Debug, thiserror::Error)]
@@ -62,6 +63,7 @@ impl AsRef<str> for AliveTestMethods {
6263
AliveTestMethods::Arp => "arp",
6364
AliveTestMethods::ConsiderAlive => "consider_alive",
6465
AliveTestMethods::TcpSyn => "tcp_syn",
66+
AliveTestMethods::HostDiscoveryIpv6 => "host_discovery_ipv6",
6567
}
6668
}
6769
}
@@ -76,6 +78,7 @@ impl TryFrom<u8> for AliveTestMethods {
7678
0x04 => Ok(AliveTestMethods::Arp),
7779
0x08 => Ok(AliveTestMethods::ConsiderAlive),
7880
0x10 => Ok(AliveTestMethods::TcpSyn),
81+
0x20 => Ok(AliveTestMethods::HostDiscoveryIpv6),
7982
_ => Err(AliveTestMethodsError::InvalidValue(value)),
8083
}
8184
}
@@ -88,6 +91,7 @@ impl From<&str> for AliveTestMethods {
8891
"tcp_syn" => AliveTestMethods::TcpSyn,
8992
"icmp" => AliveTestMethods::Icmp,
9093
"arp" => AliveTestMethods::Arp,
94+
"host_discovery_ipv6" => AliveTestMethods::HostDiscoveryIpv6,
9195
_ => AliveTestMethods::ConsiderAlive,
9296
}
9397
}
@@ -101,6 +105,7 @@ impl Display for AliveTestMethods {
101105
AliveTestMethods::Arp => write!(f, "arp"),
102106
AliveTestMethods::ConsiderAlive => write!(f, "consider_alive"),
103107
AliveTestMethods::TcpSyn => write!(f, "tcp_ping"),
108+
AliveTestMethods::HostDiscoveryIpv6 => write!(f, "host_discovery_ipv6"),
104109
}
105110
}
106111
}

rust/src/openvas/pref_handler.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ where
140140

141141
async fn prepare_plugins_for_openvas(&mut self) -> RedisStorageResult<()> {
142142
let nvts = &self.scan_config.vts;
143-
144143
if nvts.is_empty() {
145144
return Ok(());
146145
}
@@ -270,7 +269,7 @@ where
270269
alive_test |= m as u8;
271270
}
272271

273-
if (1..=31).contains(&alive_test) {
272+
if (1..=32).contains(&alive_test) {
274273
self.redis_connector.push_kb_item(
275274
format!("internal/{}/scanprefs", self.scan_config.scan_id.clone()).as_str(),
276275
format!("{BOREAS_ALIVE_TEST}|||{alive_test}"),

rust/src/scannerctl/osp/start_scan.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ impl Serialize for Target {
217217
models::AliveTestMethods::Arp => ("arp", "1"),
218218
models::AliveTestMethods::ConsiderAlive => ("consider_alive", "1"),
219219
models::AliveTestMethods::TcpSyn => ("tcp_sync", "1"),
220+
models::AliveTestMethods::HostDiscoveryIpv6 => ("host_discovery_ipv6", "1"),
220221
})
221222
.collect();
222223
if !fields.is_empty() {

0 commit comments

Comments
 (0)