Skip to main content

ZIP Symlink Vulnerability

What is Symlink?

A symlink (also called a symbolic link) is a type of file in Linux that points to another file or a folder on your computer. Symlinks are similar to shortcuts in Windows

There are two types of symlinks


Soft and Hard Link

A symbolic or soft link is an actual link to the original file, whereas a hard link is a mirror copy of the original file. If you delete the original file, the soft link has no value, because it points to a non-existent file. But in the case of hard links, it is entirely the opposite. Even if you delete the original file, the hard link will still have the data of the original file. Because hard link acts as a mirror copy of the original file

For know more about the symlink please visit:

https://ostechnix.com/explaining-soft-link-and-hard-link-in-linux-with-examples/


What is ZIP SYMLINK  Vulnerability?

An  archive can contain a symbolic link. A symbolic link is a special file that links to another file. By uploading a zip containing a symbolic link, and after the zip is extracted, you can access the symbolic link to gain access to files that you should not get access to. To do so, you need to get your symbolic link to point to files outside of the web root, for example /etc/passwd.


These type of issues are typically found when a developer allowing to accept zip file in our upload functionality. When a user uploads the zip file in the application then it  simply takes the zip file and extracts its files without any validations.


HACK STEPS: -

Create a symlink like ln -s /etc/passwd etc

Create a zip file with symlink  : zip -r --symlinks  demo.zip etc

Upload demo.zip on web application

After uploading zip file in application simply extract the files and show their content

on web page Without any validation so /etc/password data shown on web page

For demo please visit my github repo: 

Comments

Popular posts from this blog

Passcode Protection Bypass By Brute Forcing On zoho (Cliq Application)

First We discuss about what is passcode and Why it is Implemented in  Mobile Applications. PASSCODE Implemented in Mobile Application to protect Applications from an Unauthorized Access.like for example your cliq or any application account is logged in mobile phone .any your friend ask you to give phone , your friend try to open cliq application to see your message, but your friend cant open the application without entering passcode . he have to enter passcode for open, so it is an extra layer security in  applications. Passcode protection implemented in Android Application is an extra layer security to protect an unauthorized access. How Passcode Protection is bypassed by Bruteforcing? You know that passcode protection or pin protection in mobile applications have some attempt to enter passcode , if you enter  wrong passcode more than 5 times or 10 times based on application security , User logged out automatically and redirected to login page.but due to some ...

Exploitation of Improper Export of Activities In Android Application

In android You know that every GUI interface is an  separate activity. An activity represents a single screen with a user interface just like window or frame of Java. In An application there are many activities depend on application functionalities. Let's take a example : An application that have   three modules login , register and   dashboard . For that there are there are three different activities for all these modules. What is export Means Here? In Android Application there is an attribute android: exported =true or false . This attribute is used in android   to provide an access to   other third party application to start their service , activities   and receive broadcast   messages. Like for an Example : If an application    have broadcast receiver to receive any events or message , if in that application exported attribute is set to true then this    broadcast message   can also receive by other thi...

A New Way Of Brute force Passcode/Pin Protection By deep link

DESCRIPTION : AS you know already that what is passcode protection and why it is applied ? And how it is bypassed normally ? If you don’t know please read my previous blog:   https://negativewives.blogspot.com/2020/04/passcode-protection-bypass-by-brute.html                                                                                When any passcode protection is implemented first check any activity is exported or not ? Here we  only talking the scenario where no activity is exported in application   PROCEDURE : Open Application after implementing passcode protection. You see that passcode activity is launched first Go to AndroidMainfest.xml file and check launch mode of passcode activity . Question Arises in your mind   - ...