Skip to content

Comments

Add support for IKEv2 to ikebuster#5

Open
CrsiX wants to merge 98 commits intomyOmikron:mainfrom
CrsiX:v2
Open

Add support for IKEv2 to ikebuster#5
CrsiX wants to merge 98 commits intomyOmikron:mainfrom
CrsiX:v2

Conversation

@CrsiX
Copy link
Contributor

@CrsiX CrsiX commented Sep 13, 2025

This PR adds IKEv2 support to the ISAKMP library and the ikebuster tool.

It may need fine-tuning here and there, but it works overall.

CrsiX added 30 commits July 4, 2025 15:57
)
.bright_black());
owo_println!("---------------");
print_couldnt_bind_solution(500, &e)?;

Check warning

Code scanning / clippy

this expression creates a reference which is immediately dereferenced by the compiler Warning

this expression creates a reference which is immediately dereferenced by the compiler

async fn main_both(cli: &Cli) -> Result<(), Box<dyn std::error::Error>> {
owo_println!("Starting scan for IKEv2, then scanning IKEv1...");
main_v2(&cli).await?;

Check warning

Code scanning / clippy

this expression creates a reference which is immediately dereferenced by the compiler Warning

this expression creates a reference which is immediately dereferenced by the compiler
} else {
None
};
main_v1(&cli).await?;

Check warning

Code scanning / clippy

this expression creates a reference which is immediately dereferenced by the compiler Warning

this expression creates a reference which is immediately dereferenced by the compiler
}
ControlChannelEvent::DumpState(ch) => {
let dump = dump_state(&mut open, &mut todo, &mut stats, &mut results, &options, &scan_started);
ch.send(dump).expect("can't send state dump via channel")

Check warning

Code scanning / clippy

used expect() on a Result value Warning

used expect() on a Result value
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct CertificateRequest {
pub encoding: CertificateEncoding,
pub certification_authority: Vec<u8>,

Check warning

Code scanning / clippy

missing documentation for a struct field Warning

missing documentation for a struct field
/// For this representation, these are not parsed and provided as [`Vec<u8>`] instead.
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct Notification {
pub variant: NotificationType,

Check warning

Code scanning / clippy

missing documentation for a struct field Warning

missing documentation for a struct field
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct Notification {
pub variant: NotificationType,
pub data: Vec<u8>,

Check warning

Code scanning / clippy

missing documentation for a struct field Warning

missing documentation for a struct field
pub struct Notification {
pub variant: NotificationType,
pub data: Vec<u8>,
pub protocol: SecurityProtocol,

Check warning

Code scanning / clippy

missing documentation for a struct field Warning

missing documentation for a struct field
pub variant: NotificationType,
pub data: Vec<u8>,
pub protocol: SecurityProtocol,
pub spi: Option<Vec<u8>>,

Check warning

Code scanning / clippy

missing documentation for a struct field Warning

missing documentation for a struct field
@myOmikron myOmikron requested a review from Copilot October 7, 2025 16:05
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds comprehensive IKEv2 support to the ISAKMP library and ikebuster tool, expanding the existing IKEv1 functionality to support the newer IKE protocol version.

Key changes:

  • Complete IKEv2 protocol implementation with parsers, generators, and data structures
  • New IKEv2 scanner functionality with improved proposal testing and connection tracking
  • Enhanced CLI with autodetection, mode selection, and improved output formats

Reviewed Changes

Copilot reviewed 44 out of 45 changed files in this pull request and generated no comments.

Show a summary per file
File Description
setup.md Adds logging configuration documentation for Libreswan
isakmp/src/v2/ Complete IKEv2 implementation with definitions, parsers, generators, and utilities
isakmp/src/v1/ Minor fixes to comments and naming in existing IKEv1 code
isakmp/src/lib.rs Exposes new v2 module
ikebuster/src/v2/ New IKEv2 scanner implementation with advanced features
ikebuster/src/main.rs Extended CLI with multiple scan modes and IKEv2 support
ikebuster/src/lib.rs Version detection and shared networking utilities
Comments suppressed due to low confidence (1)

isakmp/src/v1/definitions/mod.rs:1

  • Corrected spelling of 'TrippleDES_CBC' to 'TripleDES_CBC'
//! Definitions of ISAKMP messages and types

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

.encryption_algorithms
.iter_mut()
.for_each(|e| e.1 = None);
for mut p in open_proposals {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't use mut p in xyz, modern Rust likes to have: p in &mut xyz

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I consume open_proposals, and thus I'd say mut p is acceptable

) {
if let Some(&sa) = open_packet
.payloads
.iter()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use into_iter, you have ownership

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants