dutchcoders / dutchcoders/transfer.sh

VirusTotal Scanning

Open
#648 7 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
15.9k
Forks
1.6k
PR merge metrics
No merged PRs in 30d

Description

I've read over the docs, and I don't know why, but I can do every other action with this app. But for some reason, testing VirualTotal never works.

```shell
curl -X PUT --upload-file nhgbhhj https://x.domain.lan/test.txt/virustotal
invalid character '<' looking for beginning of value
```


And then transfer.sh logs returns a curl 500 error.


Just to eliminate something dumb, I even used the example straight out of the docs, and created a file named `nhgbhhj`; with text inside to ensure it wasn't trying to push an empty file.

If I add a `/` to the end of the URL, or change the capitalization, no error, but nothing posts or outputs

```shell
curl -X PUT --upload-file nhgbhhj https://x.domain.lan/test.txt/virustotal/
```

Any help would be awesome with this.

I found the log file, which outputs the following:

```console
[transfer.sh] starting to listen on: :8080
[transfer.sh] ---------------------------
[transfer.sh] Submitting to VirusTotal: test.txt 5
[transfer.sh] scanid: , resource: , permalink: , md5:
[transfer.sh] "PUT /test.txt/virustotal HTTP/1.1" 500 "" "curl/7.81.0"
[transfer.sh] Submitting to VirusTotal: test.txt 5
[transfer.sh] scanid: , resource: , permalink: , md5:
[transfer.sh] "PUT /test.txt/virustotal HTTP/1.1" 500 "" "curl/7.81.0"
[transfer.sh] Error metadata: open /tmp/test.txt/virustotal.metadata: no such file or directory
[transfer.sh] "GET /test.txt/virustotal HTTP/1.1" 404 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:138.0) Gecko/20100211 Firefox/141.0"
```

But no matter what I do, I get the `<` error. And after looking online, it appears to be a GoLang JSON error.


---


After looking through the code, it appears to be coming from the Go package https://github.com/dutchcoders/go-virustotal via the line

```go
vt, err := virustotal.NewVirusTotal(s.VirusTotalKey)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
}
```

The `err` is returning
```
%!s()
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the PUT /test.txt/virustotal handler and trace the virustotal.NewVirusTotal call shown in the issue, then reproduce the request with the provided curl command and inspect the go-virustotal response. Done means VirusTotal scanning no longer returns HTTP 500 or the '<' JSON error, and the scan metadata is returned or logged successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.