Giter Club home page Giter Club logo

Comments (4)

JustinAzoff avatar JustinAzoff commented on May 30, 2024

Yes! I had been meaning to add this, but I wasn't aware there was a source of leaked keys I could use as an initial test.

It should be fairly easy to add, I think I can just treat them as passwords internally.

from ssh-auditor.

JustinAzoff avatar JustinAzoff commented on May 30, 2024

I have an initial support for this in 2617592

You have to add a key using something like this

ssh-auditor cred add -- test "$(cat testing/docker/alpine-sshd-test-key/test.key)"

The output of various commands isn't pretty, but it works. Probably the downside of re-using 'password' to mean 'password or key'

Looks like I can easily add support for importing directly from a checkout of https://github.com/rapid7/ssh-badkeys/tree/master/authorized, I just need to loop over the directory and grab the 'user' field from the yaml and the key from the .key file. I'm not sure if this is best done inside ssh-auditor or in a standalone script.... I already support bulk importing via json or csv... something like this

from __future__ import print_function
import glob
import yaml
import json

keys = []

for fn in glob.glob("*.yml"):
    keyfile = fn.replace(".yml", ".key")

    with open(fn) as f:
        metadata = yaml.safe_load(f)
    user = metadata[":user"]

    with open(keyfile) as f:
        key = f.read()

    keys.append({
        "User": user,
        "Password": key,
    })

for cred in keys:
    print(json.dumps(cred))

used like

ssh-badkeys/authorized$ python export.py  | ssh-auditor  cred import json

from ssh-auditor.

syrius01 avatar syrius01 commented on May 30, 2024

Would be very cool to see ssh key support on this awesome tool. If there could be an argument like "-key /path/to/keys/id_rsa".

Also posting a reply here to be kept in the loop if there is development :)

Thanks

from ssh-auditor.

JustinAzoff avatar JustinAzoff commented on May 30, 2024

@syrius01 Initial ssh key support is implemented now in 0.15. The UX could be better though, right now you need to do this to load a key into the database:

ssh-auditor cred add -- root "$(cat /path/to/keys/id_rsa)"

from ssh-auditor.

Related Issues (9)

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.