Commit 13ce41d6 authored by Alexandre Dulaunoy's avatar Alexandre Dulaunoy
Browse files

Merge pull request #83 from adulau/master

Bug fixes
parents 04ff3d5a 0fbeb641
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -156,7 +156,7 @@ if vSearch:
            else:
            else:
                csvoutput.writerow([item['id'], item['Published'], item['cvss'], item['summary'], refs, nl])
                csvoutput.writerow([item['id'], item['Published'], item['cvss'], item['summary'], refs, nl])
        elif htmlOutput:
        elif htmlOutput:
            print("<h2>" + item['id'] + "<br></h2>CVSS score: " + item['cvss'] + "<br>" + "<b>" + item['Published'] + "<b><br>" + item['summary'] + "<br>")
            print("<h2>" + item['id'] + "<br></h2>CVSS score: " + str(item['cvss']) + "<br>" + "<b>" + item['Published'] + "<b><br>" + item['summary'] + "<br>")
            print("References:<br>")
            print("References:<br>")
            for entry in item['references']:
            for entry in item['references']:
                print(entry + "<br>")
                print(entry + "<br>")
+1 −1
Original line number Original line Diff line number Diff line
@@ -21,7 +21,7 @@ vFeed: http://www.toolswatch.org/vfeed/vfeed.db.tgz
vFeedStatus: http://www.toolswatch.org/update.dat
vFeedStatus: http://www.toolswatch.org/update.dat
Vendor: https://nvd.nist.gov/download/vendorstatements.xml
Vendor: https://nvd.nist.gov/download/vendorstatements.xml
CAPEC: http://capec.mitre.org/data/xml/capec_v2.6.xml
CAPEC: http://capec.mitre.org/data/xml/capec_v2.6.xml
MSBULLETIN: http://download.microsoft.com/download/6/7/3/673E4349-1CA5-40B9-8879-095C72D5B49D/BulletinSearch.xls
MSBULLETIN: http://download.microsoft.com/download/6/7/3/673E4349-1CA5-40B9-8879-095C72D5B49D/BulletinSearch.xlsx
Ref: https://cve.mitre.org/data/refs/refmap/allrefmaps.zip
Ref: https://cve.mitre.org/data/refs/refmap/allrefmaps.zip
[Webserver]
[Webserver]
Host: 127.0.0.1
Host: 127.0.0.1
+1 −1
Original line number Original line Diff line number Diff line
@@ -45,7 +45,7 @@ class Configuration():
               'd2sec': "http://www.d2sec.com/exploits/elliot.xml",
               'd2sec': "http://www.d2sec.com/exploits/elliot.xml",
               'vendor': "https://nvd.nist.gov/download/vendorstatements.xml",
               'vendor': "https://nvd.nist.gov/download/vendorstatements.xml",
               'capec': "http://capec.mitre.org/data/xml/capec_v2.6.xml",
               'capec': "http://capec.mitre.org/data/xml/capec_v2.6.xml",
               'msbulletin': "http://download.microsoft.com/download/6/7/3/673E4349-1CA5-40B9-8879-095C72D5B49D/BulletinSearch.xls",
               'msbulletin': "http://download.microsoft.com/download/6/7/3/673E4349-1CA5-40B9-8879-095C72D5B49D/BulletinSearch.xlsx",
               'ref': "https://cve.mitre.org/data/refs/refmap/allrefmaps.zip",
               'ref': "https://cve.mitre.org/data/refs/refmap/allrefmaps.zip",
               'logging': True,           'logfile': "../log/cve-search.log",
               'logging': True,           'logfile': "../log/cve-search.log",
               'maxLogSize': '100MB',     'backlog': 5,
               'maxLogSize': '100MB',     'backlog': 5,
+2 −5
Original line number Original line Diff line number Diff line
@@ -27,11 +27,8 @@ def setIndex(col, field):
        collection = db[col]
        collection = db[col]
        collection.ensure_index(field)
        collection.ensure_index(field)
        print('[+]Success to create index %s on %s' % (field, col))
        print('[+]Success to create index %s on %s' % (field, col))
    except Exception:
    except Exception as e:
        print('[-]Failed to create index %s on %s' % (collection, field))
        print('[-]Failed to create index %s on %s: %s' % (col, field, e))
        traceback.print_exc()
        print('=======')
        pass


setIndex('cpe', 'id')
setIndex('cpe', 'id')
setIndex('cpeother', 'id')
setIndex('cpeother', 'id')
+3 −2
Original line number Original line Diff line number Diff line
@@ -42,11 +42,12 @@ if i is not None:


if not os.path.exists(tmppath):
if not os.path.exists(tmppath):
    os.mkdir(tmppath)
    os.mkdir(tmppath)
with open(tmppath+'/BulletinSearch.xls', 'wb') as fp:
with open(tmppath+'/BulletinSearch.xlsx', 'wb') as fp:
    shutil.copyfileobj(f, fp)
    shutil.copyfileobj(f, fp)
fp.close()
     
     
# parse xlsx and store in database
# parse xlsx and store in database
wb = xlrd.open_workbook(tmppath+'/BulletinSearch.xls')
wb = xlrd.open_workbook(tmppath+'/BulletinSearch.xlsx')
sh = wb.sheet_by_name('Bulletin Search')
sh = wb.sheet_by_name('Bulletin Search')
header = [s.replace('\n', ' ') for s in sh.row_values(0)]
header = [s.replace('\n', ' ') for s in sh.row_values(0)]
bulletin = {}
bulletin = {}
Loading