gothreat

package module
v0.0.0-...-5acf494 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2017 License: MIT Imports: 4 Imported by: 1

README

gothreat


Go package for ThreatCrowd.org

Functions and Structs for:

  • email

  • ip

  • domain

  • antivirus


Example

package main

import (
	"fmt"
	"github.com/jheise/gothreat"
)

func main() {
	ipData, err := gothreat.IPReport("4.2.2.1")
	if err != nil {
		panic(err)
	}

	fmt.Printf("Permalink: %s\n", ipData.Permalink)
	fmt.Printf("DNS Resolutions:\n")
	for _, resolve := range ipData.Resolutions {
		fmt.Printf("\t%v -> %v\n", resolve.LastResolved, resolve.Domain)
	}
	fmt.Printf("References:\n")
	for _, reference := range ipData.References {
		fmt.Printf("\t%s\n", reference)
	}
	fmt.Printf("Hashes:\n")
	for _, hash := range ipData.Hashes {
		fmt.Printf("\t%s\n", hash)
	}
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AntiVirusReportRaw

func AntiVirusReportRaw(av string) ([]byte, error)

func DomainReportRaw

func DomainReportRaw(domain string) ([]byte, error)

func EmailReportRaw

func EmailReportRaw(email string) ([]byte, error)

func FileReportRaw

func FileReportRaw(file string) ([]byte, error)

func IPReportRaw

func IPReportRaw(ipaddr string) ([]byte, error)

Types

type AntiVirusData

type AntiVirusData struct {
	ResponseCode string   `json:"response_code"`
	Hashes       []string `json:"hashes"`
	References   []string `json:"references"`
	Permalink    string   `json:"permalink"`
}

func AntiVirusReport

func AntiVirusReport(av string) (AntiVirusData, error)

type DomainData

type DomainData struct {
	ResponseCode string `json:"response_code"`
	Resolutions  []struct {
		LastResolved string `json:"last_resolved"`
		IPAddress    string `json:"ip_address"`
	} `json:"resolutions"`
	Hashes     []string `json:"hashes"`
	Emails     []string `json:"emails"`
	Subdomains []string `json:"subdomains"`
	References []string `json:"references"`
	Permalink  string   `json:"permalink"`
}

func DomainReport

func DomainReport(domain string) (DomainData, error)

type EmailData

type EmailData struct {
	ResponseCode string   `json:"response_code"`
	Domains      []string `json:"domains"`
	References   []string `json:"references"`
	Permalink    string   `json:"permalink"`
}

func EmailReport

func EmailReport(email string) (EmailData, error)

type FileData

type FileData struct {
	ResponseCode string   `json:"response_code"`
	Md5          string   `json:"md5"`
	Sha1         string   `json:"sha1"`
	Scans        []string `json:"scans"`
	Ips          []string `json:"ips"`
	Domains      []string `json:"domains"`
	References   []string `json:"references"`
	Permalink    string   `json:"permalink"`
}

func FileReport

func FileReport(file string) (FileData, error)

type IPData

type IPData struct {
	ResponseCode string `json:"response_code"`
	Resolutions  []struct {
		LastResolved string `json:"last_resolved"`
		Domain       string `json:"domain"`
	} `json:"resolutions"`
	Hashes     []string `json:"hashes"`
	References []string `json:"references"`
	Permalink  string   `json:"permalink"`
}

func IPReport

func IPReport(ipaddr string) (IPData, error)

Jump to

Keyboard shortcuts

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