fofa

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2021 License: MIT Imports: 11 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 Data

type Data struct {
	Mode    string     `json:"mode"`
	Error   bool       `json:"error"`
	Query   string     `json:"query"`
	Page    int        `json:"page"`
	Size    int        `json:"size"`
	Results [][]string `json:"results"`
}

Data fofa result

func (*Data) String

func (r *Data) String() string

String data to string

type Fofa

type Fofa struct {
	Email []byte
	Key   []byte
	*http.Client
}

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) 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={}" Default: host title ip domain port country city

func (*Fofa) QueryAsObject

func (ff *Fofa) QueryAsObject(page uint, args ...[]byte) (data Data, err error)

QueryAsObject make a fofa query and return object 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) UserInfo

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

UserInfo get user information

type SingleData

type SingleData struct {
	Mode    string   `json:"mode"`
	Error   bool     `json:"error"`
	Query   string   `json:"query"`
	Page    int      `json:"page"`
	Size    int      `json:"size"`
	Results []string `json:"results"`
}

SingleData single results data

type User

type User struct {
	Email      string `json:"email"`
	UserName   string `json:"username"`
	Fcoin      int    `json:"fcoin"`
	Vip        bool   `json:"isvip"`
	VipLevel   int    `json:"vip_level"`
	IsVerified bool   `json:"is_verified"`
	Avatar     string `json:"avatar"`
	Err        string `json:"errmsg,omitempty"`
}

User struct for fofa user

func (*User) String

func (u *User) String() string

String user to string

Jump to

Keyboard shortcuts

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