Documentation ¶
Index ¶
- Constants
- func Exists(path string) bool
- func PasswordToBytes(password []byte) ([]byte, error)
- type FileHashes
- type FileType
- type GetSetAPIKey
- type GetSourcesRequest
- type NewSample
- type SampleInfo
- type SampleSource
- type SearchResult
- type SearchSample
- type ServerFileTypes
- type ServerInfo
- type SourceInfo
- type Sources
Constants ¶
View Source
const ERROR0 = "OK" // No errors
View Source
const ERROR1 = "Unauthorized"
View Source
const ERROR2 = "Invalid Request"
View Source
const ERROR3 = "Sample Not Found"
View Source
const ERROR4 = "Server Error"
View Source
const GetFileSources string = "/v1/sources/list"
Request with GetSourcesRequest, respond with Sources.
View Source
const GetServerInfoURL string = "/v1/server/info"
Request empty, respond with struct.
View Source
const GetServerSupportedFileTypes string = "/v1/server/types"
Get supported file types, useful for clients
View Source
const SearchBySampleInfoURL string = "/v1/samples/search"
Request with SearchSample, respond with SampleInfo or error code.
View Source
const UploadSampleURL string = "/v1/samples/upload"
Request with struct, respond with error code.
View Source
const UserLoginURL string = "/v1/users/getkey"
Request, Response same struct. Respond with password empty.
View Source
const VERSION string = "0.0.0"
View Source
const WEBSITE string = "https://github.com/rjzak/malwaredb"
Variables ¶
This section is empty.
Functions ¶
func PasswordToBytes ¶
Types ¶
type FileHashes ¶
type FileHashes struct { SHA1 string SHA256 string SHA512 string MD5 string LZJD string SSDeep string SDHash string }
func GetFileHashesFromBytes ¶
func GetFileHashesFromBytes(fileContents []byte) FileHashes
func GetFileHashesFromFilePath ¶
func GetFileHashesFromFilePath(fPath string) (*FileHashes, error)
func (*FileHashes) GetSearchQuery ¶
func (hashes *FileHashes) GetSearchQuery() SearchSample
type GetSetAPIKey ¶
type GetSourcesRequest ¶
type SampleInfo ¶
type SampleInfo struct { ID int64 `json:"ID"` Size int `json:"Size"` SHA1 string `json:"SHA1"` SHA256 string `json:"SHA256"` SHA512 string `json:"SHA512"` MD5 string `json:"MD5"` SSDeep string `json:"SSDeep"` SDHash string `json:"SDHash"` LZJD string `json:"LZJD"` SimilarityScore float64 `json:"SimilarityScore"` FirstUploadDate string `json:"FirstUploadDate"` FileCreatedDate string `json:"FileCreatedDate"` Entropy float64 `json:"Entropy"` ConfirmedMalicious bool `json:"ConfirmedMalicious"` FileType string `json:"FileType"` FileExecutable bool `json:"FileExecutable"` Labels []string `json:"Labels"` FileContentsBase64 string `json:"FileContentsB64"` Sources []SampleSource `json:"SampleSources"` }
type SampleSource ¶
type SampleSource struct { SourceName string `json:"SourceName"` SourceID int64 `json:"SourceID"` FileNames []string `json:"FileNames"` UploaderUname string `json:"UploaderUname"` }
Sample might be in multiple sources
type SearchResult ¶
type SearchResult struct { NumResults int `json:"NumResults"` FoundSamples []SampleInfo `json:"FoundSamples"` Message string `json:"Message"` }
type SearchSample ¶
type SearchSample struct { SHA1 string `json:"SHA1"` SHA256 string `json:"SHA256"` SHA512 string `json:"SHA512"` MD5 string `json:"MD5"` SSDeep string `json:"SSDeep"` SDHash string `json:"SDHash"` LZJD string `json:"LZJD"` SimilarityThreshold float64 `json:"SimilarityThreshold"` // For SSDeep, SDHash, LZJD. SendSample bool `json:"SendSample"` APIKey string `json:"APIKey"` }
type ServerFileTypes ¶
type ServerInfo ¶
type SourceInfo ¶
type Sources ¶
type Sources struct { NumSources int `json:"NumSources"` Sources []SourceInfo `json:"Sources"` ResponseMessage string `json:"SourceResponseMessage"` }
Click to show internal directories.
Click to hide internal directories.