Skip to content

Instantly share code, notes, and snippets.

@manesec
Last active August 31, 2025 14:43
Show Gist options
  • Save manesec/b98fe34e638b0f4139c7ad9db35a11bf to your computer and use it in GitHub Desktop.
Save manesec/b98fe34e638b0f4139c7ad9db35a11bf to your computer and use it in GitHub Desktop.
simple search CVE page, old blog archived
<!-- force light and load mdui js -->
<style>
:root, .mdui-theme-light ,.mdui-theme-dark {
color: #000 !important;;
background-color: #fff !important;;
}
</style>
<link rel="stylesheet" href="https://unpkg.com/mdui@2/mdui.css">
<script src="https://unpkg.com/mdui@2/mdui.global.js"></script>
<!-- Custom CSS -->
<style>
.center {
margin: auto; position: relative; top: 0; left: 0; right: 0; bottom: 0;
}
.subButton {
background-color:rgb(var(--mdui-color-secondary-light));
}
</style>
<!-- Body -->
<div style="width: 100%;">
<p style="text-align: center; font-size: 20px">Open multiple tabs at once for CVE search.</p>
</div>
<mdui-text-field clearable id="searchInput" variant="filled" label="what do you want to search?"></mdui-text-field>
<mdui-button onClick="search()" style='margin-top: 20px'>Search</mdui-button>
<div style="width: 100%; margin-top:20px">
<div class="center" style="text-align: center">
<mdui-button class="subButton" onClick="selectAll()">Select All</mdui-button>
<mdui-button class="subButton" onClick="selectDefault()">Default</mdui-button>
<mdui-button class="subButton" onClick="clearAll()">Clear</mdui-button>
</div>
<mdui-menu selects="multiple" id="searchEngine" class="center" style="margin-top: 20px;">
</mdui-menu>
</div>
<!-- Event -->
<script>
var searchEngines = [
["ExploitDB", "https://www.exploit-db.com/search?q=^^SEARCH^^"],
["MITRE CVE", "https://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=^^SEARCH^^"],
["OpenCVE", "https://www.opencve.io/cve?cvss=&search=^^SEARCH^^"],
["CVE details", "https://www.cvedetails.com/google-search-results.php?q=^^SEARCH^^#gsc.tab=0&gsc.q=^^SEARCH^^&gsc.sort=date"],
["Tenable", "https://www.tenable.com/cve/search?q=^^SEARCH^^&sort=newest&page=1"],
["Sploitus", "https://sploitus.com/?query=^^SEARCH^^"],
["Vulners", "https://vulners.com/search?query=^^SEARCH^^"],
["NIST", "https://nvd.nist.gov/vuln/search/results?form_type=Basic&results_type=overview&query=^^SEARCH^^&search_type=all&isCpeNameSearch=false"],
["Rapid7", "https://www.rapid7.com/db/?q=^^SEARCH^^&type="],
["OSV", "https://osv.dev/list?q=^^SEARCH^^&ecosystem="],
["PacketStormSecurity", "https://packetstormsecurity.com/search/?q=^^SEARCH^^"],
["GitHub Advisory Database", "https://github.com/advisories?query=^^SEARCH^^"],
["Vulnerability Lab", "https://www.vulnerability-lab.com/search.php?search=^^SEARCH^^&submit=aSearch"],
["AVD", "https://avd.aliyun.com/search?q=^^SEARCH^^"],
]
var defaultValue = ["ExploitDB","CVE details","Tenable","Vulners","MITRE CVE","NIST","PacketStormSecurity"];
// Insert search engines
const menu = document.getElementById("searchEngine");
for (var i = 0; i < searchEngines.length; i++) {
var item = document.createElement('mdui-menu-item');
item.value = searchEngines[i][0];
item.innerText = searchEngines[i][0];
document.getElementById("searchEngine").appendChild(item);
}
menu.value = defaultValue
function selectAll() {
var allItem = [];
searchEngines.forEach(element => {
allItem.push(element[0]);
})
menu.value = allItem;
}
function clearAll() {
menu.value = [];
}
function selectDefault() {
menu.value = defaultValue;
}
function sleep(delay) {
var start = new Date().getTime();
while (new Date().getTime() < start + delay);
}
function search() {
var selectValues = document.getElementById("searchEngine").value;
searchEngines.forEach(element => {
if (selectValues.includes(element[0])) {
var searchString = document.getElementById("searchInput").value;
window.open(element[1].replaceAll("^^SEARCH^^",encodeURIComponent(searchString)));
sleep(1000);
}
})
}
function checkURLHash() {
if (window.location.hash.trim() != "" ){
var splitData = window.location.hash.split("#");
switch(window.location.hash.split("#").length){
case 3:
document.getElementById("searchInput").value = decodeURIComponent(splitData[1]);
menu.value = splitData[2].split(",");
break;
case 2:
document.getElementById("searchInput").value = decodeURIComponent(splitData[1]);
break;
}
}
}
checkURLHash();
function updateURLHash(){
window.location.hash = "#" + encodeURIComponent(document.getElementById("searchInput").value) + "#" + menu.value.join(",")
}
setInterval(updateURLHash,500)
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment