Code Monkey home page Code Monkey logo

silver's Introduction


Silver
Silver

Mass Vulnerability Scanner

Introduction

masscan is fast, nmap can fingerprint software and vulners is a huge vulnerability database. Silver is a front-end that allows complete utilization of these programs by parsing data, spawning parallel processes, caching vulnerability data for faster scanning over time and much more.

demo

Features

  • Resumable scanning
  • Slack notifcations
  • Multi-core utilization
  • Supports: IPs, CIDR & hostnames
  • Vulnerability data caching
  • Shodan integration

Dependencies

External Programs

Python libraries

  • psutil
  • requests

Required Python libraries can be installed by executing sudo pip3 install -r requirements.txt in Silver directory.

Setting up Slack notifications

  • Create a workspace on slack, here
  • Create an app, here
  • Enable WebHooks from the app and copy the URL from there to Silver's /core/memory.py file.

Usage

Before you start

⚠️ Run Silver as root and with python3 i.e. with sudo python3 silver.py <your input>. The python libraries need to be installed as root too.

⚠️ Silver scans all TCP ports by default i.e. ports 0-65535. Use --quick switch to only scan top ~1000 ports.

Scan host(s) from command line

python3 silver.py 127.0.0.1
python3 silver.py 127.0.0.1/22
python3 silver.py 127.0.0.1,127.0.0.2,127.0.0.3

Use Shodan

Shodan can provide open ports, service information and CVEs from the data collected during its contiunous internet wide scanning. I think this is the best choice for quickly checking top ~1500 ports. Not using it makes sense when:

  • You want to scan all the ports instead of the most common ones
  • You are not okay with the scan results being 2-3 days old
  • The IP you want to scan has been excluded by Shodan by a request of the owner
python3 silver.py 127.0.0.1 --shodan

Scan top ~1000 ports

python3 silver.py 127.0.0.1 --quick

Scan specific ports

python3 silver.py 127.0.0.1 -p80,443

Scan hosts from a file

python3 silver.py -i /path/to/targets.txt

Save JSON output to a file

Default: result-<ip_here>.json

python3 silver.py 127.0.0.1 -o my_target.json

Note: The output is saved regardless of using this option. It only exists to choose a specific name for the file instead of the autogenerated one.

Set max number of parallel nmap instances

Default: number_of_cores

python3 silver.py -i /path/to/targets.txt -t 4

Choose packets to be sent per seconds

Default: 10000

python3 silver.py 127.0.0.1 --rate 1000

Contribution

You can contribute to this project by providing suggestions, reporting sensible issues and spreading the word. Pull requessts for the following will not be accepted:

  • Typos
  • coDe qUaLiTY
  • Docker and .gitignore file

silver's People

Contributors

s0md3v avatar somdev-rhl 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

silver's Issues

TypeError when silver.py is executed outside Silver directory.

Hi,

I was trying to call silver.py outside the directory and I got the following error:

fagent@faradayagent:~$ /home/fagent/Silver/silver.py
Traceback (most recent call last):
  File "/home/fagent/Silver/silver.py", line 13, in <module>
    from modules.shodan import shodan
  File "/home/fagent/Silver/modules/shodan.py", line 5, in <module>
    from modules.vulners import vulners, cache
  File "/home/fagent/Silver/modules/vulners.py", line 7, in <module>
    database = json.loads(reader(file))
  File "/usr/lib/python3.6/json/__init__.py", line 348, in loads
    'not {!r}'.format(s.__class__.__name__))
TypeError: the JSON object must be str, bytes or bytearray, not 'bool'

Will you like to create a python package of silver? I think the root of this problem could be fixed by creating a package (I could help with this).

Thanks!

Ability to control masscan pps rate

Currently silver will command masscan to use --rate=10000 pps. When scanning one host this becomes an issue, the scan is too fast and not all open ports are discovered. I would suggest to give the ability to control the rate option by either specifying the rate limit explicitly or providing --slow argument which will command masscan to use --rate=100 pps which is default for this tool.

Although better approach would be to use --rate=100 by default and providing --fast argument which will command masscan to use --rate=100000.

I can prepare PR if you are interested.

Lack of filtering when specifying an IP range as a target result in an error due to bad filename

Hi there,

I just pulled the tool, and it seems it uses the target argument to create the result file. The problem is that if you specify a IP range with a / in it, for example 192.168.0.0/16, it will give an error, it will search for file 16.txt in a directory result-192.168.0.0

╭─ ~/Tools/Silver │ master !1 ?2                                                                                                                                                                                                                                                                             1 х │ 12:02:29 
╰─ sudo python3 silver.py '192.168.0.0/16'

	𝘴𝘪𝘭𝘷𝘦𝘳

[~] Deploying masscan
Traceback (most recent call last):
  File "silver.py", line 86, in <module>
    file = open(savefile, 'w+')
FileNotFoundError: [Errno 2] No such file or directory: '/foo/bar/Tools/Silver/result-192.168.0.0/16.txt'

not scanning the target

python3 silver.py 127.0.0.1 --quick

It's not scanning the my target ...within seconds it shown scan completed message

𝘴𝘪𝘭𝘷𝘦𝘳

[] Deploying masscan
[!] Result saved to /root/Silver/result-targets.txt
[
] 0 services to fingerprint
[!] ETA: 0 seconds
[] Spawning 1 nmap instance
[!] Updated /root/Silver/result-targets.txt
[
] Looking for vulnerablilites
[+] Scan completed

please help me out

Not scanning target file

Hi @s0md3v
silver is not scanning list of ips provided via targets.txt.
silver -i targets.txt --quick

[~] Deploying masscan
[!] Result saved to /root/result-targets.txt
[~] 0 services to fingerprint
[!] ETA: 0 seconds 
[~] Spawning 1 nmap instance
[!] Updated /root/result-targets.txt
[~] Looking for vulnerablilites
[+] Scan completed

Scan 0.0.0.0

With masscan i can scan the internet with 0.0.0.0, but with siver i can't, why?

can´t install it

Hello,
when I try to inststall it using git clone I get
E: Unable to locate package https://github.com/s0md3v E: Couldn't find any package by glob 'https://github.com/s0md3v' E: Couldn't find any package by regex 'https://github.com/s0md3v'
Thanks for your time

Scan immediately ends

Using any IP, ETA is always 0 seconds and states there are 0 services to fingerprint.

On kali, works fine. On manjaro is where the issue is seen

No such file or directory: 'silver-.. ( when input the ips file)

traceback (most recent call last):
File "/home/kali/tools/Silver/silver.py", line 61, in
targets = resolver(input_file)
File "/home/kali/tools/Silver/core/resolver.py", line 30, in resolver
with open('silver-' + hostnames, 'w+') as outfile:
FileNotFoundError: [Errno 2] No such file or directory: 'silver-/home/kali/tools/....

not producing any output?

Hello,

Just installed the tool, requirements, nmap & masscan without any issues. Tried running python3 silver.py 127.0.0.1 --quick command (or any other IP/or IP's from file) immediately receiving Scan Completed message:

[] Deploying masscan
[!] Result saved to /home/xxx/Silver/result-test.txt
[
] 0 services to fingerprint
[!] ETA: 0 seconds
[] Spawning 1 nmap instance
[!] Updated /home/xxx/Silver/result-test.txt
[
] Looking for vulnerablilites
[+] Scan completed

~/Silver$ cat result-test.txt
{}

Any ideas what might be causing this?

Thanks!

Feature request

add support to scanning by hostname. Currently scanning by only ip is supported.

e.g.
python3 silver.py example.com

Use masscan only if multiple hosts are provided

Usage of masscan against a single host would cause most open ports to be left unidentified, especially at the default rate of 10K.

Instead of asking the user to set the necessary rate (if you add a --rate from another issue here), leave it to nmap to identify open ports, which is much more capable for atleast an entire /24 range, from where usage of masscan would be more useful.

Quick Completion.

I have followed the instructions but It displays no output

Rocket1@Macbookpro silver % sudo python3 silver.py IP 

	𝘴𝘪𝘭𝘷𝘦𝘳

 Deploying masscan
 Result saved to /Users/Rocket1/Silver/result-IP.json
 0 services to fingerprint
 Spawning 1 nmap instance
 Updated /Users/Rocket1/Silver/result-IP.json
 Looking for vulnerablilites
 Scan completed ```

No module named 'psutil'

When I am ran this command, I got this issue...

python3 silver.py 127.0.0.1
Traceback (most recent call last):
File "silver.py", line 7, in
import psutil
ModuleNotFoundError: No module named 'psutil'

no module named core.memory

user@host:~/tools/Silver$ sudo python silver.py
Traceback (most recent call last):
  File "silver.py", line 11, in <module>
    import core.memory
ImportError: No module named core.memory

Tried installing core module, core-memory / tried py2-py3 etc
nothing work.

Error when running scan...

Hi! When I try to run a scan against a single IP, I get the following...

[] Deploying masscan
[!] Result saved to /home/xxxxx/Silver/result-targets.txt
[
] 3 services to fingerprint
Traceback (most recent call last):
File "silver.py", line 104, in
result = shodan(host)
File "/home/xxxxx/Silver/modules/shodan.py", line 45, in shodan
cache(software, version, 'dummy')
TypeError: cache() missing 1 required positional argument: 'cpe'

Feature request

Add a output format similar to nmap.xml
As many tools use the nmap's xml format to do stuff like
aquatone used it to take screenshot
brutespray used it to spray common credential across different services identified.
In this way we are not only looking for the outdated services, also completely using silver for port scanning workflow as whole.

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.