<?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 Rick Harris on Medium]]></title>
        <description><![CDATA[Stories by Rick Harris on Medium]]></description>
        <link>https://medium.com/@rickharris_dev?source=rss-7cf1b9c00dc9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*qbUlotdVIoTJ3eraQ7RLlg.jpeg</url>
            <title>Stories by Rick Harris on Medium</title>
            <link>https://medium.com/@rickharris_dev?source=rss-7cf1b9c00dc9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 12:05:37 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rickharris_dev/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[Hacking Holberton School’s Security Cameras]]></title>
            <link>https://medium.com/@rickharris_dev/hacking-holberton-schools-security-cameras-9b01957c8fd2?source=rss-7cf1b9c00dc9------2</link>
            <guid isPermaLink="false">https://medium.com/p/9b01957c8fd2</guid>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[holberton-school]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Rick Harris]]></dc:creator>
            <pubDate>Wed, 14 Sep 2016 20:45:18 GMT</pubDate>
            <atom:updated>2016-09-14T20:45:18.638Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eY6DsDAmYCRNSbFGTNdkiQ.png" /></figure><p>It is a busy season at Holberton School as students, including myself, are looking for opportunities to step outside the classroom and into the industry. So what would make me want to break away from interview preparation and start up a new project? Julien Barbier, co-founder of Holberton School, was chatting with several students and daringly said he was surprised that no student has tried to hack the school’s security cameras. Challenge accepted.</p><h3>Finding the Cameras on the Network</h3><p>The first step to hacking the cameras is to be on the same network. Holberton School has a separate wireless network for infrastructure devices including the IP cameras. Volunteerism paid dividends because the student DevOps team that I was a part of was given access to that network. Once connected, I need to locate the devices on the network. In the past I have used network monitoring tools to see devices on a network. Instead of using one of those I investigated command line tools available to learn something new.</p><h4>Address Resolution Protocol</h4><p>ARP, or address resolution protocol, is the translation of the network IP address to the device address (MAC or physical address). A command line tool called “arp” is described as an “address resolution display and control”. I entered “arp -a” in Terminal and hit return, it displayed the IP and MAC address of devices on the network. The physical address may be used to identify the manufacturer of a device. The response showed several devices with similar physical addresses. However, I needed further confirmation. Often IP cameras have a web interface to manage the device. Entering the IP address in a web browser confirmed that they were the cameras.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*hCJtpaU6qk3inDiy3ZsBtQ.jpeg" /></figure><h3>Default Passwords are a Hacker’s Friend</h3><p>Now that the cameras were located on the network. The next problem was access. A default user and password come already configured on the device . The new owner is expected to change the password, but often they don’t. The first thing I did was check the default user and password that I obtained via Google. The default logins were not changed. Once logged in to each camera, I had access to all streams. As a note, I hacked the cameras while the school was relatively empty since I usually am the first to arrive. Accessing the streams is a hack in itself. However, I wanted to affect the image streaming from a camera. To do this I needed to get inside the camera, so I turned to the “nmap” tool to identify others services running on the camera.</p><h4>Mapping the Ports on a Network Device</h4><p>According to the tool’s description, “Nmap (‘Network Mapper’) is an open source tool for network exploration and security auditing.” This made it perfect for what I was trying to do. I entered “nmap -p&lt;port range&gt; &lt;ip address&gt;”. The results revealed that port 22, the default port for SSH, was listening. I tried using the default username and password to SSH into the camera. To my surprise it worked! In fact, when I reviewed the /etc/passwd file the only user account was the default user which meant that I would have access to manage the files as well. However, not all would be as simple as it seemed. The camera uses a Linux environment modified specifically for the device, Dropbear for SSH, Lighttpd for the web server, Busybox for the bulk of normal Linux shell commands, and, as I discovered later, Evostream for the media server.</p><h3>Subverting the Web View</h3><p>The majority of configuration files were on a read-only mount of the file space which prevented modification. A mount is a connection to a physical disk space such as a hard drive or some other type of storage. In a recent, Commando Project at Holberton School we were given a broken server that we had to repair and bring the services back online. One piece of the problem was that the SQL database was on a read-only mount preventing the service from starting. Through this I learned about using “mount” to remount the file space with read/write capabilities. However, mount would not work to change the permissions on the camera. As a result, I was blocked from altering many of the main services of the camera.</p><p>The camera constantly changed jpeg images in the tmp folder. The web page accessed the images to provide the “live stream” on the web interface. The web interface files in the “www” folder were located on the read-only mount so I could not modify it there. However, I did have write access in the “tmp”, meaning temporary, folder. I copied the web folder into temporary folder. There I modified the symbolic link to point to my hacked image. A symbolic link is basically a file pointer that tells the system to respond with a different file when asked for that file. The next step was to get lighttpd to point to the modified files.</p><h4>Redirecting and Restarting lighttpd</h4><p>The primary lighttpd configuration file was in the /var/etc folder which was in a read/write mount. To redirect the web server, I used the vi text editor to change host file path from “/usr/www” to “/tmp/www”. With all of my hacked configurations in place. I restarted the service using the command “pkill lighttpd”. To confirm it worked, I logged back into the web interface of the camera. It displayed my hacked image with a pokeball in place of a hanging plant and a black hole in the floor.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JSTVn7rII07U11ryS2i-Ug.png" /></figure><h3>Hitting a Roadblock with the Server-Managed Configuration</h3><p>While I knew the camera’s web interface was down, I could tell that the cameras were managed by a central server used to access the streams. The active connections showed one from the server. I did not believe the hack altered the stream on the server. Through a source with access to the server I confirmed that the hack was not effective.</p><h4>Taking the Camera Offline</h4><p>With the amount of time to devote to this project dwindling, I tried to understand how the image was going from the the camera to server to determine what I could do to disrupt the process. The most interesting part of the output from “netstat -pal” was the manufacturer’s streamer service. It connected to a service called “evostreamms”. A quick Google search revealed that this is a media server. To confirm the media server hosted the stream to the security camera server, I created a looping shell script to kill the media server service, and created a listener on the same port with “nc -lp &lt;port&gt;”. The streamer service sent a Flash video stream to that part. The security camera server connected to the media server to get the stream. When I stopped the media service I took the camera offline.</p><p>Although the camera was offline, still images were still updated in the tmp folder and could be retrieved. The manufacturer’s streamer service produced the updated images. To prevent those images from being created I took that service offline as well. The issue persisted until the camera was manually rebooted which initialized the camera configuration process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TAzIyqRJqEvS5RVymNPF3w.jpeg" /></figure><h3>All Good Things Must Come to an End</h3><p>While I wanted to take the next step of streaming a looped video through the media server, I could not devote more time as I needed to prepare for interviews. In terms of the camera, I was impressed by some of the protections in place. The fact that I could kill a core service without something noticing seems flawed. However, much of the hack would have been inhibited by changing the default password. The security camera server managed the configuration of the cameras, so when implementing the system the camera logins may be overlooked. I met with Julien to reveal the hack and point out vulnerabilities in the system. It was a great learning experience with even more still there to be learned.</p><p><em>This article was first published on </em><a href="https://www.linkedin.com/pulse/hacking-holberton-schools-security-cameras-richard-harris"><em>LinkedIn</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9b01957c8fd2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Goldcrests Commando Project Post-mortem]]></title>
            <link>https://medium.com/@rickharris_dev/goldcrests-commando-project-post-mortem-422e67d1a3bb?source=rss-7cf1b9c00dc9------2</link>
            <guid isPermaLink="false">https://medium.com/p/422e67d1a3bb</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[holberton-school]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Rick Harris]]></dc:creator>
            <pubDate>Fri, 22 Jul 2016 21:31:22 GMT</pubDate>
            <atom:updated>2016-07-22T22:15:11.521Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R50vl_PkMKbyaqTQWfsvtw.png" /></figure><p><em>On Tuesday, July 19th Holberton School students participated in a commando project, similar to a hackathon. We were split into two teams and given a task to complete. This task was for educational purposes only. In other words, “Don’t be mad Twitter.”</em></p><h4>Project Goal:</h4><p>Create a Web Service that increases followers for a registered user based on a user-defined keyword. This would be achieved through retrieving statuses with that keyword and liking those statuses.</p><h4>Project Tasks Completed by the Team:</h4><ul><li>Front-end design</li><li>Twitter Login on our site using Auth0</li><li>Connection From Auth0 to our web service’s API</li><li>MySQL Database Setup with Required Tables</li><li>Bot to Like Statuses Based on Keyword</li></ul><h4>Incomplete Project Tasks that would have been Essential to a Functional Product:</h4><ul><li>Routes for storing and retrieving data from the database</li><li>Twitter access token and access token secret for the logged in user</li></ul><h4>Auth0 Service Investigation:</h4><p>Auth0 is a third-party identity management provider that developed a ‘zero-friction’ solution for developers. The majority of the team was unfamiliar with OAuth and the Auth0. As a result, the project ended with a level of uncertainty as to whether the Auth0 service would have actually met the requirements of the task. For personal discovery and knowledge, I spent some time after the commando project determining if the solution was viable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/872/1*S-V_RkAVGkPwXy3V1-sBrA.png" /><figcaption>Permissions displayed on Twitter under Settings &gt; Apps after a user logged in on our service</figcaption></figure><p>There were two separate issues that we were facing. The first issue dealt with the permission level of the consumer keys our app was using. The consumer keys authorize our app to connect to Twitter user accounts at the requested permission level. Each user is prompted to accept or decline the level of access an app requests. Our configuration used development Twitter keys provided by Auth0. These keys only gave read access. This is perfect for using the service for login only, but would have prevented us from actually liking statuses on behalf of the user. This is a fairly easy fix that would require registering the app with Twitter, getting consumer keys with read and write privileges, and configuring them within Auth0’s service interface.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/1*PURNFEGGvlcefU_B6J92MQ.png" /><figcaption>Example image in documentation from Auth0 displaying the access token and token secret which should appear in the response. The actual values were removed from the image.</figcaption></figure><p>The second issue is that we were not receiving the Twitter access token and access token secret after a user logged in. The <a href="https://auth0.com/docs/connections/social/twitter">documentation</a> indicated through a screenshot that it would return that information. However, all tests on our part indicated otherwise. As a result, I logged a support ticket with Auth0 given the contradicting information. The case was escalated to the <em>Developer Success Engineering Team</em>. I received the following response last night.</p><blockquote>Hi Rick,</blockquote><blockquote>You are correct; the Identity Provider’s access token is not sent along with the user profile anymore due to security concerns. The documentation is currently being updated and I’ve escalated this to the documentation team to update the screenshots as soon as possible. Really sorry about the confusion.</blockquote><blockquote>You can read more about this change here: <a href="https://auth0.com/docs/migrations#identity-provider-access-tokens-removed-from-user-profile-and-id_token">https://auth0.com/docs/migrations#identity-provider-access-tokens-removed-from-user-profile-and-id_token</a></blockquote><blockquote>After the user logs in, you need to call the Auth0 Management API from your backend to obtain the access token. There is a step-by-step guide here: <a href="https://auth0.com/docs/what-to-do-once-the-user-is-logged-in/calling-an-external-idp-api">https://auth0.com/docs/what-to-do-once-the-user-is-logged-in/calling-an-external-idp-api</a></blockquote><blockquote>Please let me know if this answers your question.</blockquote><blockquote>Thanks,</blockquote><blockquote>Thameera<br>Developer Success Engineer — <a href="https://auth0.com/">https://auth0.com</a></blockquote><p>Conclusively, it is possible to obtain the token and secret through the Auth0 service. Therefore, it is a viable solution for this task.</p><h4>Auth0 Database Integration:</h4><p>During the project, <a href="https://twitter.com/MayoChandler">Chandler Mayo</a>, our team member leading the configuration of the Auth0 service, mentioned integrating the MySQL database with Auth0 directly. We opted against so that all data incoming and outgoing pass through our web service’s API. After reviewing the Auth0 interface, I would probably reconsider that decision if we were doing the project again. The reason is that their service is already handling our identity management and half of our database was the data retrieved through their service. Connecting our database to their would have reduced our workload on a short timeframe.</p><h4>Security Concerns:</h4><p>During our closing presentation, <a href="https://www.linkedin.com/in/alaoufomar">Omar Alaouf</a>, a mentor at Holberton School, brought up the concern of security and the need to setup SSL. Given that we would have a token and token secret that can be used to control a user’s account through the API, I would reaffirm that SSL should be in place if we were to redo the project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qby5u4zZRvSDVsPKsHHftw.png" /><figcaption>Team planning session at the start of the commando project.</figcaption></figure><h4>Lessons Learned:</h4><p>Holberton School’s focus is project-based, peer-learning. These commando projects provide us the opportunity to think through building services under pressure, but in evaluating our work we can learn even more on how to improve our process in the future. Some things we could do differently based on this experience include:</p><ul><li><strong>Evaluate the unknown</strong> — Our biggest knowledge gap on the team was working with API services that require OAuth. This also happened to be the most critical item to our success. Given the priority and importance of this requirement, we should allocate more resources to evaluate several options. Evaluating options provides a backup plan in case the primary solution falls through.</li><li><strong>Simplify with integrations</strong> — We passed on integrating Auth0 with our database to funnel input and output through an API. If secure integrations already exist which can also reduce workload, we should use those integrations.</li><li><strong>Always consider security </strong>— When dealing with data, security of the information is critical. The team should be working to secure our services whether setting up SSL or configuring a deployment process to keep developers from destroying the server configuration.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=422e67d1a3bb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Reverse-engineering: Using Linux GDB]]></title>
            <link>https://medium.com/@rickharris_dev/reverse-engineering-using-linux-gdb-a99611ab2d32?source=rss-7cf1b9c00dc9------2</link>
            <guid isPermaLink="false">https://medium.com/p/a99611ab2d32</guid>
            <category><![CDATA[holberton-school]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[reverse-engineering]]></category>
            <dc:creator><![CDATA[Rick Harris]]></dc:creator>
            <pubDate>Thu, 19 May 2016 05:22:35 GMT</pubDate>
            <atom:updated>2016-05-20T22:58:35.651Z</atom:updated>
            <content:encoded><![CDATA[<p>At <a href="https://www.holbertonschool.com/">Holberton School</a>, we have had a couple rounds of a ‘#forfun’ project called crackme. For these projects, we are given an executable that accepts a password. Our assignment is to crack the program through reverse engineering. For round one we were given <a href="https://www.linux.com/blog/4-ways-password-could-be-hacked-using-common-linux-tools">four Linux tools to use</a>, and we had to demonstrate how to find the answer with each tool. It was quickly apparent that using a standard library string comparison is a bad idea as was hardcoding passwords into the executable in plain text. Another round demonstrated that the ltrace tool could gather not only the password from string comparisons, but the encryption method (MD5 in that case) to decrypt the password.</p><p>This week we were given another crack at hacking. I went to my go-to tool for reverse-engineering, the GNU Project Debugger (aka GDB), to find the password. If you would like to take a shot at cracking the executable, you can find it at <a href="https://github.com/holbertonschool/dont_hate_the_hacker_hate_the_code">Holberton School’s Github</a>. The file relevant to this post is <em>crackme3</em>.</p><h4>Program Checks</h4><p>Before I dig too deep into the exec file, I check what information I can get from it. First, I do a test run of the file to see what error information is provided.</p><blockquote>Usage: ./crackme3 password</blockquote><p>For this executable the password is expected to be provided on the command line. The next check I run is <strong><em>ltrace</em></strong> just to see if the password will appear. In addition, it can provide some other useful information about how the program works.</p><blockquote><strong>$</strong> ltrace ./crackme3 password</blockquote><blockquote>__libc_start_main(0x40068c, 2, 0x7ffcdd754bd8, 0x400710 &lt;unfinished …&gt;</blockquote><blockquote>strlen(“password”) = 8</blockquote><blockquote>puts(“ko”ko</blockquote><blockquote>) = 3</blockquote><blockquote>+++ exited (status 1) +++</blockquote><p>The return shows that the program is checking the length of the string, but there is no clear indication that this is a roadblock. Time to break down the program.</p><h4>The GNU Project Debugger</h4><p>GDB is a tool developed for Linux systems with the goal of helping developers identify sources of bugs in their programs. In their own words, from the gnu.org website:</p><blockquote>GDB, the GNU Project debugger, allows you to see what is going on `inside’ another program while it executes — or what another program was doing at the moment it crashed.</blockquote><p>When reverse engineering a program, the tool is used to review the compiled Assembly code in either the AT&amp;T or Intel flavors to see step-by-step what is happening. Breakpoints are added to stop the program midstream and review data in the memory registers to identify how it is being manipulated. I will cover these steps in more detail below.</p><h4>The Anatomy of Assembly</h4><p>To get started, I entered the command to launch the crackme3 file with GDB followed by the <em>disass</em> command and the function name. The output is a list of Assembly instructions that direct each action of the executable.</p><blockquote><strong>$</strong> gdb ./crackme3</blockquote><blockquote><strong>(gdb)</strong> disass main</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*nFXdF4fjl3tuQ49gSyvi-A.png" /></figure><p>The AT&amp;T and Intel syntaxes are displayed above side-by-side. However, the output will actually display only one of the two. I prefer to use the AT&amp;T format because the flow makes more sense to me. The first column provides the address of the command. The next column is the command itself followed by the data source and the destination. Jumps and function calls have the jump location or function name following those lines. Intel syntax reverses the data source and destination in its display. There are additional differences in the command names and data syntaxes, but this is common when comparing scripts of two different languages that perform the same function. If I were writing Assembly, my syntax preference might be different and would be based on more than just flow of information.</p><h4>The Logic Flow</h4><p>Every script depends highly on logic flow. Depending on the compiler and options selected when compiled, the flow of the Assembly code could be straightforward or very complex. Some options intentionally obfuscate the flow to disrupt attempts to reverse engineer the executable. Below is the output of the <em>disass main</em> command in AT&amp;T syntax.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*A_dEEbU_TukZi34Zmom3Tg.png" /></figure><p>The portions of the command not highlighted are jumps and closing processes before exit. There are four types of jumps in the output of main and check_password; je, jmp, jne, and jbe. The jmp command performs the described jump regardless of condition. The other three are conditional jumps. The first two, je and jne, are straight forward. They mean <em>jump if equal</em> and <em>jump if not equal</em>. The last command, jbe, is a jump used in a loop that means <em>jump if less than or equal</em>.</p><h4>The Heart of the Question</h4><p>Ultimately we are looking for the password. Based on the information from the main output, it is primarily depending on the check_password function to determine whether to exit or provide access. To analyze the process happening in that function, I entered <em>disass check_password</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*KqE8H9IByyF0D9cF8PMhXg.png" /></figure><p>The first thing I confirm is that the length of the password entered is important. The program looks for a password that is four characters long. The instruction at 0x400632 actually shows the password in integer form, but I did not recognize it immediately. That value is stored in memory four bytes before the memory address stored in the RBP register. I use <em>x/h * $RBP - 0x04 </em>to print the value. The ‘h’ stands for hexadecimal and it is the easiest format to to see how the password is stored. From the instruction set, a comparison of two registers, rax and rdx, occurs at 0x40066a. This is where the next step of my investigation leads.</p><blockquote><strong>(gdb)</strong> b *0x40066a</blockquote><blockquote><strong>(gdb)</strong> run test</blockquote><blockquote>Starting program: /home/vagrant/reverse_engineering/crackme3/crackme3 test</blockquote><blockquote>Breakpoint 1, 0x000000000040066a in check_password ()</blockquote><blockquote><strong>(gdb)</strong> info registers</blockquote><h4>Registered and Certified</h4><p>I set a breakpoint to analyze the data in process. Breakpoints do exactly what they say, they interrupt the process at the given instruction address. Once the breakpoint is set, I initialize the executable with the command <em>run test</em>. The value ‘test’ is the four character password I used to get past length test and into the password comparison. Once the breakpoint is triggered I enter <em>info registers</em> to view the data in the registers at the point the program was interrupted.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/872/1*eFe3ln6AoY8qmdkQz_ZzVg.png" /><figcaption>Blue — User input | Green — Stored Password</figcaption></figure><blockquote><strong>Register Data On Each Loop</strong></blockquote><blockquote><strong>1:</strong> RDX — 0x41 = A</blockquote><blockquote><strong>2:</strong> RDX — 0x42 = B</blockquote><blockquote><strong>3:</strong> RDX — 0x43 = C</blockquote><blockquote><strong>4:</strong> RDX — 0x4 = ^D or EOF</blockquote><p>From the register information, I find two integers are stored; 0x74 and 0x41. The ASCII value of the letter ‘t’ is 0x74. The printable letter for 0x41 is ‘A’. I also noticed that in RCX is an integer value of 0x4434241. If read in reverse, it is 41, 42, 43 and 4. Converted to the character values it is A, B, C, ^D or EOF. Inputting the password is tricky. Bash interprets the EOF file command so it isn’t passed to the executable. In fact, it is used to exit executables. I tried to store it in a file, but emacs reads ^D (Ctrl + D) as an end of buffer command. My workaround is to use an online ASCII to text converter and paste into a file through Atom. It adds a new line character which I remove with emacs. To get the password past Bash and into the executable, I use the command line below. This keeps Bash busy with passing the values to the executable so it does not interpret the EOF, end of file or transmission.</p><blockquote><strong>$ </strong>./crackme3 $(&lt; 0-password)</blockquote><blockquote>Congratulations!</blockquote><p>Gdb is a powerful tool that is useful for much more than I have covered in this post. Take the time to read the <a href="https://sourceware.org/gdb/download/onlinedocs/">documentation from GNU</a> to learn more. I am confident there are many other tools that can be used as well. Share your go-to tool for reverse-engineering or debugging in the comments below.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a99611ab2d32" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Troubleshooting Mac OS X Timeout & Login Failure With Active Directory Credentials After Locking…]]></title>
            <link>https://medium.com/@rickharris_dev/troubleshooting-mac-os-x-timeout-login-failure-with-active-directory-credentials-after-locking-f6ffac2aebaf?source=rss-7cf1b9c00dc9------2</link>
            <guid isPermaLink="false">https://medium.com/p/f6ffac2aebaf</guid>
            <category><![CDATA[el-capitan]]></category>
            <category><![CDATA[holberton-school]]></category>
            <category><![CDATA[dns]]></category>
            <dc:creator><![CDATA[Rick Harris]]></dc:creator>
            <pubDate>Sat, 09 Apr 2016 17:44:32 GMT</pubDate>
            <atom:updated>2016-04-10T01:27:31.221Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5QxoSZPcNGNnSdlbdgQnUg.jpeg" /></figure><h3>Troubleshooting Mac OS X Timeout &amp; Login Failure With Active Directory Credentials After Locking the System</h3><h4>Issue</h4><p>Students (including myself) at Holberton School had reported that the provided iMacs would freeze and would not allow access after locking the system. The reports were inconsistent and showed no clear time or user patterns. Some students noted that if they left the machine and returned after 20–30 minutes it would work again. However, this was not the case for all students, and many would resort to hard-resetting the system.</p><h4>Environment</h4><p>We have 30+ iMac systems managed using Casper Suite. The systems are bound to Active Directory (AD) and students use their AD credentials to access those systems and other linked services. The iMacs are currently running OS X 10.11 (El Capitan).</p><h4>Investigation</h4><p>Our first attempt to reproduce the issue was to initialize a Casper policy update to see if a policy configuration was interfering with accessing the system. This did not reproduce the problem, and we had to wait for the next report. Daniel, another student member of the DevOps team, was able to reproduce the problem by locking his system for 25 minutes. I used SSH to access the system with a local admin account. Via the terminal I entered, “tail -f /var/log/system.log” to begin monitoring the system. Daniel attempted to login to the machine, and we recorded the following error messages.</p><blockquote>loginwindow[1877]: in od_record_create(): failed: 13<br>loginwindow[1877]: in od_record_create_cstring(): failed: 13</blockquote><p>The error messages appeared in conjunction with timeouts rather than immediate errors. This coordinated with the timeout experienced on the user-side. The symptoms indicated a network/connection issue between the iMacs and the Active Directory server.</p><h4>Network Configurations</h4><p>The next step of investigation led me to analyze the network configurations. First, I wanted to know more about the directory binding. I turned to System Preferences &gt; Users &amp; Groups &gt; Login Options. I used the domain address to do some more testing in terminal with domain resolution. To test, I ran “nslookup &lt;domain&gt;” and it resolved successfully. Not having worked with the domain configuration for Holberton School, I was not certain if there was an alternate domain controller address. I logged into JAMF to analyze the binding policy. There did not seem to be any alternate address that I could use for testing.</p><p>When there is an issue with connecting to a server, the first step in the network process I investigate is domain resolution to an IP address. Our systems are configured with two DNS servers. The first address pointed to a DNS server hosted at Holberton School, and the second address was Google’s public DNS address. Our DNS server was used automatically with the previous nslookup for the domain. For testing the secondary DNS configuration, I ran the command, “nslookup &lt;domain&gt; 8.8.8.8” which forced the usage of Google’s public DNS. The domain could not be resolved.</p><p>This seemed odd as we had external services that relied on the Active Directory information including Google Apps and Casper Suite hosted on jamfcloud.net. I re-accessed Casper to review the connection to our AD. In System Settings &gt; LDAP Servers I found that the AD connection was made using a static IP address rather than the domain name. This explained why external services could connect even though the domain could not be resolved using Google’s public DNS.</p><h4>Problem</h4><p>The public DNS address was added to the configuration as a failover if our locally-hosted DNS server went down. This worked well when students were connected and actively using the system. However, when students would lock the machine and leave it for 20–30 minutes, the system would go to sleep disconnecting from the network. On wake if the system used the public DNS server, login would timeout and ultimately fail as it could not connect to Active Directory. This resulted in the inconsistent occurrence without a clear pattern.</p><h4>Confirming Through Tests</h4><p>To test this issue, I modified my DNS configuration to point only to the public DNS. Using SSH with a local admin account, I tried to switch to my AD user account using ‘su &lt;userid&gt;’. The attempt timed out and failed. I modified the system to only use the Holberton DNS server and entered the same command, it immediately logged in.</p><h4>Temporary Workaround</h4><p>We have removed the public DNS configuration to only point to the local DNS server, and systems should be updated after reboot or reconnection. If the system is locked, the workaround is to disconnect the Ethernet cable and reconnect to allow the system to reconfigure the network settings. Upon reconnection, the DNS configuration resets and login may be attempted again. Full problem resolution including DNS failover is scheduled for discussion during the next DevOps meeting.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f6ffac2aebaf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Reverse Engineering: Let’s Hash This Out]]></title>
            <link>https://medium.com/@rickharris_dev/reverse-engineering-let-s-hash-this-out-6ddc6a99a585?source=rss-7cf1b9c00dc9------2</link>
            <guid isPermaLink="false">https://medium.com/p/6ddc6a99a585</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[reverse-engineering]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Rick Harris]]></dc:creator>
            <pubDate>Mon, 04 Apr 2016 06:40:10 GMT</pubDate>
            <atom:updated>2016-04-04T16:37:19.658Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RSV0ZPtDfZM5eR2HpBRuIA.png" /></figure><p><a href="https://www.linkedin.com/pulse/strcmpyouve-been-hackedyouve-hacked-access-granted-richard-harris">In a recent post on LinkedIn</a>, I shared how using the strcmp() function in C, or similar functions in other languages, for password validation presented a security risk. In the discussion on this post, it was suggested that hashing out the password would resolve the issue. A new reverse engineering challenge at Holberton School put this theory to the test.</p><blockquote>If you would like to take a shot at the ‘crackme2’ program, you can obtain the file from the <a href="https://github.com/holbertonschool/dont_hate_the_hacker_hate_the_code">Holberton School Github</a>.</blockquote><h4>Know Your Environment</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yJ2KZ6SFGJ4VR3WlYAiY8Q.png" /><figcaption>crackme2 is checking the first 9 characters of every environment variable for “Passw0rd=”.</figcaption></figure><p>The first step in understanding the program was discovering how to input the password. Unfortunately, it was not as simple as putting in a command line argument. After confirming this, I cracked open the Linux tool bag. The ltrace tool runs the program and listens for standard library calls. Immediately, it was clear that crackme2 was checking for an environment variable called “Passw0rd=” (The ‘o’ is the number ‘0’). To get started, I added an environment variable and moved on to understanding the program.</p><h4>Two Steps Forward, One Step Back</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fezp8jHpw5mvUBO2lnyNhg.png" /><figcaption>Program is using MD5 encryption from the standard library.</figcaption></figure><p>To dig into what the program was doing, I called upon objdump. I used the -j flag to only output the .text section, the -M flag to set the syntax to Intel, and the -d flag to disassemble the program. Initially the code indicated a lot happening in the program. However, one particular section that stood out was the calling of MD5_Init, MD5_Update, and MD5_Final. Instead of moving forward with investigating the Assembly code, I took a step back to look at ltrace now that a password was in place.</p><h4>When Passwords Come Calling</h4><p>This time ltrace picked up a lot more activity, but the critical answer was found just near the bottom. A strcmp() call containing two MD5 encrypted values. The first value was the encrypted password, and the second was my encrypted input.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-OKGCmheKgBrC2lLJ7MTGg.png" /><figcaption>Encrypted password was output during a strcmp function call and uncovered using ltrace.</figcaption></figure><p>After retrieving the encrypted string, I used Google to return MD5 decryption sites. According to the site, the decrypted hash value was ‘qwerty’. Quick and simple. To ensure this wasn’t a red herring, I had to test the password in the program itself. I set the environment variable equal to ‘qwerty’, launched the crackme2 program, and the result was ‘Access Granted’. The program was successfully hacked.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KPsk62OxvnbJCaBEcMKJaw.png" /><figcaption>Decryption tool at <a href="https://hashkiller.co.uk/md5-decrypter.aspx">https://hashkiller.co.uk/md5-decrypter.aspx</a></figcaption></figure><h4>Showing The Hand</h4><p>Encrypting passwords is good step toward securing data. MD5 encryption converts all strings to 16 two-character hexadecimal values (32 total characters, 128 bits). As a result, using time variances to identify the password one character at a time is ineffective since the full string would only validate if the correct password was entered. For example, if you encrypt the string ‘qwert’ it returns ‘a384b6463fc216a5f8ecb6670f86456a’ which is nowhere near the same as ‘d8578edf8458ce06fbc5bb76a58c5ca4’ (the encrypted version of ‘qwerty’). One missing character produces a completely different string. However, showing the hand using a function like strcmp that outputs readable text (even if it is encrypted) undermines the security of the program.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6ddc6a99a585" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ever since I was a kid, I was questioning and learning.]]></title>
            <link>https://medium.com/@rickharris_dev/ever-since-i-was-a-kid-i-was-questioning-and-learning-9ec8d6d9355a?source=rss-7cf1b9c00dc9------2</link>
            <guid isPermaLink="false">https://medium.com/p/9ec8d6d9355a</guid>
            <category><![CDATA[holberton-school]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Rick Harris]]></dc:creator>
            <pubDate>Fri, 02 Oct 2015 13:35:37 GMT</pubDate>
            <atom:updated>2015-10-02T13:35:37.344Z</atom:updated>
            <content:encoded><![CDATA[<p>Ever since I was a kid, I was questioning and learning. I would challenge myself to find creative solutions to everyday problems. Often technology would be involved in the process, and I would go above and beyond to learn something new to achieve my goal. As I have grown in the tech industry, I am learning more and more everyday about the enterprise environment in my role at Notre Dame. I want to build tools that solve bigger problems than the ones I am able to at this point. To do that, I need invest in my knowledge of programming the full tech stack. Holberton School provides the opportunity to learn from leaders in the tech industry. This kind of opportunity would catapult me from what I am capable of now to brand new horizons.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9ec8d6d9355a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>