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

fix bad argument exception when using smb-ls script #588

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
7 participants
@dallaswinger

dallaswinger commented Nov 9, 2016

After updating to nmap7.25BETA2 from nmap7.25BETA1 I started consistently encountering a bad date argument exception when trying to run the smb-ls script on a target

On line 1068 an additional / was added to the expression in commit "Merge branch 'nse-lua53'"

Adding a / to the expression on line 2808 to match line 1068 fixes the issue.

Alternatively, removing the newly added / to the expression on line 1068 should also fix it.

I do not know which solution is preferred/correct.

Dallas Winger
@sstelfox

This comment has been minimized.

sstelfox commented Nov 9, 2016

The difference is a single slash ('/') will do full division return a floating point number. A double slash ('//') will drop the decimal returning a whole integer.

Based on how it is being used I'm guessing the double slash, dropping the decimals values, is correct.

@dallaswinger

This comment has been minimized.

dallaswinger commented Nov 9, 2016

@sstelfox thank you for the clarification :)

@awk9000

This comment has been minimized.

awk9000 commented Nov 11, 2016

Also tested this with latest stable update, smb-ls fails, downloaded Dallas's modified smb.lua and replaced, retested, everything works!

@ZeroChaos-

This comment has been minimized.

ZeroChaos- commented Nov 11, 2016

bump

@tremblerz

This comment has been minimized.

Contributor

tremblerz commented Nov 12, 2016

As stated by @sstelfox already Link tells that // will perform floor division, which is needed in this case since os.date() only expects integer value as second parameter.

@cldrn

This comment has been minimized.

Member

cldrn commented Nov 21, 2016

I will look into this today, your solution seems correct. Thanks for all the details.

@granolocks

This comment has been minimized.

granolocks commented Nov 29, 2016

@cldrn bump, did you get a chance to look at this?

@nmap-bot nmap-bot closed this in 70e9d70 Nov 30, 2016

suraj51k added a commit to suraj51k/nmap that referenced this pull request Jan 31, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment