> For the complete documentation index, see [llms.txt](https://sarpers-organization.gitbook.io/ctftricks/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sarpers-organization.gitbook.io/ctftricks/_chapter-intro-17/bypass/filesystem/trick-0041.md).

# Bypass Flag Check By Log Deletion

***

Once a shell is obtained on the target system, check for application logs or state files on the filesystem that might be preventing desired actions via the web interface. If identified (e.g., through hints, code review, or filesystem exploration), deleting the specific file can reset the application's state, bypassing checks.

For instance, deleting a log file that tracks uploads might allow re-accessing or retrieving previously blocked files. On Windows systems, the `del` command can be used:

```powershell
del C:\xampp\htdocs\uploads\log.txt
```

To remove a file on Unix-like systems, you can use the `rm` command:

```bash
rm /path/to/webroot/uploads/log.txt
```

The `-f` flag can be used with `rm` to force deletion:

```bash
rm -f /path/to/file/to/delete
```

After deleting the relevant file, attempt the action on the web application again, such as accessing the flag URL:

```bash
curl http://TARGET_IP:8000/asdasdadasdjakjdnsdfsdfs.php
```
