Skip to content

Commit

Permalink
Remove fofa email field
Browse files Browse the repository at this point in the history
  • Loading branch information
M4rtin Hsu committed Dec 20, 2023
1 parent bd52f81 commit aab443d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
14 changes: 7 additions & 7 deletions internal/cli/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ type config struct {
// fofa 地址
FoFaURL string
FoFaOpenURL string
FoFaEmail string
FoFaKey string
// FoFaEmail string
FoFaKey string
// 脱敏密码
FoFaKeyFake string
Proxy string
Expand Down Expand Up @@ -127,7 +127,7 @@ var (
func initOptions() {
rand.Seed(time.Now().UnixNano())
args = new(Options)
args.FoFaEmail = os.Getenv("FOFA_EMAIL")
// args.FoFaEmail = os.Getenv("FOFA_EMAIL")
args.FoFaKey = utils.HiddenUrlKey(false, os.Getenv("FOFA_KEY"))
args.FoFaKeyFake = os.Getenv("FOFA_KEY")
args.FoFaURL = "https://fofa.info"
Expand All @@ -145,7 +145,7 @@ func init() {
flags.StringVar(&args.ConfigFile, "config", args.ConfigFile, "fofax configuration file.The file reading order("+strings.Join(utils.ConfDefaultPath, ",")+")")
createGroup(
flags, "config", "CONFIGS",
flags.StringVarP(&args.FoFaEmail, "fofa-email", "email", args.FoFaEmail, "Fofa API Email"),
// flags.StringVarP(&args.FoFaEmail, "fofa-email", "email", args.FoFaEmail, "Fofa API Email"),
flags.StringVarP(&args.FoFaKey, "fofakey", "key", args.FoFaKey, "Fofa API Key"),
flags.StringVarP(&args.Proxy, "proxy", "p", "", "proxy for http like http://127.0.0.1:8080"),
flags.StringVar(&args.FoFaURL, "fofa-url", args.FoFaURL, "Fofa api url"),
Expand Down Expand Up @@ -396,10 +396,10 @@ func checkMutFlags() error {
return nil
}

// 检查 email,key
// 检查 key
func checkFoFaInfo() {
if args.FoFaKey == "" || args.FoFaEmail == "" {
printer.Error("FoFaKey or FoFaEmail is empty")
if args.FoFaKey == "" {
printer.Error("FoFaKey is empty")
os.Exit(1)
}
}
Expand Down
6 changes: 3 additions & 3 deletions internal/cli/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ func updateTips(tagName string) error {
return nil
}
latest, err := updateFoFaXVersionToLatest()
if err != nil {
return err
}
if latest == nil {
return errors.New("latest version is nil")
}

if err != nil {
return err
}
if !args.Update {
bannerSite(fmt.Sprintf("New:\n\nVersion:%s\n\n%s\n", latest.Version, latest.Notes))
bannerSite("Please Use [./fofax -update] to download\n\n")
Expand Down
4 changes: 2 additions & 2 deletions internal/fofa/fofa_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ func (f *FoFa) fetchByFields(fields string, queryStr string) bool {
isOptionsArgs += "&full=true"
}
uri := fmt.Sprintf(
"/api/v1/search/all?email=%s&key=%s%s&qbase64=%s&size=%d&page=%d&fields=%s",
f.option.FoFaEmail, f.option.FoFaKey, isOptionsArgs,
"/api/v1/search/all?key=%s%s&qbase64=%s&size=%d&page=%d&fields=%s",
f.option.FoFaKey, isOptionsArgs,
base64.StdEncoding.EncodeToString([]byte(queryStr)),
perPage,
f.page,
Expand Down

0 comments on commit aab443d

Please sign in to comment.