What Is Recon-ng and How Do Ethical Hackers Use It for OSINT?
Recon-ng is an open source framework for open source intelligence (OSINT) gathering, written in Python and included in Kali Linux. It works like a console with workspaces, a built-in database and installable modules that query public sources such as DNS, certificate transparency logs and search APIs to find domains, hosts and contacts related to a target.
Topic: Security Tools, Authorized Labs & CTFs in Cybersecurity & Ethical Hacking · Lab / project
Quick answer: Recon-ng is an open source framework for open source intelligence (OSINT) gathering, written in Python and included in Kali Linux. It works like a console with workspaces, a built-in database and installable modules that query public sources such as DNS, certificate transparency logs and search APIs to find domains, hosts and contacts related to a target. Ethical hackers use it in the reconnaissance phase of authorised tests, and defenders use it to see what their organisation exposes publicly. Use it only within agreed scope, and treat any personal data you collect carefully.
Key takeaways
- Recon-ng organises OSINT into workspaces with a shared database.
- Modules are installed from a marketplace; many need API keys.
- Results can be exported into reports for test documentation.
- Defenders use the same findings to reduce their attack surface.
- Reconnaissance of others' organisations needs authorisation and respect for privacy law.
Table of Contents
- What Is Recon-ng?
- How Is Recon-ng Organised?
- What Does a Basic Workflow Look Like?
- How Do You Manage API Keys?
- How Do Defenders Use OSINT?
- What Are the Legal and Ethical Limits?
- References
What Is Recon-ng?
Recon-ng, created by Tim Tomes, is a reconnaissance framework modelled on the Metasploit console style. It is packaged in Kali Linux. It covers the Reconnaissance tactic in MITRE ATT&CK, which is also why defenders need to understand it.
How Is Recon-ng Organised?
| Concept | Purpose |
|---|---|
| Workspaces | Separate projects, each with its own database |
| Marketplace | Install, update and search modules |
| Modules | Discovery, recon, reporting and import tasks |
| Database tables | Domains, hosts, contacts, credentials found, and more |
| Keys | Store API keys for services modules use |
What Does a Basic Workflow Look Like?
Example for an organisation's own domain or one you are authorised to assess:
recon-ng
[recon-ng][default] > workspaces create acme_assessment
[recon-ng][acme_assessment] > db insert domains
domain (TEXT): example.com
[recon-ng][acme_assessment] > marketplace search hackertarget
[recon-ng][acme_assessment] > marketplace install recon/domains-hosts/hackertarget
[recon-ng][acme_assessment] > modules load recon/domains-hosts/hackertarget
[recon-ng][acme_assessment][hackertarget] > run
[recon-ng][acme_assessment] > show hosts
[recon-ng][acme_assessment] > marketplace install reporting/html
Module names and availability change over time; use marketplace search to see current ones.
How Do You Manage API Keys?
- Add keys with
keys add <name> <value>; list them withkeys list. - Use separate keys for testing, not personal accounts.
- Respect each service's terms and rate limits.
- Never include keys in shared reports or repositories.
How Do Defenders Use OSINT?
| Finding | Defensive action |
|---|---|
| Forgotten subdomains (from DNS and certificate logs) | Decommission or secure them |
| Exposed staff email patterns | Target phishing training and email filtering |
| Leaked credentials in breach data | Force resets, enforce MFA |
| Outdated technologies on public hosts | Patch or retire |
The OWASP Web Security Testing Guide describes information gathering as the first testing step.
What Are the Legal and Ethical Limits?
- Use Recon-ng for your own organisation or within a written scope of work.
- Collecting and storing personal data is regulated; in India the DPDP Act 2023 applies.
- Do not use OSINT for stalking, harassment or doxxing.
- Moving from passive lookup to active probing or access without permission can breach the IT Act 2000, Sections 43 and 66.
Related: Recon-ng commands and setup and bug bounty tools. WebAsha offers ethical hacking training.
References
Frequently Asked Questions
What's Your Reaction?
Like
0
Dislike
0
Love
0
Funny
0
Wow
0
Sad
0
Angry
0