PEASS-ng/parsers
Carlos Polop c37db4654c peass-ng 2024-04-04 11:30:56 +02:00
..
README.md Fix typo in /parser/README.md 2022-10-09 13:56:29 +09:00
json2html.ps1 peass-ng 2024-04-04 11:30:56 +02:00
json2html.py html and pdf 2022-02-07 08:50:24 -05:00
json2pdf.py html and pdf 2022-02-07 08:50:24 -05:00
peas2json.ps1 peass-ng 2024-04-04 11:30:56 +02:00
peas2json.py Update peas2json.py 2022-02-08 01:40:50 +00:00

README.md

Privilege Escalation Awesome Scripts Parsers

These scripts allows you to transform the output of linpeas/macpeas/winpeas to JSON and then to PDF and HTML.

python3 peas2json.py </path/to/executed_peass.out> </path/to/peass.json>
python3 json2pdf.py </path/to/peass.json> </path/to/peass.pdf>
python3 json2html.py </path/to/peass.json> </path/to/peass.html>

JSON Format

Basically, each section has:

  • Infos (URLs or info about the section)
  • Text lines (the real text info found in the section, colors included)
  • More sections

There is a maximun of 3 levels of sections.

{
  "<Main Section Name>": {
    "sections": {
      "<Secondary Section Name>": {
        "sections": {},
        "lines": [
          {
            "raw_text": "\u001b[0m\u001b[1;33m[+] \u001b[1;32mnmap\u001b[1;34m is available for network discover & port scanning, you should use it yourself",
            "clean_text": "[+]  is available for network discover & port scanning, you should use it yourself",
            "colors": {
                "GREEN": [
                    "nmap"
                ],
                "YELLOW": [
                    "[+]"
                ]
            }
          }
        ],
        "infos": [
          "https://book.hacktricks.xyz/linux-hardening/privilege-escalation#kernel-exploits"
        ]
      },
      "infos": []
{
  "System Information": {
    "sections": {
      "Operative system": {
        "sections": {},
        "lines": [
          {
            "raw_text": "\u001b[0m\u001b[1;33m[+] \u001b[1;32mnmap\u001b[1;34m is available for network discover & port scanning, you should use it yourself",
            "clean_text": "[+]  is available for network discover & port scanning, you should use it yourself",
            "colors": {
                "GREEN": [
                    "nmap"
                ],
                "YELLOW": [
                    "[+]"
                ]
            }
          }
        ],
        "infos": [
          "https://book.hacktricks.xyz/linux-hardening/privilege-escalation#kernel-exploits"
        ]
      },
      "infos": []

There can also be a <Third level Section Name>

If you need to transform several outputs check out https://github.com/mnemonic-re/parsePEASS

TODO:

  • PRs improving the code and the aspect of the final PDFs and HTMLs are always welcome!