|
3 | 3 | [](https://pypi.python.org/pypi/ares/)
|
4 | 4 |
|
5 | 5 | **ares** is an APACHE licensed library written in Python providing an easy to use wrapper around https://cve.circl.lu.
|
6 |
| -This library has been tested with Python 2.7.x and Python 3.6.x. |
| 6 | +This library has been tested with Python 2.7.x and Python 3.6+. |
7 | 7 |
|
8 | 8 | ## Installation:
|
9 | 9 |
|
10 | 10 | From source use
|
11 | 11 |
|
12 |
| - $ python setup.py install |
| 12 | +```bash |
| 13 | +$ python setup.py install |
| 14 | +``` |
13 | 15 |
|
14 | 16 | or install from PyPi
|
15 | 17 |
|
16 |
| - $ pip install ares |
| 18 | +```bash |
| 19 | +$ pip install ares |
| 20 | +``` |
17 | 21 |
|
18 | 22 | ## Documentation:
|
19 | 23 |
|
20 |
| -- **`GET /api/browse/`** |
21 |
| -- **`GET /api/browse/vendor`** |
| 24 | +#### **`GET /api/browse`** |
| 25 | +#### **`GET /api/browse/<vendor>`** |
| 26 | + |
| 27 | +##### Description |
| 28 | + |
| 29 | +Returns a list of vendors or products of a specific vendor. |
| 30 | +This API call can be used in two ways; With or without the vendor. |
| 31 | +When the link is called without a vendor, it will return a list of possible vendors. |
| 32 | +When the link is called with a vendor, it enumerates the products for said vendor. |
| 33 | + |
| 34 | +| Argument | Description | Example | |
| 35 | +| :-------------------| :------------------ | :------------------- | |
| 36 | +| vendor | Vendor name | `microsoft` | |
22 | 37 |
|
23 | 38 | ```python
|
24 | 39 | >>> from ares import CVESearch
|
25 | 40 | >>> cve = CVESearch()
|
26 |
| ->>> cve.browse(<vendor>) |
| 41 | +>>> cve.browse('microsoft') |
| 42 | +``` |
| 43 | + |
| 44 | +<br/> |
| 45 | + |
| 46 | +#### **`GET /api/capec/<cpe> `** |
| 47 | + |
| 48 | +##### Description |
| 49 | + |
| 50 | +Outputs a list of CAPEC related to a CWE. |
| 51 | +CAPEC (Common Attack Pattern Enumeration and Classification) are a list of attack types commonly used by attackers. |
| 52 | + |
| 53 | +| Argument | Description | Example | |
| 54 | +| :-------------------| :------------------ | :------------------- | |
| 55 | +| cweid | CWE ID | `200` | |
| 56 | + |
| 57 | + |
| 58 | +```python |
| 59 | +>>> cve.capec('200') |
27 | 60 | ```
|
28 | 61 |
|
29 |
| -- **`GET /api/search/vendor/product`** |
| 62 | +<br/> |
| 63 | + |
| 64 | +#### **`GET /api/cpe2.2/<cpe> `** |
| 65 | + |
| 66 | +##### Description |
| 67 | + |
| 68 | +**DISABLED ON cve.circl.lu** |
| 69 | + |
| 70 | +Converts a CPE code to the CPE2.2 standard, stripped of appendices. |
| 71 | +CPE2.2 is the old standard, and is a lot less uniform than the CPE2.3 standard. |
| 72 | + |
| 73 | +| Argument | Description | Example | |
| 74 | +| :-------------------| :---------------------------------- | :--------------------------------------------------------------------- | |
| 75 | +| cpe | CPE code in cpe2.2 or cpe2.3 format | `cpe:2.3:o:microsoft:windows_vista:6.0:sp1:-:-:home_premium:-:-:x64:-` | |
30 | 76 |
|
31 | 77 | ```python
|
32 |
| ->>> cve.search('microsoft/office') |
| 78 | +>>> cve.cpe22('cpe:2.3:a:microsoft:office:2011:-:mac') |
33 | 79 | ```
|
34 | 80 |
|
35 |
| -- **`GET /api/cveid/cveid`** |
| 81 | +<br/> |
| 82 | + |
| 83 | +#### **`GET /api/cpe2.3/<cpe> `** |
| 84 | + |
| 85 | +##### Description |
| 86 | + |
| 87 | +**DISABLED ON cve.circl.lu** |
| 88 | + |
| 89 | +Converts a CPE code to the CPE2.3 standard, stripped of appendices. |
| 90 | +CPE2.3 is the newer standard, and is a lot more uniform and easier to read than the CPE2.2 standard. |
| 91 | + |
| 92 | +| Argument | Description | Example | |
| 93 | +| :-------------------| :---------------------------------- | :--------------------------------------------------------------- | |
| 94 | +| cpe | CPE code in cpe2.2 or cpe2.3 format | `cpe:/o:microsoft:windows_vista:6.0:sp1:~-~home_premium~-~x64~-` | |
| 95 | + |
| 96 | +```python |
| 97 | +>>> cve.cpe23('cpe:/a:microsoft:office:2011::mac') |
| 98 | +``` |
| 99 | + |
| 100 | +<br/> |
| 101 | + |
| 102 | +#### **`GET /api/cve/<cveid>`** |
| 103 | + |
| 104 | +##### Description |
| 105 | + |
| 106 | +Outputs all available information for the specified CVE (Common Vulnerability and Exposure), in JSON format. |
| 107 | +This information includes basic CVE information like CVSS (Common Vulnerability Scoring System), related CPE (Common Product Enumeration), |
| 108 | +CWE (Common Weakness Enumeration), ... as well as additional information (RedHat Advisories etc). |
| 109 | + |
| 110 | +| Argument | Description | Example | |
| 111 | +| :-------------------| :-------------------- | :----------------------- | |
| 112 | +| cveid | CVE number | `CVE-2014-0160` | |
| 113 | + |
| 114 | +```python |
| 115 | +>>> cve.cve('CVE-2014-0160') |
| 116 | +``` |
| 117 | + |
| 118 | +<br/> |
| 119 | + |
| 120 | +#### **`GET /api/cvefor/<cpe> `** |
| 121 | + |
| 122 | +##### Description |
| 123 | + |
| 124 | +**DISABLED ON cve.circl.lu** |
| 125 | + |
| 126 | +Outputs a list of CVEs related to the product. |
| 127 | + |
| 128 | +| Argument | Description | Example | |
| 129 | +| :-------------------| :---------------------------------- | :--------------------------------------------------------------- | |
| 130 | +| cpe | CPE code in cpe2.2 or cpe2.3 format | `cpe:/o:microsoft:windows_vista:6.0:sp1:~-~home_premium~-~x64~-` | |
| 131 | + |
36 | 132 |
|
37 | 133 | ```python
|
38 |
| ->>> cve.id('CVE-2014-0160') |
| 134 | +>>> cve.cvefor('cpe:/o:microsoft:windows_vista:6.0:sp1:~-~home_premium~-~x64~-') |
39 | 135 | ```
|
40 | 136 |
|
41 |
| -- **`GET /api/last`** |
| 137 | +<br/> |
| 138 | + |
| 139 | +#### **`GET /api/cwe `** |
| 140 | + |
| 141 | +##### Description |
| 142 | + |
| 143 | +Outputs a list of all CWEs (Common Weakness Enumeration). |
42 | 144 |
|
43 | 145 | ```python
|
44 |
| ->>> cve.last() |
| 146 | +>>> cve.cwe() |
45 | 147 | ```
|
46 | 148 |
|
47 |
| -- **`GET /api/dbInfo`** |
| 149 | +<br/> |
| 150 | + |
| 151 | +#### **`GET /api/dbInfo`** |
| 152 | + |
| 153 | +##### Description |
| 154 | + |
| 155 | +Returns the stats of the database. When the user authenticates, more information is returned. This information includes: |
| 156 | + |
| 157 | + Amount of whitelist and blacklist records |
| 158 | + Some server settings like the database name |
| 159 | + Some database information like disk usage |
| 160 | + |
| 161 | +Unauthenticated queries return only collection information. |
| 162 | + |
| 163 | +**Note: as of April 2020, authentication is disabled on cve.circl.lu.** |
48 | 164 |
|
49 | 165 | ```python
|
50 | 166 | >>> cve.dbinfo()
|
51 | 167 | ```
|
52 | 168 |
|
| 169 | +<br/> |
| 170 | + |
| 171 | +#### **`GET /api/last`** |
| 172 | +#### **`GET /api/last/<limit>`** |
| 173 | + |
| 174 | +##### Description |
| 175 | + |
| 176 | +Outputs the last `n` amount of vulnerabilities. If the limit is not specified, the default of 30 is used. |
| 177 | + |
| 178 | +| Argument | Description | Example | |
| 179 | +| :-------------------| :---------------------------------- | :--------------------- | |
| 180 | +| limit | The amount of CVEs to display | `10` | |
| 181 | + |
| 182 | +```python |
| 183 | +>>> cve.last('10') |
| 184 | +``` |
| 185 | + |
| 186 | +<br/> |
| 187 | + |
| 188 | +#### **`GET /api/search/link/<key>/<value>`** |
| 189 | + |
| 190 | +##### Description |
| 191 | + |
| 192 | +Returns all CVEs that are linked by a given key/value pair. |
| 193 | + |
| 194 | +| Argument | Description | Example | |
| 195 | +| :-------------------| :---------------------------------- | :-------------------------- | |
| 196 | +| key | The key to link CVEs on | `msbulletin.bulletin_id` | |
| 197 | +| value | The value for the given key | `MS16-098` | |
| 198 | + |
| 199 | +```python |
| 200 | +>>> cve.link('msbulletin.bulletin_id/MS16-098') |
| 201 | +``` |
| 202 | + |
| 203 | +<br/> |
| 204 | + |
| 205 | +#### **`GET /api/search/<vendor>/<product>`** |
| 206 | + |
| 207 | +##### Description |
| 208 | + |
| 209 | +**DISABLED ON cve.circl.lu** |
| 210 | + |
| 211 | +When vendor and product are specified, this API call returns a list of CVEs related to the product. The output of the browse call can be used for this. |
| 212 | + |
| 213 | +| Argument | Description | Example | |
| 214 | +| :-------------------| :---------------------------------- | :-------------------------- | |
| 215 | +| vendor | Vendor name | `microsoft` | |
| 216 | +| product | Product name | `office` | |
| 217 | + |
| 218 | +```python |
| 219 | +>>> cve.search('microsoft/office') |
| 220 | +``` |
| 221 | + |
53 | 222 | ## License:
|
54 | 223 |
|
55 | 224 | ```
|
56 |
| -Copyright 2014-2018 Martin Simon |
| 225 | +Copyright 2014-2020 Martin Simon |
57 | 226 |
|
58 | 227 | Licensed under the Apache License, Version 2.0 (the "License");
|
59 | 228 | you may not use this file except in compliance with the License.
|
|
0 commit comments