Skip to content

Commit

Permalink
Add VulDB Spider (#23)
Browse files Browse the repository at this point in the history
* Add OBS Vigilance Spider

* Add VulDB spider

Co-authored-by: karimhabush <37211852+karimhabush@users.noreply.github.com>
  • Loading branch information
chaymae-jhr and karimhabush committed Jul 30, 2022
1 parent a11bce0 commit c79ae4a
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 1 deletion.
4 changes: 3 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from spiders.CISASpider import CisaSpider
from spiders.CertFrSpider import CertFrSpider
from spiders.DgssiSpider import DgssiSpider
from spiders.VulDBSpider import VulDBSpider
from spiders.ZDISpider import ZDISpider
from scrapy.crawler import CrawlerProcess
from datetime import datetime, timezone
Expand All @@ -12,7 +13,7 @@

def main():
now = datetime.now(timezone.utc).strftime("%d/%m/%Y %H:%M:%S")
item = f"""<div id="top"></div>\n\n## CyberOwl \n ![cyberowl](docs/images/logo.png)\n> Last Updated {now} UTC \n\nA daily updated summary of the most frequent types of security incidents currently being reported from different sources.\n\n--- \n\n### :kangaroo: Jump to \n | CyberOwl Sources | Description |\n|---|---|\n| [US-CERT](#us-cert-arrow_heading_up) | United States Computer Emergency and Readiness Team. |\n| [MA-CERT](#ma-cert-arrow_heading_up) | Moroccan Computer Emergency Response Team. |\n| [CERT-FR](#cert-fr-arrow_heading_up) | The French national government Computer Security Incident Response Team. |\n| [IBM X-Force Exchange](#ibmcloud-arrow_heading_up) | A cloud-based threat intelligence platform that allows to consume, share and act on threat intelligence. |\n| [ZeroDayInitiative](#zerodayinitiative-arrow_heading_up) | An international software vulnerability initiative that was started in 2005 by TippingPoint. |\n| [OBS Vigilance](#obs-vigilance-arrow_heading_up) |Vigilance is an initiative created by OBS (Orange Business Services) since 1999 to watch public vulnerabilities and then offer security fixes, a database and tools to remediate them. |\n\n> Suggest a source by opening an [issue](https://github.com/karimhabush/cyberowl/issues)! :raised_hands:\n\n"""
item = f"""<div id="top"></div>\n\n## CyberOwl \n ![cyberowl](docs/images/logo.png)\n> Last Updated {now} UTC \n\nA daily updated summary of the most frequent types of security incidents currently being reported from different sources.\n\n--- \n\n### :kangaroo: Jump to \n | CyberOwl Sources | Description |\n|---|---|\n| [US-CERT](#us-cert-arrow_heading_up) | United States Computer Emergency and Readiness Team. |\n| [MA-CERT](#ma-cert-arrow_heading_up) | Moroccan Computer Emergency Response Team. |\n| [CERT-FR](#cert-fr-arrow_heading_up) | The French national government Computer Security Incident Response Team. |\n| [IBM X-Force Exchange](#ibmcloud-arrow_heading_up) | A cloud-based threat intelligence platform that allows to consume, share and act on threat intelligence. |\n| [ZeroDayInitiative](#zerodayinitiative-arrow_heading_up) | An international software vulnerability initiative that was started in 2005 by TippingPoint. |\n| [OBS Vigilance](#obs-vigilance-arrow_heading_up) |Vigilance is an initiative created by OBS (Orange Business Services) since 1999 to watch public vulnerabilities and then offer security fixes, a database and tools to remediate them. |\n| [VulDB](#vuldb-arrow_heading_up) | Number one vulnerability database documenting and explaining security vulnerabilities, threats, and exploits since 1970. |\n\n> Suggest a source by opening an [issue](https://github.com/karimhabush/cyberowl/issues)! :raised_hands:\n\n"""

with open("README.md", "w", encoding="utf-8") as f:
f.write(item)
Expand All @@ -26,6 +27,7 @@ def main():
process.crawl(IBMCloudSpider)
process.crawl(ZDISpider)
process.crawl(VigilanceSpider)
process.crawl(VulDBSpider)
process.start()

except Exception:
Expand Down
43 changes: 43 additions & 0 deletions spiders/VulDBSpider.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
from urllib import response
import scrapy
from mdtemplate import Template
from datetime import date


class VulDBSpider(scrapy.Spider):
name = 'VulDB'
start_urls = [
'https://vuldb.com/?live.recent'
]
def parse(self, response):
if('cached' in response.flags):
return
num_bulletins=0
_data = []
print(response.css("table>tr").extract())
for bulletin in response.css("table>tr"):
if num_bulletins==0:
num_bulletins+=1
continue
LINK = "https://vuldb.com/"+bulletin.xpath("descendant-or-self::td[4]//@href").get()
DATE = str(date.today())+" at "+bulletin.xpath("descendant-or-self::td[1]//text()").get()
TITLE = bulletin.xpath("descendant-or-self::td[4]//text()").get().replace(
"\n", "").replace("\t", "").replace("\r", "").replace(" ", "").replace("|","-")
DESC = "Visit link for details"
ITEM = {
"_title": TITLE,
"_link": LINK,
"_date": DATE,
"_desc": DESC
}

_data.append(ITEM)
num_bulletins += 1
if num_bulletins >= 11:
break

_to_write = Template("VulDB", _data)

with open("README.md", "a", encoding="utf-8") as f:
f.write(_to_write._fill_table())
f.close()

0 comments on commit c79ae4a

Please sign in to comment.