iT邦幫忙

0

OpenVAS報告內的時間問題

  • 分享至 

  • xImage

我的gvm是22.4.1 run在Kali上
kali系統內的時區已經調整為CST
https://ithelp.ithome.com.tw/upload/images/20230711/201245811zSGfHsrDK.png
OpenVas內的User settings也調整為Asia/Taipei
https://ithelp.ithome.com.tw/upload/images/20230711/201245811obskXPo0T.png
弱掃Task時間:5/2 12:02AM CST
https://ithelp.ithome.com.tw/upload/images/20230711/20124581vJegh8tUEI.png
但產出的報告,雖然時區是CST,但時間都會少8小時,應該是抓到UTC的時間
5/1 16:02
https://ithelp.ithome.com.tw/upload/images/20230711/20124581vXCkgiMRRK.png
https://ithelp.ithome.com.tw/upload/images/20230711/201245811PEF8WchkE.png
還有哪裡需要修改的嗎

圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

1 個回答

0
Ivan Cheng
iT邦研究生 5 級 ‧ 2023-07-11 17:43:28

OpenVAS 產生 PDF 報告的時間似乎是被寫死的

GVM 22.4 路徑如下

sudo -i
cd /var/lib/gvm/gvmd/report_formats/eef7a139-d464-4702-bdce-9a3ea59e88e5/c402cc3e-b531-11e1-9163-406186ea4fc5
ls
generate  latex.xsl  report_format.xml

查看報告格式說明

cat report_format.xml
<!-- Copyright (C) 2020-2022 Greenbone Networks GmbH -->
<report_format id="c402cc3e-b531-11e1-9163-406186ea4fc5">
  <name>PDF</name>
  <summary>Portable Document Format report. Version 20220831.</summary>
  <description>Scan results in Portable Document Format (PDF). Version 20220831.</description>
  <extension>pdf</extension>
  <content_type>application/pdf</content_type>
  <file name="generate"/>
  <file name="latex.xsl"/>
  <file name="report_format.xml"/>
</report_format>

修改 LaTeX 樣式表

nano latex.xsl

需要自行調整 "format-date" 的範本

  <xsl:template match="scan_start" name="format-date">
    <xsl:param name="date" select="."/>
    <xsl:if test="string-length ($date)">
      <xsl:value-of select="concat (date:day-abbreviation ($date), ' ', date:month-abbreviation ($date), ' ', date:day-in-month ($date), ' ', format-number(date:hour-in-day($date), '00'), ':', format-number(date:minute-in-hour($date), '00'), ':', format-number(date:second-in-minute($date), '00'), ' ', date:year($date), ' ', gvm:timezone-abbrev ())"/>
    </xsl:if>
  </xsl:template>

  <xsl:template match="scan_end">
    <xsl:param name="date" select="."/>
    <xsl:if test="string-length ($date)">
      <xsl:value-of select="concat (date:day-abbreviation ($date), ' ', date:month-abbreviation ($date), ' ', date:day-in-month ($date), ' ', format-number(date:hour-in-day($date), '00'), ':', format-number(date:minute-in-hour($date), '00'), ':', format-number(date:second-in-minute($date), '00'), ' ', date:year($date), ' ', gvm:timezone-abbrev ())"/>
    </xsl:if>
  </xsl:template>

修改前記得先備份,希望有幫助到你。

rb1102 iT邦研究生 2 級 ‧ 2023-07-11 17:44:18 檢舉

謝謝您!我來試試看

我要發表回答

立即登入回答