<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Marília Rocha</title>
    <description>The latest articles on DEV Community by Marília Rocha (@malwarilias).</description>
    <link>https://dev.to/malwarilias</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2929856%2Fb4b20cf1-2917-4592-992f-779cd94171a1.jpg</url>
      <title>DEV Community: Marília Rocha</title>
      <link>https://dev.to/malwarilias</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/malwarilias"/>
    <language>en</language>
    <item>
      <title>How I created a successful recon tool for bug hunters and how you can build one too</title>
      <dc:creator>Marília Rocha</dc:creator>
      <pubDate>Tue, 22 Jul 2025 22:21:56 +0000</pubDate>
      <link>https://dev.to/malwarilias/how-i-created-a-successful-recon-tool-for-bug-hunters-and-how-you-can-build-one-too-1fg8</link>
      <guid>https://dev.to/malwarilias/how-i-created-a-successful-recon-tool-for-bug-hunters-and-how-you-can-build-one-too-1fg8</guid>
      <description>&lt;p&gt;Recon is one of the most important steps when you’re looking for vulnerabilities. I use several tools in my workflow to speed things up, and one of the ones I created myself is called malwaricon (&lt;a href="https://github.com/mrlrch/malwaricon" rel="noopener noreferrer"&gt;GitHub link&lt;/a&gt;). I based it on a script originally written at MIT and adapted it to fit how I work during bug bounty programs.&lt;/p&gt;

&lt;p&gt;malwaricon helped me spot new assets, map out endpoints quickly, and keep my recon work organized-all with a single script. It’s been super useful, and if it worked for me, you can definitely create something even better for yourself.&lt;/p&gt;

&lt;p&gt;In this post, I’m going to walk you through exactly how I built this script, step by step. No magic, no black box, just plain Bash scripting and some great open-source tools. By the end, you’ll have your own recon framework to use and expand.&lt;br&gt;
Why write your own recon script?&lt;/p&gt;

&lt;p&gt;Yes, there are a ton of great tools out there like Amass, Subfinder, Assetfinder, and more. Each of them is good at one thing. But if you want to automate your workflow and stop running the same commands over and over again, writing your own recon script can make a huge difference.&lt;/p&gt;

&lt;p&gt;Here’s what you gain:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;You control everything: You choose which tools to run, how they run, and where the output goes.
It saves time: No more typing long commands by hand. Just run a script and let it handle the rest.
It’s flexible: Add or remove tools whenever you want. Tweak it as your methodology evolves.
You get organized results: Save output in structured folders, generate reports, and track changes over time.
You can automate everything: Schedule scans with cron, track differences with Git, and get alerts when something changes.
You learn a lot: Building the script forces you to understand how tools like Nmap, Dirsearch, and crt.sh actually work.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;This isn’t just for beginners either. Even experienced bug hunters use scripts like this to streamline their workflow. With something like malwaricon, recon becomes a fast, repeatable, and reliable part of your routine.&lt;br&gt;
Understanding bash scripting basics&lt;/p&gt;

&lt;p&gt;Let’s start by writing a simple Bash script. Open any text editor. Every script should begin with a shebang line to declare the interpreter:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;#!/bin/bash&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This tells the system to use Bash to run the script. Let’s say we want to run Nmap and Dirsearch against a target:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;#!/bin/bash&lt;br&gt;
nmap scanme.nmap.org&lt;br&gt;
/PATH/TO/dirsearch.py -u scanme.nmap.org -e php&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Not very flexible yet. Let’s modify it to accept a target domain from the user:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;#!/bin/bash&lt;br&gt;
nmap $1&lt;br&gt;
/PATH/TO/dirsearch.py -u $1 -e php&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Here, $1 is the first argument passed to the script (your domain). If you run:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;./recon.sh scanme.nmap.org&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;It will scan that domain.&lt;/p&gt;

&lt;p&gt;But what if dirsearch.py isn’t in the same folder? You’ll need the full path:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/PATH/TO/dirsearch.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or you can add the folder to your system’s PATH so it can be called from anywhere:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;export PATH="/your/dirsearch/path:$PATH"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;To make that change permanent, add it to your ~/.bash_profile.&lt;/p&gt;

&lt;p&gt;Now update the script like this:&lt;br&gt;
`&lt;/p&gt;
&lt;h1&gt;
  
  
  !/bin/bash
&lt;/h1&gt;

&lt;p&gt;nmap $1&lt;br&gt;
dirsearch.py -u $1 -e php`&lt;/p&gt;

&lt;p&gt;Save the file as recon.sh and make it executable:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;chmod +x recon.sh&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now you can run it like this:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;./recon.sh scanme.nmap.org&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If you get a permission error, it’s likely the file isn’t executable yet. The chmod command fixes that.&lt;br&gt;
Saving tool output to files&lt;/p&gt;

&lt;p&gt;To make your recon work easier to review later, you’ll want to save the output into organized folders. Let’s improve the script by creating a directory for each scan and redirecting the output of the tools into specific files:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#!/bin/bash
echo "Creating directory $1_recon."
mkdir $1_recon
nmap $1 &amp;gt; $1_recon/nmap
echo "The results of nmap scan are stored in $1_recon/nmap."
/PATH/TO/dirsearch.py -u $1 -e php --simple-report=$1_recon/dirsearch
echo "The results of dirsearch scan are stored in $1_recon/dirsearch."
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This version:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Creates a folder named domain_recon.
Stores the Nmap result in nmap.
Stores the Dirsearch result in dirsearch.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;We can make this even cleaner by using variables:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#!/bin/bash
PATH_TO_DIRSEARCH="/Users/yourname/tools/dirsearch"
DOMAIN=$1
DIRECTORY=${DOMAIN}_recon
echo "Creating directory $DIRECTORY."
mkdir $DIRECTORY
nmap $DOMAIN &amp;gt; $DIRECTORY/nmap
echo "The results of nmap scan are stored in $DIRECTORY/nmap."
$PATH_TO_DIRSEARCH/dirsearch.py -u $DOMAIN -e php --simple-report=$DIRECTORY/dirsearch
echo "The results of dirsearch scan are stored in $DIRECTORY/dirsearch."
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This small change will help you avoid hardcoding values and make your script easier to update later if needed.&lt;br&gt;
Adding the date of the scan to the output&lt;/p&gt;

&lt;p&gt;Sometimes you want to know exactly when a scan was performed. You can add the current date to your script’s output by using command substitution in Bash. Here’s how:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#!/bin/bash
PATH_TO_DIRSEARCH="/Users/yourname/tools/dirsearch"
TODAY=$(date)
echo "This scan was created on $TODAY"
DOMAIN=$1
DIRECTORY=${DOMAIN}_recon
echo "Creating directory $DIRECTORY."
mkdir $DIRECTORY
nmap $DOMAIN &amp;gt; $DIRECTORY/nmap
echo "The results of nmap scan are stored in $DIRECTORY/nmap."
$PATH_TO_DIRSEARCH/dirsearch.py -u $DOMAIN -e php --simple-report=$DIRECTORY/dirsearch
echo "The results of dirsearch scan are stored in $DIRECTORY/dirsearch."
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, the command $(date) runs the system date command and stores the output in the variable TODAY. Then you print that out as a message.&lt;br&gt;
Adding options to choose the tools to run&lt;/p&gt;

&lt;p&gt;Maybe you want to choose whether to run only Nmap, only Dirsearch, or both. You can add a second argument to specify the scan mode and then use conditional statements to decide what to run.&lt;/p&gt;

&lt;p&gt;Here’s an example using if-else:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#!/bin/bash
PATH_TO_DIRSEARCH="/Users/yourname/tools/dirsearch"
TODAY=$(date)
echo "This scan was created on $TODAY"
DOMAIN=$1
DIRECTORY=${DOMAIN}_recon
echo "Creating directory $DIRECTORY."
mkdir $DIRECTORY 

if [ "$2" == "nmap-only" ]; then
  nmap $DOMAIN &amp;gt; $DIRECTORY/nmap
  echo "The results of nmap scan are stored in $DIRECTORY/nmap."
elif [ "$2" == "dirsearch-only" ]; then  
  $PATH_TO_DIRSEARCH/dirsearch.py -u $DOMAIN -e php --simple-report=$DIRECTORY/dirsearch
  echo "The results of dirsearch scan are stored in $DIRECTORY/dirsearch."
else
  nmap $DOMAIN &amp;gt; $DIRECTORY/nmap
  echo "The results of nmap scan are stored in $DIRECTORY/nmap."
  $PATH_TO_DIRSEARCH/dirsearch.py -u $DOMAIN -e php --simple-report=$DIRECTORY/dirsearch
  echo "The results of dirsearch scan are stored in $DIRECTORY/dirsearch."
fi
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Using case statements to simplify multiple options&lt;/p&gt;

&lt;p&gt;If you want to add more options (like a third tool crt.sh), using if-else can get messy. Instead, you can use a case statement for cleaner code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#!/bin/bash
PATH_TO_DIRSEARCH="/Users/yourname/tools/dirsearch"
TODAY=$(date)
echo "This scan was created on $TODAY"
DOMAIN=$1
DIRECTORY=${DOMAIN}_recon
echo "Creating directory $DIRECTORY."
mkdir $DIRECTORY
case $2 in
  nmap-only)
    nmap $DOMAIN &amp;gt; $DIRECTORY/nmap
    echo "The results of nmap scan are stored in $DIRECTORY/nmap."
    ;;
  dirsearch-only)
    $PATH_TO_DIRSEARCH/dirsearch.py -u $DOMAIN -e php --simple-report=$DIRECTORY/dirsearch
    echo "The results of dirsearch scan are stored in $DIRECTORY/dirsearch."
    ;;         
  crt-only)       
    curl "https://crt.sh/?q=$DOMAIN&amp;amp;output=json" -o $DIRECTORY/crt
    echo "The results of cert parsing is stored in $DIRECTORY/crt."
    ;;
  *)
    nmap $DOMAIN &amp;gt; $DIRECTORY/nmap
    echo "The results of nmap scan are stored in $DIRECTORY/nmap."
    $PATH_TO_DIRSEARCH/dirsearch.py -u $DOMAIN -e php --simple-report=$DIRECTORY/dirsearch
    echo "The results of dirsearch scan are stored in $DIRECTORY/dirsearch."
    curl "https://crt.sh/?q=$DOMAIN&amp;amp;output=json" -o $DIRECTORY/crt
    echo "The results of cert parsing is stored in $DIRECTORY/crt."
    ;;
esac

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Creating functions to avoid code repetition&lt;/p&gt;

&lt;p&gt;To keep the script tidy, define functions for each scan:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#!/bin/bash
PATH_TO_DIRSEARCH="/Users/yourname/tools/dirsearch"
TODAY=$(date)
echo "This scan was created on $TODAY"
DOMAIN=$1
DIRECTORY=${DOMAIN}_recon
echo "Creating directory $DIRECTORY."
mkdir $DIRECTORY

nmap_scan() {
  nmap $DOMAIN &amp;gt; $DIRECTORY/nmap
  echo "The results of nmap scan are stored in $DIRECTORY/nmap."
}

dirsearch_scan() {
  $PATH_TO_DIRSEARCH/dirsearch.py -u $DOMAIN -e php --simple-report=$DIRECTORY/dirsearch
  echo "The results of dirsearch scan are stored in $DIRECTORY/dirsearch."
}

crt_scan() {
  curl "https://crt.sh/?q=$DOMAIN&amp;amp;output=json" -o $DIRECTORY/crt
  echo "The results of cert parsing is stored in $DIRECTORY/crt."
}

case $2 in
  nmap-only)
    nmap_scan
    ;;
  dirsearch-only)
    dirsearch_scan
    ;;         
  crt-only)       
    crt_scan
    ;;
  *)
    nmap_scan
    dirsearch_scan
    crt_scan
    ;;     
esac

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Parsing the results with grep and jq&lt;/p&gt;

&lt;p&gt;After your scans finish, you’ll have output files packed with information. Reading all that manually can be tedious and inefficient. To speed things up, you can use grep to search for specific patterns in files and jq to parse JSON output, like from crt.sh.&lt;br&gt;
Using grep to filter Nmap output&lt;/p&gt;

&lt;p&gt;For example, Nmap’s default output contains lots of status lines, but you might only want the lines showing open ports. Those typically have three columns: port, state, and service.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;grep -E "^\s*\S+\s+\S+\s+\S+\s*$" $DIRECTORY/nmap &amp;gt; $DIRECTORY/nmap_cleaned&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Explanation:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;The -E option enables extended regular expressions
The regex matches lines with exactly three non-whitespace strings separated by spaces, filtering out unnecessary lines.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;Running this command produces nmap_cleaned, a clean list of ports and their states.&lt;br&gt;
Using jq to extract data from crt.sh JSON&lt;/p&gt;

&lt;p&gt;crt.sh returns JSON containing many fields. To extract all domain names from certificates, use:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;jq -r ".[] | .name_value" $DIRECTORY/crt&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Explanation:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-r outputs raw strings (no quotes).
.[] iterates over each item in the JSON array.
.name_value pulls out the domain names
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;Building a master report&lt;/p&gt;

&lt;p&gt;To combine everything into a single report file, you can aggregate the outputs like this:&lt;/p&gt;

&lt;p&gt;echo "Generating recon report..."&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;TODAY=$(date)
echo "This scan was created on $TODAY" &amp;gt; $DIRECTORY/report

echo "Results for Nmap:" &amp;gt;&amp;gt; $DIRECTORY/report
grep -E "^\s*\S+\s+\S+\s+\S+\s*$" $DIRECTORY/nmap &amp;gt;&amp;gt; $DIRECTORY/report

echo "Results for Dirsearch:" &amp;gt;&amp;gt; $DIRECTORY/report
cat $DIRECTORY/dirsearch &amp;gt;&amp;gt; $DIRECTORY/report

echo "Results for crt.sh:" &amp;gt;&amp;gt; $DIRECTORY/report
jq -r ".[] | .name_value" $DIRECTORY/crt &amp;gt;&amp;gt; $DIRECTORY/report
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This report file will be nicely organized, containing everything you need to analyze your target in one place.&lt;br&gt;
Scanning multiple domains with getopts and loops&lt;/p&gt;

&lt;p&gt;Sometimes you want to scan several domains at once, for example:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;./recon.sh -m nmap-only example.com test.com&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Here, -m specifies the scan mode (like nmap-only), and the rest are domains.&lt;br&gt;
Parsing options with getopts&lt;/p&gt;

&lt;p&gt;getopts helps you handle flags and their values. Here’s how to parse the -m option for mode:&lt;/p&gt;

&lt;p&gt;`getopts "m:" OPTION&lt;br&gt;
MODE=$OPTARG&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"m:" means -m expects an argument.
$OPTARG stores the argument’s value (e.g., nmap-only).
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;`&lt;br&gt;
Looping through domains&lt;/p&gt;

&lt;p&gt;After parsing options, $OPTIND tells you the index of the first non-option argument (the domains). You can loop through all domains like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for DOMAIN in "${@:$OPTIND:$#}"; do
  DIRECTORY=${DOMAIN}_recon
  echo "Creating directory $DIRECTORY."
  mkdir $DIRECTORY
  # call your scan functions here based on $MODE
done

"${@:$OPTIND:$#}" slices the arguments array from the first domain onward.

#!/bin/bash

PATH_TO_DIRSEARCH="/Users/yourname/tools/dirsearch"

nmap_scan() {
  nmap $DOMAIN &amp;gt; $DIRECTORY/nmap
  echo "The results of nmap scan are stored in $DIRECTORY/nmap."
}

dirsearch_scan() {
  $PATH_TO_DIRSEARCH/dirsearch.py -u $DOMAIN -e php --simple-report=$DIRECTORY/dirsearch
  echo "The results of dirsearch scan are stored in $DIRECTORY/dirsearch."
}

crt_scan() {
  curl "https://crt.sh/?q=$DOMAIN&amp;amp;output=json" -o $DIRECTORY/crt
  echo "The results of cert parsing is stored in $DIRECTORY/crt."
}

getopts "m:" OPTION
MODE=$OPTARG

for DOMAIN in "${@:$OPTIND:$#}"; do
  DIRECTORY=${DOMAIN}_recon
  echo "Creating directory $DIRECTORY."
  mkdir $DIRECTORY
  case $MODE in
    nmap-only)
      nmap_scan
      ;;
    dirsearch-only)
      dirsearch_scan
      ;;
    crt-only)
      crt_scan
      ;;
    *)
      nmap_scan
      dirsearch_scan
      crt_scan
      ;;
  esac

  echo "Generating recon report for $DOMAIN..."
  TODAY=$(date)
  echo "This scan was created on $TODAY" &amp;gt; $DIRECTORY/report

  if [ -f $DIRECTORY/nmap ]; then
    echo "Results for Nmap:" &amp;gt;&amp;gt; $DIRECTORY/report
    grep -E "^\s*\S+\s+\S+\s+\S+\s*$" $DIRECTORY/nmap &amp;gt;&amp;gt; $DIRECTORY/report
  fi

  if [ -f $DIRECTORY/dirsearch ]; then
    echo "Results for Dirsearch:" &amp;gt;&amp;gt; $DIRECTORY/report
    cat $DIRECTORY/dirsearch &amp;gt;&amp;gt; $DIRECTORY/report
  fi

  if [ -f $DIRECTORY/crt ]; then
    echo "Results for crt.sh:" &amp;gt;&amp;gt; $DIRECTORY/report
    jq -r ".[] | .name_value" $DIRECTORY/crt &amp;gt;&amp;gt; $DIRECTORY/report
  fi
done
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Writing a function library&lt;/p&gt;

&lt;p&gt;As your scripts grow, it’s best to keep your commonly used functions in a separate file, so you can reuse them easily.&lt;/p&gt;

&lt;p&gt;Create a file called scan.lib with your scan functions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#!/bin/bash

nmap_scan() {
  nmap $DOMAIN &amp;gt; $DIRECTORY/nmap
  echo "The results of nmap scan are stored in $DIRECTORY/nmap."
}

dirsearch_scan() {
  $PATH_TO_DIRSEARCH/dirsearch.py -u $DOMAIN -e php --simple-report=$DIRECTORY/dirsearch
  echo "The results of dirsearch scan are stored in $DIRECTORY/dirsearch."
}

crt_scan() {
  curl "https://crt.sh/?q=$DOMAIN&amp;amp;output=json" -o $DIRECTORY/crt
  echo "The results of cert parsing is stored in $DIRECTORY/crt."
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, in your main script, source the library to access these functions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#!/bin/bash

source ./scan.lib
PATH_TO_DIRSEARCH="/Users/yourname/tools/dirsearch"

# rest of your script here

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This way, you keep your main script clean and focused.&lt;br&gt;
Adding an interactive mode&lt;/p&gt;

&lt;p&gt;Sometimes, instead of passing domains as arguments, you might want to enter them one by one during execution.&lt;/p&gt;

&lt;p&gt;You can add an interactive mode triggered by a flag (like -i), and use a while loop to prompt the user:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;while getopts "m:i" OPTION; do
  case $OPTION in
    m)
      MODE=$OPTARG
      ;;
    i)
      INTERACTIVE=true
      ;;
  esac
done

scan_domain() {
  DOMAIN=$1
  DIRECTORY=${DOMAIN}_recon
  echo "Creating directory $DIRECTORY."
  mkdir $DIRECTORY
  case $MODE in
    nmap-only)
      nmap_scan
      ;;
    dirsearch-only)
      dirsearch_scan
      ;;
    crt-only)
      crt_scan
      ;;
    *)
      nmap_scan
      dirsearch_scan
      crt_scan
      ;;
  esac
}

report_domain() {
  DOMAIN=$1
  DIRECTORY=${DOMAIN}_recon
  echo "Generating recon report for $DOMAIN..."
  TODAY=$(date)
  echo "This scan was created on $TODAY" &amp;gt; $DIRECTORY/report
  if [ -f $DIRECTORY/nmap ]; then
    echo "Results for Nmap:" &amp;gt;&amp;gt; $DIRECTORY/report
    grep -E "^\s*\S+\s+\S+\s+\S+\s*$" $DIRECTORY/nmap &amp;gt;&amp;gt; $DIRECTORY/report
  fi
  if [ -f $DIRECTORY/dirsearch ]; then
    echo "Results for Dirsearch:" &amp;gt;&amp;gt; $DIRECTORY/report
    cat $DIRECTORY/dirsearch &amp;gt;&amp;gt; $DIRECTORY/report
  fi
  if [ -f $DIRECTORY/crt ]; then
    echo "Results for crt.sh:" &amp;gt;&amp;gt; $DIRECTORY/report
    jq -r ".[] | .name_value" $DIRECTORY/crt &amp;gt;&amp;gt; $DIRECTORY/report
  fi
}

if [ "$INTERACTIVE" ]; then
  INPUT=""
  while [ "$INPUT" != "quit" ]; do
    echo "Please enter a domain (or type 'quit' to exit):"
    read INPUT
    if [ "$INPUT" != "quit" ]; then
      scan_domain "$INPUT"
      report_domain "$INPUT"
    fi
  done
else
  # process domains from command line as before
fi

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Scheduling automatic scans with cron&lt;/p&gt;

&lt;p&gt;To automate running your recon regularly, use cron jobs.&lt;/p&gt;

&lt;p&gt;Edit your crontab:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;crontab -e&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Add a line like this to run your script every day at 9:30 PM:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;30 21 * * * /path/to/recon.sh example.com&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;You can also run a script to commit scan results to GitHub and get notifications when new findings appear.&lt;br&gt;
Example usage and explanations&lt;/p&gt;

&lt;p&gt;After saving your script (e.g., recon.sh) and making it executable (chmod +x recon.sh), here’s how to use it:&lt;br&gt;
Running a full scan on one domain&lt;/p&gt;

&lt;p&gt;&lt;code&gt;./recon.sh example.com&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This runs all scans (Nmap, Dirsearch, and crt.sh) against example.com, saving the results in the example.com_recon folder, with a master report summarizing everything.&lt;br&gt;
Running only Nmap scans&lt;/p&gt;

&lt;p&gt;&lt;code&gt;./recon.sh example.com nmap-only&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This runs just Nmap for the target domain.&lt;br&gt;
Running scans on multiple domains&lt;/p&gt;

&lt;p&gt;&lt;code&gt;./recon.sh -m dirsearch-only example.com test.com&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This runs Dirsearch scans on both domains sequentially.&lt;br&gt;
Using interactive mode&lt;/p&gt;

&lt;p&gt;&lt;code&gt;./recon.sh -i -m nmap-only&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The script enters interactive mode, prompting you to enter domains one by one (type quit to exit). It runs Nmap only on each input.&lt;br&gt;
Final tips&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Customize tools and flags: You can add more tools, change flags, or add output parsing to suit your recon style.
Schedule scans: Use cron jobs to automate your recon and stay updated on target changes.
Version control: Keep your scripts and output in Git to track changes and collaborate.
Expand the script: Integrate other tools like Amass, Subfinder, or your custom checks.
Learn Bash: The more comfortable you get scripting, the more powerful and flexible your recon process becomes.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Building your own recon tool like this can save you hours, keep your workflow consistent, and give you a deeper understanding of the tools and processes behind recon. With malwaricon as a solid starting point, you can tweak and scale your recon to fit any bug bounty program or pentesting engagement.&lt;/p&gt;

&lt;p&gt;Happy hunting!&lt;/p&gt;

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