Skip to content

Commit

Permalink
补充CVE来源的官网URL
Browse files Browse the repository at this point in the history
  • Loading branch information
lyy289065406 committed May 5, 2020
1 parent f083d1c commit ed5f728
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/bean/cve_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def to_html(self):
"[<b>漏洞编号</b>] <font color='blue'>%s</font>" % self.id,
"[<b>披露时间</b>] %s" % self.time,
"[<b>漏洞描述</b>] %s" % self.title,
"[<b>相关链接</b>] %s" % self.url
"[<b>相关链接</b>] <a href='%s'>%s</a>" % (self.url, self.url)
])


Expand Down
5 changes: 5 additions & 0 deletions src/crawler/_base_crawler.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ def NAME_EN(self):
return 'unknow'


@abstractmethod
def HOME_PAGE(self):
return 'https://exp-blog.com'


def CACHE_PATH(self):
return '%s/cache/%s.dat' % (env.PRJ_DIR, self.NAME_EN())

Expand Down
5 changes: 5 additions & 0 deletions src/crawler/anquanke.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def __init__(self):
BaseCrawler.__init__(self)
self.name_ch = '安全客'
self.name_en = 'AnQuanKe'
self.home_page = 'https://www.anquanke.com/vul'
self.url = 'https://www.anquanke.com/vul/'


Expand All @@ -32,6 +33,10 @@ def NAME_EN(self):
return self.name_en


def HOME_PAGE(self):
return self.home_page


def get_cves(self):
response = requests.get(
self.url,
Expand Down
5 changes: 5 additions & 0 deletions src/crawler/cert360.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ def __init__(self):
BaseCrawler.__init__(self)
self.name_ch = '360'
self.name_en = '360'
self.home_page = 'https://cert.360.cn/warning'
self.url_list = 'https://cert.360.cn/warning/searchbypage'
self.url_cve = 'https://cert.360.cn/warning/detail?id='

Expand All @@ -34,6 +35,10 @@ def NAME_EN(self):
return self.name_en


def HOME_PAGE(self):
return self.home_page


def get_cves(self, limit = 6):
params = {
'length': limit,
Expand Down
4 changes: 4 additions & 0 deletions src/crawler/nsfocus.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def __init__(self):
BaseCrawler.__init__(self)
self.name_ch = '绿盟'
self.name_en = 'Nsfocus'
self.home_page = 'http://www.nsfocus.net/index.php'
self.url_list = 'http://www.nsfocus.net/index.php'
self.url_cve = 'http://www.nsfocus.net/vulndb/'

Expand All @@ -33,6 +34,9 @@ def NAME_EN(self):
return self.name_en


def HOME_PAGE(self):
return self.home_page


def get_cves(self):
params = {
Expand Down
5 changes: 5 additions & 0 deletions src/crawler/qianxin.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def __init__(self):
BaseCrawler.__init__(self)
self.name_ch = '奇安信'
self.name_en = 'QiAnXin'
self.home_page = 'https://ti.qianxin.com/advisory/'
self.url = 'https://ti.qianxin.com/advisory/'


Expand All @@ -32,6 +33,10 @@ def NAME_EN(self):
return self.name_en


def HOME_PAGE(self):
return self.home_page


def get_cves(self):
response = requests.get(
self.url,
Expand Down
5 changes: 5 additions & 0 deletions src/crawler/redqueen.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def __init__(self):
BaseCrawler.__init__(self)
self.name_ch = '红后'
self.name_en = 'RedQueen'
self.home_page = 'https://redqueen.tj-un.com/IntelHome.html'
self.url_list = 'https://redqueen.tj-un.com/Json/intelHomeVulnIntelList.json'
self.url_cve = 'https://redqueen.tj-un.com/IntelDetails.html?id='

Expand All @@ -33,6 +34,10 @@ def NAME_EN(self):
return self.name_en


def HOME_PAGE(self):
return self.home_page


def to_headers(self):
headers = self.headers()
headers['Host'] = 'redqueen.tj-un.com'
Expand Down
5 changes: 5 additions & 0 deletions src/crawler/vas.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ def __init__(self):
BaseCrawler.__init__(self)
self.name_ch = '斗象'
self.name_en = 'vas'
self.home_page = 'https://vas.riskivy.com/vuln'
self.url_list = 'https://console.riskivy.com/vas'
self.url_details = 'https://console.riskivy.com/vas/'
self.url_cve = 'https://vas.riskivy.com/vuln-detail?id='
Expand All @@ -35,6 +36,10 @@ def NAME_EN(self):
return self.name_en


def HOME_PAGE(self):
return self.home_page


def get_cves(self, limit = 5):
params = {
'title': '',
Expand Down
3 changes: 2 additions & 1 deletion src/notice/mail.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def to_mail(cves, smtp, sender, password):


def format_content(cves):
src_tpl = ' <li><font color="red">%(cnt)d</font>条由 [%(src)s] 提供</li>'
src_tpl = ' <li><font color="red">%(cnt)d</font>条由 [<a href="%(url)s">%(src)s</a>] 提供</li>'
mail_tpl = '''
<h3>发现最新威胁情报<font color="red">%(total)d</font>条:</h3>
<ul>
Expand All @@ -65,6 +65,7 @@ def format_content(cves):
total += cnt
src_infos.append(src_tpl % {
'cnt': cnt,
'url': src.NAME_CH(),
'src': src.NAME_CH()
})
map(lambda cve: cve_infos.append(cve.to_html()), _cves)
Expand Down

0 comments on commit ed5f728

Please # to comment.