Skip to content

Commit

Permalink
fixed fofa asset url
Browse files Browse the repository at this point in the history
  • Loading branch information
antx-code committed Jul 29, 2022
1 parent c11d3a2 commit 8f23828
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pocx/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = '0.2.1'
__version__ = '0.2.2'

from .aio_poc import AioPoc
from .basic_poc import BasicPoc
4 changes: 2 additions & 2 deletions pocx/funcs/fofa.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def assets(self, grammar: str, page: int = 1, size: int = 100):
if not results:
return targets
for asset in results['results']:
target = f'https://{asset[1]}:{asset[2]}' if int(asset[2]) == 443 else f'http://{asset[1]}:{asset[2]}'
target = asset[0] if 'http' in asset[0] else (f'https://{asset[1]}:{asset[2]}' if int(asset[2]) == 443 else f'http://{asset[1]}:{asset[2]}')
targets.append(target)
return list(set(targets))

Expand Down Expand Up @@ -128,7 +128,7 @@ def asset_pages(self, grammar: str, size: int = 100):
return 1
all_counts = results['size']
if all_counts >= 10000:
logger.warning("Fofa's asset counts is {all_counts}, which is too much, so we only search the first 10000.")
logger.warning(f"Fofa's asset counts is {all_counts}, which is too much, so we only search the first 10000.")
count = 10000 % size
pages = 10000 // size if count == 0 else 10000 // size + 1
else:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "pocx"
version = "0.2.1"
version = "0.2.2"
description = "A Simple, Fast and Powerful poc engine tools was built by antx, which support synchronous mode and asynchronous mode."
authors = ["antx <[email protected]>"]
license = "MIT"
Expand Down

0 comments on commit 8f23828

Please sign in to comment.