python-history-disclosure: Python History File Disclosure

2026-01-08 Python PoC Public

Description

Detected exposed .python_history files on web servers.These files contained Python REPL command history that could have leaked sensitive information such as credentials, API keys, internal paths, database queries, and system commands.

PoC

id: python-history-disclosure

info:
  name: Python History File Disclosure
  author: pussycat0x
  severity: low
  description: |
    Detected exposed .python_history files on web servers.These files contained Python REPL command history that could have leaked sensitive information such as credentials, API keys, internal paths, database queries, and system commands.
  classification:
    cwe-id: CWE-538
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
    cvss-score: 5.3
  metadata:
    max-request: 1
    verified: true
  tags: exposure,python,config,misconfig,vuln

http:
  - method: GET
    path:
      - "{{BaseURL}}/.python_history"

    matchers:
      - type: dsl
        dsl:
          - 'status_code == 200'
          - 'contains_any(body, "import ", "from ", "print(", "def ", "class ", ">>>", "exit()", "quit()", "pip install", "python -")'
          - 'contains_all(header, "application/octet-stream", "Server: SimpleHTTP")'
        condition: and
# digest: 490a0046304402200d580a47263cf2edf2ee2d18791a571f99fdcaee3c865f44c0a0cbe5ec7109750220143a8c1b1a03a676c9fe6121d37509a0e9a28894f9832a87cd4553231b9e4cea:922c64590222798bb761d5b6d8e72950

# Visit https://trap.biu.life/ to view exploit trends for this vulnerability.

References

Related Vulnerabilities