Skip to content

Commit

Permalink
fixed fofa error msg
Browse files Browse the repository at this point in the history
  • Loading branch information
antx-code committed Mar 29, 2022
1 parent 8db8c3e commit 0b01de1
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class POC(BasicPoc):
your poc code here.
"""
return


if __name__ == '__main__':
Expand Down Expand Up @@ -67,7 +68,7 @@ class DLinkPoc(BasicPoc):
poc_url = '/config/getuser?index=0'
try:
resp = self.get(target + poc_url)
if resp.status_code == 200 and 'name' in resp.text and 'pass' in resp.text:
if resp.status_code == 200 and 'name=' in resp.text and 'pass=' in resp.text and 'priv=' in resp.text:
logger.success(resp.text)
elif resp.status_code == 500:
logger.error(f'[-] {target} {resp.status_code}')
Expand Down Expand Up @@ -104,7 +105,7 @@ class DLinkPoc(AioPoc):
poc_url = '/config/getuser?index=0'
try:
resp = await self.aio_get(target + poc_url)
if resp.status_code == 200 and 'name' in resp.text and 'pass' in resp.text:
if resp.status_code == 200 and 'name=' in resp.text and 'pass=' in resp.text and 'priv=' in resp.text:
logger.success(resp.text)
elif resp.status_code == 500:
logger.error(f'[-] {target} {resp.status_code}')
Expand Down Expand Up @@ -143,6 +144,7 @@ class POC(BasicPoc):
your poc code here.
"""
return


if __name__ == '__main__':
Expand Down Expand Up @@ -187,6 +189,7 @@ class POC(BasicPoc):
"""

self.ceyeio.verify(pid, 'dns')
return


if __name__ == '__main__':
Expand Down
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.1.9'
__version__ = '0.2.0'

from .aio_poc import AioPoc
from .basic_poc import BasicPoc
6 changes: 5 additions & 1 deletion pocx/funcs/fofa.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ def _search(self, grammar: str, page: int = 1, size: int = 100):
furl = f'https://{self.domain}/api/v1/search/all?email={self.email}&key={self.key}&qbase64={b64}&{grammar}&page={page}&size={size}'
try:
assets = httpx.get(furl).content.decode('utf-8')
return json.loads(assets)
result = json.loads(assets)
if not result['error']:
return result
logger.error(f'Fofa API error: {result["errmsg"]}')
return None
except Exception as e:
logger.error(e)
return None
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.1.9"
version = "0.2.0"
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 0b01de1

Please sign in to comment.