ztgrace / changeme

A default credential scanner.
GNU General Public License v3.0
1.44k stars 248 forks source link

refactoring changeme project #18

Closed AlessandroZ closed 7 years ago

AlessandroZ commented 7 years ago

Hi,

I was waiting for your new commit changing the structure of the project how you told me few month ago. Nothing happened, so I decided to do it myself even if I will change a lot of your code (which is the case in this pull request). However, right now, the project is able to manage different protocols easily. Some have already been implemented (ssh, ftp, http, telnet and mssql).

Note:

Hope you will like it.

ztgrace commented 7 years ago

AlessandroZ - awesome work. I love the new protocols.

The holidays were a bit crazy for me, so I didn't get as much done on this as I would have liked.

What I'd like to do is get this code merged in with the https://github.com/ztgrace/changeme/tree/refactor branch while we work on it. That way the master branch stays clean for anyone who wants to clone + run until the refactor is ready.

I'm good with moving from lxml->xml for the CSRF checking if it makes for easier integration with pupy. Also, the test_get_csrf_token method in tests/changeme_tests.py should be able to validate if it's working.

Let me know what you think.

AlessandroZ commented 7 years ago

Hi,

No problem, I let you time to merge it to the refactor branch (at first I wanted to do my commit on this branch), and to do every tests you want. I think the csrf test will fail at first and should be modified (lxml is much more easy to use that xml lib, however, xml is already used with pupy, so the integration of this lib is already managed). When you're happy of the refactor branch, I let you merge the code on the master branch and then I will try to add it to pupy as a module.

If you have questions, do not hesitate to let me know. Do not hesitate to change the code, the only thing you have to keep in mind is that the "changeme" directory will be loaded as a package (only this directory), so the function "run_changeme" represent the first function called and each parameter (creds, config, etc.) should be loaded outside this package.

Let me know, if you need any help. I let you time to do every test and when it will be merge on the master branch, I will work on it again.

ztgrace commented 7 years ago

I've started merging your code into the refactor branch: https://github.com/ztgrace/changeme/commit/5043a61e341fc53dacec09f9a176d224db6168de. Hopefully I'll have that done in the next day or two.

I did try your new get_csrf_token function but had issues in unit testing. I think etree is a bit more brittle when it comes to parsing than lxml. I'll do a little more testing on my end to see if I can get that to work, otherwise I'll probably leave it as-is for now.