Skip to content
This repository was archived by the owner on Dec 19, 2024. It is now read-only.

Commit bec7d41

Browse files
toolswatchnabil.ouchn@gmail.com
authored andcommitted
Fixed issue in Migrate Module
1 parent 26c259b commit bec7d41

8 files changed

Lines changed: 48 additions & 34 deletions

File tree

CHANGELOG.md

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
Changelog
22
=========
33

4+
0.7.2.1
5+
-----
6+
* [Fix] Imporved Migrate() module (SQLite to MongoDB). Thanks to Thiago Palmeira from Infolink for reporting the bug.
7+
48
0.7.2
59
-----
6-
* Added support to CAPEC v2.10. Check [the full changelog](http://capec.mitre.org/data/reports/diff_reports/v2.9_v2.10.html).
7-
* Added support to CWE v2.11. Check [the full changelog](http://cwe.mitre.org/data/reports/diff_reports/v2.10_v2.11.html).
8-
* Added support to the new [Microsoft security update](https://portal.msrc.microsoft.com/en-us/security-guidance)
10+
* [New] Added support to CAPEC v2.10. Check [the full changelog](http://capec.mitre.org/data/reports/diff_reports/v2.9_v2.10.html).
11+
* [New] Added support to CWE v2.11. Check [the full changelog](http://cwe.mitre.org/data/reports/diff_reports/v2.10_v2.11.html).
12+
* [New] Added support to the new [Microsoft security update](https://portal.msrc.microsoft.com/en-us/security-guidance)
913
* [Improve] Improved the `get_ms` method to returns both all and new Microsoft bulletins and KBs.
1014
* [Improve] Fixed issue #65. Cleaned the database from **Reject** entries.
1115
* [Doc] [Documentation](https://vfeed.io/docs) updated to reflect the new changes.
@@ -33,18 +37,18 @@ _All changes are immediate for consultancy / integrator license customers. The C
3337

3438
0.6.9
3539
-----
36-
* The vFeed DB is no more available through `update` command. The command is deprecated.
37-
* The delivery of the vFeed DB was handed over to a new established entity [vFeed IO](https://vfeed.io). This entity sets the goal to become the Leading Provider of Vulnerability and Threat Intelligence Database.
38-
* The API has been modified to reflect the new changes.
40+
* [New] The vFeed DB is no more available through `update` command. The command is deprecated.
41+
* [New] The delivery of the vFeed DB was handed over to a new established entity [vFeed IO](https://vfeed.io). This entity sets the goal to become the Leading Provider of Vulnerability and Threat Intelligence Database.
42+
* [New] The API has been modified to reflect the new changes.
3943

4044
0.6.8
4145
-----
42-
* Added support to CAPEC version 2.8. Check [about CAPEC v2.8](http://capec.mitre.org/news/index.html#december72015_CAPEC_List_Version_2.8_Now_Available).
43-
* Added support to CWE v2.9. Check [the full changelog](http://cwe.mitre.org/data/reports/diff_reports/v2.8_v2.9.html).
44-
* Added mapping to [WASC v2.0 Threat Classification](http://projects.webappsec.org/w/page/13246978/Threat%20Classification).
45-
* Added CVSS v2.0 vectors to `risk.py` class. Now, the methods `get_cvss` and `get_severity` display the vector when available.
46-
* Added new method `get_wasc` to reflect the new mapping with WASC v2.0. The method returns ID, Title and URL when available.
47-
* Modified the method `get_capec` to return the following:
46+
* [New] Added support to CAPEC version 2.8. Check [about CAPEC v2.8](http://capec.mitre.org/news/index.html#december72015_CAPEC_List_Version_2.8_Now_Available).
47+
* [New] Added support to CWE v2.9. Check [the full changelog](http://cwe.mitre.org/data/reports/diff_reports/v2.8_v2.9.html).
48+
* [New] Added mapping to [WASC v2.0 Threat Classification](http://projects.webappsec.org/w/page/13246978/Threat%20Classification).
49+
* [New] Added CVSS v2.0 vectors to `risk.py` class. Now, the methods `get_cvss` and `get_severity` display the vector when available.
50+
* [New] Added new method `get_wasc` to reflect the new mapping with WASC v2.0. The method returns ID, Title and URL when available.
51+
* [New] Modified the method `get_capec` to return the following:
4852
* The title
4953
* [Method of Attacks](http://capec.mitre.org/documents/schema/schema_v2.7.1.html#Method_of_Attack%20%28Methods_of_Attack%29)
5054
* [Mitigations](http://capec.mitre.org/documents/schema/schema_v2.7.1.html#Solution_or_Mitigation)
@@ -56,16 +60,16 @@ _All changes are immediate for consultancy / integrator license customers. The C
5660

5761
0.6.7
5862
---------
59-
* Added support to landscape.io with some code cleaning.
63+
* [New] Added support to landscape.io with some code cleaning.
6064

6165
0.6.6
6266
---------
63-
* Modified the `update.py` class to display the vFeed License before downloading the database.
67+
* [Improve] Modified the `update.py` class to display the vFeed License before downloading the database.
6468

6569
0.6.5
6670
---------
67-
* Added the ability to migrate to Mongo Database (Thanks so much to Ushan89 for the original code)
68-
* A new class `mongo.py` added (based on Ushan89 [code](https://github.com/ushan89/vFeed) to simply the process of migration from SQLite to MongoDB
71+
* [New] Added the ability to migrate to Mongo Database (Thanks so much to Ushan89 for the original code)
72+
* [New] A new class `mongo.py` added (based on Ushan89 [code](https://github.com/ushan89/vFeed) to simply the process of migration from SQLite to MongoDB
6973
* --migrate: Dump into a CSV then populate the vFeed MongoDB
7074
* The documentation updated. Visit [Documentation Page](https://github.com/toolswatch/vFeed/wiki/)
7175

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
vFeed The Correlated Vulnerability and Threat Intelligence Database Wrapper
22
=======================================================================
3-
![vFeed](https://vfeed.io/wp-content/uploads/2016/07/vfeed.png)
3+
![vFeed](https://vfeed.io/wp-content/uploads/2016/08/logo_new-e1472658851686.png)
44

55
[![Build Status](https://travis-ci.org/toolswatch/vFeed.svg?branch=master)](https://travis-ci.org/toolswatch/vFeed)
66
[![Code Health](https://landscape.io/github/toolswatch/vFeed/master/landscape.svg?style=flat)](https://landscape.io/github/toolswatch/vFeed/master)
@@ -68,6 +68,10 @@ Refer to the [Documentation](https://vfeed.io/docs) official documentation page.
6868
Latest release
6969
==============
7070

71+
0.7.2.1
72+
-----
73+
* [Fix] Fixed Migrate() module (SQLite to MongoDB). Thanks to Thiago Palmeira from Infolink for reporting the bug.
74+
7175
0.7.2
7276
-----
7377
* Added support to CAPEC v2.10. Check [the full changelog](http://capec.mitre.org/data/reports/diff_reports/v2.9_v2.10.html).

config/constants.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
db_location = os.path.join(root_dir, db)
1414

1515
# vFeed database information
16-
title = "vFeed - The Correlated Vulnerability and Threat Intelligence Database Wrapper"
16+
title = "vFeed - The Correlated Vulnerability and Threat Intelligence Database API"
1717
author = "vFeed IO"
1818
twitter = "@vfeed_io"
1919
repository = "https://vfeed.io"
20-
build = "0.7.1"
20+
build = "0.7.2.1"
2121

2222
# Automated update Information
2323
dropbox_dl = " INSERT YOUR DB LINK HERE"

config/stats.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def get_stats(self):
3030
print("\t[-] Common Weakness Enumeration (CWE) types:", self.data[3])
3131
print("\t[-] Common Attack Pattern Enumeration and Classification (CAPEC) types:", self.data[4])
3232
print("\t[-] SecurityFocus BID:", self.data[5])
33-
print("\t[-] OSVDB - Open Source Vulnerability Database advisories:", self.data[6])
33+
print("\t[! DEPRECATED] OSVDB - Open Source Vulnerability Database advisories:", self.data[6])
3434
print("\t[-] CERT.org Vulnerability Notes:", self.data[7])
3535
print("\t[-] DOD-CERT Information Assurance Vulnerability Alert (IAVA):", self.data[8])
3636
print("\t[-] Scip AG Security Advisories:", self.data[9])
@@ -47,14 +47,13 @@ def get_stats(self):
4747
print("\t[-] HP (Hewlett Packard) Patches Advisories:", self.data[18])
4848
print("\t[-] Mandriva Patches Advisories:", self.data[19])
4949
print("\t[-] Microsoft Bulletins Advisories:", self.data[20])
50-
print("\t[-] Microsoft KB Advisories:", self.data[21])
5150
print("\t[-] Redhat Patches Advisories:", self.data[22])
5251
print("\t[-] Redhat Bugzilla Advisories:", self.data[23])
5352

5453
print("\n[+] Exploits and Proof of Concepts")
5554
print("\t[-] Exploit-DB Exploits:", self.data[24])
5655
print("\t[-] Metasploit Exploits / Modules:", self.data[25])
57-
print("\t[-] Milw0rm Exploits (Deprecated) :", self.data[26])
56+
print("\t[! DEPRECATED] Milw0rm Exploits (Deprecated) :", self.data[26])
5857
print("\t[-] Saint Corporation Proof of Concepts and exploits:", self.data[27])
5958
print("\t[-] D2 Elliot Web Exploitation Framework:", self.data[34])
6059

lib/migration/csvexports.sql

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,6 @@ SELECT * FROM map_cve_msf;
100100
.once csv_exports/map_cve_ubuntu.csv
101101
SELECT * FROM map_cve_ubuntu;
102102

103-
.once csv_exports/map_cve_mskb.csv
104-
SELECT * FROM map_cve_mskb;
105-
106103
.once csv_exports/map_cve_vmware.csv
107104
SELECT * FROM map_cve_vmware;
108105

lib/migration/mongo.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77

88
from __future__ import print_function
99

10+
import os
1011
import glob
1112
import subprocess
1213

13-
from config.constants import migration_dir
14+
from config.constants import csv_dir
1415
from config.constants import mongo_conf
15-
from config.constants import migration_script
1616
from config.constants import db_location
17-
from config.constants import csv_dir
18-
17+
from config.constants import migration_dir
18+
from config.constants import migration_script
1919

2020
class Migrate(object):
2121
def __init__(self):
@@ -42,6 +42,7 @@ def do_sqlite_to_csv(self, ):
4242
""" read the vFeed.db and export entries to CSV
4343
:return: CSV files into csv_exports directory
4444
"""
45+
print("[+] Starting Migration Process ....")
4546
self.migration_read = '.read ' + self.migration_script
4647

4748
try:
@@ -52,7 +53,7 @@ def do_sqlite_to_csv(self, ):
5253
])
5354
except OSError as e:
5455
if e.errno == os.errno.ENOENT:
55-
print('[Error] SQlite binary not found: install SQLite', e)
56+
print("[Error] SQlite binary not found: install SQLite", e)
5657
raise
5758
else:
5859
raise
@@ -81,6 +82,6 @@ def do_csv_to_mongo(self, ):
8182
'--headerline'
8283
])
8384
except Exception as e:
84-
print('[Warning] Caught an exception', e)
85+
print("[Warning] Caught an exception", e)
8586

8687
print (("[+] Imported collection: {} --> vFeed MongoDB".format(self.table_name)))

tests.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,11 @@
106106
print("Search for", txt)
107107
print(Search(txt).text())
108108

109+
from config.stats import Stats
110+
111+
Stats().get_stats()
112+
109113
from lib.core.update import Update
110114

111115
Update().update()
116+

vfeedcli.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
if __name__ == "__main__":
2424

2525
parser = argparse.ArgumentParser()
26-
parser.add_argument("-v", action="version", version=".:. {0} .:. ".format(title) + "API version: {0}".format(build))
26+
parser.add_argument("-v", action="version", version="{0}".format(title) + " {0}".format(build))
2727
parser.add_argument("-m", "--method", metavar=('method', 'CVE'), help="Invoking multiple vFeed built-in functions",
2828
nargs=2)
2929
parser.add_argument("-e", "--export", metavar=('json_dump', 'CVE'), help="Export the JSON content", nargs=2)
@@ -59,8 +59,9 @@
5959
# checking whether the MongoDB server is running
6060
# todo This test will be moved to Migrate class
6161
if mongo_server("mongod"):
62-
print("[+] Mongo service is up. Starting migrating ....")
63-
Migrate()
62+
print("[+] Mongo service is up")
63+
if Migrate():
64+
print("[+] Migration successfully completed")
6465
else:
6566
print("[!] Mongo service is probably not up.")
6667

@@ -87,3 +88,6 @@
8788
result = enum_classes(method_name, cve_id)
8889
if result is not False:
8990
print(result)
91+
92+
if len(sys.argv) < 2:
93+
parser.print_help()

0 commit comments

Comments
 (0)