fofa

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: May 11, 2023 License: AGPL-3.0 Imports: 12 Imported by: 1

Documentation

Overview

Package fofa implements some fofa-api utility functions.

Index

Constants

This section is empty.

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) *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.info/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.info/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