├── .gitignore ├── composer.json ├── composer.lock ├── db.php ├── exploits ├── gotcha-normal.otf ├── gotcha.css ├── gotcha_font.php ├── rshell-normal.otf ├── rshell.css └── rshell_font.php ├── func.php ├── images └── screenshot.png ├── index.php ├── mail.php ├── pdf.php ├── readme.md ├── sql └── database.sql └── tasks.php /.gitignore: -------------------------------------------------------------------------------- 1 | ### Composer ### 2 | .DS_Store 3 | composer.phar 4 | /vendor/ 5 | .gitignore -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "snyk/phpgoof", 3 | "description": "A project to demonstrate the vulnerabilities that can occur inside PHP frameworks and libraries", 4 | "type": "project", 5 | "license": "Apache 2.0", 6 | "require": { 7 | "league/commonmark": "0.18.2", 8 | "phpmailer/phpmailer": "6.4.1", 9 | "dompdf/dompdf": "1.2" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /composer.lock: -------------------------------------------------------------------------------- 1 | { 2 | "_readme": [ 3 | "This file locks the dependencies of your project to a known state", 4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", 5 | "This file is @generated automatically" 6 | ], 7 | "content-hash": "eba49990c2c9d490a1a65bd7786ae4f4", 8 | "packages": [ 9 | { 10 | "name": "dompdf/dompdf", 11 | "version": "v1.2.0", 12 | "source": { 13 | "type": "git", 14 | "url": "https://github.com/dompdf/dompdf.git", 15 | "reference": "60b704331479a69e9bcdb3496da2315b5c4f94fd" 16 | }, 17 | "dist": { 18 | "type": "zip", 19 | "url": "https://api.github.com/repos/dompdf/dompdf/zipball/60b704331479a69e9bcdb3496da2315b5c4f94fd", 20 | "reference": "60b704331479a69e9bcdb3496da2315b5c4f94fd", 21 | "shasum": "" 22 | }, 23 | "require": { 24 | "ext-dom": "*", 25 | "ext-mbstring": "*", 26 | "phenx/php-font-lib": "^0.5.4", 27 | "phenx/php-svg-lib": "^0.3.3 || ^0.4.0", 28 | "php": "^7.1 || ^8.0" 29 | }, 30 | "require-dev": { 31 | "mockery/mockery": "^1.3", 32 | "phpunit/phpunit": "^7.5 || ^8 || ^9", 33 | "squizlabs/php_codesniffer": "^3.5" 34 | }, 35 | "suggest": { 36 | "ext-gd": "Needed to process images", 37 | "ext-gmagick": "Improves image processing performance", 38 | "ext-imagick": "Improves image processing performance", 39 | "ext-zlib": "Needed for pdf stream compression" 40 | }, 41 | "type": "library", 42 | "autoload": { 43 | "psr-4": { 44 | "Dompdf\\": "src/" 45 | }, 46 | "classmap": [ 47 | "lib/" 48 | ] 49 | }, 50 | "notification-url": "https://packagist.org/downloads/", 51 | "license": [ 52 | "LGPL-2.1" 53 | ], 54 | "authors": [ 55 | { 56 | "name": "Fabien Ménager", 57 | "email": "fabien.menager@gmail.com" 58 | }, 59 | { 60 | "name": "Brian Sweeney", 61 | "email": "eclecticgeek@gmail.com" 62 | }, 63 | { 64 | "name": "Gabriel Bull", 65 | "email": "me@gabrielbull.com" 66 | } 67 | ], 68 | "description": "DOMPDF is a CSS 2.1 compliant HTML to PDF converter", 69 | "homepage": "https://github.com/dompdf/dompdf", 70 | "support": { 71 | "issues": "https://github.com/dompdf/dompdf/issues", 72 | "source": "https://github.com/dompdf/dompdf/tree/v1.2.0" 73 | }, 74 | "time": "2022-02-07T13:02:10+00:00" 75 | }, 76 | { 77 | "name": "league/commonmark", 78 | "version": "0.18.2", 79 | "source": { 80 | "type": "git", 81 | "url": "https://github.com/thephpleague/commonmark.git", 82 | "reference": "ad51c7cafb90e0bbd9f34b71d18d05994547e352" 83 | }, 84 | "dist": { 85 | "type": "zip", 86 | "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/ad51c7cafb90e0bbd9f34b71d18d05994547e352", 87 | "reference": "ad51c7cafb90e0bbd9f34b71d18d05994547e352", 88 | "shasum": "" 89 | }, 90 | "require": { 91 | "ext-mbstring": "*", 92 | "php": ">=5.6.5" 93 | }, 94 | "replace": { 95 | "colinodell/commonmark-php": "*" 96 | }, 97 | "require-dev": { 98 | "cebe/markdown": "~1.0", 99 | "commonmark/commonmark.js": "0.28", 100 | "erusev/parsedown": "~1.0", 101 | "michelf/php-markdown": "~1.4", 102 | "mikehaertl/php-shellcommand": "^1.2", 103 | "phpunit/phpunit": "^5.7|^6.5", 104 | "scrutinizer/ocular": "^1.1", 105 | "symfony/finder": "^3.0|^4.0" 106 | }, 107 | "suggest": { 108 | "league/commonmark-extras": "Library of useful extensions including smart punctuation" 109 | }, 110 | "bin": [ 111 | "bin/commonmark" 112 | ], 113 | "type": "library", 114 | "extra": { 115 | "branch-alias": { 116 | "dev-master": "0.19-dev" 117 | } 118 | }, 119 | "autoload": { 120 | "psr-4": { 121 | "League\\CommonMark\\": "src/" 122 | } 123 | }, 124 | "notification-url": "https://packagist.org/downloads/", 125 | "license": [ 126 | "BSD-3-Clause" 127 | ], 128 | "authors": [ 129 | { 130 | "name": "Colin O'Dell", 131 | "email": "colinodell@gmail.com", 132 | "homepage": "https://www.colinodell.com", 133 | "role": "Lead Developer" 134 | } 135 | ], 136 | "description": "PHP Markdown parser based on the CommonMark spec", 137 | "homepage": "https://github.com/thephpleague/commonmark", 138 | "keywords": [ 139 | "commonmark", 140 | "markdown", 141 | "parser" 142 | ], 143 | "support": { 144 | "docs": "https://commonmark.thephpleague.com/", 145 | "issues": "https://github.com/thephpleague/commonmark/issues", 146 | "rss": "https://github.com/thephpleague/commonmark/releases.atom", 147 | "source": "https://github.com/thephpleague/commonmark" 148 | }, 149 | "time": "2019-03-17T01:41:59+00:00" 150 | }, 151 | { 152 | "name": "phenx/php-font-lib", 153 | "version": "0.5.4", 154 | "source": { 155 | "type": "git", 156 | "url": "https://github.com/dompdf/php-font-lib.git", 157 | "reference": "dd448ad1ce34c63d09baccd05415e361300c35b4" 158 | }, 159 | "dist": { 160 | "type": "zip", 161 | "url": "https://api.github.com/repos/dompdf/php-font-lib/zipball/dd448ad1ce34c63d09baccd05415e361300c35b4", 162 | "reference": "dd448ad1ce34c63d09baccd05415e361300c35b4", 163 | "shasum": "" 164 | }, 165 | "require": { 166 | "ext-mbstring": "*" 167 | }, 168 | "require-dev": { 169 | "symfony/phpunit-bridge": "^3 || ^4 || ^5" 170 | }, 171 | "type": "library", 172 | "autoload": { 173 | "psr-4": { 174 | "FontLib\\": "src/FontLib" 175 | } 176 | }, 177 | "notification-url": "https://packagist.org/downloads/", 178 | "license": [ 179 | "LGPL-3.0" 180 | ], 181 | "authors": [ 182 | { 183 | "name": "Fabien Ménager", 184 | "email": "fabien.menager@gmail.com" 185 | } 186 | ], 187 | "description": "A library to read, parse, export and make subsets of different types of font files.", 188 | "homepage": "https://github.com/PhenX/php-font-lib", 189 | "support": { 190 | "issues": "https://github.com/dompdf/php-font-lib/issues", 191 | "source": "https://github.com/dompdf/php-font-lib/tree/0.5.4" 192 | }, 193 | "time": "2021-12-17T19:44:54+00:00" 194 | }, 195 | { 196 | "name": "phenx/php-svg-lib", 197 | "version": "0.4.1", 198 | "source": { 199 | "type": "git", 200 | "url": "https://github.com/dompdf/php-svg-lib.git", 201 | "reference": "4498b5df7b08e8469f0f8279651ea5de9626ed02" 202 | }, 203 | "dist": { 204 | "type": "zip", 205 | "url": "https://api.github.com/repos/dompdf/php-svg-lib/zipball/4498b5df7b08e8469f0f8279651ea5de9626ed02", 206 | "reference": "4498b5df7b08e8469f0f8279651ea5de9626ed02", 207 | "shasum": "" 208 | }, 209 | "require": { 210 | "ext-mbstring": "*", 211 | "php": "^7.1 || ^7.2 || ^7.3 || ^7.4 || ^8.0", 212 | "sabberworm/php-css-parser": "^8.4" 213 | }, 214 | "require-dev": { 215 | "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5" 216 | }, 217 | "type": "library", 218 | "autoload": { 219 | "psr-4": { 220 | "Svg\\": "src/Svg" 221 | } 222 | }, 223 | "notification-url": "https://packagist.org/downloads/", 224 | "license": [ 225 | "LGPL-3.0" 226 | ], 227 | "authors": [ 228 | { 229 | "name": "Fabien Ménager", 230 | "email": "fabien.menager@gmail.com" 231 | } 232 | ], 233 | "description": "A library to read, parse and export to PDF SVG files.", 234 | "homepage": "https://github.com/PhenX/php-svg-lib", 235 | "support": { 236 | "issues": "https://github.com/dompdf/php-svg-lib/issues", 237 | "source": "https://github.com/dompdf/php-svg-lib/tree/0.4.1" 238 | }, 239 | "time": "2022-03-07T12:52:04+00:00" 240 | }, 241 | { 242 | "name": "phpmailer/phpmailer", 243 | "version": "v6.4.1", 244 | "source": { 245 | "type": "git", 246 | "url": "https://github.com/PHPMailer/PHPMailer.git", 247 | "reference": "9256f12d8fb0cd0500f93b19e18c356906cbed3d" 248 | }, 249 | "dist": { 250 | "type": "zip", 251 | "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/9256f12d8fb0cd0500f93b19e18c356906cbed3d", 252 | "reference": "9256f12d8fb0cd0500f93b19e18c356906cbed3d", 253 | "shasum": "" 254 | }, 255 | "require": { 256 | "ext-ctype": "*", 257 | "ext-filter": "*", 258 | "ext-hash": "*", 259 | "php": ">=5.5.0" 260 | }, 261 | "require-dev": { 262 | "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", 263 | "doctrine/annotations": "^1.2", 264 | "phpcompatibility/php-compatibility": "^9.3.5", 265 | "roave/security-advisories": "dev-latest", 266 | "squizlabs/php_codesniffer": "^3.5.6", 267 | "yoast/phpunit-polyfills": "^0.2.0" 268 | }, 269 | "suggest": { 270 | "ext-mbstring": "Needed to send email in multibyte encoding charset or decode encoded addresses", 271 | "hayageek/oauth2-yahoo": "Needed for Yahoo XOAUTH2 authentication", 272 | "league/oauth2-google": "Needed for Google XOAUTH2 authentication", 273 | "psr/log": "For optional PSR-3 debug logging", 274 | "stevenmaguire/oauth2-microsoft": "Needed for Microsoft XOAUTH2 authentication", 275 | "symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)" 276 | }, 277 | "type": "library", 278 | "autoload": { 279 | "psr-4": { 280 | "PHPMailer\\PHPMailer\\": "src/" 281 | } 282 | }, 283 | "notification-url": "https://packagist.org/downloads/", 284 | "license": [ 285 | "LGPL-2.1-only" 286 | ], 287 | "authors": [ 288 | { 289 | "name": "Marcus Bointon", 290 | "email": "phpmailer@synchromedia.co.uk" 291 | }, 292 | { 293 | "name": "Jim Jagielski", 294 | "email": "jimjag@gmail.com" 295 | }, 296 | { 297 | "name": "Andy Prevost", 298 | "email": "codeworxtech@users.sourceforge.net" 299 | }, 300 | { 301 | "name": "Brent R. Matzelle" 302 | } 303 | ], 304 | "description": "PHPMailer is a full-featured email creation and transfer class for PHP", 305 | "support": { 306 | "issues": "https://github.com/PHPMailer/PHPMailer/issues", 307 | "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.4.1" 308 | }, 309 | "funding": [ 310 | { 311 | "url": "https://github.com/Synchro", 312 | "type": "github" 313 | } 314 | ], 315 | "time": "2021-04-29T12:25:04+00:00" 316 | }, 317 | { 318 | "name": "sabberworm/php-css-parser", 319 | "version": "8.4.0", 320 | "source": { 321 | "type": "git", 322 | "url": "https://github.com/sabberworm/PHP-CSS-Parser.git", 323 | "reference": "e41d2140031d533348b2192a83f02d8dd8a71d30" 324 | }, 325 | "dist": { 326 | "type": "zip", 327 | "url": "https://api.github.com/repos/sabberworm/PHP-CSS-Parser/zipball/e41d2140031d533348b2192a83f02d8dd8a71d30", 328 | "reference": "e41d2140031d533348b2192a83f02d8dd8a71d30", 329 | "shasum": "" 330 | }, 331 | "require": { 332 | "ext-iconv": "*", 333 | "php": ">=5.6.20" 334 | }, 335 | "require-dev": { 336 | "codacy/coverage": "^1.4", 337 | "phpunit/phpunit": "^4.8.36" 338 | }, 339 | "suggest": { 340 | "ext-mbstring": "for parsing UTF-8 CSS" 341 | }, 342 | "type": "library", 343 | "autoload": { 344 | "psr-4": { 345 | "Sabberworm\\CSS\\": "src/" 346 | } 347 | }, 348 | "notification-url": "https://packagist.org/downloads/", 349 | "license": [ 350 | "MIT" 351 | ], 352 | "authors": [ 353 | { 354 | "name": "Raphael Schweikert" 355 | } 356 | ], 357 | "description": "Parser for CSS Files written in PHP", 358 | "homepage": "https://www.sabberworm.com/blog/2010/6/10/php-css-parser", 359 | "keywords": [ 360 | "css", 361 | "parser", 362 | "stylesheet" 363 | ], 364 | "support": { 365 | "issues": "https://github.com/sabberworm/PHP-CSS-Parser/issues", 366 | "source": "https://github.com/sabberworm/PHP-CSS-Parser/tree/8.4.0" 367 | }, 368 | "time": "2021-12-11T13:40:54+00:00" 369 | } 370 | ], 371 | "packages-dev": [], 372 | "aliases": [], 373 | "minimum-stability": "stable", 374 | "stability-flags": [], 375 | "prefer-stable": false, 376 | "prefer-lowest": false, 377 | "platform": [], 378 | "platform-dev": [], 379 | "plugin-api-version": "2.2.0" 380 | } 381 | -------------------------------------------------------------------------------- /db.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /exploits/gotcha-normal.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/snyk-labs/php-goof/24267df239984e38e8ce1285ea1d2b439e42a525/exploits/gotcha-normal.otf -------------------------------------------------------------------------------- /exploits/gotcha.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family:'gotcha'; 3 | src:url('https://github.com/snyk-labs/php-goof/blob/main/exploits/gotcha_font.php?raw=true'); 4 | font-weight:'normal'; 5 | font-style:'normal'; 6 | } 7 | -------------------------------------------------------------------------------- /exploits/gotcha_font.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/snyk-labs/php-goof/24267df239984e38e8ce1285ea1d2b439e42a525/exploits/gotcha_font.php -------------------------------------------------------------------------------- /exploits/rshell-normal.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/snyk-labs/php-goof/24267df239984e38e8ce1285ea1d2b439e42a525/exploits/rshell-normal.otf -------------------------------------------------------------------------------- /exploits/rshell.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family:'rshell'; 3 | src:url('https://github.com/snyk-labs/php-goof/blob/main/exploits/rshell_font.php?raw=true'); 4 | font-weight:'normal'; 5 | font-style:'normal'; 6 | } 7 | -------------------------------------------------------------------------------- /exploits/rshell_font.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/snyk-labs/php-goof/24267df239984e38e8ce1285ea1d2b439e42a525/exploits/rshell_font.php -------------------------------------------------------------------------------- /func.php: -------------------------------------------------------------------------------- 1 | 'escape', 'allow_unsafe_links' => false]); 8 | 9 | if (isset($_GET['edid'])){ 10 | 11 | $id = $_GET['edid']; 12 | 13 | $query = "SELECT * FROM task where id = $id"; 14 | $result = mysqli_query($conn, $query); 15 | 16 | if(mysqli_num_rows($result) == 1){ 17 | $row = mysqli_fetch_array($result); 18 | $title = $row['title']; 19 | 20 | $_SESSION['message'] = 'Edit Task'; 21 | $_SESSION['message_type'] = 'info'; 22 | } 23 | } 24 | 25 | 26 | ?> -------------------------------------------------------------------------------- /images/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/snyk-labs/php-goof/24267df239984e38e8ce1285ea1d2b439e42a525/images/screenshot.png -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 15 | PHP Goof Todo 16 | 17 | 18 | 24 | 25 |
26 |
27 | 28 |
29 | 30 | 33 | 34 |
35 |
36 |
37 | 38 | 40 | 41 |
42 | 43 |
44 |
45 |
46 |
47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 63 | 64 | 66 | 67 | 105 | 106 | 109 | 110 |
Titledate/timeActions
convertToHtml(urldecode($row['title']));?> 68 | edit 69 | delete_forever 70 | 71 | picture_as_pdf 72 | 73 | 74 | 103 | 104 |
111 |
112 |
113 |
114 | 115 | 116 | -------------------------------------------------------------------------------- /mail.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pdf.php: -------------------------------------------------------------------------------- 1 | setIsRemoteEnabled(true); 11 | 12 | $dompdf = new Dompdf($options); 13 | 14 | $title = $_GET['title']; 15 | 16 | $html = " 17 | 18 | 19 | 25 | 26 | "; 27 | 28 | $html .= "

PHP-Goof demo app

"; 29 | 30 | $html .= "

".urldecode($_GET['title'])."

"; 31 | 32 | if($font = $dompdf->getFontMetrics()->getFont("gotcha", "normal") or $font = $dompdf->getFontMetrics()->getFont("rshell", "normal")){ 33 | $html .= "Gotcha hack"; 34 | } 35 | 36 | $html .= ""; 37 | $html .= ""; 38 | 39 | $dompdf->loadHtml($html); 40 | $dompdf->setPaper('A5', 'portrait'); 41 | 42 | // lets us know if something goes wrong 43 | global $_dompdf_show_warnings; 44 | $_dompdf_show_warnings = true; 45 | 46 | // render the HTML as PDF 47 | $dompdf->render(); 48 | 49 | // output the generated PDF to browser 50 | $dompdf->stream($filename, array('Attachment' => 0)); 51 | 52 | ?> 53 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # PHP Goof - Snyk's vulnerable demo php app 2 | 3 | A vulnerable PHP demo todo application that is for demonstration and education purposes only, i take no responsibility for this being used with malicious intent nor should this be used for malicious intent (or be run in any product environment). 4 | 5 | ![PHP Goof](/images/screenshot.png) 6 | 7 | ## Requisites & Running 8 | 9 | - PHP 7.4+ 10 | - Mysql or MariaDB 11 | - Composer 2 12 | 13 | Run composer install from the project root directory 14 | 15 | Create mysql or mariaDB database and update the db.php file, with database details. 16 | 17 | Import sql/database.sql file into the newly created database or run the following table create. 18 | 19 | ``` 20 | CREATE TABLE `task` ( 21 | `id` int(11) NOT NULL AUTO_INCREMENT, 22 | `title` varchar(255) NOT NULL, 23 | `created_at` timestamp NOT NULL DEFAULT current_timestamp(), 24 | PRIMARY KEY (`id`) 25 | ) ENGINE=InnoDB AUTO_INCREMENT=76 DEFAULT CHARSET=utf8mb3; 26 | ``` 27 | 28 | Finally, Using the PHP built in server run the code from the root app directory 29 | 30 | ``` 31 | php -S localhost:8000 32 | ``` 33 | 34 | ## Exploiting the vulnerabilities 35 | 36 | ### Commonmark XSS Vulnerability 37 | 38 | [SNYK-PHP-LEAGUECOMMONMARK-174004](https://security.snyk.io/vuln/SNYK-PHP-LEAGUECOMMONMARK-174004) 39 | 40 | ``` 41 | * Markdown link 42 | This is **markdown** 43 | 44 | * Markdown link 45 | [Snyk](https://snyk.io/) 46 | 47 | * Failed XSS 48 | [Gotcha](javascript:alert(1)) 49 | 50 | * Failed XSS despite URL encoding 51 | [Gotcha](javascript:alert(1)) 52 | 53 | * Successfull XSS using vuln and browser interpretation 54 | [Gotcha](javascript:alert%28'Gotcha'%29) 55 | ``` 56 | 57 | ### PHPMailer 58 | 59 | [SNYK-PHP-PHPMAILERPHPMAILER-1311001](https://security.snyk.io/vuln/SNYK-PHP-PHPMAILERPHPMAILER-1311001) 60 | 61 | Uses the `validateAddress()` exploit from PHPMailer 6.4.1 to execute the global `PHP()` function by default. If no argument is passed into the `validateAddress()` function, which isnt in this demo, PHPMailer sets "PHP" as the default value and runs it if its available in the scope. 62 | 63 | To run click the email icon next to a line entry to send an email reminder. 64 | 65 | Note: No emails will actually send or are being stored, only validating the email address entered into the input using the PHPMailer library. 66 | 67 | 68 | ### dompdf remote code execution 69 | 70 | [SNYK-PHP-DOMPDFDOMPDF-2428942](https://security.snyk.io/vuln/SNYK-PHP-DOMPDFDOMPDF-2428942) 71 | 72 | [Read more about this Vulnerability](https://snyk.io/blog/security-alert-php-pdf-library-dompdf-rce/) 73 | 74 | This vulnerability is using dompdf library version 1.2.0 and allows for remote code execution on the target application. In this app there is a custom font called gotcha-normal.otf which has `` loaded into the copyright font meta. 75 | 76 | The font file is then referenced as a `font-family` in the CSS file `gotcha.css` which is then injected into the dompdf html output via a stylesheet link. 77 | 78 | Dompdf loads the style sheet and saves the custom font type to the dompdf font cache (and as part of the framework). This can then be remotely executed. 79 | 80 | *** Note: in the CSS font-family, the font name needs to match the actual font name or this will not work. 81 | 82 | To use this in this app, load the below code into a todo item and click pdf on its line entry, chicken and egg note that you will need to refresh the PDF with the file examples below so that the link generates into the pdf to click. 83 | 84 | ``` 85 | 86 | ``` 87 | Additional, added an example that uses a reverse shell by using a php `eval()` in a font file leveraging the RCE exploit. This works the same as above but using the below CSS. To use it simply load any get variable into the url when the gotcha link is created in the pdf, example `...?test=phpinfo();`. Regular $_GET references didnt work but `reset()` did which will pick up the first in the $ array and run it in `eval()`. 88 | 89 | Note this uses a different font file and family in the exploit folder. 90 | 91 | ``` 92 | 93 | ``` 94 | -------------------------------------------------------------------------------- /sql/database.sql: -------------------------------------------------------------------------------- 1 | -- MariaDB dump 10.19 Distrib 10.6.3-MariaDB, for osx10.16 (x86_64) 2 | -- 3 | -- Host: localhost Database: phpgoof 4 | -- ------------------------------------------------------ 5 | -- Server version 10.6.3-MariaDB 6 | 7 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; 8 | /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; 9 | /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; 10 | /*!40101 SET NAMES utf8mb4 */; 11 | /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; 12 | /*!40103 SET TIME_ZONE='+00:00' */; 13 | /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; 14 | /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; 15 | /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; 16 | /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; 17 | 18 | -- 19 | -- Table structure for table `task` 20 | -- 21 | 22 | DROP TABLE IF EXISTS `task`; 23 | /*!40101 SET @saved_cs_client = @@character_set_client */; 24 | /*!40101 SET character_set_client = utf8 */; 25 | CREATE TABLE `task` ( 26 | `id` int(11) NOT NULL AUTO_INCREMENT, 27 | `title` varchar(255) NOT NULL, 28 | `created_at` timestamp NOT NULL DEFAULT current_timestamp(), 29 | PRIMARY KEY (`id`) 30 | ) ENGINE=InnoDB AUTO_INCREMENT=76 DEFAULT CHARSET=utf8mb3; 31 | /*!40101 SET character_set_client = @saved_cs_client */; 32 | 33 | -- 34 | -- Dumping data for table `task` 35 | -- 36 | 37 | LOCK TABLES `task` WRITE; 38 | /*!40000 ALTER TABLE `task` DISABLE KEYS */; 39 | /*!40000 ALTER TABLE `task` ENABLE KEYS */; 40 | UNLOCK TABLES; 41 | /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; 42 | 43 | /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; 44 | /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; 45 | /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; 46 | /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; 47 | /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; 48 | /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; 49 | /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; 50 | 51 | -- Dump completed on 2021-11-04 10:52:52 52 | -------------------------------------------------------------------------------- /tasks.php: -------------------------------------------------------------------------------- 1 | --------------------------------------------------------------------------------