ronin-rb / ronin-recon

A micro-framework and tool for performing reconnaissance.
https://ronin-rb.dev
GNU Lesser General Public License v3.0
34 stars 9 forks source link

Add an animated SVG of `ronin-recon run` in action to the README #150

Open postmodern opened 3 months ago

postmodern commented 3 months ago

The README needs an animated SVG of ronin-recon run finding things. Use termtosvg with the window_frame theme.

AI-Mozi commented 2 months ago

ronin_recon_run

Something like this? Without error messages ofc 😅

AI-Mozi commented 2 months ago

It's kinda long tho..

postmodern commented 2 months ago

Here's the Ruby script I used (called autoshell) to simulate typing in the terminal which is then recorded by termtosvg.

#!/usr/bin/env ruby

def write_line(line, delay: 0.05, jitter: 0.0..0.06)
  line.each_char do |c|
    $stdout.putc(c)

    sleep(delay + rand(jitter))
  end
end

def type_command(command, pause: 0.5)
  # print the prompt
  print "$ "

  write_line(line, **kwargs)

  # pause before executing the command
  sleep(pause)

  puts
end

def run_command(command, **kwargs)
  type_command(command,**kwargs)

  begin
    # execute the command
    system(command)
  rescue Interrupt
    puts
  end
end

ARGF.each_line(chomp: true) do |line|
  run_command(line)
end

and here's the shell script I used to auto-type a command, run it, and record it.

#!/usr/bin/env bash

utils_dir="${BASH_SOURCE%/*}"

theme="window_frame"

function print_usage()
{
    cat <<USAGE
usage: $0 [OPTIONS] TXT_FILE [SVG_FILE]

Options:
    --javascript        Create an animated SVG with JavaScript controls
    --noscript      Create an animated SVG without JavaScript
    -h, --help      Prints this message

USAGE
}

function parse_options()
{
    local argv=()

    while [[ $# -gt 0 ]]; do
        case "$1" in
            --javascript)
                theme="window_frame_js"
                shift
                ;;
            --noscript)
                theme="window_frame"
                shift
                ;;
            -h|--help)
                print_usage
                exit
                ;;
            -*)
                echo "$0: unrecognized option $1" >&2
                return 1
                ;;
            *)
                argv+=($1)
                shift
                ;;
        esac
    done

    case "${#argv[@]}" in
        1)
            input="${argv[0]}"
            output="${input%.txt}.svg"
            ;;
        2)
            input="${argv[0]}"
            output="${argv[1]}"
            ;;
        0)
            echo "$0: too few arguments given" >&2
            return 1
            ;;
        *)
            echo "$0: too many arguments given" >&2
            return 1
            ;;
    esac
}

parse_options "$@" || exit $?

termtosvg "$output" -t "$theme" -c "$utils_dir/autoshell $input"

Both scripts are designed to live in a utils/ directory. Might also want to run it on a faster internet connection or something without a firewall/NAT which can slow down nmap.

AI-Mozi commented 2 months ago

I have a 300Mbps download, so I thought it's enough..

postmodern commented 2 months ago

@AI-Mozi also maybe try changing your system DNS to 1.1.1.1 or 8.8.8.8. The DNS workers should be finding sub-domains much faster while nmap continuous to port scan.