-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add an ls
module to unify arguments and outputs for -ls
scripts
#106
Conversation
d4f10f9
to
8d11513
Compare
I like this idea, and it looks like you've thought through the script-args part very well. I would like to see a couple things before I do a more thorough review:
|
@dmiller-nmap since you do not actually merge the PR, is it OK for you if I leave the |
@p-l- Yes, that's fine. Just comment again when you would like a second look at this PR. |
@dmiller-nmap if you have some time I'd like you to have another look and let me know how you feel about these changes. Thanks! |
92396fe
to
9cb0bbd
Compare
The library looks wonderful and very useful :D.
Gyani |
Just a comment on one of @h4ck3rk3y's points regarding concatenations: every time you do |
Thanks for this review! For the point about using an About For the other remarks, I'll update the PR as soon as I can. Thanks again! |
This PR is ready for another review. Thanks! By the way I have not updated the changelog section found in some scripts. |
I am yet to go through all the changes that you might have made since last time but I have some quick comments.
The spidering library is a good example on how to handle options. It handles a lot of options like maxdepth, maxpagecount, blacklists, etc. One can override the default values while initializing a crawler. |
|
I agree. The PR brings a lot of good changes by homogenizing the output and I guess I am trying to be too picky. We can always push the present ls library, get feedback and make changes if needed later. Just one more thing, line 12 talks about ls.checksum, if you could talk about it being a library level argument that works for scripts that implement checksum locally that would be great, else it's a bit confusing. If the only use of the ls.checksum argument is that while running *-ls scripts we don't have to put the pattern arg individually for all scripts then I would suggest that using --script-args pattern serves the same purpose assuming all the scripts that take args do so using stdnse.get_script_args(SCRIPT_NAME .. ".pattern") |
Don't worry about being "too picky", I've learnt a lot thanks to you! Plus you're totally right to be demanding regarding submitted code. I have fixed the documentation as you suggested. Even if, for now, the only real benefits of handling |
The "ls" module is to be used by the scripts rendering file listings, such as the *-ls scripts and ftp-anon. The "http-ls" script is a simple script that uses this new module to output Web servers rendering directories with "Index of" pages.
This change was suggested by @h4ck3rk3y and @dmiller-nmap
This PR adds a new module called
ls
and uses it to unify arguments and outputs from*-ls
scripts (so far,afp-ls
,nfs-ls
andsmb-ls
plus a new script,http-ls
).What remains to do is add
ftp-anon
(I'm working on that part), but I think it's OK to merge this first so that it can be tested by more people.I'm running scans to tests these scripts against random hosts and have seen no problem so far.