phishtank

package
v0.0.0-...-c5d900d Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2019 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Service = fx.Provide(func(lc fx.Lifecycle, params Params) Phishtank {
	logger := params.Logger
	if logger == nil {
		logger = log15.New()
		logger.SetHandler(log15.DiscardHandler())
	}
	p := NewPhishtank(
		params.Args.Phishtank.Active,
		params.Args.Phishtank.ApplicationKey,
		params.Args.Phishtank.CacheDir,
		logger,
	)
	utils.Append(lc, p, logger)
	return p
})

Functions

func Download

func Download(ctx context.Context, entries chan *models.PhishtankEntry, errs chan error, cacheDir string, applicationKey string, logger log15.Logger)

Types

type Detail

type Detail struct {
	IPAddress         string `xml:"ip_address"`
	CIDRBlock         string `xml:"cidr_block"`
	AnnouncingNetwork string `xml:"announcing_network"`
	RIR               string `xml:"rir"`
	Time              string `xml:"detail_time"`
}

type Details

type Details struct {
	Details []Detail `xml:"detail"`
}

type Entry

type Entry struct {
	URL          string       `xml:"url"`
	PhishID      int          `xml:"phish_id"`
	DetailURL    string       `xml:"phish_detail_url"`
	Details      Details      `xml:"details"`
	Submission   Submission   `xml:"submission"`
	Verification Verification `xml:"verification"`
	Status       Status       `xml:"status"`
	Target       string       `xml:"target"`
}

func (*Entry) Parse

func (e *Entry) Parse(gEntry *models.PhishtankEntry) *models.PhishtankEntry

type Params

type Params struct {
	fx.In
	Args   *arguments.Args `optional:"true"`
	Logger log15.Logger    `optional:"true"`
}

type Phishtank

type Phishtank interface {
	utils.Service
	utils.Startable
	URL(string) []*models.PhishtankEntry
	URLMany([]string) []*models.PhishtankEntry
}

func NewPhishtank

func NewPhishtank(active bool, appKey string, cacheDir string, logger log15.Logger) Phishtank

type Status

type Status struct {
	Online string `xml:"online"`
}

type Submission

type Submission struct {
	Time string `xml:"submission_time"`
}

type Tree

type Tree struct {
	art.Tree
}

func BuildTree

func BuildTree(ctx context.Context, entries chan *models.PhishtankEntry, errs chan error, logger log15.Logger) (*Tree, error)

func (*Tree) Get

func (t *Tree) Get(url string) []*models.PhishtankEntry

func (*Tree) Walk

func (t *Tree) Walk(f func(string, []*models.PhishtankEntry) bool)

type Verification

type Verification struct {
	Verified string `xml:"verified"`
	Time     string `xml:"verification_time"`
}

Jump to

Keyboard shortcuts

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