Skip to content

Commit 5776c47

Browse files
committed
update
1 parent 80fee81 commit 5776c47

3 files changed

Lines changed: 32 additions & 87 deletions

File tree

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ __debug_bin
1616
# Output of the go coverage tool, specifically when used with LiteIDE
1717
*.out
1818

19-
# Dependency directories (remove the comment below to include it)
20-
# vendor/
21-
2219
# Go workspace file
2320
go.work
2421

README.md

Lines changed: 32 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,82 +1,64 @@
11
# saferwall-cli
22

3-
A CLI tool to interact with Saferwall.com to download samples, scan or re-scan new samples.
3+
A CLI tool to interact with Saferwall.com to scan, rescan and download malware samples.
44

55
## Install
66

77
You can either download pre-built binaries or build the tool yourself.
88

99
```sh
10-
go install github.com/saferwall/cli
10+
go install github.com/saferwall/cli@latest
1111
```
1212

13+
## Getting Started
1314

14-
## Usage
15-
16-
To use the CLI tool you need a [Saferwall](https://saferwall.com) account in order to authenticate yourself.
17-
18-
Use the `config.example.toml` as a reference to reference your credendials. The file should be located in:
19-
``~/.config/saferwall/config.toml`:
20-
21-
```toml
22-
[credentials]
23-
# The URL used to interact with saferwall APIs.
24-
url = "https://api.saferwall.com"
25-
# The user name you choose when you sign-up for saferwall.com.
26-
username = "YourUsername"
27-
# The password you choose when you sign-up for saferwall.com.
28-
password = "YourPassword"
29-
```
30-
31-
The CLI app can also be used to interfact with a self-hosted deployment.
15+
To use the CLI you need a [Saferwall](https://saferwall.com) account. Run the `init` command to interactively set up your credentials:
3216

3317
```sh
34-
saferwall-cli - Saferwall command line tool
18+
saferwall-cli init
19+
```
3520

36-
███████╗ █████╗ ███████╗███████╗██████╗ ██╗ ██╗ █████╗ ██╗ ██╗ ██████╗██╗ ██╗
37-
██╔════╝██╔══██╗██╔════╝██╔════╝██╔══██╗██║ ██║██╔══██╗██║ ██║ ██╔════╝██║ ██║
38-
███████╗███████║█████╗ █████╗ ██████╔╝██║ █╗ ██║███████║██║ ██║ ██║ ██║ ██║
39-
╚════██║██╔══██║██╔══╝ ██╔══╝ ██╔══██╗██║███╗██║██╔══██║██║ ██║ ██║ ██║ ██║
40-
███████║██║ ██║██║ ███████╗██║ ██║╚███╔███╔╝██║ ██║███████╗███████╗ ╚██████╗███████╗██║
41-
╚══════╝╚═╝ ╚═╝╚═╝ ╚══════╝╚═╝ ╚═╝ ╚══╝╚══╝ ╚═╝ ╚═╝╚══════╝╚══════╝ ╚═════╝╚══════╝╚═╝
21+
This launches an interactive prompt that asks for:
22+
- **URL** — the Saferwall API endpoint (defaults to `https://api.saferwall.com`)
23+
- **Username** — your Saferwall account username
24+
- **Password** — your Saferwall account password
4225

26+
The credentials are saved to `~/.config/saferwall/config.toml`. To reconfigure, delete that file and run `init` again.
4327

44-
saferwall-cli allows you to interact with the saferwall API. You can
45-
upload, scan samples from your drive, or download samples.
46-
For more details see the github repo at https://github.com/saferwall
28+
The CLI can also be used with a self-hosted Saferwall deployment by providing your own API URL during init.
4729

48-
Usage:
49-
saferwall-cli [flags]
50-
saferwall-cli [command]
30+
## Usage
5131

32+
```
5233
Available Commands:
53-
completion Generate the autocompletion script for the specified shell
54-
delete Delete a sample(s) given its SHA256 hash.
55-
download Download a sample(s) or a behavior report
56-
help Help about any command
57-
list List users or files.
58-
rescan Rescan an exiting file using its hash
59-
scan Submit a scan request of a file using its hash
60-
souk Populate malware-souk database.
61-
upload Upload samples directly to object storage.
34+
init Configure saferwall CLI credentials
35+
scan Upload and scan files
36+
rescan Rescan an existing file using its hash
37+
download Download a sample or a behavior report
38+
souk Populate malware-souk database
6239
version Version number
40+
```
41+
42+
### Scan
43+
44+
Upload and scan files. Supports scanning a single file or an entire directory.
6345

64-
Flags:
65-
-h, --help help for saferwall-cli
46+
```sh
47+
saferwall-cli scan -p /path/to/sample
6648
```
6749

68-
### Download
50+
### Rescan
6951

70-
You can download files using their SHA256 hash and specify an output folder, you can also download a batch of samples by copying their SHA256 hash to the clipboard.
52+
Rescan an existing file by its SHA256 hash, or rescan a batch of hashes from a text file.
7153

7254
```sh
73-
cli download --hash 0001cb47c8277e44a09543291d95559886b9c2da195bd78fdf108775ac91ac53
55+
saferwall-cli rescan <sha256>
7456
```
7557

76-
### Scan
58+
### Download
7759

78-
You can scan or rescan files using the scan command.
60+
Download files by their SHA256 hash. You can also download a batch of samples from a text file.
7961

8062
```sh
81-
cli scan -p /samples/0001cb47c8277e44a09543291d95559886b9c2da195bd78fdf108775ac91ac53
63+
saferwall-cli download --hash <sha256>
8264
```

config.example.toml

Lines changed: 0 additions & 34 deletions
This file was deleted.

0 commit comments

Comments
 (0)