fofa

package
v0.0.0-...-94001bf Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package fofa implements some fofa-api utility functions.

Index

Constants

View Source
const (
	DefaultAPIUrl = "https://fofa.so/"
	InfoAPIUrl    = "https://fofa.info/"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Fofa

type Fofa struct {
	*http.Client
	// contains filtered or unexported fields
}

Fofa a fofa client can be used to make queries

func NewFofaClient

func NewFofaClient(email, key []byte, website string) *Fofa

NewFofaClient create a fofa client

func (*Fofa) Get

func (ff *Fofa) Get(u string) ([]byte, error)

Get overwrite http.Get

func (*Fofa) QueryAsArray

func (ff *Fofa) QueryAsArray(page uint, args ...[]byte) (result Results, err error)

QueryAsArray make a fofa query and return array data as result echo 'domain="nosec.org"' | base64 - | xargs -I{} curl "https://fofa.so/api/v1/search/all?email=${FOFA_EMAIL}&key=${FOFA_KEY}&qbase64={}"

func (*Fofa) QueryAsJSON

func (ff *Fofa) QueryAsJSON(page uint, args ...[]byte) ([]byte, error)

QueryAsJSON make a fofa query and return json data as result echo 'domain="nosec.org"' | base64 - | xargs -I{} curl "https://fofa.so/api/v1/search/all?email=${FOFA_EMAIL}&key=${FOFA_KEY}&qbase64={}" host title ip domain port country city

func (*Fofa) UserInfo

func (ff *Fofa) UserInfo() (user *User, err error)

UserInfo get user information

type Results

type Results []result

Results fofa result set

func (*Results) String

func (r *Results) String() string

type User

type User struct {
	Email  string `json:"email,omitempty"`
	Fcoin  int    `json:"fcoin,omitempty"`
	Vip    bool   `json:"bool,omitempty"`
	Avatar string `json:"avatar,omitempty"`
	Err    string `json:"errmsg,omitempty"`
}

User struct for fofa user

func (*User) String

func (u *User) String() string

Jump to

Keyboard shortcuts

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