Skip to content
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

Win32UI.exe Application Manifest Not Applied #184

Open
mstarks01 opened this issue Apr 14, 2014 · 10 comments
Open

Win32UI.exe Application Manifest Not Applied #184

mstarks01 opened this issue Apr 14, 2014 · 10 comments
Assignees

Comments

@mstarks01
Copy link
Contributor

Starting with Vista, applications need to have either an internal or external XML application manifest for applications that require administrator access. This elevates the application using UAC. os_win32ui.c has some code which seems to attempt to identify if the user is an administrator, and there is a .manifest file in that same directory, but it doesn't work.

@mstarks01 mstarks01 added the bug label Apr 14, 2014
@awiddersheim
Copy link
Member

I've seen this as well and know how to fix it but am waiting for the 2.8 release before I start to consider taking on any major changes.

@mstarks01
Copy link
Contributor Author

@awiddersheim Thanks and much appreciated.

@awiddersheim
Copy link
Member

Right now I'm basically thinking of not only applying this manifest to the UI but to many if not all of the OSSEC executables that get installed. I'd also like to consolidate a lot of the Windows code/definitions into single includes like defs.h for example. Right now things on the windows side is a bit all over the place and there is a lot of code duplication for no real reason.

I would also like to move a lot of installation stuff surrounding services/permissions into NSIS instead of having it written in C. The ground work has been started in the upcoming 2.8 release but a lot more can be moved which will reduce a lot of C code and hopefully make things a bit easier to change for everyone since NSIS is a bit easier to work with IMO.

@awiddersheim
Copy link
Member

Also, just to put this down in public, the manifest does get added to the win32ui.exe. It just isn't doing so in a way to Windows is seeing it/using it. I think changing the ID that gets to 1 should fix the issue.

https://github.com/ossec/ossec-hids/blob/master/src/win32/ui/os_win32ui.h#L103

I thought I read somewhere on some Windows documentation page that it is required to be 1 to work so I'm not sure why 201 was used but I'm having a hard time finding that documentation right now.

@mstarks01
Copy link
Contributor Author

There's very little reason for standard users to be messing with ossec. An unprivileged attacker would benefit from seeing even ossec.conf, so I agree that most everything should require privilege escalation.

@awiddersheim
Copy link
Member

Agreed. The ossec.conf should no longer become world readable when edited by the win32ui.exe after the work in #89 but using a manifest is the proper way to do things in Windows which is what prompted me to start looking at the manifest and it's failure to be applied in the first place.

@mstarks01
Copy link
Contributor Author

I don't want to diverge the intent of this thread, but if you have the inclination you may want to look at the feasibility of running ossec-agent.exe under Local Service or Network Service rather than Local System (I tried it and it doesn't work). The network part should not need widespread access to the system that Local System provides. Syscheck and rootcheck does need this access and perhaps it is inheriting the rights from ossec-agent.exe, but a more privilege separated model similar to what exists on the 'nix side it desirable.

@jrossi
Copy link
Member

jrossi commented Apr 23, 2014

No need to wait master is moving forward and stable will pull in changes/bug fixes as needed.

@awiddersheim
Copy link
Member

Just a bit busy at the moment. Didn't mean to imply that I was waiting for 2.8 but rather after 2.8 is probably the timeframe at which I'll be able to start tackling things again.

@jrossi
Copy link
Member

jrossi commented Apr 23, 2014

No problem ;)

On Apr 23, 2014, at 8:48 AM, "awiddersheim" [email protected] wrote:

Just a bit busy at the moment. Didn't mean to imply that I was waiting for 2.8 but rather after 2.8 is probably the timeframe at which I'll be able to start tackling things again.


Reply to this email directly or view it on GitHub.

@awiddersheim awiddersheim self-assigned this Feb 1, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants