<?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 mr_p0tat0 on Medium]]></title>
        <description><![CDATA[Stories by mr_p0tat0 on Medium]]></description>
        <link>https://medium.com/@7769944853vodafone?source=rss-93c4304e9490------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Stories by mr_p0tat0 on Medium</title>
            <link>https://medium.com/@7769944853vodafone?source=rss-93c4304e9490------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 06:04:33 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@7769944853vodafone/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[Security Headers and Cookie Flags]]></title>
            <link>https://medium.com/@7769944853vodafone/security-headers-and-cookie-flags-2ef4268b7086?source=rss-93c4304e9490------2</link>
            <guid isPermaLink="false">https://medium.com/p/2ef4268b7086</guid>
            <category><![CDATA[http-security-headers]]></category>
            <category><![CDATA[security-hardening]]></category>
            <category><![CDATA[header-implementation]]></category>
            <category><![CDATA[security-header]]></category>
            <category><![CDATA[cyber-attack-prevention]]></category>
            <dc:creator><![CDATA[mr_p0tat0]]></dc:creator>
            <pubDate>Sat, 25 Mar 2023 16:06:54 GMT</pubDate>
            <atom:updated>2023-03-25T16:06:54.578Z</atom:updated>
            <content:encoded><![CDATA[<p>Security headers are a group of HTTP response headers that can be used to enhance the security of a web application. We are discussing about headers that makes attackers life harder. Here are some of the most commonly used security headers:</p><ol><li>Content Security Policy (CSP) — This header allows a website to specify which sources of content are allowed to be loaded by a web page. This can help prevent cross-site scripting (XSS) attacks by blocking the execution of malicious scripts. CSP can be used to whitelist specific sources of content, such as scripts, images, and stylesheets, and can also be used to specify where resources can be loaded from, such as from the same origin or from a specific domain. CSP can also be used to specify a reporting mechanism, where the browser will send reports of any policy violations to a specified endpoint.</li><li>X-Frame-Options — This header can be used to prevent clickjacking attacks by specifying whether a web page can be embedded in a frame or iframe. The possible values for this header are “deny” and “same-origin”. When the value is set to “deny”, the page cannot be displayed in a frame, and when set to “same-origin” the page can only be displayed in a frame on the same origin as the page.</li><li>X-XSS-Protection — This header can be used to enable the browser’s built-in XSS protection. When a browser detects a potential XSS attack, it will prevent the page from loading and notify the user. The value for this header can be set to “0” to disable the protection, “1” to enable it, or “1; mode=block” to enable it and block the page from loading.</li><li>Strict-Transport-Security (HSTS) — This header can be used to force a website to be accessed only over HTTPS. This helps to protect against man-in-the-middle attacks that could intercept and modify unencrypted traffic. The value for this header can include a “max-age” directive, which specifies how long the browser should remember that the site should only be accessed over HTTPS.</li><li>X-Content-Type-Options — This header can be used to prevent MIME type confusion attacks. This header tells the browser to only process a response as the declared content type and not to try to sniff the content type. The value for this header should be set to “nosniff”.</li><li>Referrer-Policy — This header can be used to control the information that is sent in the Referrer header when a user clicks on a link. This can help prevent information leakage and protect user privacy. The possible values for this header include “no-referrer”, “no-referrer-when-downgrade”, “same-origin”, “origin”, “strict-origin”, “origin-when-cross-origin”, and “strict-origin-when-cross-origin”.</li></ol><p><strong>Lets talk about implementation…</strong></p><p>Here we are discussing commonly used languages only,</p><ul><li>In <strong>PHP</strong>, you can use the header() function to add headers to an HTTP response.</li><li>In <strong>.NET</strong>, you can use the HttpResponse.AppendHeader method to add headers to an HTTP response.</li><li>In <strong>Ruby on Rails</strong>, you can use the response.headers method to add headers to an HTTP response.</li><li>In <strong>Node.js</strong>, you can use the res.setHeader() method to add headers to an HTTP response.</li><li>In <strong>Django</strong>, you can use the HttpResponse.headers attribute to add headers to an HTTP response.</li></ul><p>Depending on the web server you are using, you will need to configure it to include the headers in the HTTP response. The exact method for doing this will vary depending on the web server you are using. For example, Apache and Nginx allow you to add headers to the server configuration file, while IIS allows you to add headers through the IIS Manager.</p><p>There are a few <strong>common</strong> <strong>misunderstandings</strong> about security headers that are worth mentioning:</p><ol><li>They are a magic bullet: Security headers can provide an additional layer of security, but they should not be relied on as the sole means of protection. Other security measures, such as input validation and sanitization, should also be implemented to ensure the overall security of your web application.</li><li>All headers are created equal: Not all security headers are equally effective in protecting against different types of attacks. For example, while CSP can help prevent XSS attacks, it does not protect against other types of attacks such as SQL injection.</li><li>They are only for large companies: Security headers can be useful for web applications of any size. Even small websites can benefit from the added security provided by security headers.</li><li>They can’t be bypassed: While security headers can provide an additional layer of security, it’s important to remember that no security measure is completely foolproof. Security headers can be bypassed by attackers with sufficient knowledge and resources.</li><li>The more headers, the better: While it’s true that security headers can provide an additional layer of security, it’s important to remember that they can also have a negative impact on performance. Too many security headers can slow down your website and negatively impact the user experience. It’s important to use only the headers that are necessary for your specific use case.</li></ol><h3><strong>Lets talk about Cookie Security Flags</strong></h3><p>A cookie is a small piece of data that is stored on a user’s computer by a web server. Cookies are often used to remember a user’s preferences, login information, and browsing history. They can also be used to track a user’s behavior on a website.</p><p>Security flags are parameters that can be set on cookies to control how they are handled by the browser. Some of the most commonly used security flags include:</p><ol><li><strong>HttpOnly</strong> — This flag tells the browser that the cookie should only be accessed via HTTP requests, and not through client-side scripts. This can help prevent cross-site scripting (XSS) attacks by blocking the execution of malicious scripts.</li><li><strong>Secure</strong> — This flag tells the browser that the cookie should only be sent over HTTPS connections. This helps to protect against man-in-the-middle attacks that could intercept and modify unencrypted traffic.</li><li><strong>SameSite</strong> — This flag tells the browser whether or not to send the cookie with cross-site requests. The possible values for this flag are “lax”, “strict” and “none” .</li><li><strong>Expiry</strong> — This flag tells the browser when the cookie should be deleted. It can be set as a specific date or as a number of seconds.</li><li><strong>Path</strong> — This flag tells the browser which pages on the website can access the cookie. This can be used to restrict access to specific pages or sections of a website.</li></ol><p>It’s important to note that security flags can provide an additional layer of security, but they should not be relied on as the sole means of protection. Other security measures, such as input validation and sanitization, should also be implemented to ensure the overall security of your web application.</p><p><strong>Lets talk about implementation….</strong></p><p>Here are some examples of how to implement some of the most commonly used cookie flags in different programming languages and frameworks:</p><ul><li>In <strong>PHP</strong>, you can use the setcookie() function to set cookies and include flags as options.</li><li>In<strong> .NET</strong>, you can use the HttpCookie class to set cookies and include flags as properties.</li><li>In <strong>Ruby on Rails</strong>, you can use the cookies.permanent.signed or cookies.signed method to set cookies and include flags as options.</li><li>In <strong>Node.js</strong>, you can use the res.cookie() method to set cookies and include flags as options.</li><li>In <strong>Django</strong>, you can use the HttpResponse.set_cookie() method to set cookies and include flags as options.</li></ul><p>It’s important to note that the exact method for setting cookies with flags will vary depending on the specific programming language and framework you are using, so be sure to consult the documentation for the specific technology you are working with.</p><p><strong>References:</strong></p><ol><li>OWASP: Content Security Policy (CSP) — <a href="https://owasp.org/www-project-content-security-policy/">https://owasp.org/www-project-content-security-policy/</a></li><li>Mozilla Developer Network: HTTP Strict Transport Security (HSTS) — <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Strict-Transport-Security">https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Strict-Transport-Security</a></li><li>OWASP: HTTP Security Headers — <a href="https://owasp.org/www-project-secure-headers/">https://owasp.org/www-project-secure-headers/</a></li><li>Mozilla Developer Network: Referrer Policy — <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy">https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy</a></li><li>OWASP: Clickjacking Defense Cheat Sheet — <a href="https://owasp.org/www-project-clickjacking-defense-cheat-sheet/">https://owasp.org/www-project-clickjacking-defense-cheat-sheet/</a></li><li>Mozilla Developer Network: X-XSS-Protection — <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-XSS-Protection">https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-XSS-Protection</a></li><li>OWASP: X-Content-Type-Options — <a href="https://owasp.org/www-community/http-headers#X-Content-Type-Options">https://owasp.org/www-community/http-headers#X-Content-Type-Options</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2ef4268b7086" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Sonarqube troubleshooting]]></title>
            <link>https://medium.com/@7769944853vodafone/sonarqube-troubleshooting-5fda3d9eb374?source=rss-93c4304e9490------2</link>
            <guid isPermaLink="false">https://medium.com/p/5fda3d9eb374</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[devsecops]]></category>
            <category><![CDATA[troubleshooting]]></category>
            <category><![CDATA[sonar]]></category>
            <category><![CDATA[sonarqube]]></category>
            <dc:creator><![CDATA[mr_p0tat0]]></dc:creator>
            <pubDate>Thu, 23 Feb 2023 07:48:12 GMT</pubDate>
            <atom:updated>2023-02-23T07:50:53.087Z</atom:updated>
            <content:encoded><![CDATA[<p>Sonar is a popular open-source platform used for continuous code quality checks. It provides insights into the overall health of your codebase by analyzing the code for potential bugs, vulnerabilities, and other issues. Sonar’s popularity is due to its ease of installation, configuration, and use. However, as with any software, installation issues can arise, and troubleshooting them can be a daunting task for those new to Sonar. In this blog, we will discuss some common Sonar installation issues on Linux machines and their solutions.</p><p><strong>1.Port already in use</strong>: One of the most common issues encountered during the installation of Sonar on a Linux machine is the “Port already in use” error. This error occurs when the port that Sonar is trying to use is already occupied by another process. To resolve this issue, you can change the port number in the Sonar configuration file. The default port used by Sonar is 9000. You can change it to any available port, for example, 9001, by modifying the “sonar.web.port” property in the Sonar configuration file located at “<em>/opt/sonarqube/conf/sonar.properties</em>”.</p><p><strong>2. Outdated or incompatible Java version</strong>: Sonar requires a compatible version of Java to run correctly. If you encounter errors during the installation process or when trying to start Sonar, it may be because your Java version is outdated or incompatible. To resolve this issue, make sure you have the correct Java version installed. Sonar requires Java 11 or later. You can check your Java version by running the command “java -version” in the terminal. If you have an outdated version of Java, you can download and install the latest version using the following commands:</p><blockquote>sudo apt update<br>sudo apt install openjdk-11-jdk</blockquote><p><strong>3.</strong> <strong>Insufficient permissions</strong>: Sonar requires certain permissions to run correctly, and if it does not have the necessary permissions, you may encounter errors during the installation process or when trying to start Sonar. To resolve this issue, make sure that the Sonar installation directory and all its subdirectories have the correct permissions. You can change the ownership and permissions of the Sonar installation directory using the following command:</p><blockquote>sudo chown -R sonar:sonar /opt/sonarqube<br>sudo chmod -R 755 /opt/sonarqube</blockquote><p><strong>4. Configuration errors</strong>: If the Sonar configuration file contains errors, Sonar may not start or may not function correctly. To resolve this issue, make sure that the Sonar configuration file is correctly configured. You can check the Sonar configuration file for errors using the following command:</p><blockquote>sudo /opt/sonarqube/bin/sonar.sh check</blockquote><p>If the configuration file contains errors, the above command will display an error message indicating the nature of the error. You can then correct the error and restart Sonar using the following command:</p><blockquote>sudo /opt/sonarqube/bin/linux-x86–64/sonar.sh start</blockquote><p><strong>5.</strong> <strong>Database connection errors</strong>: Sonar stores its data in a database, and if it cannot connect to the database, it may not start or may not function correctly. To resolve this issue, make sure that the database server is running and that the Sonar configuration file is correctly configured to connect to the database. You can check the Sonar logs for database connection errors using the following command:</p><blockquote>sudo tail -f /opt/sonarqube/logs/sonar.log</blockquote><p><strong>6.</strong> <strong>Installation directory not found</strong>: If the Sonar installation directory does not exist or is not correctly configured in the Sonar configuration file, Sonar may not start or may not function correctly. To resolve this issue, make sure that the Sonar installation directory exists and that the “s<em>onar.path.data</em>” and “<em>sonar.path.temp</em>” properties in the Sonar configuration file are correctly configured to point to the correct directories.</p><p>Now lets discuss some common issues that you may encounter when running Sonar in a Docker container,</p><p><strong>1.Docker container not running</strong>: If the Sonar container is not running, you can use the following command to check its status:</p><blockquote>docker ps -a | grep sonarqube</blockquote><p>If the container is not running, use the following command to start it:</p><blockquote>docker start sonarqube</blockquote><p><strong>2. Docker container not accessible</strong>: If the Sonar container is running but you are unable to access it, ensure that the container is listening on the correct ports by running the following command:</p><blockquote>docker ps | grep sonarqube</blockquote><p><strong>3.</strong> If the ports are not correct, you can map them to different ports on the host by modifying the “docker run” command as follows:</p><blockquote>docker run -p 9000:9000 -p 9092:9092 sonarqube</blockquote><p>This command maps port 9000 (the default Sonar port) and port 9092 (the default Elasticsearch port) in the container to the same ports on the host.</p><p><strong>4. Insufficient memory</strong>: If your Docker container does not have enough memory, Sonar may not start or may crash during use. To resolve this issue, increase the amount of memory available to the container by specifying the “SONAR_ES_JAVA_OPTS” and “SONAR_WEB_JAVA_OPTS” environment variables when starting the container. For example, to increase the maximum heap size to 2GB, use the following command:</p><blockquote>docker run -e SONAR_ES_JAVA_OPTS=”-Xmx2G -Xms2G” -e SONAR_WEB_JAVA_OPTS=”-Xmx2G -Xms2G” sonarqube</blockquote><p>In conclusion, while Sonar is a powerful tool for analyzing code quality, installation issues can be frustrating. However, by following the steps outlined above and consulting the Sonar documentation and user forums for further assistance.</p><p>Here are the links to some helpful resources for Sonar installation issues:</p><ol><li>The official SonarQube documentation: <a href="https://docs.sonarqube.org/latest/setup/install-server/">https://docs.sonarqube.org/latest/setup/install-server/</a></li><li>The SonarQube user forums: <a href="https://community.sonarsource.com/">https://community.sonarsource.com/</a></li><li>The Docker documentation: <a href="https://docs.docker.com/">https://docs.docker.com/</a></li><li>The Docker Hub page for the SonarQube image: <a href="https://hub.docker.com/_/sonarqube">https://hub.docker.com/_/sonarqube</a></li><li>A tutorial on running SonarQube in a Docker container: <a href="https://www.baeldung.com/sonar-docker">https://www.baeldung.com/sonar-docker</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5fda3d9eb374" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[NoSQLi Basics]]></title>
            <link>https://medium.com/@7769944853vodafone/nosqli-basics-1b0ca4d38567?source=rss-93c4304e9490------2</link>
            <guid isPermaLink="false">https://medium.com/p/1b0ca4d38567</guid>
            <category><![CDATA[nosql-injection]]></category>
            <category><![CDATA[nosql-database]]></category>
            <category><![CDATA[nosql]]></category>
            <dc:creator><![CDATA[mr_p0tat0]]></dc:creator>
            <pubDate>Fri, 27 Jan 2023 12:46:27 GMT</pubDate>
            <atom:updated>2023-01-27T12:46:27.562Z</atom:updated>
            <content:encoded><![CDATA[<p>NoSQL (Not Only SQL) is a type of database that allows for more flexible and scalable data storage than traditional SQL databases. It allows for handling unstructured and semi-structured data, it is popular for big data and real-time web applications. Unlike SQL databases, which use a fixed table structure, NoSQL databases uses different data models like document, key-value, graph, and column-family, and it can scale horizontally. On the other hand, SQL databases are well-suited for structured data and complex data relationships, they use SQL to store and retrieve data and they organize data in tables.</p><p>An example use of NoSQL databases is in a social media application. The application stores a large amount of user-generated content, including text, images, and videos. The data is constantly changing, with new content being added and old content being removed.</p><p>A NoSQL database, such as MongoDB, would be well-suited for this application because it can handle unstructured data and handle a high volume of write operations. The data can be stored in a document model, with each user’s content represented as a separate document. This allows for easy querying and retrieval of specific user’s content.</p><p><strong>What is NoSQLi and how to find it manually…</strong></p><p>Like normal sqli it occurs when a web application uses untrusted user-supplied data in a NoSQL query without proper validation or sanitation. This can allow an attacker to inject malicious code into the query, allowing them to gain access to sensitive information or disrupt the normal functioning of the application.</p><p>Identification procedure is also similar, Identify input fields in the web application, such as forms, search fields, and query parameters, where the tester can tests different payloads as input into it, observe the response of the web application for any unusual behavior, such as error messages, unexpected data, or changes in the web page, and validate the results by reviewing the logs, database, and network traffic to confirm if the payloads have caused any changes in the database, or if it has returned any sensitive information.</p><p><strong>Let see one example…</strong></p><p>One example of a NoSQL injection payload that could be used to bypass a web login is a MongoDB injection payload.</p><p>Imagine a web application that uses a MongoDB database to store user information, and has a login form where users enter their username and password. An attacker could craft a request as follows:</p><blockquote>POST /login?username=admin&amp;password={$ne:null}</blockquote><p>This request would inject a malicious payload into the login query, which would bypass the validation check and allow the attacker to login as the “admin” user without providing a valid password.</p><p>The payload {$ne:null} is used to check if a field is not equal to null and in this case it will check if the password field is not equal to null which always returns true bypassing the validation check.</p><p>You can find more payload here <a href="https://github.com/swisskyrepo/PayloadsAllTheThings/tree/master/NoSQL%20Injection">https://github.com/swisskyrepo/PayloadsAllTheThings/tree/master/NoSQL%20Injection</a></p><p>Here are a few references on NoSQL injection and security issues:</p><ol><li>OWASP NoSQL injection: <a href="https://owasp.org/www-community/attacks/NoSQL_injection">https://owasp.org/www-community/attacks/NoSQL_injection</a></li><li>NoSQL Injection: <a href="https://www.acunetix.com/blog/articles/nosql-injection/">https://www.acunetix.com/blog/articles/nosql-injection/</a></li><li>NoSQL Injection: <a href="https://portswigger.net/blog/nosql-injection">https://portswigger.net/blog/nosql-injection</a></li><li>NoSQL Database Security: <a href="https://www.owasp.org/index.php/NoSQL_Database_Security">https://www.owasp.org/index.php/NoSQL_Database_Security</a></li><li>NoSQL injection attacks: <a href="https://www.ibm.com/cloud/blog/nosql-injection-attacks">https://www.ibm.com/cloud/blog/nosql-injection-attacks</a></li><li>NoSQL injection attacks: <a href="https://www.csoonline.com/article/2989354/nosql-injection-attacks-are-on-the-rise-here-s-how-to-fight-back.html">https://www.csoonline.com/article/2989354/nosql-injection-attacks-are-on-the-rise-here-s-how-to-fight-back.html</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1b0ca4d38567" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[iOS Application Testing — Static analysis]]></title>
            <link>https://medium.com/@7769944853vodafone/ios-application-testing-static-analysis-58cd2030088f?source=rss-93c4304e9490------2</link>
            <guid isPermaLink="false">https://medium.com/p/58cd2030088f</guid>
            <category><![CDATA[ios-development]]></category>
            <category><![CDATA[ios-testing]]></category>
            <category><![CDATA[ios-static-analysis]]></category>
            <category><![CDATA[ios-bug]]></category>
            <category><![CDATA[ios-pentesting]]></category>
            <dc:creator><![CDATA[mr_p0tat0]]></dc:creator>
            <pubDate>Tue, 24 Jan 2023 22:16:31 GMT</pubDate>
            <atom:updated>2023-01-24T22:16:31.310Z</atom:updated>
            <content:encoded><![CDATA[<h3>iOS Application Testing — Static analysis</h3><p>Hello guys this is part-1 for iOS application security testing. Here i’m discussing most common issues with examples i have came across in day today life for iOS application security testing.</p><p>iOS application static analysis is the process of analyzing the code and resources of an iOS application without executing it. This technique is used to identify potential security vulnerabilities and other issues that could compromise the integrity and functionality of the application. In this blog, we will discuss some of the most popular iOS application static analysis tools and techniques for security professionals.</p><p>There are several issues that can be found during static analysis for iOS application security. Some of the most common issues include:</p><ol><li>Insecure Data Storage: This issue occurs when sensitive information, such as passwords and keys, is stored in an unencrypted or easily accessible format. This information can be easily accessed by attackers and used for malicious purposes. Tools such as iNalyzer and Mobile Security Framework (MobSF) can be used to identify this issue.</li></ol><p>Example: An application that stores a user’s password in plain text in the application’s local storage. Dump the application document/cache directory from local storage after using application for some time. Make sure you login or register in application that may cause it store some data to local storage.</p><p>2. Unvalidated Input: This issue occurs when an application does not properly validate user input, which can lead to buffer overflows, SQL injection, and other types of attacks.</p><p>Example: An application that allows a user to enter a username and password without properly validating the input, which could allow an attacker to input malicious code and gain access to the system.</p><p>3. Weak Encryption: This issue occurs when an application uses weak encryption algorithms or keys, which can be easily cracked by attackers.</p><p>Example: An application that uses a weak encryption algorithm, such as MD5, to encrypt sensitive information, which could be easily cracked by an attacker. You can use online or offline tool to decrypt weak hashes.</p><p>4. Insecure Network Communications: This issue occurs when an application uses insecure protocols or does not properly validate SSL/TLS certificates, which can lead to man-in-the-middle attacks.</p><p>Example: An application that uses HTTP instead of HTTPS to transmit sensitive information, which could allow an attacker to intercept the communication and access the sensitive information. Inside of info.plist file you will find configuration that is responsible for it.</p><p>5. Hardcoded Secrets: This issue occurs when an application includes hardcoded secrets, such as passwords, keys, or tokens, in the code. This information can be easily accessed by attackers, who can use it for malicious purposes.</p><p>Example: An application that includes an API key in the code, which could be easily accessed by an attacker who decompiles the binary.</p><p>6. Insecure Random Number Generation: This issue occurs when an application uses a weak or predictable random number generator, which can lead to the generation of predictable keys or nonces.</p><p>Example: An application that uses the current time as a seed for the random number generator, which could lead to the generation of predictable keys. Application uses old library to generate pin/otp that can be easily guessed or calculated by attacker.</p><p>7. Insecure Cryptographic Operations: This issue occurs when an application uses an insecure or deprecated cryptographic algorithm, which can be easily cracked by attackers.</p><p>Example: An application that uses the DES encryption algorithm, which is considered insecure and has been deprecated. An application stores data on client location with weak encryption.</p><p>8. Insecure File Operations: This issue occurs when an application uses insecure file operations, such as insecure file permissions or unsafe file handling, which can lead to data leakage or unauthorized access. Tools such as iNalyzer and Mobile Security Framework (MobSF) can be used to identify this issue.</p><p>Example: An application that stores sensitive information in a file with world-readable permissions, which could allow an attacker to access the sensitive information or An application stores data to shared memory which is readable/writable to other application.</p><p>9. Insecure Session Management: This issue occurs when an application does not properly manage user sessions, such as using weak session IDs or failing to properly invalidate sessions, which can lead to session hijacking and unauthorized access.</p><p>Example: An application that uses a simple session ID that is easily guessable, which could allow an attacker to hijack a user’s session.</p><p>10. Insecure Error Handling: This issue occurs when an application does not properly handle errors, such as displaying sensitive information or leaking information about the internal workings of the application, which can lead to information disclosure and other types of attacks.</p><p>Example: An application that displays a detailed error message when an exception is thrown, which could reveal information about the internal workings of the application to an attacker.</p><p>11. Insecure Third-Party Libraries: This issue occurs when an application uses third-party libraries that contain known vulnerabilities, which can be exploited by attackers.</p><p>Example: An application that uses an old version of a third-party library that contains a known vulnerability, which could be exploited by an attacker.</p><p>12. Insecure Logging: This issue occurs when an application does not properly log events, such as logging sensitive information or failing to properly protect log files, which can lead to information disclosure and other types of attacks.</p><p>Example: An application that logs sensitive information, such as passwords, in plain text, which could be easily accessed by an attacker who gains access to the log files.</p><p>13. Insecure Data Caching: This issue occurs when an application uses insecure data caching mechanisms, such as caching sensitive information or failing to properly invalidate cached data, which can lead to information leakage and other types of attacks.</p><p>Example: An application that caches sensitive information, such as passwords, in memory, which could be easily accessed by an attacker who gains access to the device’s memory.</p><p><strong>Tools</strong></p><p>There are several tools that can be used for iOS application static analysis, some of the most popular tools include:</p><ol><li>Clang Static Analyzer: <a href="https://clang-analyzer.llvm.org/">https://clang-analyzer.llvm.org/</a></li><li>Hopper Disassembler: <a href="https://www.hopperapp.com/">https://www.hopperapp.com/</a></li><li>OCLint: <a href="https://oclint.org/">https://oclint.org/</a></li><li>Mobile Security Framework (MobSF): <a href="https://github.com/MobSF/Mobile-Security-Framework-MobSF">https://github.com/MobSF/Mobile-Security-Framework-MobSF</a></li><li>Objection: <a href="https://github.com/sensepost/objection">https://github.com/sensepost/objection</a></li></ol><p><strong>References:</strong></p><ol><li>OWASP Mobile Security Testing Guide: <a href="https://owasp.org/www-project-mobile-security-testing-guide/">https://owasp.org/www-project-mobile-security-testing-guide/</a></li><li>“iOS Application Security: The Definitive Guide for Hackers and Developers” by David Thiel: <a href="https://www.amazon.com/iOS-Application-Security-Definitive-Developers/dp/1593277527">https://www.amazon.com/iOS-Application-Security-Definitive-Developers/dp/1593277527</a></li><li>“iOS Pentest” by David Thiel: <a href="https://www.packtpub.com/networking-and-servers/ios-pentest">https://www.packtpub.com/networking-and-servers/ios-pentest</a></li><li>“iOS Hacker’s Handbook” by Charlie Miller, Dionysus Blazakis, Stefan Esser, Vincenzo Iozzo, and Ralf-Philipp Weinmann: <a href="https://www.wiley.com/en-us/iOS+Hacker&#39;s+Handbook-p-9781118204305">https://www.wiley.com/en-us/iOS+Hacker&#39;s+Handbook-p-9781118204305</a></li><li>“The iOS Hacker’s Handbook” by Charlie Miller, Dionysus Blazakis, Stefan Esser, Vincenzo Iozzo, and Ralf-Philipp Weinmann: <a href="https://www.wiley.com/en-us/The+iOS+Hacker%27s+Handbook-p-9781118204305">https://www.wiley.com/en-us/The+iOS+Hacker%27s+Handbook-p-9781118204305</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=58cd2030088f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Websockets Testing Basics]]></title>
            <link>https://medium.com/@7769944853vodafone/websockets-testing-basics-33de85849acf?source=rss-93c4304e9490------2</link>
            <guid isPermaLink="false">https://medium.com/p/33de85849acf</guid>
            <category><![CDATA[websocket-security]]></category>
            <category><![CDATA[websocket]]></category>
            <category><![CDATA[websecurity-testing]]></category>
            <dc:creator><![CDATA[mr_p0tat0]]></dc:creator>
            <pubDate>Sat, 21 Jan 2023 13:56:45 GMT</pubDate>
            <atom:updated>2023-01-21T13:56:45.735Z</atom:updated>
            <content:encoded><![CDATA[<p>WebSockets are a communication protocol that allows for real-time, bidirectional communication between a client and a server. They are commonly used in web applications to enable real-time updates, chat functionality, and other interactive features.</p><p>When working with WebSockets, it is important to consider the security implications of the protocol and to test for vulnerabilities that could be exploited by attackers. In this blog post, we will discuss the basics of WebSockets and the security risks associated with them, and provide an example of how to perform security testing on a WebSocket application.</p><h3>Understanding WebSockets</h3><p>WebSockets are a protocol that allows for real-time communication between a client and a server. They are built on top of the HTTP or HTTPS protocol and use a different handshake process to establish a connection. Once a connection is established, the client and server can send messages to each other without the need for a new request/response cycle.</p><p>WebSockets use the “ws://” and “wss://” protocols to establish a connection between a client and a server. “ws://” is used for unencrypted connections and “wss://” is used for encrypted connections using Transport Layer Security (TLS) protocol. “wss://” ensures a secure communication by encrypting the data transmitted.</p><h3><strong>How to find websocket</strong></h3><p>In order to check if a website is using WebSockets, one simple and easy way is to use the browser developer tools. By opening the developer tools in your browser (usually by pressing F12), and navigating to the “Network” tab, you can observe the network traffic of the website you want to check. By looking for requests with the “ws” protocol in the network traffic, you can quickly determine if the website is using WebSockets. This method is simple and easy to use and doesn’t require any additional tools, it will give you a good idea if a website is using WebSockets or not.</p><h3>How to test websocket</h3><p>To ensure the security of a WebSocket application, it is important to perform thorough testing to identify and mitigate vulnerabilities. The following are some steps that can be taken to perform security testing on a WebSocket application:</p><ol><li><strong>Test for cross-site WebSocket hijacking (CSWSH)</strong>: Attempt to intercept and modify the WebSocket handshake to inject malicious headers. Use tools such as Burp Suite or OWASP ZAP to intercept and modify traffic.</li></ol><blockquote>Using Burp Suite, you can intercept the WebSocket handshake and modify the headers to inject malicious headers. For example, you can modify the “Origin” header to point to a malicious website, and then observe if the server accepts the connection.</blockquote><p><strong>2. Test for cross-site scripting (XSS)</strong>: Attempt to inject malicious code into the data sent over a WebSocket connection. Use tools such as Burp Suite or OWASP ZAP to intercept and modify traffic.</p><blockquote>Using OWASP ZAP, you can intercept the WebSocket traffic and modify the data being sent to inject a payload that would trigger an XSS vulnerability. For example, you can inject a script tag that would execute arbitrary javascript code in the client’s browser.</blockquote><p><strong>3. Test for denial of service (DoS)</strong>: Attempt to flood the WebSocket server with a high volume of requests to determine if it can handle the load. Use tools such as Apache JMeter or Siege to generate a high volume of requests.</p><blockquote>Using Apache JMeter, you can create a test plan that generates a high volume of requests to a WebSocket server. For example, you can create a test plan that sends 1000 WebSocket requests per second to the server, and observe if the server can handle the load.</blockquote><p><strong>4. Test for injection attacks:</strong> Attempt to inject malicious data into the WebSocket connection to see if the server properly validates or sanitizes input data. Use tools such as sqlmap to test for SQL injection vulnerabilities, and OWASP.</p><blockquote>Using sqlmap, you can test for SQL injection vulnerabilities by injecting malicious data into the WebSocket connection. For example, you can inject a payload that would cause the server to execute an arbitrary SQL query and observe if it’s possible to extract sensitive information.</blockquote><p>It’s important to note that intercepting and modifying WebSocket traffic can disrupt the normal communication and cause the website to malfunction. It’s also important to use this feature for testing purposes only, and not for malicious activities.</p><p>In conclusion, security testing of WebSockets applications is important to ensure the application is secure and free from vulnerabilities. A combination of tools, manual testing, code review, and threat modeling should be used for a complete security analysis. Understanding of web application security and WebSockets protocol is crucial for identifying potential vulnerabilities.</p><p>References:</p><ul><li>OWASP WebSocket Security: <a href="https://owasp.org/www-project-web-socket-security/">https://owasp.org/www-project-web-socket-security/</a></li><li>WebSocket Security Cheat Sheet: <a href="https://cheatsheetseries.owasp.org/cheatsheets/WebSocket_Security_Cheat_Sheet.html">https://cheatsheetseries.owasp.org/cheatsheets/WebSocket_Security_Cheat_Sheet.html</a></li><li>WebSocket-Node: <a href="https://github.com/theturtle32/WebSocket-Node">https://github.com/theturtle32/WebSocket-Node</a></li><li>WebSocket Security — Burp Suite: <a href="https://portswigger.net/web-security/websockets">https://portswigger.net/web-security/websockets</a></li><li>WebSockets — OWASP ZAP: <a href="https://owasp.org/www-project-zap/websockets/">https://owasp.org/www-project-zap/websockets/</a></li><li>WebSockets — Apache JMeter: <a href="https://jmeter.apache.org/usermanual/component_reference.html#WebSocket_Sampler">https://jmeter.apache.org/usermanual/component_reference.html#WebSocket_Sampler</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=33de85849acf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HTTP request smuggling Basics]]></title>
            <link>https://medium.com/@7769944853vodafone/http-request-smuggling-basics-9bd466831fd5?source=rss-93c4304e9490------2</link>
            <guid isPermaLink="false">https://medium.com/p/9bd466831fd5</guid>
            <category><![CDATA[proxy-server]]></category>
            <category><![CDATA[crlf-injection]]></category>
            <category><![CDATA[request-smuggling]]></category>
            <dc:creator><![CDATA[mr_p0tat0]]></dc:creator>
            <pubDate>Thu, 19 Jan 2023 16:10:40 GMT</pubDate>
            <atom:updated>2023-01-19T16:10:40.401Z</atom:updated>
            <content:encoded><![CDATA[<p>HTTP request smuggling is a technique used by attackers to exploit vulnerabilities in web servers or intermediate devices such as proxies, load balancers, and firewalls. It involves manipulating the request in such a way that it is interpreted differently by different parts of the system, leading to unexpected behavior.</p><p>One common example of HTTP request smuggling is the “Double CRLF Injection” attack. This attack takes advantage of a vulnerability in servers or intermediaries that use CRLF (carriage return and line feed) to delimit headers in HTTP requests. By injecting a second CRLF before the end of a request, an attacker can create a new request that is interpreted as part of the original request by some parts of the system, but as a separate request by others.</p><p>For example, consider the following HTTP request:</p><blockquote>POST /login HTTP/1.1<br>Host: example.com<br>Content-Type: application/x-www-form-urlencoded<br>Content-Length: 29</blockquote><blockquote>username=test&amp;password=test</blockquote><p>An attacker could inject a second CRLF before the end of the request, like this:</p><blockquote>POST /login HTTP/1.1<br>Host: example.com<br>Content-Type: application/x-www-form-urlencoded<br>Content-Length: 29</blockquote><blockquote>username=test&amp;password=test</blockquote><blockquote>GET /admin HTTP/1.1<br>Host: example.com</blockquote><p>This request would be interpreted by some parts of the system as a single request to login with the username “test” and password “test”, but by others as two separate requests: one to login, and one to access the admin page. Depending on how the server or intermediary is configured, this can allow the attacker to bypass authentication or access restricted resources.</p><p>There are several different types of HTTP request smuggling attacks, each of which takes advantage of different vulnerabilities in web servers or intermediaries.</p><ol><li>“Double CRLF Injection” attack: This attack takes advantage of a vulnerability in servers or intermediaries that use CRLF (carriage return and line feed) to delimit headers in HTTP requests. By injecting a second CRLF before the end of a request, an attacker can create a new request that is interpreted as part of the original request by some parts of the system, but as a separate request by others.</li></ol><p>Example:</p><blockquote>POST /login HTTP/1.1<br>Host: example.com<br>Content-Type: application/x-www-form-urlencoded<br>Content-Length: 29</blockquote><blockquote>username=test&amp;password=test</blockquote><blockquote>GET /admin HTTP/1.1<br>Host: example.com</blockquote><p>2. “Transfer-Encoding Chunked” attack: This attack takes advantage of a vulnerability in servers or intermediaries that use the “Transfer-Encoding: chunked” header to handle requests with variable-length bodies. By injecting a second “chunked” encoded payload, an attacker can create a new request that is interpreted as part of the original request by some parts of the system, but as a separate request by others.</p><p>Example:</p><blockquote>POST /login HTTP/1.1<br>Host: example.com<br>Content-Type: application/x-www-form-urlencoded<br>Transfer-Encoding: chunked</blockquote><blockquote>5<br>username<br>6<br>=test&amp;<br>5<br>passwo<br>4<br>rd=test<br>0</blockquote><blockquote>GET /admin HTTP/1.1<br>Host: example.com</blockquote><p>3. “Content-Length” attack: This attack takes advantage of a vulnerability in servers or intermediaries that use the “Content-Length” header to handle requests with a fixed-length bodies. By injecting a new request by manipulating the “Content-Length” header, an attacker can create a new request that is interpreted as part of the original request by some parts of the system, but as a separate request by others.</p><p>Example:</p><blockquote>POST /login HTTP/1.1<br>Host: example.com<br>Content-Type: application/x-www-form-urlencoded<br>Content-Length: 57</blockquote><blockquote>username=test&amp;password=test<br>GET /admin HTTP/1.1<br>Host: example.com</blockquote><p>It is important to note that these are just examples and there are many variations to these attacks, but these are the most commonly used ones. To prevent these types of attacks, it is important to properly validate and handle multiple requests in a single stream, and to properly delimit headers in requests. Additionally, it is important to keep software up-to-date and apply security patches as soon as they become available.</p><p>To prevent HTTP request smuggling, web server and intermediary software should be configured to properly validate and handle multiple requests in a single stream, and to properly delimit headers in requests. It is also important to keep software up-to-date and apply security patches as soon as they become available.</p><p>In conclusion, HTTP request smuggling is a technique that attackers can use to exploit vulnerabilities in web servers and intermediaries. By injecting a second CRLF before the end of a request, an attacker can create a new request that is interpreted as part of the original request by some parts of the system, but as a separate request by others.</p><p>References:</p><p><a href="https://portswigger.net/web-security/request-smuggling">HTTP request smuggling</a></p><p><a href="https://www.youtube.com/watch?v=w-eJM2Pc0KI">https://www.youtube.com/watch?v=w-eJM2Pc0KI</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9bd466831fd5" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>