@@ -18,13 +18,13 @@ Or by calling the Web server (After running `server.py`), example: `curl -s -X P
18
18
19
19
### Installation
20
20
21
- - ` git clone https://github.com/cve-search/cpe-guesser.git `
22
- - ` cd cpe-guesser/bin `
23
- - Download the CPE dictionary & populate the database with ` python3 ./import.py ` .
24
- - Take a cup of black or green tea ().
25
- - ` python3 cpe-guesser /bin/server.py ` to run the local HTTP server.
21
+ 1 . ` git clone https://github.com/cve-search/cpe-guesser.git `
22
+ 2 . ` cd cpe-guesser `
23
+ 3 . Download the CPE dictionary & populate the database with ` python3 ./bin /import.py ` .
24
+ 4 . Take a cup of black or green tea ().
25
+ 5 . ` python3 . /bin/server.py ` to run the local HTTP server.
26
26
27
- If you don't want to install it locally, there is a public online version. Check below.
27
+ If you don't want to install it locally, there is a public online version. Check below.
28
28
29
29
### Docker
30
30
@@ -55,9 +55,11 @@ If you do not want to use the Web server, `lookup.py` can still be used. Example
55
55
[ cpe-guesser.cve-search .org] ( https://cpe-guesser.cve-search.org ) is public online version of CPE guesser which can be used via
56
56
a simple API. The endpoint is ` /search ` and the JSON is composed of a query list with the list of keyword(s) to search for.
57
57
58
-
59
- ~~~~
58
+ ``` bash
60
59
curl -s -X POST https://cpe-guesser.cve-search.org/search -d " {\" query\" : [\" outlook\" , \" connector\" ]}" | jq .
60
+ ```
61
+
62
+ ``` json
61
63
[
62
64
[
63
65
18117 ,
@@ -72,11 +74,11 @@ curl -s -X POST https://cpe-guesser.cve-search.org/search -d "{\"query\": [\"out
72
74
" cpe:2.3:a:oracle:corporate_time_outlook_connector"
73
75
]
74
76
]
75
- ~~~~
77
+ ```
76
78
77
79
### Command line - ` lookup.py `
78
80
79
- ~~~~
81
+ ``` text
80
82
usage: lookup.py [-h] WORD [WORD ...]
81
83
82
84
Find potential CPE names from a list of keyword(s) and return a JSON of the results
@@ -86,11 +88,13 @@ positional arguments:
86
88
87
89
optional arguments:
88
90
-h, --help show this help message and exit
89
- ~~~~
90
-
91
+ ```
91
92
92
- ~~~~
93
+ ``` bash
93
94
python3 lookup.py microsoft sql server | jq .
95
+ ```
96
+
97
+ ``` json
94
98
[
95
99
[
96
100
51325 ,
@@ -129,41 +133,40 @@ python3 lookup.py microsoft sql server | jq .
129
133
" cpe:2.3:a:ibm:tivoli_storage_manager_for_databases_data_protection_for_microsoft_sql_server"
130
134
]
131
135
]
132
- ~~~~
136
+ ```
133
137
134
138
## How does this work?
135
139
136
140
A CPE entry is composed of a human readable name with some references and the structured CPE name.
137
141
138
- ~~~
142
+ ``` xml
139
143
<cpe-item name =" cpe:/a:10web:form_maker:1.7.17::~~~wordpress~~" >
140
144
<title xml : lang =" en-US" >10web Form Maker 1.7.17 for WordPress</title >
141
145
<references >
142
146
<reference href =" https://wordpress.org/plugins/form-maker/#developers" >Change Log</reference >
143
147
</references >
144
148
<cpe-23 : cpe23-item name =" cpe:2.3:a:10web:form_maker:1.7.17:*:*:*:*:wordpress:*:*" />
145
149
</cpe-item >
146
- ~~~
150
+ ```
147
151
148
152
The CPE name is structured with a vendor name, a product name and some additional information.
149
153
CPE name can be easily changed due to vendor name or product name changes, some vendor/product are
150
154
sharing common names or name is composed of multiple words.
151
155
152
-
153
156
### Data
154
157
155
158
Split vendor name and product name (such as ` _ ` ) into single word(s) and then canonize the word. Building an inverse index using
156
- the cpe vendor: product format as value and the canonized word as key. Then cpe guesser creates a ranked set with the most common
159
+ the cpe vendor: product format as value and the canonized word as key. Then cpe guesser creates a ranked set with the most common
157
160
cpe (vendor: product ) per version to give a probability of the CPE appearance.
158
161
159
162
### Redis structure
160
163
161
164
- ` w:<word> ` set
162
165
- ` s:<word> ` sorted set with a score depending of the number of appearance
163
166
164
- # License
167
+ ## License
165
168
166
169
Software is open source and released under a 2-Clause BSD License
167
170
168
- Copyright (C) 2021 Alexandre Dulaunoy
169
- Copyright (C) 2021 Esa Jokinen
171
+ Copyright (C) 2021-2024 Alexandre Dulaunoy
172
+ Copyright (C) 2021-2024 Esa Jokinen
0 commit comments