Skip to content

Commit

Permalink
将exp合并到kb
Browse files Browse the repository at this point in the history
  • Loading branch information
cn-kali-team committed Feb 21, 2024
1 parent 7b9ee9b commit c211e51
Show file tree
Hide file tree
Showing 43 changed files with 897 additions and 1,654 deletions.
12 changes: 6 additions & 6 deletions helper/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ pub struct CPECommand {
}

#[derive(FromArgs, PartialEq, Debug)]
#[argh(description = "exp helper")]
#[argh(subcommand, name = "exp")]
#[argh(description = "kb helper")]
#[argh(subcommand, name = "kb")]
pub struct EXPCommand {
#[argh(option, description = "import exp from files_exploits.csv")]
#[argh(option, description = "import kb from files_exploits.csv")]
pub path: Option<PathBuf>,
#[argh(option, description = "import exp from nuclei-templates path")]
#[argh(option, description = "import kb from nuclei-templates path")]
pub template: Option<PathBuf>,
#[argh(switch, description = "update exp from nuclei-templates")]
#[argh(switch, description = "update kb from nuclei-templates")]
pub api: bool,
}

Expand All @@ -71,7 +71,7 @@ pub struct KBCommand {
#[argh(description = "sync helper")]
#[argh(subcommand, name = "sync")]
pub struct SyncCommand {
#[argh(switch, description = "sync exp")]
#[argh(switch, description = "sync kb")]
pub exp: bool,
#[argh(switch, description = "sync cve")]
pub cve: bool,
Expand Down
6 changes: 3 additions & 3 deletions helper/src/cve/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ use std::path::PathBuf;
use std::str::FromStr;

use diesel::mysql::MysqlConnection;
use nvd_api::ApiVersion;
use nvd_api::pagination::Object;
use nvd_api::v2::vulnerabilities::CveParameters;
use nvd_api::ApiVersion;

use nvd_cves::v4::{CVEContainer, CVEItem};
use nvd_model::cve::{CreateCve, Cve};
use nvd_model::error::DBResult;
use nvd_model::types::AnyValue;

use crate::cpe::{del_expire_product, import_vendor_product_to_db};
use crate::exp::associate_cve_and_exploit;
use crate::{create_cve_product, init_db_pool};
use crate::cpe::{del_expire_product, import_vendor_product_to_db};
use crate::kb::associate_cve_and_exploit;

pub(crate) async fn async_cve(param: CveParameters) {
let connection_pool = init_db_pool();
Expand Down
Loading

0 comments on commit c211e51

Please sign in to comment.