virustotal

package module
v0.0.0-...-24cc8e6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 23, 2014 License: MIT Imports: 10 Imported by: 14

README

go-virustotal

VirusTotal public api interface implementation in Golang.

GoDoc Build Status

Usage

You can also set the environment variable VIRUSTOTAL_APIKEY to the api key.

go run ./bin/vt.go --apikey {key} (--debug) scan {file} {file} ...
go run ./bin/vt.go --apikey {key} (--debug) rescan {hash} {hash} ...
go run ./bin/vt.go --apikey {key} (--debug) report 99017f6eebbac24f351415dd410d522d
go run ./bin/vt.go --apikey {key} (--debug) scan-url {url} {url} ...
go run ./bin/vt.go --apikey {key} (--debug) report-url www.google.com
go run ./bin/vt.go --apikey {key} (--debug) ipaddress 90.156.201.27
go run ./bin/vt.go --apikey {key} (--debug) domain 027.ru
go run ./bin/vt.go --apikey {key} (--debug) --resource 99017f6eebbac24f351415dd410d522d comment "How to disinfect you from this file... #disinfect #zbot"

Contributions

Contributions are welcome.

Creators

Remco Verhoef

Code and documentation copyright 2011-2014 Remco Verhoef. Code released under the MIT license.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommentResponse

type CommentResponse struct {
	VirusTotalResponse
}

type DetectedUrl

type DetectedUrl struct {
	ScanDate  string `json:"scan_date"`
	Url       string `json:"url"`
	Positives int    `json:"positives"`
	Total     int    `json:"total"`
}

type DomainReportResponse

type DomainReportResponse struct {
	VirusTotalResponse
	Resolutions  []Resolution  `json:"resolutions"`
	DetectedUrls []DetectedUrl `json:"detected_urls"`
}

type FileScan

type FileScan struct {
	Detected bool   `json:"detected"`
	Version  string `json:"version"`
	Result   string `json:"result"`
	Update   string `json:"update"`
}

type IpAddressReportResponse

type IpAddressReportResponse struct {
	VirusTotalResponse
	Resolutions  []Resolution  `json:"resolutions"`
	DetectedUrls []DetectedUrl `json:"detected_urls"`
}

type ReportResponse

type ReportResponse struct {
	VirusTotalResponse
	Resource  string              `json:"resource"`
	ScanId    string              `json:"scan_id"`
	Sha1      string              `json:"sha1"`
	Sha256    string              `json:"sha256"`
	Md5       string              `json:"md5"`
	Scandate  string              `json:"scan_date"`
	Positives int                 `json:"positives"`
	Total     int                 `json:"total"`
	Permalink string              `json:"permalink"`
	Scans     map[string]FileScan `json:"scans"`
}

type RescanResponse

type RescanResponse struct {
	ScanResponse
}

func (*RescanResponse) String

func (sr *RescanResponse) String() string

type Resolution

type Resolution struct {
	LastResolved string `json:"last_resolved"`
	Hostname     string `json:"hostname"`
}

type ScanResponse

type ScanResponse struct {
	VirusTotalResponse

	ScanId    string `json:"scan_id"`
	Sha1      string `json:"sha1"`
	Resource  string `json:"resource"`
	Sha256    string `json:"sha256"`
	Permalink string `json:"permalink"`
	Md5       string `json:"md5"`
}

func (*ScanResponse) String

func (sr *ScanResponse) String() string

type ScanUrlResponse

type ScanUrlResponse struct {
	ScanResponse
}

type VirusTotal

type VirusTotal struct {
	// contains filtered or unexported fields
}

func NewVirusTotal

func NewVirusTotal(apikey string) (*VirusTotal, error)

func (*VirusTotal) Comment

func (vt *VirusTotal) Comment(resource string, comment string) (*CommentResponse, error)

func (*VirusTotal) DomainReport

func (vt *VirusTotal) DomainReport(domain string) (*DomainReportResponse, error)

func (*VirusTotal) IpAddressReport

func (vt *VirusTotal) IpAddressReport(ip string) (*IpAddressReportResponse, error)

func (*VirusTotal) Report

func (vt *VirusTotal) Report(resource string) (*ReportResponse, error)

func (*VirusTotal) ReportUrl

func (vt *VirusTotal) ReportUrl(url2 *url.URL) (*ReportResponse, error)

func (*VirusTotal) Rescan

func (vt *VirusTotal) Rescan(hash []string) (*RescanResponse, error)

func (*VirusTotal) Scan

func (vt *VirusTotal) Scan(path string, file io.Reader) (*ScanResponse, error)

func (*VirusTotal) ScanUrl

func (vt *VirusTotal) ScanUrl(url2 *url.URL) (*ScanResponse, error)

type VirusTotalResponse

type VirusTotalResponse struct {
	ResponseCode int    `json:"response_code"`
	Message      string `json:"verbose_msg"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL