diff --git a/_typos.toml b/_typos.toml index 7aeff92..fbd0407 100644 --- a/_typos.toml +++ b/_typos.toml @@ -7,6 +7,7 @@ extend-exclude = [ "notebooks/*", "config/development.yaml", "migration", + "fixtures/*", ] [default.extend-identifiers] diff --git a/fixtures/seebug.html b/fixtures/seebug.html new file mode 100644 index 0000000..6c692ee --- /dev/null +++ b/fixtures/seebug.html @@ -0,0 +1,7280 @@ + + + + + + + + + 漏洞列表 - 知道创宇 Seebug 漏洞平台 + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
+

漏洞列表

+ +
+ +
+ + + +
+ +
+
+ 漏洞类别: + +
+ +
+ 漏洞等级: + +
+
+ +
+ +
+
+
+
+ +
+ 全部 +
+ +
+ 今天 +
+ +
+ 一周内 +
+ + + +
+ 半年内 +
+
+
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SSV ID漏洞名称
SSV-99847Rejetto HTTP File Server 未授权 + RCE(CVE-2024-23692)
SSV-99846PHPCGI + 远程命令执行漏洞(CVE-2024-4577)
SSV-99845Apache OFBiz 目录遍历致代码执行漏洞(CVE-2024-36104)
SSV-99844Apache HugeGraph-Server Command Execution In + Gremlin(CVE-2024-27348)
SSV-99843Check Point Security Gateway + 任意文件读取(CVE-2024-24919)
SSV-99842Sonatype Nexus Repository + 3路径遍历漏洞(CVE-2024-4956)
SSV-99841Zabbix + 后台延时注入(CVE-2024-22120)
SSV-99839WordPress-XStore-Core-Plugin-SQL-Injection(CVE-2024-33551) +
SSV-99838 + QNAP QTS 溢出导致的未授权 RCE 漏洞(CVE-2024-27130)
SSV-99837D-LINK DIR-X4860未授权 RCE
SSV-99836Cacti + 命令注入漏洞(CVE-2024-29895)
SSV-99835Mura/Masa CMS SQL 注入漏洞( CVE-2024-32640)
SSV-99834禅道项目管理系统身份认证绕过漏洞
SSV-99833CrushFTP + 认证绕过漏洞(CVE-2024-4040)
SSV-99832Primeton EOS Platform 反序列化致远程代码执行漏洞
SSV-99831Progress Flowmon 命令注入漏洞(CVE-2024-2389)
SSV-99830Oracle WebLogic Server + 存在远程代码执行漏洞(CVE-2024-21006)
SSV-99829Palo Alto Networks PAN-OS GlobalProtect + 命令注入漏洞(CVE-2024-3400)
SSV-99828OpenMetadata + 身份认证绕过漏洞与多个表达式注入漏洞(CVE-2024-28253、CVE-2024-28254、CVE-2024-28255、CVE-2024-28845、CVE-2024-28848) +
SSV-99827Linux内核n_gsm模块多个本地提权漏洞
+
+ + +
+ + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/fixtures/seebug_many_cve.html b/fixtures/seebug_many_cve.html new file mode 100644 index 0000000..83796d4 --- /dev/null +++ b/fixtures/seebug_many_cve.html @@ -0,0 +1,7079 @@ + + + + + + + + + + + 漏洞列表 - 知道创宇 Seebug 漏洞平台 + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
+

漏洞列表

+ +
+ +
+ + + +
+ +
+
+ 漏洞类别: + +
+ +
+ 漏洞等级: + +
+
+ +
+ +
+
+
+
+ +
+ 全部 +
+ +
+ 今天 +
+ +
+ 一周内 +
+ + + +
+ 半年内 +
+
+
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SSV ID漏洞名称
SSV-99806GL.iNet 多个产品未授权 RCE(CVE-2023-50445、CVE-2023-50919)
SSV-99805Jenkins CLI 任意文件读取漏洞(CVE-2024-23897)
SSV-99804Fortra GoAnywhere MFT 身份验证绕过(CVE-2024-0204)
SSV-99802Confluence 未授权远程代码执行(CVE-2023-22527)
SSV-99801Linux本地提权漏洞(CVE-2023-6546)
SSV-99800Ivanti VPN 未授权 RCE(CVE-2023-46805、CVE-2024-21887)
SSV-99799Ruijie 部分网络产品未授权 RCE (CVE-2023-34644)
SSV-99798GitLab 任意用户密码重置漏洞(CVE-2023-7028)
SSV-99796Apache OFBiz 远程代码执行漏洞(CVE-2023-51467)
SSV-99795OpenSSH 命令注入漏洞(CVE-2023-51385)
SSV-99794Windows通用日志文件系统驱动程序特权提升漏洞(CVE-2023-36424)
SSV-99793Citrix NetScaler ADC & Gateway信息泄露漏洞(CVE-2023-4966)
SSV-99792SAP BusinessObjects Intelligence 4.3 XXE漏洞(CVE-2022-28213)
SSV-99791libcue远程代码执行漏洞(CVE-2023-43641)
SSV-99790Confluence Data Center and Confluence Server远程代码执行漏洞(CVE-2023-22522)
SSV-99789Apache Struts 目录遍历导致文件上传漏洞(CVE-2023-50164)
SSV-99788D-Link D-View8 coreservice_action_script 危险函数远程代码执行漏洞(CVE-2023-44414)
SSV-99787ownCloud Graph API信息泄漏(CVE-2023-49103)
SSV-99786Apache ActiveMQ jolokia 远程代码执行漏洞(CVE-2022-41678)
SSV-99785 I Doc View在线文档预览系统远程代码执行漏洞
+
+ + +
+ + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/grab/seebug.rs b/src/grab/seebug.rs index 1ad8fb9..44bc957 100644 --- a/src/grab/seebug.rs +++ b/src/grab/seebug.rs @@ -231,14 +231,14 @@ impl SeeBugCrawler { .attr("data-original-title") .ok_or_else(|| eyre!("data-original-title not found"))? .trim(); - let mut cve_id = ""; if cve_ids.contains('、') { - cve_id = cve_ids + return Ok(cve_ids .split('、') .nth(0) .ok_or_else(|| eyre!("cve_ids split not found cve id"))? + .to_owned()); } - Ok(cve_id.to_string()) + Ok(cve_ids.to_string()) } fn get_tag(&self, el: ElementRef) -> Result { @@ -255,3 +255,50 @@ impl SeeBugCrawler { Ok(tag.to_string()) } } + +#[cfg(test)] +mod tests { + use super::*; + use std::fs; + + #[tokio::test] + async fn test_seebug_get_cve() -> Result<()> { + let seebug = SeeBugCrawler::new(); + // read fixtures/seebug.html + let html = fs::read_to_string("fixtures/seebug.html")?; + let document = Html::parse_document(&html); + let selector = Selector::parse(".sebug-table tbody tr") + .map_err(|err| eyre!("seebug parse html error {}", err))?; + let tr_elements = document.select(&selector).collect::>(); + if tr_elements.is_empty() { + return Err(Error::Message("failed to get seebug page".into())); + } + let first = tr_elements + .first() + .ok_or_else(|| Error::Message("failed to get seebug page first element".to_string()))? + .to_owned(); + let cve_id = seebug.get_cve_id(first)?; + assert_eq!(cve_id, "CVE-2024-23692"); + Ok(()) + } + #[tokio::test] + async fn test_many_cve_seebug_get_cve() -> Result<()> { + let seebug = SeeBugCrawler::new(); + // read fixtures/seebug.html + let html = fs::read_to_string("fixtures/seebug_many_cve.html")?; + let document = Html::parse_document(&html); + let selector = Selector::parse(".sebug-table tbody tr") + .map_err(|err| eyre!("seebug parse html error {}", err))?; + let tr_elements = document.select(&selector).collect::>(); + if tr_elements.is_empty() { + return Err(Error::Message("failed to get seebug page".into())); + } + let first = tr_elements + .first() + .ok_or_else(|| Error::Message("failed to get seebug page first element".to_string()))? + .to_owned(); + let cve_id = seebug.get_cve_id(first)?; + assert_eq!(cve_id, "CVE-2023-50445"); + Ok(()) + } +} diff --git a/src/grab/ti.rs b/src/grab/ti.rs index f48988f..390c736 100644 --- a/src/grab/ti.rs +++ b/src/grab/ti.rs @@ -146,7 +146,7 @@ pub struct TiVulnDetail { pub description: String, pub description_en: String, pub change_impact: i32, - pub operator_hid: String, + pub operator_hid: Option, pub create_hid: Option, pub channel: Option, pub tracking_id: Option,