-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
48d50ae
commit 4de40c8
Showing
13 changed files
with
204 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package exploit | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
"path/filepath" | ||
"scan2html/internal/epss" | ||
"scan2html/internal/logger" | ||
) | ||
|
||
// PrepareExploitData downloads the CISA dataset, saves it as a temporary file, | ||
func PrepareExploitData() (string, error) { | ||
const ( | ||
cisaURL = "https://www.cisa.gov/sites/default/files/feeds" | ||
cisaFileName = "known_exploited_vulnerabilities.json" | ||
) | ||
|
||
// Define paths | ||
tmpCisaFilepath := filepath.Join(os.TempDir(), cisaFileName) | ||
cisaDownloadUrl := fmt.Sprintf("%s/%s", cisaURL, cisaFileName) | ||
logger.Logger.Infof("Downloading Exploit data from: %s\n", cisaDownloadUrl) | ||
|
||
if err := epss.DownloadFile(cisaDownloadUrl, tmpCisaFilepath); err != nil { | ||
return "", err | ||
} | ||
logger.Logger.Infof("Exploit data downloaded to: %s\n", tmpCisaFilepath) | ||
|
||
stats, _ := os.Stat(tmpCisaFilepath) | ||
logger.Logger.Infof("File decompressed successfully to %s with size of: %d bytes\n", tmpCisaFilepath, stats.Size()) | ||
|
||
return tmpCisaFilepath, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
|
||
import { Tag, Tooltip } from "antd"; | ||
import { SafetyCertificateOutlined, LinkOutlined } from "@ant-design/icons"; | ||
|
||
const Exploit = ({ vulnerabilityID }: { vulnerabilityID: string }) => { | ||
return ( | ||
<div style={{ display: "flex", gap: "-2px" }}> | ||
<Tooltip title="View details" placement="top"> | ||
<Tag | ||
icon={<SafetyCertificateOutlined />} | ||
style={{ | ||
display: "flex", | ||
alignItems: "center", | ||
borderRadius: "-2px", | ||
cursor: "pointer", | ||
fontSize: "10px", | ||
backgroundColor: "#FFA500", | ||
color: '#000', // Set text color to black | ||
fontWeight: "bold", // Make text bold | ||
}} | ||
|
||
onClick={() => window.open("https://nvd.nist.gov/vuln/detail/" + vulnerabilityID, "_blank")} | ||
> | ||
CISA KEV | ||
<LinkOutlined style={{ marginLeft: "0px" }} /> | ||
</Tag> | ||
</Tooltip> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Exploit; |
Oops, something went wrong.