Skip to content

Commit

Permalink
BugFix | 更新部分功能,详情见CHANGELOG
Browse files Browse the repository at this point in the history
  • Loading branch information
panyi committed Mar 15, 2023
1 parent 7db9314 commit 09d5ec7
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
__pycache__/
*.py[cod]
*$py.class

*.txt
.idea
# C extensions
*.so
Expand Down
2 changes: 1 addition & 1 deletion config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# @Github: https://github.com/Cl0udG0d

# Fofa-hack 版本号
VERSION_NUM="2.0.2"
VERSION_NUM="2.0.3"
# 登录最大重试次数
MAX_LOGIN_RETRY_NUM=3
# 页面URL获取最大重试次数
Expand Down
3 changes: 3 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# CHANGELOG 代码变更记录

### 2.0.3
+ 修复fofa单关键字下第二页错误情况

### 2.0.2
+ 修复fofa多个查询条件下出现的错误

Expand Down
9 changes: 8 additions & 1 deletion fofa.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ def logoutInitMsg(self):
)
return

def initKeyWord(self,keyword):
tempkey=keyword.replace("'",'"')
if '"' not in tempkey and ' ' not in tempkey:
tempkey='"{}"'.format(tempkey)
return tempkey

def init(self):
parser = argparse.ArgumentParser(description='Fofa-hack v{} 使用说明'.format(config.VERSION_NUM))
parser.add_argument('--timesleep', '-t', help='爬取每一页等待秒数,防止IP被Ban,默认为3',default=3)
Expand All @@ -67,7 +73,7 @@ def init(self):
parser.add_argument('--fuzz', '-f', help='关键字fuzz参数,增加内容获取粒度',action='store_true')
args = parser.parse_args()
self.timeSleep= int(args.timesleep)
self.searchKey= args.keyword.replace("'",'"')
self.searchKey=self.initKeyWord(args.keyword)
if args.endcount:
self.endcount=int(args.endcount)
else:
Expand Down Expand Up @@ -160,6 +166,7 @@ def fofa_common_spider(self, search_key, searchbs64):
self.timestamp_set.clear()
self.fofa_spider_page(searchbs64)
search_key_modify= self.modify_search_time_url(search_key)
# print(search_key_modify)
searchbs64_modify = quote_plus(base64.b64encode(search_key_modify.encode()))
search_key = search_key_modify
searchbs64 = searchbs64_modify
Expand Down

0 comments on commit 09d5ec7

Please sign in to comment.