# T1553.001 - Gatekeeper Bypass
## [Description from ATT&CK](https://attack.mitre.org/techniques/T1553/001)
<blockquote>Adversaries may modify file attributes that signify programs are from untrusted sources to subvert Gatekeeper controls. In macOS and OS X, when applications or programs are downloaded from the internet, there is a special attribute set on the file called <code>com.apple.quarantine</code>. This attribute is read by Apple's Gatekeeper defense program at execution time and provides a prompt to the user to allow or deny execution. 

Apps loaded onto the system from USB flash drive, optical disk, external hard drive, or even from a drive shared over the local network won’t set this flag. Additionally, it is possible to avoid setting this flag using [Drive-by Compromise](https://attack.mitre.org/techniques/T1189). This completely bypasses the built-in Gatekeeper check. (Citation: Methods of Mac Malware Persistence) The presence of the quarantine flag can be checked by the xattr command <code>xattr /path/to/MyApp.app</code> for <code>com.apple.quarantine</code>. Similarly, given sudo access or elevated permission, this attribute can be removed with xattr as well, <code>sudo xattr -r -d com.apple.quarantine /path/to/MyApp.app</code>. (Citation: Clearing quarantine attribute) (Citation: OceanLotus for OS X)
 
In typical operation, a file will be downloaded from the internet and given a quarantine flag before being saved to disk. When the user tries to open the file or application, macOS’s gatekeeper will step in and check for the presence of this flag. If it exists, then macOS will then prompt the user to confirmation that they want to run the program and will even provide the URL where the application came from. However, this is all based on the file being downloaded from a quarantine-savvy application. (Citation: Bypassing Gatekeeper)</blockquote>

## Atomic Tests

- [Atomic Test #1 - Gatekeeper Bypass](#atomic-test-1---gatekeeper-bypass)


<br/>

## Atomic Test #1 - Gatekeeper Bypass
Gatekeeper Bypass via command line

**Supported Platforms:** macOS


**auto_generated_guid:** fb3d46c6-9480-4803-8d7d-ce676e1f1a9b





#### Inputs:
| Name | Description | Type | Default Value |
|------|-------------|------|---------------|
| app_path | Path to app to be used | Path | myapp.app|


#### Attack Commands: Run with `sh`!  Elevation Required (e.g. root or admin) 


```sh
sudo xattr -d com.apple.quarantine #{app_path}
```






<br/>
