wp

package
v0.0.0-...-7d29f3a Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Plugin

type Plugin struct {
	Name    string `json:"name"`
	Slug    string `json:"slug"`
	Version string `json:"version"`
	Author  string `json:"author"`
	Ratings struct {
		Num1 int `json:"1"`
		Num2 int `json:"2"`
		Num3 int `json:"3"`
		Num4 int `json:"4"`
		Num5 int `json:"5"`
	} `json:"ratings,omitempty"`
	NumRatings             int    `json:"num_ratings"`
	SupportThreads         int    `json:"support_threads"`
	SupportThreadsResolved int    `json:"support_threads_resolved"`
	ActiveInstalls         int    `json:"active_installs"`
	Downloaded             int    `json:"downloaded"`
	LastUpdated            string `json:"last_updated"`
	Added                  string `json:"added"`
	Homepage               string `json:"homepage"`
	Description            string `json:"description"`
	ShortDescription       string `json:"short_description"`
	DownloadLink           string `json:"download_link"`
	DonateLink             string `json:"donate_link"`
	Icons                  struct {
		OneX string `json:"1x"`
		TwoX string `json:"2x"`
	} `json:"icons,omitempty"`
	DaysSinceLastUpdate string
	OutPath             string
	FileName            string
	// contains filtered or unexported fields
}

Plugin struct holds the information for each plugin we iterate through

type Plugins

type Plugins struct {
	Info struct {
		Page    int `json:"page"`
		Pages   int `json:"pages"`
		Results int `json:"results"`
	} `json:"info"`
	Plugins        []Plugin
	ScannedPlugins []Plugin
	URI            string

	VulnsFound int
	LatestVuln vulnerabilities.Results
	Vulns      []vulnerabilities.Results

	Skipped      int
	FilesScanned int
	Timer        time.Time
	// contains filtered or unexported fields
}

Plugins struct holds the WordPress Plugins information and satisfies the scanner interface.

func NewPlugins

func NewPlugins(ctx context.Context) (*Plugins, error)

NewPlugins is the constructor for creating a new *Plugins object with initial data

func (*Plugins) AddInfo

func (w *Plugins) AddInfo(ctx context.Context) error

AddInfo retrieve the number of pages in the WP plugin store and the number of plugins to scan

func (*Plugins) Page

func (w *Plugins) Page() int

Page returns the page property and satisfies the scanner interface.

func (*Plugins) Pages

func (w *Plugins) Pages() int

Pages returns the pages property and satisfies the scanner interface.

func (*Plugins) RemovePlugin

func (w *Plugins) RemovePlugin(i int)

RemovePlugin takes the random plugin we've just selected and removes it from the plugins object so we dont scan it again later.

func (*Plugins) Scan

func (w *Plugins) Scan(ctx context.Context, errCh chan error)

Scan is the main word press plugin scanner function that controls the execution flow of a full scan. Satisfies the scanner interface.

func (*Plugins) ScannedCount

func (w *Plugins) ScannedCount() int

ScannedCount returns the FileScanned property and satisfiies the scanner interface

func (*Plugins) TotalFiles

func (w *Plugins) TotalFiles() int

TotalFiles returns the Results property and satisfies the scanner interface

Jump to

Keyboard shortcuts

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