Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a file to test Zip Slip Vulnerability from commandline

Tags:

zip

From https://snyk.io/research/zip-slip-vulnerability

The contents of this zip file have to be hand crafted. Archive creation tools don’t typically allow users to add files with these paths, despite the zip specification allowing it. However, with the right tools, it’s easy to create files with these paths.

I want to create a test payload so that i can check few of my zip handling logic. But i cant find any leads on how to create one.

:~/Desktop # touch "../../../../../../../../tmp/evil.sh"
:~/Desktop # ll
:~/Desktop # ll /tmp/evil.sh
-rw-r--r-- 1 root root 0 Jun 14 09:27 /tmp/evil.sh
like image 781
Atul Soman Avatar asked Jun 14 '18 03:06

Atul Soman


People also ask

How do I test a zip file?

To access the test function, open the Unzip tab (the Zip pane must be the active pane). Click the top part of the Diagnostics button to test the Zip file and view a summary report. To receive a more detailed report, click on the bottom half of the Diagnostics button and click Detailed on the dropdown menu.

What is zip Slip vulnerability?

Zip Slip is a widespread critical archive extraction vulnerability, allowing attackers to write arbitrary files on the system, typically resulting in remote command execution.

What is a zip file used for?

Zipped (compressed) files take up less storage space and can be transferred to other computers more quickly than uncompressed files. In Windows, you work with zipped files and folders in the same way that you work with uncompressed files and folders.


1 Answers

Maybe

zip zipslip.zip ../../../../../../../../tmp/evil.sh
like image 166
Hillebrand Gelderblom Avatar answered Oct 27 '22 00:10

Hillebrand Gelderblom