Forbid an exe to read part of memory [closed] - windows

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
There is a program that scans the memory of my machine to find what programs I am using. I want to avoid this.
Is there any solution to forbid this other program from checking my memory, so it will only see its own memory?
I'm using windows.

The only way I know of for one process to read another process's memory is via ReadProcessMemory(), which requires the reading process to use OpenProcess() to obtain PROCESS_VM_READ permission to the process being read. So, presumably that is succeeding, which means the reading process has adequate permission to access your app's memory, such as if the reading app is running as an admin, or is a debugger. In which case, there is not much your app can do to block it, except either alter its own security descriptor via SetSecurityInfo() (but OpenProcess() allows debuggers to bypass that descriptor and gain full access), or set your app to run with a higher integrity level (Vista and later only) than the reading app uses so that PROCESS_VM_READ permission is denied.
Refer to MSDN for more details:
Process Security and Access Rights

I always use the sandbox that comes with Avast Antivirus (www.avast.com). It allows you to run applications in a completely isolated environment.

Related

Windows Accounts and processes exploitation [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 5 years ago.
Improve this question
Part 1- Do all processes and executables in Windows require an account run and manage them. I was reading how the System account manages the core processes of the OS while service accounts and User accounts manage applications.
Part 2- Do applications or processes that are exploited by any means such as buffer overflow for example and a hacker receives a shell from the exploitation will the shell be under the priveleges of the account that was running the process?
I do not really understand your first question, but yes all the processes have a owner (so a 'user' account in some way...). System is just a particular user in Windows who can basically do anything.
Given a process X which has been run by USER_A, if you're USER_B and exploit the process X with a buffer overflow (or whatever), by controlling this process, you will be able to do everything USER_A can do, so if you launch a shell through the process X, you will have the rights of USER_A in this shell.

Mac app: want to copy system files out of the protected location, and failed [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
In my Mac program, I want to copy the file located in /private/var/db/dslocal/nodes/Default/users/xx.plist to another disc.
Presumably it will failed, and it is.
I use the api of copyItemAtPath:toPath:error: to do this,
and I NSLog out the error infomation:
it says /private/var/db/dslocal/nodes/Default/users/xx.plist this file couldn't be opened because I don't have permission to view it.
The operation couldn't be completed, Permission denied.
And can anyone could introduce me to some documentations or sample codes that I should read to solve my problem? Please!
You're trying to do something that requires the user to be an administrator (or root), which requires elevated access. The way to do go about this in OSX is to factor out the privileged code into a separate executable that is run with elevated permissions, after having prompted the user for an administrator's credentials.
Take a look at OSX Authorization services for prompting the user:
https://developer.apple.com/library/mac/#documentation/Security/Reference/authorization_ref/Reference/reference.html
And SMJobBless for creating the application with elevated rights: -
https://developer.apple.com/library/mac/#samplecode/SMJobBless/Introduction/Intro.html

Is there a way to handle locked file from command line and release it? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
Is there a way to detect locked files in specify folder and release them by command line?
Something like this in pseudo-code:
for file in folder do
unlock file
Yes, this is possible using a free utility called Handle, by Mark Russinovich.
It can be download here from Microsoft.
This runs from the command line, and will tell you which program has a particular file or directory open, based on whether it has an open handle to that resource.
By running handle.exe with the -c flag, you can also force the specified handle closed, which will unlock the resource. But fair warning: this will likely cause the application using the resource to crash, perhaps even the entire system to become unstable. So I wouldn't make a habit of doing this; only use it for special cases like debugging where you expect some instability.
No, you can't you have to close the application holding the lock first. Unlocker may help you locate the source of the lock - if it's a crashed application then you'll be able to terminate it's process.

How to force delete a file? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
This question exists because it has
historical significance, but it is not
considered a good, on-topic question
for this site, so please do not use it
as evidence that you can ask similar
questions here.
How can i force Windows XP to delete file that is currently being used by some application?
You have to close that application first. There is no way to delete it, if it's used by some application.
UnLock IT is a neat utility that helps you to take control of any file or folder when it is locked by some application or system. For every locked resource, you get a list of locking processes and can unlock it by terminating those processes. EMCO Unlock IT offers Windows Explorer integration that allows unlocking files and folders by one click in the context menu.
There's also Unlocker (not recommended, see Warning below), which is a free tool which helps locate any file locking handles running, and give you the option to turn it off. Then you can go ahead and do anything you want with those files.
Warning: The installer includes a lot of undesirable stuff. You're almost certainly better off with UnLock IT.

Is it possible to limit folder size in a Windows environment? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
Is it possible to limit a folder size in Windows so that when a user tries to write to the folder when it is full he receives an error message?
Keep in mind that Disk Quotas are per user not per folder, there are other solutions that will allow you to lock down a folder size regardless of user, my experience has been with Veritas Storage Exec, but it seems to be discontinued.
Do you mean disk quotas as described at, e.g. http://www.windowsnetworking.com/articles_tutorials/Configuring-Disk-Quotas-Windows-2003.html?
Have a look at Quotas for NTFS file systems..
The Windows Server 2008 Administrator's Companion recommends using the File Server Resource Manager instead of the older "disk quota" feature since these allow per-directory settings. (I'm not familiar with this tool myself; after 5 mins of playing around with it, I still have no idea how to actually do this. There certainly is a column for "quota", however.)
Another trick is to create a new volume and then use a symbolic link (see MKLINK) to map the directory to that volume. (MKLINK is Vista/2008 and later; for XP/2003 use NTFS junctions.)
It depends on how limiting you want to be. :)
For example, it's not difficult to write a program that listens/monitors a folder and displays a message box error/warning in case the user exceeds his quota. But that doesn't prevent him from exceeding it - just notifies him he did so.

Resources