diff --git a/static/linkbin/linkbin.css b/static/linkbin/linkbin.css new file mode 100644 index 0000000..a4e9710 --- /dev/null +++ b/static/linkbin/linkbin.css @@ -0,0 +1,111 @@ +/* Set font, make stuff centered, set colors */ +body { + font-family: Arial, sans-serif; + text-align: center; + margin: auto; + margin-top: 10%; + width: 60%; + + color: black; + background-color: rgb(239, 239, 239); +} + +/* Make logo big and have orange outline */ +.logo { + user-select: none; + padding: 0; + margin: 0; + font-size: 70px; + font-weight: lighter; + text-shadow: 0 0 6px orangered; +} + + +.search-container { + margin: 20px; +} + +.search-container button { + padding: 4px; + font-size: 24px; +} + +/* Make search boxes look a bit better */ +.search-container input { + border: 1px solid grey; + border-radius: 5px; + outline: 0; + background-color: #f5f5f5; +} +.search-container input:hover, .search-container input:focus { + border: 1.5px solid orange; + background-color: white; +} + +/* Make the main search box big */ +.big-input { + height: 20px; + font-size: 24px; + padding: 10px; + width: 100%; +} + +/* Make the tag search box smaller and with a different font */ +.small-input { + margin-top: 5px; + height: 10px; + font-size: 12px; + padding: 5px; + width: 64%; + font-family: 'Courier New', Courier, monospace; +} + +/* Make each result box look nicer */ +.result-box { + text-align: left; + border: 1px solid black; + border-radius: 5px; + background-color: #f5f5f5; + width: 100%; + margin: 8px auto 8px auto; + padding: 10px; + padding-top: 4px; + box-shadow: 2px 2px 5px black; +} +.result-box:hover { + background-color: white; + box-shadow: 1px 1px 8px orangered; +} + +/* No margin on result title and have big font */ +.result-title { + margin: 0; + font-size: 24px; +} + +/* Make the link stick to the right side of the box */ +.result-link { + position: relative; + float: right; + font-size: 24px; +} +/* Make the link have dotted underline and orange on hover */ +.result-link a { + text-decoration-style: dotted; +} +.result-link a:hover { + color: orangered; +} + +/* No margin on the description */ +.result-description { + margin: 0; +} + +/* Make tags grey and have no margin */ +.result-tags { + margin: 0; + color: grey; +} + + diff --git a/static/linkbin/linkbin.html b/static/linkbin/linkbin.html new file mode 100644 index 0000000..a5d9b78 --- /dev/null +++ b/static/linkbin/linkbin.html @@ -0,0 +1,29 @@ + + + + + + + OSUSEC Link Bin + + + + +

OSUSEC Link Bin

+
+
+ + + + +
+
+
+ + diff --git a/static/linkbin/linkbin.js b/static/linkbin/linkbin.js new file mode 100644 index 0000000..b124c0e --- /dev/null +++ b/static/linkbin/linkbin.js @@ -0,0 +1,120 @@ +// Assume data.json has an array of objects like: [{name: 'Object 1'}, {name: 'Object 2'}, ...] +const fetchData = async () => { + const response = await fetch('links.json'); + const data = await response.json(); + return data; +}; + +const displayResults = (results) => { + const resultsContainer = document.getElementById('results-container'); + resultsContainer.innerHTML = ''; + + if (results.length === 0) { + resultsContainer.innerHTML = 'No results found :('; + } else { + results.forEach((result) => { + // Container for each result + const resultDiv = document.createElement('div'); + resultDiv.className = 'result-box'; + + // The link + const link = document.createElement('h3'); + link.className = 'result-link'; + link.innerHTML = '[link]'; + resultDiv.append(link); + + // The title + const resultTitle = document.createElement('h3'); + resultTitle.className = 'result-title'; + resultTitle.textContent = result.title; + resultDiv.append(resultTitle); + + // The description + const resultDescription = document.createElement('p'); + resultDescription.className = 'result-description'; + resultDescription.textContent = result.description; + resultDiv.append(resultDescription); + + // The tags + const tags = document.createElement("p"); + tags.className = 'result-tags'; + tags.innerHTML = 'tags: ' + result.tags.join(', ') + ''; + resultDiv.append(tags); + + // Add this result to the main results container + resultsContainer.appendChild(resultDiv); + }); + } +}; + + +// Weird sort function :sob: +function compareNicheness(a, b) { + const sortBy = document.getElementById('sort').value; + + if(a.nicheness > b.nicheness) { + if (sortBy == 'asc-nicheness') { + return 1; + } else { + return -1; + } + } else if (a.nicheness < b.nicheness) { + if (sortBy == 'asc-nicheness') { + return -1; + } else { + return 1; + } + } + + return 0; +} + +const search = async () => { + // Get the data + const data = await fetchData(); + + // Get the search query + const query = document.getElementById('searchInput').value.toLowerCase(); + + // Get the tags + const tags = document.getElementById('tagsInput').value.toLowerCase().split(' '); + + // Filter by tags if they were specified + var tagged = data; + tags.forEach((tag) => { + if(tag.length != 0) { + tagged = tagged.filter((item) => item.tags.includes(tag)); + } + }); + + // Filter by search query + var filtered = tagged.filter((item) => item.title.toLowerCase().includes(query) || item.description.toLowerCase().includes(query)); + + // Sort if needed + if (document.getElementById('sort').value != 'none') { + filtered.sort(compareNicheness); + } + + // Display the results + displayResults(filtered); +}; + + +// Fetch data and display all results initially +fetchData().then((data) => displayResults(data)); + + +// jQuery code called after web page loads +$(function() { + + // Execute a search any time an input field changes + $('input').on('input', function() { + search(); + }); + + // Also execute a search any time the sort by parameter changes + $('select').on('input', function() { + search(); + }); + +}); diff --git a/static/linkbin/links.json b/static/linkbin/links.json new file mode 100644 index 0000000..0adbf3d --- /dev/null +++ b/static/linkbin/links.json @@ -0,0 +1,30 @@ +[ + { + "link": "https://github.com/HACKE-RC/awesome-reversing", + "title": "GitHub | Awesome Reversing", + "description": "A github awesome list for reverse engineering", + "tags": ["awesome-list", "reversing", "github"], + "nicheness": 1 + }, + { + "link": "https://empyreal96.github.io/nt-info-depot/Windows-Internals-PDFs/Windows%20System%20Internals%207e%20Part%201.pdf", + "title": "Windows Internals E-Book PDF", + "description": "An e book about windows internals", + "tags": ["windows", "ebook"], + "nicheness": 5 + }, + { + "link": "https://secret.club/", + "title": "secret.club reverse engineering blog", + "description": "A blog with some really interesting reverse engineering posts. Many related to windows or anti-cheat bypass", + "tags": ["blog", "windows", "reversing"], + "nicheness": 3 + }, + { + "link": "https://www.unknowncheats.me/forum/rust-language-/588419-windows-uefi-bootkit-rust-codename-redlotus.html", + "title": "UEFI Bootkit in Rust (RedLotus) on UnknownCheats.me", + "description": "A UEFI bootkit written in rust, originally intended to assist in bypassing anti-cheats by getting code execution before the drivers for anti-cheats have loaded.", + "tags": ["bootkit", "rust", "UEFI", "github", "windows"], + "nicheness": 7 + } +] \ No newline at end of file