1
mirror of https://github.com/carlospolop/PEASS-ng synced 2024-11-20 12:39:21 +01:00

html and pdf

This commit is contained in:
carlospolop 2022-02-07 08:50:24 -05:00
parent b3c12e22b6
commit 33f4ca923c
5 changed files with 360 additions and 9 deletions

View File

@ -21,6 +21,9 @@ These tools search for possible **local privilege escalation paths** that you co
## Quick Start
Find the **latest versions of all the scripts and binaries in [the releases page](https://github.com/carlospolop/PEASS-ng/releases/latest)**.
## JSON, HTML & PDF output
Check the **[parsers](./parsers/)** directory to **transform PEASS outputs to JSON, HTML and PDF**
## Let's improve PEASS together
If you want to **add something** and have **any cool idea** related to this project, please let me know it in the **telegram group https://t.me/peass** or contribute reading the **[CONTRIBUTING.md](https://github.com/carlospolop/privilege-escalation-awesome-scripts-suite/blob/master/CONTRIBUTING.md)** file.

View File

@ -1,14 +1,15 @@
# Privilege Escalation Awesome Scripts JSON exporter
# Privilege Escalation Awesome Scripts Parsers
This script allows you to transform the output of linpeas/macpeas/winpeas to JSON.
These scripts allows you to transform the output of linpeas/macpeas/winpeas to JSON and then to PDF and HTML.
```python3
python3 peass-parser.py </path/to/executed_peass> </path/to/output_peass.json>
python3 peass2json.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>
```
This script is still in beta version and has been tested only with linpeas output.
## Format
## 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)
@ -75,4 +76,4 @@ There can also be a `<Third level Section Name>`
# TODO:
I'm looking for **someone that could create HTML and PDF reports** from this JSON.
- **PRs improving the code and the aspect of the final PDFs and HTMLs are always welcome!**

347
parsers/json2html.py Normal file

File diff suppressed because one or more lines are too long

View File

@ -156,7 +156,7 @@ if __name__ == "__main__":
JSON_PATH = sys.argv[1]
PDF_PATH = sys.argv[2]
except IndexError as err:
print("Error: Please pass the peas.json file and the path to save the pdf\n./json2pdf.py <json_file> <pdf_file.pdf>")
print("Error: Please pass the peas.json file and the path to save the pdf\njson2pdf.py <json_file> <pdf_file.pdf>")
sys.exit(1)
main()

View File

@ -90,7 +90,7 @@ def clean_colors(line: str) -> str:
for reg in re.findall(r'\x1b\[[^a-zA-Z]+\dm', line):
line = line.replace(reg,"")
line = line.replace('\x1b',"").replace("[0m", "") #Sometimes that byte stays
line = line.replace('\x1b',"").replace("[0m", "").replace("[3m", "") #Sometimes that byte stays
line = line.strip()
return line
@ -162,7 +162,7 @@ if __name__ == "__main__":
OUTPUT_PATH = sys.argv[1]
JSON_PATH = sys.argv[2]
except IndexError as err:
print("Error: Please pass the peas.out file and the path to save the json\n./peas-parser.py <output_file> <json_file.json>")
print("Error: Please pass the peas.out file and the path to save the json\npeas2json.py <output_file> <json_file.json>")
sys.exit(1)
main()