<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Bruno</title>
    <description>The latest articles on Forem by Bruno (@menna).</description>
    <link>https://forem.com/menna</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1321114%2F1529e85c-d351-4338-80ca-fa47dc293c88.png</url>
      <title>Forem: Bruno</title>
      <link>https://forem.com/menna</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/menna"/>
    <language>en</language>
    <item>
      <title>Some handy notes for GCP pentesting</title>
      <dc:creator>Bruno</dc:creator>
      <pubDate>Tue, 19 Nov 2024 21:10:55 +0000</pubDate>
      <link>https://forem.com/menna/some-handy-notes-for-gcp-pentesting-c8i</link>
      <guid>https://forem.com/menna/some-handy-notes-for-gcp-pentesting-c8i</guid>
      <description>&lt;p&gt;Hey folks!&lt;br&gt;
Here's some notes that I use when validating some GCP service accounts and looking for SSRFs.&lt;/p&gt;

&lt;h3&gt;How to authenticate in a service account using the GCP CLI&lt;/h3&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gcloud auth activate-service-account 1234567-compute@developer.gserviceaccount.com &lt;span class="nt"&gt;--key-file&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;pathtofile.json &lt;span class="nt"&gt;--project&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;project_name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;The e-mail address you will copy from the json file, also the key file you will point to where the file it's saved, and the project name you also can get in the file.&lt;/p&gt;

&lt;h3&gt;List of some commands&lt;/h3&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#List SSL certificates &lt;/span&gt;
gcloud compute ssl-certificates list
&lt;span class="c"&gt;#List compute engine image disks&lt;/span&gt;
gcloud compute images list
&lt;span class="c"&gt;#List compute engine instances&lt;/span&gt;
gcloud compute instances list
&lt;span class="c"&gt;#List buckets&lt;/span&gt;
gcloud storage &lt;span class="nb"&gt;ls&lt;/span&gt;
&lt;span class="c"&gt;#List buckets using gsutil&lt;/span&gt;
gsutil &lt;span class="nb"&gt;ls&lt;/span&gt;
&lt;span class="c"&gt;#List containers&lt;/span&gt;
gcloud container images list
&lt;span class="c"&gt;#List clusters&lt;/span&gt;
gcloud container clusters list
&lt;span class="c"&gt;#List firewall rules&lt;/span&gt;
gcloud compute firewall-rules list
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;Achieving SSRFs in Axios&lt;/h3&gt;

&lt;p&gt;When attempting to achieve SSRF in a GCP environment, it's mandatory to have a 'Metada-Flavor: Google' header to your request.&lt;/p&gt;

&lt;p&gt;In Axios, you can add headers to your request by default, you just need to create an object in the request body and it's done.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo8m49kghwiowg57x2y70.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo8m49kghwiowg57x2y70.png" alt="Axios Docs" width="800" height="479"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;Some usefull links and tools&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://cloud.hacktricks.xyz/pentesting-cloud/gcp-security" rel="noopener noreferrer"&gt;GCP Pentesting - Hacktricks &lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://cloud.hacktricks.xyz/pentesting-cloud/gcp-security/gcp-services" rel="noopener noreferrer"&gt;GCP Services - Hacktricks&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/Littlehack3r/awesome-gcp-pentesting" rel="noopener noreferrer"&gt;Awesome GCP Pentesting&lt;/a&gt;&lt;/p&gt;

</description>
      <category>security</category>
      <category>infosec</category>
      <category>bugbounty</category>
    </item>
    <item>
      <title>A simple tip to find hidden gems in Shodan</title>
      <dc:creator>Bruno</dc:creator>
      <pubDate>Sun, 03 Mar 2024 03:55:28 +0000</pubDate>
      <link>https://forem.com/menna/a-simple-tip-to-find-hidden-gems-in-shodan-2c92</link>
      <guid>https://forem.com/menna/a-simple-tip-to-find-hidden-gems-in-shodan-2c92</guid>
      <description>&lt;p&gt;Shodan is a well-known recon tool, but in larger scopes, it has so many results that it’s hard to find something useful without navigating through all the results pages.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxnt44draj731ffmptc9j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxnt44draj731ffmptc9j.png" alt="Microsoft results" width="800" height="690"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this image searching for hostnames from Microsoft we got +100k results. It would be a TON of work going through 20 pages of results trying to find something.&lt;/p&gt;

&lt;h3&gt;
  
  
  That's when the 'facets' search comes into play
&lt;/h3&gt;

&lt;p&gt;Facets are a set of filters that can help with your search. Some basic filters are ‘country’, ‘city’, ‘ssl cert’, and so on. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjxoa40twl8ckp142hor2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjxoa40twl8ckp142hor2.png" alt="Facets" width="800" height="531"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Personally, the filter that helps me the most to find some interesting stuff for pentests and bug bounties is the ‘http.title’. In many cases, there will be some repetitive titles with an error message or a default response for pages without content.&lt;/p&gt;

&lt;p&gt;So instead of going through 20 pages of search, you will have a list that only shows one time each title, and it’s filtered by occurrences.&lt;/p&gt;

&lt;p&gt;By doing that we can go for the titles that only show up one or two times in the whole search, that’s where we can find something misconfigured, a subdomain that shouldn’t be public, internal dashboards, and many more.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbtdmvvraoxda69xbepp3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbtdmvvraoxda69xbepp3.png" alt="Facets3" width="800" height="612"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Usually I don't bother looking for the most common titles, the focus is in the ones with a few appearances.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5istr5dq4tpf6279r1c1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5istr5dq4tpf6279r1c1.png" alt="Facets2" width="555" height="846"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this image, we can see that we have some titles that get our attention. &lt;/p&gt;

&lt;p&gt;Usually I try to look for titles that contain some keywords like "Dashboard", "Welcome", "Internal" and so on.&lt;/p&gt;

&lt;p&gt;From now on, you just gotta dig and look for more.&lt;/p&gt;

</description>
      <category>security</category>
      <category>infosec</category>
      <category>cybersecurity</category>
    </item>
  </channel>
</rss>
