Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Adds script to extract SMB Enum Services #987
There is an issue with smb-enum-services I created.
While you execute the script, you can observe the debug statements added, focus on the debug statements in line 3502 in msrpc.lua. Since we are not sure of the offset, I'm iterating over all the values and you can see the output as numbers like 11, 0 and nil. These are the error status codes as represented in here.
I read the documentation as mentioned in https://msdn.microsoft.com/en-us/library/windows/desktop/ms682637(v=vs.85).aspx.
Any kind suggestions are appreciated, Thanks !
This comment has been minimized.
This comment has been minimized.Show comment Hide comment
The above comment explains that I got error as ERROR_BAD_FORMAT, even after sending the correct request(I think so). So, here is something new I found.
The last 2 commits tries adding new function, enumservicestatusexw to retrieve the list of services. Reasons to add this service.
The issue with this service is,
From these series of errors and debugging I think there is some issue with the crafting the request packets before being sent.
Any kind of help is highly appreciated !!
You can ignore the above 2 comments for now(I think so).
The final code as of now, captures the entire buffer and unmarshalls pcbBytesNeeded, lpServicesReturned, lpResumeHandle, ReturnValue, pcbBytesAcquired successfully. The next issue I'm having is unmarshalling the LPENUM_SERVICE_STATUS data type as mentioned in here.
I tried unmarshalling the captured lpservices but the SERVICE_STATUS of all services are present in the beginning of the hexdump while lpDisplayName and lpServiceName of all services are at the ending of the buffer. I tried by unmarshalling it the lpservices with
Very exciting to see this working! Some polish items and some issues to deal with, and then you can commit.