Re: How to block system copy commands at driver level



Ok, well, by and large, driver hackers aren't the best people to ask
about GUI level windows internals, but there are a number of tricks you
could try, including global windows message hooks, Shell Extensions,
clipboard monitoring, hooking of the CopyFile/Ex function (using, e.g.,
Detours), etc.

Still... are you talking about just Windows Explorer? Because hundreds
of apps implement copy and paste functionality for files, and they don't
all do it through the clipboard. In particular, File Menu->Copy types of
functionality are probably implemented by a lot of apps using a simple
Open Source&Dest/Read Source/Write Dest loop, and you're not going to be
able to deal with that.

Also, I don't know enough about it to say for certain, but I really
don't know how the cmd prompt copies files, or whether there's a good
way to squeeze in there.

In any event, I agree with another poster that called this "snake oil".
It's really not improving your security the same way that, say,
encrypting the data would.

Bipin Mistry wrote:
Hello Ray,

I do agree that there is no limits to copy file(hacking the data),
thats the reason our task is limited to restrict standerd copy/paste
methods which are as follows:

1. [Ctrl + C],
2. Right Click Menu -> Copy
3. File Menu -> Copy
4. Command prompt copy
5. Drag& Drop

Bipin


On 5月30日, 午前3:02, Ray Trent<r...@xxxxxxxxxxxxx> wrote:
I think that your biggest difficulty here is that your problem space is
completely undefined. Which of the following things do you need to prevent:

1) Just well-known GUI-level copy commands such as cut-and-paste&
drag-and-drop.

2) #1 + opening a command prompt and typing "copy z:foo.txt a:"

3) #2 + preventing a specific list of existing archiving/copying
applications from copying the data.

4) #3 + preventing someone opening the file in notepad, selecting all
the data, and pasting into another program, and saving the data from there.

5) #4 + preventing the user from writing any program that would allow
the copying of data from z: to any other location.

The problem you have is that #4 and #5 are impossible, as long as you
allow arbitrary read-access to the data by any program that you don't
control 100%. But if you control the program 100% then you don't need
what you're asking for here, because the app can just refuse to copy it.

And then there's 6) #5 + preventing the user from debugging your
application, extracting the data from memory, and copying it to another
location for duplication.

You can't stop #6 *even if* you control the only program that can read
the data, as long as it's possible for the user to see the data at some
point, unless you required external hardware support (such as a monitor
that decodes encrypted data in order to display it, and an app that
never stores decrypted data in memory).

And then there's 7) #6 + preventing the user from taking a digital
photograph of their screen and running the data through OCR to save it
on another machine.

If you can fix #7, well, patent it quick because the big media companies
will make you rich beyond your wildest dreams.

So... which of these do you need to prevent? I don't see any hope for
anything above #3, actually... but who knows.

Seriously, though, just encrypt your data. Then it doesn't matter if
someone copies it.





Bipin Mistry wrote:
Hello Tim
As you stated below
Not at the driver level. Just stop and think for a moment: how is the
"copy" program implemented? It's a loop:
hSrc = CreateFile( ... );
hDst = CreateFile( ... );
while( 1 ) {
ReadFile( hSrc, Buffer ... );
if( end of file )
break;
WriteFile( hDst, Buffer ... );
}
Now I also understand that there is only read/write at driver level
that is what been called in loop.
but to call this loop there should be some system event which also
contains hSrc& hDst information.
we can trace that and can figure out that current process required to
copy data from restricted (z:) to local zone (c:) or so...
As per me thinking logically
Way 1
1. we need to figure out a way to identify<< hSrc>> & << hDst
2. check for<< hSrc>> with restricted (z:) then do not perform
this task& reset the system& environment variable
Way 2
1. Hook the clipboard where Copy / Paste commands gets triggered
2. Check for Copy source with restricted (z:) then ignore the copy
sequence.
Way 3 (by Alexander Grigoriev)
1. When restricted drive (z:) is mounted user can not access any
other drive or network share folder in write mode.
Although these all are just thinking process, haven't come across who
have implemented.
If any one have any updates or improvement or tips& tricks to do any
of above then please do get back on this thread.
Bipin
--
Ray- 引用テキストを表示しない -

- 引用テキストを表示 -



--
Ray
.



Relevant Pages

  • Re: How to block system copy commands at driver level
    ... thats the reason our task is limited to restrict standerd copy/paste ... #3 + preventing someone opening the file in notepad, ... WriteFile(hDst, Buffer ... ... that is what been called in loop. ...
    (microsoft.public.development.device.drivers)
  • Re: Splash Screens , how could something so basic still be hard?
    ... You say that there "is no message pump to allow for further GUI ... Note that by "there is no message pump", I mean that because of the way the code is written, no message pump is working while the "splash screen" is displayed. ... In a normal Forms app, there would be a message pump loop, and there's no reason to believe that in those examples, one doesn't exist. ... The same technique is possible in Windows, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Bug in win xp: Auto-detaching modeless dialog.
    ... Destroying the dialog is important whether there is a bug or not. ... >I don't think that windows API cares about design flaws. ... >> The whole loop with a sleep in it is a colossal blunder. ... My program does some time consuming calculations and from ...
    (microsoft.public.vc.mfc)
  • Re: threading question
    ... say I have a worker process processing in a loop ... Note that console apps very rarely show "Not Responding" because the Win32/64 console subsystem puts a layer between the application's input queue and the underlying windows message queue. ... A dotNet Console application become "native" console applications. ...
    (microsoft.public.dotnet.languages.csharp)
  • Delaying events for fixed amounts of time.
    ... amount of time after the *FIRST* event with a given key arrives. ... maybe on the order of 50-100 every second, with 15-30 unique keys per ... I have anything Windows has to offer. ... Pause for, say, 250ms each time through the loop ...
    (comp.programming.threads)