Giter VIP home page Giter VIP logo

reconpi's Introduction

Recon Pi

__________                          __________.__ 
\______   \ ____   ____  ____   ____\______   \__|
 |       _// __ \_/ ___\/  _ \ /    \|     ___/  |
 |    |   \  ___/\  \__(  <_> )   |  \    |   |  |
 |____|_  /\___  >\___  >____/|___|  /____|   |__|
        \/     \/     \/           \/             
                            
			v2.2 - @x1m_martijn 

ReconPi - A lightweight recon tool that performs extensive reconnaissance with the latest tools using a Raspberry Pi.

Start using that Raspberry Pi -- I know you all have one laying around somewhere ;)

Since version 2.1 ReconPi is usable on your VPS, thanks to Sachin Grover for putting in a lot of work.

The latest HypriotOS image works perfect for Raspberry Pi's!

Easy installation

Connect to your ReconPi or VPS with SSH:

ssh [email protected] [Edit IP address if needed]

Curl the install.sh script and run it: curl -L https://raw.githubusercontent.com/x1mdev/ReconPi/master/install.sh | bash

Manual installation

Connect to your system with SSH:

$ ssh [email protected] [Edit IP address if needed]

Now we can set up everything, it's quite simple:

  • git clone https://github.com/x1mdev/ReconPi.git
  • cd ReconPi
  • ./install.sh

Grab a cup of coffee since this will take a while.

Usage

After installing all of the dependencies for the ReconPi you can finally start doing some recon!

$ recon <domain.tld>

recon.sh will first gather resolvers for the given target, followed by subdomain enumeration and checking those assets for potential subdomain takeover. When this is done the IP addresses of the target are enumerated. Open ports will be discovered accompanied by a service scan provided by Nmap.

Nuclei and its templates have been implemented in the routine!

Finally the live targets will be screenshotted and evaluated to discover endpoints.

Results will be stored on the Recon Pi and can be viewed by running `python -m SimpleHTTPServer 1337" in your results directory. Your results will be accessible from any system with a browser that exists in the same network.

Make sure to add your SLACK token to the tokens.txt file if you want to get slack notification after the completion of recon process.

Sample Token.txt ($HOME/ReconPi/configs/tokens.txt)

github_subdomains_token=""
SLACK_WEBHOOK_URL="https://hooks.slack.com/services/xxx/xxx/xxx"
findomain_spyse_token=""
findomain_virustotal_token=""
findomain_securitytrails_token=""
CHAOS_KEY=""
hackerhandle="reconpi"

Config Files (Note: config file for amass, subfinder and naabu are stored inside ReconPi/configs/ folder, provide your api keys in these files)

Input your API keys in these files to get better results

Subfinder Config file path : $HOME/ReconPi/configs/config.yaml

Amass Config file path : $HOME/ReconPi/configs/config.ini

We have added a $hackerhandle which is used in the nuclei scans. An additional x-bug-bounty: reconpi header will be added, please update this with your own handle :)

Scripts

  • Script folder contains a script named daily which can be used as a cronjob to run subdomain enumeration automatically.

  • Methodology is to take already enumerated subdomains as input and use amass on top of them, then track their last 2 result, and alert new subdomains on slack.

Tools

Tools that will be installed:

Methodology

  • gatherResolvers
  • gatherSubdomains
  • checkTakeovers
  • getCNAME
  • gatherIPs
  • gatherScreenshots
  • startMeg
  • fetchArchive
  • fetchEndpoints
  • runNuclei
  • portScan
  • notifySlack

Subdomain Enumeration:

  • Sublert

  • Subfinder

  • assetfinder

  • amass

  • findomain (Add findomain sources token to get better result)

  • chaos dataset

  • github-subdomains

  • dns.bufferover.run

  • Mutate above Subdomains using commonspeak subdomain list

  • Combine and Sort above result -> Use shuffledns to resolve -> dnsgen(to mutate) -> httprobe (to get alive hosts)

  • Check takeover using subjack and nuclei

  • Get CNAME to check manually for takeovers

  • Use dnsprobe to gather IP, ignore if they fall in cloudflare ip range

  • Do masscan and then nmap scan on them, also use http-title and vulners script.

  • Take Screenshot for visual recon

  • Use gau to to get archive urls, get paramlist, jsurls, phpurls, aspxurls, and jspurls in there own files.

  • Get Endpoints using Linkfinder

  • Run Nuclei Scripts on alive hosts

  • Notify on Slack channel if token is specified.

  • Directory Buteforcing (Not enabled, as it takes long time, it is better to do manually)

More tools will be added in the future, feel free to make a pull request!

Contributors

reconpi's People

Contributors

anu-bhav avatar bjhulst avatar haones avatar kre80r avatar mavericknerd avatar maxvaer avatar theyosh avatar wh1tenoise avatar x1mdev avatar x86shell avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

reconpi's Issues

add

add ffufplus

Laravel environment

  • Add a docker environment for the Laravel app (lightweight and easier to setup for the install script)

v0.2.0 changelog (work in progress)

  • Added Laravel application and dependencies in the install script

  • Updated the nginx config file to fit the Laravel app

  • Added native Golang and changed subfinder usage from Docker to Golang

  • Added RVM and Ruby, which makes Aquatone usable without Docker.

full commit info: 7f0babe

Possibly wrong list for portscan

Describe the bug
It looks like that the loop for nmap is using a wrong list? At https://github.com/x1mdev/ReconPi/blob/master/recon.sh#L131 the file with host names is used for scanning ports. But in that list there could be a lot of hosts with the same ip (all subdomains). That would take a long time to scan the same host.

To Reproduce
Run the scan against a wildcard DNS domain. All subdomains are valid and producing an IP

Expected behavior
Use the list of "$IPS"/"$domain"-ips.txt of line https://github.com/x1mdev/ReconPi/blob/master/recon.sh#L123 In there are the unique IP numbers of all the subdomain hosts.

Screenshots
None

Desktop (please complete the following information):
Linux black-pearl 4.19.75-v7+ #1270 SMP Tue Sep 24 18:45:11 BST 2019 armv7l GNU/Linux (RPI 3B+)

Additional context
I think that port scanning is not depending on (v)host names. So therefore I would think that only the unique IP address are enough for port scanning. Could be wrong....

Error in Nuclei Templates

Describe the bug
When running an fresh ReconPi installation into an Raspberry Pi 2 + Ubuntu Server 20.04, Nuclei can't run because of missing template folder.
I already downloaded manually those Templates into /home/user/tools but ReconPi seems not find it.

To Reproduce
Steps to reproduce the behavior:

  1. Just install a fresh ReconPi and run it.

Screenshots
0

Add GF into workflow

GFSCAN="$RESULTDIR/gfscan"

: 'Use gf to find secrets in meg file'
startGfScan(){
startFunction "Gf scan in meg files"
cd "$SUBS"/meg
for i in gf -list;
do
gf ${i} > "$GFSCAN"/"${i}".txt
[[ -s "$GFSCAN"/"${i}".txt ]] || rm "$GFSCAN"/"${i}".txt
done
cd -
}

startGfScan # add function after startMeg to run

Running out of memory while installing on Raspi1B

Describe the bug
Installation script throws fatal error when the machine runs out of memory, both in Raspbian and HypriotOS.

To Reproduce
Steps to reproduce the behavior:

  1. Install fresh Raspbian OR HypriotOS
  2. curl or git clone the installation script.
  3. run the installation script
  4. somewhere in the middle of the installation, a fatal error: runtime: out of memory is thrown.

Expected behavior
The installation script should go well in RP1B.

Screenshots
Screenshot (error from half of the picture)

Desktop (please complete the following information):

  • OS: Raspbian Bullseye AND HypriotOS
  • Browser: none.

resolveddomains.txt no data entry

The grep function needs to be a bit more specific, it does grep $URL >> domains.txt and if there is an empty subdomain like .sub.domain.tld it will give an error:

[+] Subfinder scan complete, checking which domains resolve..
host: '' is not in legal name syntax (unexpected end of input)
[+] Resolved domains written to resolveddomains.txt

It still writes the output but it's a bit messy

GO tools not installed during install.sh

After the automated installation of Golang the Go tools are not installed, go, command not found.

When the device is rebooted after installation the tools can be installed..

sublert.py ImportError: No module named 'tld'

Describe the bug
running recon on a tld I get a traceback and an error telling me it cannot import module named 'tld' even though it is a fresh install and followed the easy install method.

To Reproduce
Steps to reproduce the behavior:

  1. Install Hypriot image (version 1.10.0)
  2. Login to PI
  3. install using curl -L https://raw.githubusercontent.com/x1mdev/ReconPi/master/install.sh | bash
  4. recon domain

Expected behavior
I expect to get no errors

Screenshots
image

Desktop (please complete the following information):

  • OS: Hypriot image (version 1.10.0)
  • Version 1.10.0

Additional context
I followed the instructions listed here
https://x1m.nl/posts/recon-pi/

add

Can you add to the project option for Discord webhook?

"unable to cache TLDs in file /usr/local/lib/python3.7/dist-packages/tldextract/.tld_set"

After adding the GitHub API key I am having this error:

"unable to cache TLDs in file /usr/local/lib/python3.7/dist-packages/tldextract/.tld_set: [Errno 13] Permission denied: '/usr/local/lib/python3.7/dist-packages/tldextract/.tld_set'"

So after take a look at /usr/local/lib/python3.7/dist-packages/tldextract/ folder the actual name of the .tld_set file was .tld_set_snapshot so I have to chmod +775 the file and rename it to .tld_set and now its OK

Issue with wordlist in startBruteForce

cat "$SUBS"/hosts | parallel -j 5 --bar --shuf gobuster dir -u {} -t 50 -w wordlist.txt -l -e -r -k -q -o "$DIRSCAN"/"$sub".txt
/home/admin/go/bin/gobuster dir -u "$line" -w "$WORDLIST"/wordlist.txt -e -q -k -n -o "$DIRSCAN"/out.txt

the wordlist.txt is not copied to the wordlists folder found in the resultdir anywhere in the recon.sh script

Rebuild the subfinder function

  • output needs to be .json
  • .json file needs to be converted to subdomainDB API format
  • Extra recon.sh function to make the API POST request

Idea

Maybe a good idea to start the dashboard during install.sh to avoid errors when running recon.sh for a second or third time.

The runDashboard() function within recon.sh now starts up a new dashboard instance via Docker on port 4000 every time you run the script, so the port will become an issue.

Instead of starting the dashboard application it should just make the API request with the json output from subfinder.

massdns functionality fix

Check the way subfinder uses host file in the docker cmd, can be used for resolved-domains.txt as well I guess

: 'Run MassDNS on the given domains'
runMassDNS()
{
	echo -e "[$GREEN+$RESET] Starting MassDNS now!"

	#This doesn't work yet because I need to find a way to get the resolved-domains.txt from the host to docker.
	docker run -it massdns -r lists/resolvers.txt -t A -o S -w resolved-domains.txt > $ROOT/$1/massdns.txt

	echo -e "[$GREEN+$RESET] Done!"
}

Question

Can it be used without Raspberry Pi
Additional context
Add any other context or screenshots about the feature request here.

domains.json output

the domains.json file is not getting the right input data, not really sure what is going on there

https://github.com/x1mdev/ReconPi/blob/master/recon.sh

: 'Convert domains.txt to json (subdomainDB format) + make POST API request with output from subfinder'
convertDomainsFile()
{
	echo -e "[$GREEN+$RESET] Converting $GREEN$ROOT/$1/domains.txt$RESET to an acceptable $GREEN.json$RESET file.."
	cat $ROOT/$1/domains.txt | grep -P "([A-Za-z0-9]).*$1" >> $ROOT/$1/domains.json
	echo -e "{\\n\"domains\":"; jq -MRs 'split("\n")' < domains.json | sed -z 's/,\n  ""//g'; echo -e "}"
	
	# TODO: Post request to dashboard - work in progress
	#curl -X POST -H "Content-Type: application/json" -H "X-Hacking: is Illegal!" -d "@domains.json" http://127.0.0.1:4000/api/domain/:domain

}

@ebelties any ideas?

Add Discord notifications

notifyDiscord() {
startFunction "Trigger Discord Notification"
takeover="$(cat $SUBS/takeovers | wc -l)"
totalsum=$(cat $SUBS/hosts | wc -l)
intfiles=$(cat $NUCLEISCAN/*.txt | wc -l)
nucleiCveScan="$(cat $NUCLEISCAN/cve.txt)"
nucleiFileScan="$(cat $NUCLEISCAN/files.txt)"

/usr/local/bin/discord.sh --webhook-url="$WEBHOOK" --text "Found '$totalsum' live hosts for '$domain'" --username "Recon Bot"

/usr/local/bin/discord.sh --webhook-url="$WEBHOOK" --text "Found '$intfiles' interesting files using nuclei" --username "Recon Bot"

/usr/local/bin/discord.sh --webhook-url="$WEBHOOK" --text "Found '$takeover' subdomain takeovers on '$domain'" --username "Recon Bot"

/usr/local/bin/discord.sh --webhook-url="$WEBHOOK" --text "CVEs found for $domain: \n $nucleiCveScan" --username "Recon Bot"

/usr/local/bin/discord.sh --webhook-url="$WEBHOOK" --text "Files for $domain: \n $nucleiFileScan" --username "Recon Bot"

echo -e "[$GREEN+$RESET] Done."

}

image

Dependencies:
https://github.com/ChaoticWeg/discord.sh

go tools are not getting installed

Describe the bug
While running the installation script the go tools are not getting installed.

To Reproduce
Steps to reproduce the behavior:

  1. Cloned the repo into a new droplet/VPS. git clone https://github.com/x1mdev/ReconPi.git
  2. goto the cloned repo and run the installation script cd ReconPi && ./install.sh

Expected behavior
The go tools must be installed successfully when we run the installation script.

Screenshots
image

Used digital ocean droplet/VPS

  • OS: Debian
  • Version: 10 x64
  • Other details: 2 GB Memory / 1 Intel vCPU

Additional context
More details on go install are here https://go.dev/doc/go-get-install-deprecation

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.