GithubHelp home page GithubHelp logo

preventions / ssh-weak-dh Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aoncyberlabs/ssh-weak-dh

0.0 0.0 0.0 39 KB

License: GNU General Public License v2.0

Python 53.94% Shell 29.54% Dockerfile 16.52%

ssh-weak-dh's Introduction

About

This tool establishes SSH connections to a server, thereby enumerating through various client configurations, in order to determine whether the server allows a Diffie-Hellman (DH) key exchange based on a weak group. We hope that our tool will be useful to check SSH servers for weak DH key exchange configurations.

Note that this tool tests a limited number of configurations and therefore potentially fails to detect some weak configurations. Moreover, the server possibly blocks connections before the scan completes.

For further information about our tool, visit http://blog.gdssecurity.com/labs/2015/8/3/ssh-weak-diffie-hellman-group-identification-tool.html.

Consult the Logjam info page for suggestions on how to configure SSH servers to protect them as well as their clients from attacks exploiting DH key exchanges using a weak group.

Installation

Install docker and execute the following command:

docker build -t ssh-weak-dh .

Usage

Run the following commands:

docker run --rm -v "$(pwd)/logs/":/logs/ ssh-weak-dh hostname [port]

where hostname is the host name or IP address of the SSH server to scan. The optional argument port allows you to specify the port on which the SSH server listens. If the argument is not specified, it will default to 22.

The scan results are printed on stdout.

More detailed results can be found in the ./logs/ directory under the subfolder whose name has the form hostname-port where hostname and port are the corresponding command line parameters.

The scan tool calls the script ssh-weak-dh-analyze.py to analyze the scan results stored in the aforementioned subfolder. This analysis script is a standalone tool.

For example, run the following command to analyze the results of a scan of the SSH server running on port 22 on scanme.example.com:

./resources/ssh-weak-dh-analyze.py logs/scanme.example.com-22/

If you don't have Python installed, you may run the analysis script inside the Docker container:

docker run --rm -v "$(pwd)/logs/":/logs/ -it --entrypoint bash ssh-weak-dh
./ssh-weak-dh-analyze.py /logs/scanme.example.com-22/

It is also possible to run the scan script inside the container shell as follows:

./ssh-weak-dh-test.sh hostname [port]

where hostname and port are the scanner arguments as explained before.

Acknowledgments

The patch bsd-compatible-realpath.patch is provided by Alpine Linux.

Copyright

Fabian Foerg, Gotham Digital Science, 2015-2018

ssh-weak-dh's People

Contributors

faf0 avatar amahmoudgds avatar andersk avatar danbgds avatar

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.