Skip to content

Commit e5524bd

Browse files
authored
Enable code hightlighting in README (#72)
1 parent 313afdf commit e5524bd

File tree

1 file changed

+28
-28
lines changed

1 file changed

+28
-28
lines changed

README.md

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,21 @@ As this tool use the [VirusTotal API](https://developers.virustotal.com/v3.0/ref
2222

2323
For installing the tool you can download one the [pre-compiled binaries](https://github.com/VirusTotal/vt-cli/releases) we offer for Windows, Linux and Mac OS X, or alternatively you can compile it yourself from source code. For compiling the program you'll need Go 1.14.x or higher installed in your system and type the following commands:
2424

25-
```
25+
```sh
2626
$ git clone https://github.com/VirusTotal/vt-cli
2727
$ cd vt-cli
2828
$ make install
2929
```
3030

3131
NOTE: in order to use the `vt` binary, make sure the `GOBIN` is part of your `PATH` env variable:
32-
```
32+
```sh
3333
$ export GOBIN=`go env GOPATH`/bin
3434
$ export PATH=$PATH:$GOBIN
3535
```
3636

3737
#### Mac OS
3838
For Mac OS users, there's a [brew formula](https://formulae.brew.sh/formula/virustotal-cli) available. Please note this is not maintained by VirusTotal.
39-
```
39+
```sh
4040
$ brew install virustotal-cli
4141
```
4242

@@ -49,7 +49,7 @@ If you plan to use vt-cli in Windows on a regular basis we highly recommend you
4949

5050
Once you have installed the vt-cli tool you may want to configure it with your API key. This is not strictly necessary, as you can provide your API key every time you invoke the tool by using the `--apikey` option (`-k` in short form), but that's a bit of a hassle if you are going to use the tool frequently (and we bet you'll do!). For configuring your API key just type:
5151

52-
```
52+
```sh
5353
$ vt init
5454
```
5555

@@ -59,13 +59,13 @@ This command will ask for your API key, and save it to a config file in your hom
5959

6060
If you are behind a HTTP proxy you can tell `vt-cli` which is the address of your proxy server by multiple ways. One is using the `--proxy` option, like in:
6161

62-
```
62+
```sh
6363
$ vt --proxy http://myproxy.com:1234 <command>
6464
```
6565

6666
You can also use the `VTCLI_PROXY` environment variable, or add the following line to the config file:
6767

68-
```
68+
```sh
6969
proxy="http://myproxy.com:1234"
7070
```
7171

@@ -74,17 +74,17 @@ proxy="http://myproxy.com:1234"
7474
If you are going to use this tool frequently you may want to have command auto-completion. It saves both precious time and keystrokes. Notice however that you must configure your API as described in the previous section *before* following the steps listed below. The API is necessary for determining the commands that you will have access to.
7575

7676
* Linux:
77-
```
77+
```sh
7878
$ vt completion bash > /etc/bash_completion.d/vt
7979
```
8080

8181
* Mac OS X:
82-
```
82+
```sh
8383
$ brew install bash-completion
8484
$ vt completion bash > $(brew --prefix)/etc/bash_completion.d/vt
8585
```
8686
Add the following lines to `~/.bash_profile`
87-
```
87+
```sh
8888
if [ -f $(brew --prefix)/etc/bash_completion ]; then
8989
. $(brew --prefix)/etc/bash_completion
9090
fi
@@ -93,7 +93,7 @@ If you are going to use this tool frequently you may want to have command auto-c
9393
* Cygwin:
9494

9595
Make sure the `bash-completion` package is installed (Cygwin doesn't installed it by default) and type:
96-
```
96+
```sh
9797
$ vt completion bash > /usr/share/bash-completion/completions/vt
9898
```
9999

@@ -112,17 +112,17 @@ Restart the shell.
112112
## Usage examples
113113

114114
* Get information about a file:
115-
```
115+
```sh
116116
$ vt file 8739c76e681f900923b900c9df0ef75cf421d39cabb54650c4b9ad19b6a76d85
117117
```
118118

119119
* Get information about a file in JSON format:
120-
```
120+
```sh
121121
$ vt file 8739c76e681f900923b900c9df0ef75cf421d39cabb54650c4b9ad19b6a76d85 --format json
122122
```
123123

124124
* Get a specific analysis report for a file:
125-
```
125+
```sh
126126
$ # File analysis IDs can be given as `f-<file_SHA256_hash>-<UNIX timestamp>`...
127127
$ vt analysis f-8739c76e681f900923b900c9df0ef75cf421d39cabb54650c4b9ad19b6a76d85-1546309359
128128
$ # ...or as a Base64 encoded string, retrieved from the `vt scan file` command:
@@ -144,27 +144,27 @@ Restart the shell.
144144
```
145145

146146
* Download files given a list of hashes in a text file, one hash per line:
147-
```
147+
```sh
148148
$ cat /path/list_of_hashes.txt | vt download -
149149
```
150150

151151
* Get information about a URL:
152-
```
152+
```sh
153153
$ vt url http://www.virustotal.com
154154
```
155155

156156
* Get the IP address that served a URL:
157-
```
157+
```sh
158158
$ vt url last_serving_ip_address http://www.virustotal.com
159159
```
160160

161161
* Search for files:
162-
```
162+
```sh
163163
$ vt search "positives:5+ type:pdf"
164164
```
165165

166166
* Scan a file:
167-
```
167+
```sh
168168
$ vt scan file <yourfile>
169169
<yourfile> ZDZiOTcxY2JhNDE0MWU5ZWRjN2JjNGQ2NTdhN2VjODU6MTU3MDE3Mjg1NQ==
170170
$ vt analysis ZDZiOTcxY2JhNDE0MWU5ZWRjN2JjNGQ2NTdhN2VjODU6MTU3MDE3Mjg1NQ==
@@ -183,12 +183,12 @@ Restart the shell.
183183
```
184184

185185
* Export detections and tags of files from a search in CSV format:
186-
```
186+
```sh
187187
$ vt search "positives:5+ type:pdf" -i sha256,last_analysis_stats.malicious,tags --format csv
188188
```
189189

190190
* Export detections and tags of files from a search in JSON format:
191-
```
191+
```sh
192192
$ vt search "positives:5+ type:pdf" -i sha256,last_analysis_stats.malicious,tags --format json
193193
```
194194

@@ -198,7 +198,7 @@ When you ask for information about a file, URL, domain, IP address or any other
198198

199199
These options accept patterns that are matched against the fields composing the data, and allow you to include only a subset of them, or exclude any field that is not interesting for you. Let's see how it works using the data we have about `http://www.virustotal.com` as an example:
200200

201-
```
201+
```sh
202202
$ vt url http://www.virustotal.com
203203
- _id: 1db0ad7dbcec0676710ea0eaacd35d5e471d3e11944d53bcbd31f0cbd11bce31
204204
_type: "url"
@@ -252,20 +252,20 @@ The filters accepted by both `--include` and `--exclude` are paths in which we c
252252

253253
For cherry-picking only the fields you want, you should use `--include` followed by a path pattern as explained above. You can also include more than one pattern either by using the `--include` argument multiple times, or by using it with a comma-separated list of patterns. The following two options are equivalent:
254254

255-
```
255+
```sh
256256
$ vt url http://www.virustotal.com --include=reputation --include=total_votes.*
257257
$ vt url http://www.virustotal.com --include=reputation,total_votes.*
258258
```
259259

260260
Here you have different examples with their outputs (assuming that `vt url http://www.virustotal.com` returns the structure shown above):
261261

262-
```
262+
```sh
263263
$ vt url http://www.virustotal.com --include=last_http_response_headers.server
264264
- last_http_response_headers:
265265
server: "Google Frontend"
266266
```
267267

268-
```
268+
```sh
269269
$ vt url http://www.virustotal.com --include=last_http_response_headers.*
270270
- last_http_response_headers:
271271
age: "26"
@@ -280,7 +280,7 @@ $ vt url http://www.virustotal.com --include=last_http_response_headers.*
280280
x-frame-options: "DENY"
281281
```
282282

283-
```
283+
```sh
284284
$ vt url http://www.virustotal.com --include=last_analysis_results.**
285285
- last_analysis_results:
286286
ADMINUSLabs:
@@ -297,7 +297,7 @@ $ vt url http://www.virustotal.com --include=last_analysis_results.**
297297
result: "clean"
298298
```
299299

300-
```
300+
```sh
301301
$ vt url http://www.virustotal.com --include=last_analysis_results.*.result
302302
- last_analysis_results:
303303
ADMINUSLabs:
@@ -308,7 +308,7 @@ $ vt url http://www.virustotal.com --include=last_analysis_results.*.result
308308
result: "clean"
309309
```
310310

311-
```
311+
```sh
312312
$ vt url http://www.virustotal.com --include=**.result
313313
- last_analysis_results:
314314
ADMINUSLabs:
@@ -321,7 +321,7 @@ $ vt url http://www.virustotal.com --include=**.result
321321

322322
Also notice that `_id` and `_type` are also field names and therefore you can use them in your filters:
323323

324-
```
324+
```sh
325325
$ vt url http://www.virustotal.com --include=_id,_type,**.result
326326
- _id: "1db0ad7dbcec0676710ea0eaacd35d5e471d3e11944d53bcbd31f0cbd11bce31"
327327
_type: "file"

0 commit comments

Comments
 (0)