Closed h00die closed 5 years ago
@itsmeroy2012 just wanted to make sure you saw this big ticket. feel free to pick any. telnet_login and telnet_version may be pretty easy since they are like the ftp ones.
I'll be busy for some weeks. Will look into it for sure. Thanks for the tag @h00die .
No rush!
Hi @h00die
As a class project, I picked up this issue and wish to contribute. However, from your list of files, I couldn't find some files. To list a few: auxiliary/scanner/acpp/login auxiliary/scanner/afp/afp_login auxiliary/scanner/afp/afp_server
I followed all the steps listed here, to fork the repo. Can you help me on this?
HI @vishalkg
You'll find the modules in the modules
directory.
https://github.com/rapid7/metasploit-framework/pull/9310
Following modules have been documented:
http: -webdav_scanner -verb_auth_bypass -webdav_website_content -wordpress_login_enum -ssl dir_webdav_unicode_bypass cert -dir_scanner
smb: -pipe_auditor -pipe_dcerpc_auditor -smb2 -smb_enumshares
mysql: -mysql_login -mysql_version
msmsql: -mssql_ping -mssql_idf -mssql_sql
discovery: -ipv6_neighbor -udp_probe -udp_sweep
dcerpc: -endpoint_mapper -hidden -management -tcp_dcerpc_auditor
auxiliary/scanner/snmp/cisco_config_tftp auxiliary/scanner/snmp/cisco_upload_file
Hey @h00die, auxiliary/scanner/http/dir_listing
module has been documented in this PR
Documentation for auxiliary/scanner/http/tomcat_mgr_login
module already exists. Kindly take it off the list. @h00die
Documentation for
auxiliary/scanner/http/tomcat_mgr_login
module already exists. Kindly take it off the list. @h00die
Confirmed. Removed.
# ls -la documentation/modules/auxiliary/scanner/http/tomcat_mgr_login.md
-rw-r--r-- 1 root root 3556 Jan 21 2017 documentation/modules/auxiliary/scanner/http/tomcat_mgr_login.md
Following has been documented.
auxiliary/scanner/http/http_put
auxiliary/scanner/http/scraper
auxiliary/scanner/winrm/winrm_cmd
auxiliary/scanner/winrm/winrm_auth_methods
auxiliary/scanner/snmp/snmp_enum
auxiliary/scanner/snmp/snmp_enumusers
auxiliary/scanner/snmp/snmp_enumshares
auxiliary/scanner/telnet/telnet_login
auxiliary/scanner/telnet/telnet_version
Hi, I'm new to open-source project contribution, but I wanted to help by writing some documentation. The list you provided at the top of this issue might not be up to date. I wrote a piece of code to compare the list of auxiliary modules and the list of documentation, and I join the new list of modules with missing documentation. I also found some documentation which were bad-named, or maybe they used to be associated with modules which no longer exists. I also join it to this message :)
@PingouinRF this effort looks great! I'd love some help writing docs, it's a great way to contribute to open source, find bugs in the code base, and learn!
/metasploit-framework/modules/auxiliary/scanner/http/onion_omega2_login
is a python module, your script most likely only checked for .rb
java_jmx_scanner
is actually java_jmx_server
but ping @asoto-r7 .go
extension, similar to number 1 so possible false positive.scanner
to admin
: https://github.com/rapid7/metasploit-framework/blob/76954957c740525cff2db5a60bcf936b4ee06c42/modules/auxiliary/admin/mssql/mssql_idf.rb.py
.py
Check those out. If you want to confirm the mssql ones were moved and want to submit a PR that would be great! A fast easy one, you can tag me on it and I can handle landing it quickly.
Would you mind sharing your code for this? I'd love to wipe the original post content with something more up to date. You could even print out the output in MD with empty check boxes [ ] item
Hi @h00die, I didn't expect some script to be written in other languages than Ruby : my bad. I modified my script.
Here it is :
import os
import glob
modules = []
docs = []
list_docs = glob.glob('/root/Documents/MSFDoc/metasploit-framework/documentation/modules/auxiliary/scanner/*/*.md', recursive=True)
list_modules = glob.glob('/root/Documents/MSFDoc/metasploit-framework/modules/auxiliary/scanner/*/*.*', recursive=True)
for doc in list_docs:
docs.append(doc.split('.')[0].replace('/documentation/','/'))
for module in list_modules:
modules.append(module.split('.')[0])
missings = []
problems = []
for i in docs:
if i not in modules:
problems.append(i)
for i in modules:
if i not in docs:
missings.append(i)
f = open("/root/Documents/MSFDoc/missings.txt","w")
for i in sorted(missings):
f.write('+ [ ] ' + i.replace('/root/Documents/MSFDoc/','/') + '\n')
f.close()
g = open("/root/Documents/MSFDoc/problems.txt","w")
for i in sorted(problems):
g.write('+ [ ] ' + i.replace('/root/Documents/MSFDoc/','/') + '\n')
g.close()
I run it with Python 3, you need glob (which is a good directory explorer) library in order to make it functional. Don't hesitate to correct me, as I'm pretty bad at scripting ... You'll get two text files (missings and problems) markdown-formatted and ready to post on this issue (I wrote some +
instead of -
so you can integrate it in < details > tag).
I can confirm that the two mssql
related problems have been moves to admin
section. Also, it's no doubt that java_jmx_scanner
is now java_jmx_server
as I cannot find any trace of jmx_scanner anywhere ...
I can make all the required modifications for the module/documentation names and make a pull request, however I'll let you make the modification on the first post of this issue ;)
Thx for your help !
@hkerma Metasploit has a tools folder (in your path, most likely /root/Documents/MSFDoc/metasploit-framework/tools
) which has various meta tools. Looks like it isn't a requirement to run ruby. Would you mind submitting your python code as a new tool? Put it a docs
folder. You'll want to adjust a few things:
all
that will do all of these sections as well.glob
, if it wont run in py2, then detect that and exit gracefully.[ x ]
for items that do have docs50/200 (25%) module docs written
This is just some quick stuff. I think we'll be able to do further optimizations in a PR.
@hkerma hows it going on that script? Need any help?
Hi @h00die, sorry I went for vacation and didn't really work on that. I'll take care of your advices and do that quickly ;)
@hkerma no worries, just checking in!
Hi @h00die, I tried to follow your recommendations as much as I could and ended up with this code. Could you have a look and give me some feedback before I make a PR ? I'd really appreciate it :)
import os
import sys
import argparse
try:
import glob
except ImportError:
print("Please install glob package")
sys.exit()
parser = argparse.ArgumentParser(epilog='Choose options in order to print the wanted information about modules and their documentations.', prefix_chars='--', )
parser.add_argument('-m', '--modules', type=str, default='auxiliary/scanner', help='Choose the modules category to work with. Respect the module category names as in metasploit-framework. Only one category should be passed, e.g. "auxiliary/admin", "exploits/android/browser" or "encoders" are valid entries.')
parser.add_argument('--show_all', action="store_true", default=False, help='Show the complete list of items. In default mode, modules with documentation are marked "[x]" and modules without are marked "[ ]". In issues mode, documentation files without module are marked "[ ]" and documentation files with module are marked "[x]".')
parser.add_argument('--show_issues', action="store_true", default=False, help='Show the list of documentation files without modules instead of modules withouth documentation file.')
args = parser.parse_args()
module_type = args.modules
show_all = args.show_all
show_issues = args.show_issues
modules = []
docs = []
path = os.path.abspath(os.path.join(os.path.realpath(__file__),"..","..",".."))
if os.path.exists(os.path.join(path, 'modules', module_type)):
list_docs = glob.glob(os.path.join(path,'documentation/modules', module_type, '**/*.md'), recursive=True)
list_modules = glob.glob(os.path.join(path, 'modules', module_type, '**/*.*'),recursive=True)
else:
print("Path doesn't exist. Maybe you have passed a wrong module category or maybe there isn't any documentation file yet.")
sys.exit()
for doc in list_docs:
docs.append(doc.split('.')[0].replace('/documentation/','/'))
for module in list_modules:
modules.append(module.split('.')[0])
missings = []
problems = []
count = 0
if not (show_all):
if not (show_issues):
for i in modules:
if i not in docs:
missings.append(i)
for i in sorted(missings):
print('+ [ ] ' + '/metasploit-framework' + i.split('metasploit-framework')[1])
print(str(len(missings)) + ' modules have no documentation.')
else:
for i in docs:
if i not in modules:
problems.append(i)
for i in sorted(problems):
print('+ [ ] ' + '/metasploit-framework' + i.split('metasploit-framework')[1])
print(str(len(problems)) + ' doc files do not correspond to any module.')
else:
count = 0
if not (show_issues):
for i in sorted(modules):
if i in docs:
print('+ [x] ' + '/metasploit-framework' + i.split('metasploit-framework')[1])
else:
print('+ [ ] ' + '/metasploit-framework' + i.split('metasploit-framework')[1])
count += 1
print(str(count) + ' modules out of ' + str(len(modules)) + ' have no documentation.')
else:
for i in sorted(docs):
if i in modules:
print('+ [x] ' + '/metasploit-framework' + i.split('metasploit-framework')[1])
else:
print('+ [ ] ' + '/metasploit-framework' + i.split('metasploit-framework')[1])
count += 1
print(str(count) + ' doc files out of ' + str(len(docs)) + ' do not correspond to any module.')
Thx a lot !
EDIT : forgot to say that this script is supposed to be in "metasploit-framework/tools/docs/script.py" in order to work.
Awesome! Go ahead and throw it into a PR. It'll be easier to comment on code there, as well as not taking up a block of space in this issues. I should be able to look at it during the week! Good job!
@hkerma Can you throw that code into a PR so we can do a real review on it?
Hi @h00die, really sorry but I got a lot of work to do at school ... I'll try doing it today !
not a problem, just glad to see youre still around!
Closing this in favor of the docs output from @hkerma so that it can more easily be tracked and overwritten, etc. Will link to new issue shortly.
In an attempt to prioritize docs, I (arbitrarily) decided auxiliary/scanner would be the best place to start. Lots of "underlying" and basic protocols live here. These can also help for later exploit modules since once you install a certain protocol for the scanner, you may be able to use it for the exploit as well and simply copy/paste the contents of the
# Vulnerable Application
section.Please just make a comment if you are working on one, and i'll Check mark it, and then when the doc lands we'll just take it off of this PR list.