Skip to content

Commit 9aeac6e

Browse files
committed
the field has already been deprecated.
1 parent f99fa8e commit 9aeac6e

File tree

4 files changed

+20
-14
lines changed

4 files changed

+20
-14
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
uses: goreleaser/goreleaser-action@v2
3232
if: success() && startsWith(github.ref, 'refs/tags/')
3333
with:
34-
version: latest
34+
version: 1.7.0
3535
args: release --rm-dist -f scripts/gorelease.yml
3636
env:
3737
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

README.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,23 +49,20 @@ fofax
4949
2021/12/23 21:21:28 [SUCC] create config file /Users/user/.config/fofax/fofax.yaml. please modify and use
5050
```
5151

52-
接下来就是对此配置文件进行配置了,一般来说只需要配置完 `email` `key` 就可以了。
52+
接下来就是对此配置文件进行配置了,一般来说只需要配置完 `key` 就可以了。
5353

5454
```console
5555
vim ~/.config/fofax/fofax.yaml
5656
```
5757

5858
```console
59-
# fofa api email
60-
fofa-email: ******@gmail.com
61-
6259
# fofa api key
6360
fofakey: ***************
6461
```
65-
62+
**注意:** email 字段已经被弃用 (2023年12月21日)
6663
### Windows
6764

68-
解压压缩包,第一次运行 fofax.exe 会在同级目录下生成一个 fofax.yaml 的配置文件。然后打开此配置文件,并填写 `email``key`
65+
解压压缩包,第一次运行 fofax.exe 会在同级目录下生成一个 fofax.yaml 的配置文件。然后打开此配置文件,并填写 `key` 字段
6966

7067
## 0x03 使用方法
7168

@@ -285,7 +282,7 @@ http://usa.baidu.com [Baidu USA]
285282
echo 'app="APACHE-Solr"' | fofax -fs 5 -ffi -debug
286283
2021/12/25 21:28:57 [DEBUG] FoFa Size : 5
287284
2021/12/25 21:28:57 [DEBUG] FoFa Query of: app="APACHE-Solr"
288-
2021/12/25 21:28:57 [DEBUG] https://fofa.so/api/v1/search/all?email=**********@gmail.com&key=**************************&qbase64=YXBwPSJBUEFDSEUtU29sciI=&size=5&page=1&fields=protocol,ip,port,host
285+
2021/12/25 21:28:57 [DEBUG] https://fofa.so/api/v1/search/all?key=**************************&qbase64=YXBwPSJBUEFDSEUtU29sciI=&size=5&page=1&fields=protocol,ip,port,host
289286
2021/12/25 21:28:57 [DEBUG] Resp Time: 432/millis
290287
2021/12/25 21:28:57 [SUCC] Fetch Data From FoFa: [5/30942]
291288
http://35.183.115.103

internal/cli/parser.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ type config struct {
9595
// fofa 地址
9696
FoFaURL string
9797
FoFaOpenURL string
98-
// FoFaEmail string
99-
FoFaKey string
98+
FoFaEmail string
99+
FoFaKey string
100100
// 脱敏密码
101101
FoFaKeyFake string
102102
Proxy string
@@ -127,7 +127,7 @@ var (
127127
func initOptions() {
128128
rand.Seed(time.Now().UnixNano())
129129
args = new(Options)
130-
// args.FoFaEmail = os.Getenv("FOFA_EMAIL")
130+
args.FoFaEmail = os.Getenv("FOFA_EMAIL")
131131
args.FoFaKey = utils.HiddenUrlKey(false, os.Getenv("FOFA_KEY"))
132132
args.FoFaKeyFake = os.Getenv("FOFA_KEY")
133133
args.FoFaURL = "https://fofa.info"
@@ -145,7 +145,7 @@ func init() {
145145
flags.StringVar(&args.ConfigFile, "config", args.ConfigFile, "fofax configuration file.The file reading order("+strings.Join(utils.ConfDefaultPath, ",")+")")
146146
createGroup(
147147
flags, "config", "CONFIGS",
148-
// flags.StringVarP(&args.FoFaEmail, "fofa-email", "email", args.FoFaEmail, "Fofa API Email"),
148+
flags.StringVarP(&args.FoFaEmail, "fofa-email", "email", args.FoFaEmail, "Fofa API Email(the field has already been deprecated.)"),
149149
flags.StringVarP(&args.FoFaKey, "fofakey", "key", args.FoFaKey, "Fofa API Key"),
150150
flags.StringVarP(&args.Proxy, "proxy", "p", "", "proxy for http like http://127.0.0.1:8080"),
151151
flags.StringVar(&args.FoFaURL, "fofa-url", args.FoFaURL, "Fofa api url"),
@@ -398,6 +398,9 @@ func checkMutFlags() error {
398398

399399
// 检查 key
400400
func checkFoFaInfo() {
401+
if args.FoFaEmail != "" {
402+
printer.Infof("The FOFA email field has already been deprecated")
403+
}
401404
if args.FoFaKey == "" {
402405
printer.Error("FoFaKey is empty")
403406
os.Exit(1)

internal/fofa/fofa_api.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,15 @@ func (f *FoFa) fetchByFields(fields string, queryStr string) bool {
7474
if f.option.OldData {
7575
isOptionsArgs += "&full=true"
7676
}
77+
auth := fmt.Sprintf("key=%s", f.option.FoFaKey)
78+
79+
if f.option.FoFaEmail != "" {
80+
auth = fmt.Sprintf("email=%s&key=%s", f.option.FoFaEmail, f.option.FoFaKey)
81+
}
82+
7783
uri := fmt.Sprintf(
78-
"/api/v1/search/all?key=%s%s&qbase64=%s&size=%d&page=%d&fields=%s",
79-
f.option.FoFaKey, isOptionsArgs,
84+
"/api/v1/search/all?%s%s&qbase64=%s&size=%d&page=%d&fields=%s",
85+
auth, isOptionsArgs,
8086
base64.StdEncoding.EncodeToString([]byte(queryStr)),
8187
perPage,
8288
f.page,

0 commit comments

Comments
 (0)