Trust No Program
This topic is locked: you cannot edit posts or make replies.
Compressing in a sandbox with 7-Zip
schmenge35


Joined: 12 Feb 2009
Posts: 4
Reply with quote
Hello,

I like to compress some of my downloads in the sandbox with 7-Zip before moving them out. This was never a problem until now. All Sandboxie versions after 3.28 return an error from 7zip stating "can not open mapping". However archives will decompress within a sandbox without error.
No ammount of Full Access permissioning would fix it.

Thanks for the magnificent program. I DL and set up about 20 new programs a day. In the old days this meant saving and restoring regs and hunting for leftover parts of the installs.
Also I dont even run antivirus anymore except for on-access scanning of DLs.
I have never been able to get VirtualBox or VMware or the others to work for me, so Sandboxie's ease of use is most greatly appreciated.

Thank you again to Mr. Ronene Tzur!
View user's profileSend private message
Guest10


Joined: 27 Apr 2008
Posts: 4361
Location: Ohio, USA
Reply with quote
I previously posted this reply, and then withdrew it. My tests while using this were successful, and then after I posted the message, I had one test that failed, with a different error message from 7-Zip - and I couldn't figure out what that problem was. Subsequent tests have worked, so I'm re-posting this if you want to try it for yourself:
-----------
When you try to zip files that are in a sandbox folder, 7-Zip will run sandboxed, and therefore will run under Sandboxie's control. The sandboxed 7-Zip needs access to a resource that Sandboxie blocks, unless you specifically allow access to that resource. To allow that access, you will need to add an exclusion to the Sandbox Settings of each sandbox in which you want to use 7-Zip, to zip the files.

Sandbox Settings > Resource Access > IPC Access > Direct Access
In "The list above applies to:" box, type
7zg.exe
Do not press Enter, but click on the "Edit/Add" button.
Put in the box:
*\BaseNamedObjects*\7zCompressMapping*
and click OK.

Then click on "Apply", not OK, because you should also add '7zg.exe' to the list of Lingering Programs while you are in Sandbox Settings:
Program Stop > Lingering Programs > "Add by Name"
7zg.exe
and click OK until the Sandbox Settings window closes.
The Lingering Programs setting will cause the sandboxed process '7zg.exe' to end, when it is finished with the zip operation. Otherwise, you would have to manually 'Terminate' the program.
[Edited to add some wild cards to the exclusion - in case they may be needed by someone using Vista]


Last edited by Guest10 on Fri Mar 20, 2009 12:28 pm; edited 1 time in total

_________________
Paul
XP Pro SP3 (Admin rights), Zone Alarm Pro Firewall, Malwarebytes Pro, Firefox 21, Thunderbird 17
View user's profileSend private message
schmenge35


Joined: 12 Feb 2009
Posts: 4
Reply with quote
Thank you very much ,Working now! :D Thanks again
View user's profileSend private message
Compressing a file inside sandboxie
Mattchu


Joined: 03 Oct 2009
Posts: 6
Reply with quote
Hello all, i`m quite new to sandboxie and was just wondering something. When downloading stuff(possible malware) inside a sandbox and it is then found to be malicious how do you guys go about compressing the executable to a .ZIP file?
I tryed to do it with 7-zip but was unable to, kept getting an error.

Just wondered because to submit said files they need to be compressed/password protected and i wouldn`t like to let them out of the box just to compress them.
With a VM you don`t have this issue, but like i said sandboxie and it`s workings are new to me.

Many thanks for any suggestions
View user's profileSend private message
Guest10


Joined: 27 Apr 2008
Posts: 4361
Location: Ohio, USA
Reply with quote
Is it the "Cannot open mapping" error, in 7-Zip?
Since the file is in a sandbox folder, compressing it with 7-Zip will run 7-Zip sandboxed.
Sandboxie needs to be told to allow one of 7-Zip's resources.
If you want to add a local template to your Sandboxie configuration, it should allow sandboxed 7-Zip to work in the sandbox you choose.

Open Sandboxie Control's window (the tray icon), then choose any sandbox you may have from the "Sandbox" menu, then:
Sandbox Settings > Applications > Local > Create New
then paste in a copy of the template (in the code box, below).
Click OK, twice.

Then for each sandbox where you want to allow this template:
(sandbox) > Sandbox Settings > Applications > Local
Select the 7-Zip entry on the right side, then click Add and then OK.
----
This has been tested from within Windows Explorer, by right-clicking the file and choosing 7-Zip > Add to Archive.
The compressed file will be created in the same folder as the original file.

It used to be necessary for me to add 7zG.exe to my list of Lingering Programs, but for some reason I no longer have to.
It's still listed in the local template's comment line, though.
Code:
[Template_Local_7-Zip]

Tmpl.Class=Local
Tmpl.Title=7-Zip
Tmpl.Url=http://www.7-zip.org/
Tmpl.Comment=If necessary, add 7zG.exe as a Lingering Program in your Sandbox Settings
OpenIpcPath=*\BaseNamedObjects*\7zCompressMapping*
View user's profileSend private message
Mattchu


Joined: 03 Oct 2009
Posts: 6
Reply with quote
Thanks for answering Guest10, i did what you recomended but am still getting "Can not open mapping" window when i try to compress a file with 7-zip.
This is on windows 7 RC allthough i don`t no if that would make a differance. Also i do not have the "Run as UAC Administrator" ticked, i tried that but still no joy.
Tried addiing the 7zg.exe to Sandbox/Default box/Sandbox settings/Program Stop/Lingering programs as well, still no joy.

Any other ideas, suggestions, things i could try?


Cheers

It`s allright now, i`ve sussed what you need to do(run explorer sanboxed to compress Rolling Eyes) , thanks again Guest10 Wink
View user's profileSend private message
tzuk


Joined: 22 Jun 2004
Posts: 15008
Reply with quote
Guest10 should I your 7-Zip configuration to my Templates.ini ?

_________________
tzuk
View user's profileSend private message
Guest10


Joined: 27 Apr 2008
Posts: 4361
Location: Ohio, USA
Reply with quote
tzuk wrote:
Guest10 should I your 7-Zip configuration to my Templates.ini ?
Normally I would say yes. It has worked well for me.
I'm a little confused now though, since Mattchu said that he had to compress the file using a sandboxed Windows Explorer.
On XP, I just use an unsandboxed Windows Explorer and right-click the file in the sandbox.
Then after selecting 7-Zip's 'Add to Archive', 7-Zip runs sandboxed without any problems - if the template has been applied to that sandbox.

I can't test it on Win 7.

I've given this same tip before, and it worked for that user.
View user's profileSend private message
tzuk


Joined: 22 Jun 2004
Posts: 15008
Reply with quote
OK, maybe I will look into this then.
View user's profileSend private message
Mattchu


Joined: 03 Oct 2009
Posts: 6
Reply with quote
Sorry this was my mistake/misunderstanding of how sandboxie works. I removed the configuration you recomended and when running explorer sandboxed am still able to compress things in the sandboxie folder.
If i try and do it without and just having your code in place i still get the "Can not open mapping" message.
Will try on xp later on and will let you know the results, it`s most likely a 7 issue.

It did a resource access monitor and came back with these results after doing it twice. Maybe they can help.

snipped. --tzuk
View user's profileSend private message
Guest10


Joined: 27 Apr 2008
Posts: 4361
Location: Ohio, USA
Reply with quote
Try adding this line to the local template:
OpenIpcPath=*\BaseNamedObjects*\7zMap*

You will need to use:
Configure > Edit Configuration to edit the local template, and add that line.

or you could use:
(sandbox) > Sandbox Settings > Applications > Local
Select the template from the list on the right, and then click"Remove" and then OK.
After you "Remove" the template from all sandboxes where it is applied, then Sandboxie will ask if you want to delete the template itself.
If you answer yes, then the old template will be removed from your configuration file.
You would then need to use "Create New" to add the revised template, below, to the configuration file.

If you use the second method, don't forget to Add this template in
(sandbox) > Sandbox Settings > Applications > Local
for the sandbox(es) where you will be using it.
----------------------------------
It should look like this:
Code:
[Template_Local_7-Zip]

Tmpl.Class=Local
Tmpl.Title=7-Zip
Tmpl.Url=http://www.7-zip.org/
Tmpl.Comment=If necessary, add 7zG.exe as a Lingering Program in your Sandbox Settings
OpenIpcPath=*\BaseNamedObjects*\7zCompressMapping*
OpenIpcPath=*\BaseNamedObjects*\7zMap*


Last edited by Guest10 on Sat Oct 17, 2009 4:15 pm; edited 1 time in total
View user's profileSend private message
Mattchu


Joined: 03 Oct 2009
Posts: 6
Reply with quote
Champion Guest10, that did the trick, nice 1.

I had a feeling it was something to do with \BasedNamedObjects\7zMap..... as that was the only one with an X next to it.
Once again thanks and i think i may well be purchasing this product very soon.

Have a good day Smile
View user's profileSend private message
Problem with mapping with 7z
nijiko


Joined: 28 Mar 2009
Posts: 70
Reply with quote
When you are in Sandboxie's folder, not running Explorer in sandbox.
Right click to use 7z, you will receive 7z's warning, "can not open mapping", and 7z exit, can not use 7z.
View user's profileSend private message
Guest10


Joined: 27 Apr 2008
Posts: 4361
Location: Ohio, USA
Reply with quote
Here's a local template that you can use:
Code:
[Template_Local_7-Zip]

Tmpl.Class=Local
Tmpl.Title=7-Zip
Tmpl.Url=http://www.7-zip.org/
Tmpl.Comment=If necessary, add 7zG.exe as a Lingering Program in your Sandbox Settings
OpenIpcPath=*\BaseNamedObjects*\7zCompressMapping*
OpenIpcPath=*\BaseNamedObjects*\7zMap*
To add and then apply a local template:
Open Sandboxie Control's window (the tray icon), then choose any sandbox you may have from the "Sandbox" menu, then:
Sandbox Settings > Applications > Local > Create New
then paste in a copy of the template (in the code box, above).
Click OK, twice.

Then for each sandbox where you want to allow this template:
(sandbox) > Sandbox Settings > Applications > Local
Select the 7-Zip entry on the right side, then click Add and then OK.
View user's profileSend private message
nijiko


Joined: 28 Mar 2009
Posts: 70
Reply with quote
Well, it works.

Is there any other spec. programs's settings like this?

I just think to solve all these kinds of problems, not until I have error on them.

Thank you.
View user's profileSend private message
Compressing in a sandbox with 7-Zip
You cannot post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT  
Page 1 of 2  

Use the RSS feed to watch this topic for replies
  
  
 This topic is locked: you cannot edit posts or make replies.  

Sandboxie is Copyright © 2004-2012 by Sandboxie Holdings LLC.  All rights reserved.
Sandboxie.com | Contact Author
This site has been viewed 208,659,442 times since June 2004