<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/offsec-stapler-writeup-qvniuggl7" -->

---
title: [OFFSEC] Stapler Writeup | daily.dev
description: A walkthrough of the OffSec 'Stapler' vulnerable lab machine, covering full network enumeration with nmap (TCP/UDP), FTP anonymous access, Samba share...
canonical: https://daily.dev/posts/offsec-stapler-writeup-qvniuggl7
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: [OFFSEC] Stapler Writeup | daily.dev
og:description: A walkthrough of the OffSec 'Stapler' vulnerable lab machine, covering full network enumeration with nmap (TCP/UDP), FTP anonymous access, Samba share...
og:url: https://daily.dev/posts/offsec-stapler-writeup-qvniuggl7
og:image: https://api.daily.dev/og/posts/QvnIuGGl7.png
og:image:alt: [OFFSEC] Stapler Writeup
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# [OFFSEC] Stapler Writeup

**[InfoSec Write-ups](https://daily.dev/sources/infosecwriteups)** · 22 min read · 1 upvotes · 0 comments

## Summary

A walkthrough of the OffSec 'Stapler' vulnerable lab machine, covering full network enumeration with nmap (TCP/UDP), FTP anonymous access, Samba share enumeration with smbclient and enum4linux, and identification of a WordPress site via robots.txt. The exploit chain uses an LFI vulnerability in the 'Advanced Video' WordPress plugin to leak wp-config.php database credentials, then abuses MySQL root privileges to write a PHP web shell via INTO OUTFILE, gaining a www-data reverse shell. Privilege escalation is achieved by reading leaked SSH credentials from a world-readable .bash_history file and exploiting unrestricted sudo permissions for the user peter to reach root.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://infosecwriteups.com/offsec-stapler-writeup-d7e5f4600a0a>

## Questions this post answers

### How can MySQL root privileges be used to get a web shell on a WordPress server?

When a MySQL user has FILE privileges (such as root with ALL PRIVILEGES), the SELECT ... INTO OUTFILE statement can write arbitrary content to disk, including a PHP web shell like `<?php system($_GET["c"]); ?>`. Writing this file into the web root, such as a WordPress uploads directory, lets an attacker execute commands through a simple HTTP request once the correct absolute installation path is known.

_Developers hardening database privileges can track MySQL file-write risks and mitigations on daily.dev._

### What vulnerability exists in the WordPress Advanced Video Embed plugin version 1.0?

Version 1.0 of the WordPress plugin advanced-video-embed-embed-videos-or-playlists contains a Local File Inclusion vulnerability, exploitable through the admin-ajax.php ave_publishPost action's thumb parameter. Setting thumb to a target file path lets an attacker read arbitrary files on the server, such as wp-config.php, exposing database credentials and other sensitive configuration data.

_Teams auditing legacy WordPress plugins can follow LFI disclosures like this one on daily.dev._

### How can a world-readable .bash_history file lead to privilege escalation on a Linux server?

If home directories have overly permissive read access, an attacker can read every user's .bash_history file, which may contain plaintext credentials typed in commands such as sshpass -p <password> ssh user@host. Recovering valid credentials this way, combined with unrestricted sudo permissions like '(ALL : ALL) ALL' in sudoers, allows immediate escalation to root via sudo su.

_Engineers reviewing Linux hardening checklists can find bash history and sudo misconfiguration writeups on daily.dev._

## Similar posts on daily.dev

- [Cybersploit 1 Walkthrough — OffSec](https://daily.dev/posts/cybersploit-1-walkthrough-offsec-sumot5ele) · InfoSec Write-ups · 0 upvotes · 0 comments
- [\[HS\] Dark Writeup](https://daily.dev/posts/hs-dark-writeup-roulrgb8j) · InfoSec Write-ups · 0 upvotes · 0 comments
- [HTB: Job](https://daily.dev/posts/htb-job-lx37g1vbo) · 0xdf hacks stuff · 0 upvotes · 0 comments
- [Blog TryHackMe Box Writeup](https://daily.dev/posts/blog-tryhackme-box-writeup-3qlilbxuy) · InfoSec Write-ups · 0 upvotes · 0 comments
- [HTB: Orion](https://daily.dev/posts/htb-orion-p1pnwvkbh) · 0xdf hacks stuff · 0 upvotes · 0 comments

---

Tags: [#security](https://daily.dev/tags/security), [#wordpress](https://daily.dev/tags/wordpress), [#mysql](https://daily.dev/tags/mysql)

[View this post on daily.dev](https://daily.dev/posts/offsec-stapler-writeup-qvniuggl7)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"[OFFSEC] Stapler Writeup","url":"https://daily.dev/posts/offsec-stapler-writeup-qvniuggl7","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/offsec-stapler-writeup-qvniuggl7"},"datePublished":"2026-08-29T07:49:58.009Z","dateModified":"2026-09-13T18:45:50.492Z","description":"A walkthrough of the OffSec 'Stapler' vulnerable lab machine, covering full network enumeration with nmap (TCP/UDP), FTP anonymous access, Samba share...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/5004a14ee80ab6f58f9937d20e55238e?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/5004a14ee80ab6f58f9937d20e55238e?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"InfoSec Write-ups","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"InfoSec Write-ups","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/f0dc21b5bbfd46fda36f7b4b53dd1705","url":"https://daily.dev/sources/infosecwriteups"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/offsec-stapler-writeup-qvniuggl7","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"security,wordpress,mysql","timeRequired":"PT22M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"InfoSec Write-ups","item":"https://daily.dev/sources/infosecwriteups"},{"@type":"ListItem","position":3,"name":"[OFFSEC] Stapler Writeup"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/offsec-stapler-writeup-qvniuggl7#faq","mainEntity":[{"@type":"Question","name":"How can MySQL root privileges be used to get a web shell on a WordPress server?","acceptedAnswer":{"@type":"Answer","text":"When a MySQL user has FILE privileges (such as root with ALL PRIVILEGES), the SELECT ... INTO OUTFILE statement can write arbitrary content to disk, including a PHP web shell like `\u003c?php system($_GET[\"c\"]); ?\u003e`. Writing this file into the web root, such as a WordPress uploads directory, lets an attacker execute commands through a simple HTTP request once the correct absolute installation path is known. Developers hardening database privileges can track MySQL file-write risks and mitigations on daily.dev."}},{"@type":"Question","name":"What vulnerability exists in the WordPress Advanced Video Embed plugin version 1.0?","acceptedAnswer":{"@type":"Answer","text":"Version 1.0 of the WordPress plugin advanced-video-embed-embed-videos-or-playlists contains a Local File Inclusion vulnerability, exploitable through the admin-ajax.php ave_publishPost action's thumb parameter. Setting thumb to a target file path lets an attacker read arbitrary files on the server, such as wp-config.php, exposing database credentials and other sensitive configuration data. Teams auditing legacy WordPress plugins can follow LFI disclosures like this one on daily.dev."}},{"@type":"Question","name":"How can a world-readable .bash_history file lead to privilege escalation on a Linux server?","acceptedAnswer":{"@type":"Answer","text":"If home directories have overly permissive read access, an attacker can read every user's .bash_history file, which may contain plaintext credentials typed in commands such as sshpass -p \u003cpassword\u003e ssh user@host. Recovering valid credentials this way, combined with unrestricted sudo permissions like '(ALL : ALL) ALL' in sudoers, allows immediate escalation to root via sudo su. Engineers reviewing Linux hardening checklists can find bash history and sudo misconfiguration writeups on daily.dev."}}]}
```

