But we are going to focus on these 3 service issues to escalate privileges:-
Unquoted path vulnerability in this service has space in its name and is running without quotted , because of which we can drop our executable in the middle of the name.
Modifing binaries path and change arguments we can altered their functionality and do privesc
services permission if the permissions are not configured properly & with enough permission we can point our serrvice to different executable
commands
get service with unquoted path
get-serviceunquoted-verbose
service where user can write it to binary path or change argument
get-modifiableservicefile-verbose
service where user can modify the configuration
Tools
Powerup
beroot
privesc
Privesc 1
Privesc on our machine
load the script
dont,forget to run bypass AMSI
To exploit the service
after that we need to logoff & logon again to gain local admin access
confirm we are local admin
run Powershell as administrator
speed up the process run (BAT File)
Turn off firewall we need it later in reverse shell process
Moving on ,Now we need a machine where our user has local admin access/session
after finding that computer/machine we need to connect with that , in order to do that we can use
winrs
powershell
Privesc 2
Jenkins exploitation & reverse shell
login
jenkin server running on http://172.16.3.11:8080/ we need to login
for user "navigate to people" & for credentials try both :-
1. same uname & pass same
2. same uname & revrerse pass
uploading reverse shell
for this we need builduser as we have to build the process to execute command as jenkin user
NOTE:- if we dont have admin access but still execute window commands then run
navigate to >> project >> configure >> build triggers >> add build step >> execute window batch command >> enter command or reverse shell >> save >> build now
before clicking on "build now" execute HFS.exe and put "InvokePowerShellTcp.ps1" in it
turn on listner and click on build now , and we get the shell as local admin as "jenkins" needs that
check/confirm
NOTE :-
sometimes prompt is not visible after getting reverse shell , you need to hit enter frew times to check
and also make sure the firewall is off all the time