Skip to content

Commit 3712a1b

Browse files
authored
chore: update actions, minor fixes (#87)
Signed-off-by: K.B.Dharun Krishna <[email protected]>
1 parent 5473568 commit 3712a1b

File tree

4 files changed

+33
-14
lines changed

4 files changed

+33
-14
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto eol=lf

.github/workflows/build.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
name: Build
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v3
15-
- uses: actions/setup-go@v4
14+
- uses: actions/checkout@v4
15+
- uses: actions/setup-go@v5
1616
- name: Build
1717
run: make build

.github/workflows/release.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ jobs:
1010
env:
1111
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1212
steps:
13-
- uses: actions/checkout@v3
14-
- uses: actions/setup-go@v4
13+
- uses: actions/checkout@v4
14+
- uses: actions/setup-go@v5
1515
- id: get_version
1616
run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3)
1717
- name: Install dependencies

README.md

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# VirusTotal CLI
22

3-
Welcome to the VirusTotal CLI, a tool designed for those who love both VirusTotal and command-line interfaces. With this tool you can do everything you'd normally do using the VirusTotal's web page, including:
3+
Welcome to the VirusTotal CLI, a tool designed for those who love both VirusTotal and command-line interfaces. With this tool you can do everything you'd normally do using VirusTotal's web page, including:
44

55
* Retrieve information about a [file](doc/vt_file.md), [URL](doc/vt_url.md), [domain name](doc/vt_domain.md), [IP address](doc/vt_ip.md), etc.
66
* [Search](doc/vt_search.md) for files and URLs using VirusTotal Intelligence query syntax.
@@ -16,16 +16,18 @@ And much [more](doc/vt.md)...
1616

1717
## Getting started
1818

19-
As this tool use the [VirusTotal API](https://docs.virustotal.com/reference) under the hood, you will need a VirusTotal API key. By [signing-up](https://www.virustotal.com/#/join-us) with VirusTotal you will receive a free API key, however free API keys have a limited amount of requests per minute, and they don't have access to some premium features like searches and file downloads. If you are interested in using those premium features please [contact us](https://www.virustotal.com/gui/contact-us/).
19+
As this tool uses the [VirusTotal API](https://docs.virustotal.com/reference) under the hood, you will need a VirusTotal API key. By [signing up](https://www.virustotal.com/#/join-us) with VirusTotal you will receive a free API key however, free API keys have a limited amount of requests per minute, and they don't have access to some premium features like searches and file downloads. If you are interested in using those premium features please [contact us](https://www.virustotal.com/gui/contact-us/).
2020

2121
### Installing the tool
2222

2323
There are two ways of installing the tool: by using one of our pre-compiled binaries or by building it by yourself.
2424

2525
#### Pre-compiled binaries
26-
The pre-compiled binaries can be found at [the releases page](https://github.com/VirusTotal/vt-cli/releases). There are binaries for Windows, Linux and Mac OS X. To use them, just download the file, decompress it and place it in a directory where you think is more convenient to be used.
26+
27+
The pre-compiled binaries can be found on [the releases page](https://github.com/VirusTotal/vt-cli/releases). There are binaries for Windows, Linux and Mac OS X. To use them, just download the file, decompress it and place it in a directory where you think is more convenient to use.
2728

2829
#### Manual building
30+
2931
To compile the program you'll need [Go 1.14.x or higher installed in your system](https://go.dev/doc/install) and type the following commands:
3032

3133
```sh
@@ -35,6 +37,7 @@ $ make install
3537
```
3638

3739
NOTE: in order to use the `vt` binary, make sure the `GOBIN` is part of your `PATH` env variable:
40+
3841
```sh
3942
$ export GOBIN=`go env GOPATH`/bin
4043
$ export PATH=$PATH:$GOBIN
@@ -50,16 +53,15 @@ $ brew install virustotal-cli
5053

5154
##### Windows
5255

53-
For Windows uses, there's a [Winget manifest](https://github.com/microsoft/winget-pkgs/tree/master/manifests/v/VirusTotal/vt-cli) available. Please note this is not maintained by VirusTotal.
56+
For Windows users, there's a [Winget manifest](https://github.com/microsoft/winget-pkgs/tree/master/manifests/v/VirusTotal/vt-cli) available. Please note this is not maintained by VirusTotal.
5457

5558
```powershell
5659
winget install VirusTotal.vt-cli
5760
```
5861

5962
### A note on Window's console
6063

61-
If you plan to use vt-cli in Windows on a regular basis we highly recommend you to avoid the standard Windows's console and use [Cygwin](https://www.cygwin.com/) instead. The Windows's console is *very* slow when printing large amounts of text (as vt-cli usually does) while Cygwin performs much better. Additionally, you can benefit of Cygwin's support for command auto-completion, a handy feature that Window's console doesn't offer. In order to take advantage of auto-completion make sure to include the `bash-completion` package while installing Cygwin.
62-
64+
If you plan to use `vt-cli` in Windows on a regular basis we highly recommend you avoid the standard Windows console and use [Cygwin](https://www.cygwin.com/) instead. The Windows console is *very* slow when printing large amounts of text (as `vt-cli` usually does) while Cygwin performs much better. Additionally, you can benefit from Cygwin's support for command auto-completion, a handy feature that the Windows console doesn't offer. In order to take advantage of auto-completion make sure to include the `bash-completion` package while installing Cygwin.
6365

6466
### Configuring your API key
6567

@@ -73,7 +75,7 @@ This command will ask for your API key, and save it to a config file in your hom
7375

7476
### Use with a proxy
7577

76-
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:
78+
If you are behind an HTTP proxy you can tell `vt-cli` which is the address of your proxy server in multiple ways. One is using the `--proxy` option, like in:
7779

7880
```sh
7981
$ vt --proxy http://myproxy.com:1234 <command>
@@ -90,16 +92,20 @@ proxy="http://myproxy.com:1234"
9092
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.
9193

9294
* Linux:
95+
9396
```sh
9497
$ vt completion bash > /etc/bash_completion.d/vt
9598
```
9699

97100
* Mac OS X:
101+
98102
```sh
99103
$ brew install bash-completion
100104
$ vt completion bash > $(brew --prefix)/etc/bash_completion.d/vt
101105
```
102-
Add the following lines to `~/.bash_profile`
106+
107+
Add the following lines to `~/.bash_profile`:
108+
103109
```sh
104110
if [ -f $(brew --prefix)/etc/bash_completion ]; then
105111
. $(brew --prefix)/etc/bash_completion
@@ -108,7 +114,8 @@ If you are going to use this tool frequently you may want to have command auto-c
108114

109115
* Cygwin:
110116

111-
Make sure the `bash-completion` package is installed (Cygwin doesn't installed it by default) and type:
117+
Make sure the `bash-completion` package is installed (Cygwin doesn't install it by default) and type:
118+
112119
```sh
113120
$ vt completion bash > /usr/share/bash-completion/completions/vt
114121
```
@@ -118,6 +125,7 @@ If you are going to use this tool frequently you may want to have command auto-c
118125
### Setup ZSH completion
119126

120127
The output script from `vt completion zsh` needs to be put somewhere under the `$fpath` directory. For example, `.oh-my-zsh/completions` directory:
128+
121129
```shellsession
122130
$ mkdir /Users/$USERNAME/.oh-my-zsh/completions
123131
$ vt completion zsh > /Users/$USERNAME/.oh-my-zsh/completions/_vt
@@ -128,16 +136,19 @@ Restart the shell.
128136
## Usage examples
129137

130138
* Get information about a file:
139+
131140
```sh
132141
$ vt file 8739c76e681f900923b900c9df0ef75cf421d39cabb54650c4b9ad19b6a76d85
133142
```
134143

135144
* Get information about a file in JSON format:
145+
136146
```sh
137147
$ vt file 8739c76e681f900923b900c9df0ef75cf421d39cabb54650c4b9ad19b6a76d85 --format json
138148
```
139149

140150
* Get a specific analysis report for a file:
151+
141152
```sh
142153
$ # File analysis IDs can be given as `f-<file_SHA256_hash>-<UNIX timestamp>`...
143154
$ vt analysis f-8739c76e681f900923b900c9df0ef75cf421d39cabb54650c4b9ad19b6a76d85-1546309359
@@ -160,26 +171,31 @@ Restart the shell.
160171
```
161172

162173
* Download files given a list of hashes in a text file, one hash per line:
174+
163175
```sh
164176
$ cat /path/list_of_hashes.txt | vt download -
165177
```
166178

167179
* Get information about a URL:
180+
168181
```sh
169182
$ vt url http://www.virustotal.com
170183
```
171184

172185
* Get the IP address that served a URL:
186+
173187
```sh
174188
$ vt url last_serving_ip_address http://www.virustotal.com
175189
```
176190

177191
* Search for files:
192+
178193
```sh
179194
$ vt search "positives:5+ type:pdf"
180195
```
181196

182197
* Scan a file:
198+
183199
```sh
184200
$ vt scan file <yourfile>
185201
<yourfile> ZDZiOTcxY2JhNDE0MWU5ZWRjN2JjNGQ2NTdhN2VjODU6MTU3MDE3Mjg1NQ==
@@ -199,11 +215,13 @@ Restart the shell.
199215
```
200216

201217
* Export detections and tags of files from a search in CSV format:
218+
202219
```sh
203220
$ vt search "positives:5+ type:pdf" -i sha256,last_analysis_stats.malicious,tags --format csv
204221
```
205222

206223
* Export detections and tags of files from a search in JSON format:
224+
207225
```sh
208226
$ vt search "positives:5+ type:pdf" -i sha256,last_analysis_stats.malicious,tags --format json
209227
```
@@ -256,7 +274,7 @@ $ vt url http://www.virustotal.com
256274
malicious: 197
257275
```
258276

259-
Notice that the returned data usually follows a hierarchical structure, with some top-level fields that may contain subfields which in turn can contain their own subfields. In the example above `last_http_response_headers` has subfields `age`, `cache-control`, `content-length` and so on, while `total_votes` has `harmless` and `malicious`. For refering to a particular field within the hierarchy we can use a path, similarly to how we identify a file in our computers, but in this case we are going to use a dot character (.) as the separator for path components, instead of the slashes (or backslashes) used by most file systems. The following ones are valid paths for our example structure:
277+
Notice that the returned data usually follows a hierarchical structure, with some top-level fields that may contain subfields which in turn can contain their own subfields. In the example above `last_http_response_headers` has subfields `age`, `cache-control`, `content-length` and so on, while `total_votes` has `harmless` and `malicious`. For referring to a particular field within the hierarchy we can use a path, similar to how we identify a file in our computers, but in this case, we are going to use a dot character (.) as the separator for path components, instead of the slashes (or backslashes) used by most file systems. The following ones are valid paths for our example structure:
260278

261279
* `last_http_response_headers.age`
262280
* `total_votes.harmless`

0 commit comments

Comments
 (0)