Git Product home page Git Product logo

netscan's Introduction



NetScan

Netscan is a network scanner made for large-scope pentesting. It lets you scan and do your recon phase on more that 20+ protocols very quickly. All results are store in an elasticsearch database and browsable with the Kibana power. Scan, Filter, Exploit !

Features

  • Everything is stored in Elasticsearch. Data is visible via Kibana
  • Active Directory
    • Enumeration
    • Active Directory attacks
    • Active Directory modifications
    • Active Directory Certificate Services
    • Bloodhound export
    • Modules
      • ZeroLogon (CVE-2020-1472)
      • NoPAC (CVE-2021-42278 / CVE-2021-42287)
      • Check if ZONE_UPDATE_INSECURE parameter is enabled
      • Check for LDAP signing and channel binding
  • Ping scanner
  • Port scanner
    • Nmap service detection
    • Nmap scripts executions
  • FTP scanner
    • FTP authentication
    • FTP multi-host bruteforce
    • FTP listing
  • MySQL scanner
    • MySQL authentication
    • MySQL multi-host bruteforce
    • MySQL database listing
    • MySQL queries
  • MsSQL scanner
    • MsSQL authentication
    • MsSQL multi-host bruteforce
    • MsSQL database listing
    • MsSQL queries
    • MsSQL command execution
  • MongoDB scanner
    • MongoDB authentication
    • MongoDB multi-host bruteforce
    • MongoDB database listing
  • Postgres scanner
    • Postgres authentication
    • Postgres multi-host bruteforce
    • Postgres database listing
    • Postgres command execution
  • Redis scanner
    • Redis authentication
    • Redis multi-host bruteforce
    • Redis RCE detection
  • RDP scanner
    • RDP authentication (does not mean you have rdp access)
    • Modules
      • Bluekeep (CVE-2019-0708) detection
  • VNC scanner
    • VNC authentication
    • VNC multi-host bruteforce
    • VNC rubber-ducky execution
    • VNC screenshot
  • Telnet scanner
    • Telnet authentication
    • Telnet multi-host bruteforce
    • Telnet command execution
  • SSH scanner
    • SSH authentication
    • SSH multi-host bruteforce
    • SSH command execution
    • Modules
      • LinPEAS
      • DirtyPipe (CVE-2022-0847)
      • Get kernel and packages versions
      • List network interfaces
      • PwnKit vulnerability (CVE-2021-4034)
  • WinRM scanner
    • WinRM authentication
    • WinRM multi-host bruteforce
  • Rsync scanner
  • RTSP scanner
    • Screenshot
  • SNMP scanner
    • SNMP authentication
    • SNMP multi-host bruteforce
    • SNMP enumeration
  • TLS scanner
  • DNS scanner
    • DNS queries
    • Reverse-DNS queries
    • Subdomain bruteforce
    • AXFR transfer
    • Domain Controller detection
  • SMB scanner
    • SMB authentication
    • SMB multi-host bruteforce (be careful not to block accounts...)
    • SMB shared folder listing
    • SMB enumeration
    • SMB secrets collection (SAM, LSA secrets)
    • SMB command execution
    • SMB modules
      • EternalBlue detection (MS17-010)
      • SambaCry detection (CVE-2017-7494)
      • DropTheMic detection (CVE-2019-1040)
      • SMBGhost detection (CVE-2020-0796)
      • PetitPotam exploit (CVE-2021-36942)
      • PrintNightmare vulnerability (CVE-2021-1675)
      • PrintSpooler service detection
      • DFSCoerce
  • HTTP scanner
    • HTTP service header and page title enumeration
    • HTTP authentication
    • HTTP modules
      • Axis2
      • Tomcat
      • JBoss
      • Heartbleed
      • Jenkins
      • PhpMyAdmin
      • And more !

Screenshots

Display the global help menu

Display a specific module help menu

Run a ping scan to discover devices in the network

Run a port scan to get all opened ports with the nmap options

Display the result in a way-to-cool interface!

1. Installation

1.0 Automagic installation (with docker)

Run the following command and enjoy immediately..

~/netscan$> ./configure_docker.sh

The previous command will build and/or start all the framework docker containers used by netscan. It will create and configure :

  • an elasticsearch container
  • a kibana container
  • a neo4j container

When everything is up and running, you can use the netscan command and enjoy.

1.1 Manual installation (without Docker)

  1. Install dependencies
$> pip3 install -r requirements.txt
  1. Create the configuration file
$> cp config.cfg.sample config.cfg
  1. If needed, deploy Elasticsearch and Kibana on your systema.

2. Configuration

Note:
The docker version is already configured with default settings. You're good to go.

On your system or in the docker container,

  1. Edit the config.cfg file to set the name of your current pentest session under the [Global] section.

  2. Enable elasticsearch if you want to send all your scan outputs to the database under the [Elasticsearch] section.

  3. Configure the Kibana dashboards

    Via GUI

    The kibana dashboards are located at kibana/kibana_dashboards.ndjson.

    • Open kibana at http://127.0.0.1:5601/
    • Go to "Management > Stack Management"
    • Go to "Kibana > Saved Objects"
    • Click on "Import"
    • Select the kibana_dashboards.ndjson file provided in this repo
    • Click on "Import"

    Via CLI

    $> curl -X POST 'http://127.0.0.1:5601/api/saved_objects/_import?createNewCopies=true' -H "kbn-xsrf: true" --form "file=@$(pwd)/kibana/kibana_dashboards.ndjson"

The dashboards should now be available within Kibana

3. Troubleshooting


Problem: Elasticsearch has not enough memory-mapped areas to run smoothly.
Solution : Run the following command on you system

sudo sysctl -w vm.max_map_count=262144

Doc: https://www.elastic.co/guide/en/elasticsearch/reference/current/_maximum_map_count_check.html


Problem: Elastic needs at least 10% free space of your hard disk (whatever the disk size). Solution : You can disable the disk size threshold by running the following commands on you system

$> curl -X PUT -H "Content-Type: application/json" http://localhost:9200/_cluster/settings -d '{ "transient": { "cluster.routing.allocation.disk.threshold_enabled": false } }'

netscan's People

Contributors

cosad3s avatar elweth-sec avatar hegusung avatar jdouliez 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

Watchers

 avatar  avatar  avatar  avatar

netscan's Issues

Execute certipy

Execute certipy and parse output rather than trying to reimplement

Add x11scan

Not the absolute most useful tool but might be nice to take screenshots automatically on multiple targets and perhaps loot for passwords in that way (I already coded something similar and tested it on the field and would be able to push the whole thing)

Clean output when modules fail through -m all

When using -m all to launch all modules, the output is often messy as some modules that require options throw an error. I would suggest not displaying this kind of error when using -m all, and perhaps notifying the user that a few modules have not been launched successfully as they require arguments

Memory leak / overhead

I have noticed a memory leak in Netscan.
For the moment, I did not manage to find where it occurs.

In consequence, on very large scope (ex: >150000000 ports), the Netscan process is killed by oom_reaper after a while:

[79022.153825] oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),cpuset=init.scope,mems_allowed=0,global_oom,task_memcg=/user.slice/user-1000.slice/session-55.scope,task=python3,pid=3839128,uid=0
[79022.154057] Out of memory: Killed process 3839128 (python3) total-vm:5686720kB, anon-rss:5448640kB, file-rss:0kB, shmem-rss:8kB, UID:0 pgtables:10748kB oom_score_adj:0
[79022.555182] oom_reaper: reaped process 3839128 (python3), now anon-rss:0kB, file-rss:0kB, shmem-rss:8kB

How to reproduce ?

Launch a Netscan portscan on large scope, monitor the RAM, you will notice it gradually increases.

Env. : Docker or from scripts, Debian, Elasticsearch enabled.

Hints

With pdb and objgraph, with two snapshots, we can just notice than tuple objects are created without being destructed:

python3 -m pdb ./scripts/portscan.py -H ./ips.txt -p1-65535 -w 25
(Pdb) r
# wait
(Pdb) import objgraph
(Pdb) objgraph.show_most_common_types(limit=20)

Snapshot 1:

function                   10489
dict                       7023
tuple                      5639
cell                       5024
weakref                    2030
type                       1359
wrapper_descriptor         1303
getset_descriptor          1194
method_descriptor          1162
builtin_function_or_method 1126
list                       540
ModuleSpec                 536
module                     535
member_descriptor          498
SourceFileLoader           466
property                   345
_UnionGenericAlias         336
classmethod                336
set                        265
_GenericAlias              170

Snapshot 2 (same command, waiting longer):

function                   10489
dict                       7023
tuple                      5812
cell                       5024
weakref                    2030
type                       1359
wrapper_descriptor         1303
getset_descriptor          1194
method_descriptor          1162
builtin_function_or_method 1126
list                       541
ModuleSpec                 536
module                     535
member_descriptor          498
SourceFileLoader           466
property                   345
_UnionGenericAlias         336
classmethod                336
set                        265
_GenericAlias              170

Complex to analyze, there is a large variety of usage of tuple ...

Edit: I think there is maybe "something" with DB worker queue management at db.py. I think the queue / objects / process in multiprocessing manager increases all over the time without cleaning process. Not sure about that, I will continue to investigate.

[portscan] add port file argument

Would be useful to input a file with specific ports to target (e.g. SAP ports, industrial ports, or a custom list of ports commonly seen during pentests and not matching exactly the top-N ports from nmap)

[adscan] error when dumping certificate templates

Got the following error when attempting to dump certificate templates using adscan.py:

image

Got quickly fixed locally by adding a check for 'schemaIDGUID' in attr under line ~1520 in lib/adscan/ldap.py

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.