-
Notifications
You must be signed in to change notification settings - Fork 13.8k
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 error when service is already running and update exception documentation in lib/msf/core/post/windows/services.rb #16602
Fix error when service is already running and update exception documentation in lib/msf/core/post/windows/services.rb #16602
Conversation
…ly note what functions can raise
This will need a secondary review, but @kalidor if you could confirm these changes work for you, I don't think your current steps provide enough info to fully replicate your issue so I'd appreciate a demo video or similar showcasing that these fixes work for you before I land this. @bwatters-r7 Any chance you could take a look over this before I land it? Apologies in advance for asking you to take a second look at my PRs this week 😅 |
Hi, i can confirm those changes work fine. Here are two videos: https://unixed.fr/~gch/msf_service.html. The first one used the actual version of services.rb, the second one uses the updates version of services.rb. |
Alright thanks @kalidor! Videos look good, will land this now. Should be available in this week's release. |
Release NotesPreviously if a user restarted a service using |
Fixes #16603
metasploit-framework/lib/msf/core/post/windows/services.rb
Lines 517 to 564 in 20198a2
metasploit-framework/lib/msf/core/post/windows/services.rb
Lines 423 to 431 in 20198a2
service_start()
function should return Error::SERVICE_ALREADY_RUNNING as string or raise Error::SERVICE_ALREADY_RUNNING, to get catch byrescue RuntimeError => s
block and don't raise an error.I suppose raising an error is better, since the function will keep returning only Integer.