Skip to content

Instantly share code, notes, and snippets.

View jakubboucek's full-sized avatar
🚄
Living in trains

Jakub Bouček jakubboucek

🚄
Living in trains
View GitHub Profile
@jakubboucek
jakubboucek / v85.txt
Created August 27, 2020 22:13
Chorme compare headers v84 vs v85
Request URL: https://www.jakub-boucek.cz/img/profil.jpg
Request Method: GET
Status Code: 200
Remote Address: 151.101.1.195:443
Referrer Policy: no-referrer-when-downgrade
:authority: www.jakub-boucek.cz
:method: GET
:path: /img/profil.jpg
:scheme: https
@jakubboucek
jakubboucek / troll.php
Last active October 21, 2020 01:31
CVE-2020-15227 trolling
<?php
/**
* Troll your script-kiddie exploiters of CVE-2020-15227 vulnerability
* Make response which gives false hope
*/
private static function trollExploiters(): void
{
if (strpos($_SERVER['REQUEST_URI'] ?? '', '/nette.micro') === 0) {
header('Content-Type: text/plain');
@jakubboucek
jakubboucek / bookmarklet.txt
Created December 23, 2020 07:58
Kill W3schools Bookmarklet
javascript:(function(){let l=document.location;let u=new window.URL(l.href);let s=u.searchParams;let q=s.get('q')+' -site:w3schools.com';s.set('q',q);s.set('oq',q);l.assign(u);})()
@jakubboucek
jakubboucek / recursive-schema.php
Created August 21, 2021 23:48
Recursive Nette Schema structure
<?php
declare(strict_types=1);
use Nette\Schema\Elements\Type;
use Nette\Schema\Expect;
require __DIR__ . '/vendor/autoload.php';
$childrenList = (new Type('array'))->default([]);
@jakubboucek
jakubboucek / formular.php
Created August 22, 2021 17:41
Vypsání dat z formuláře
<?php
declare(strict_types=1);
// $_POST <--- do této proměnné se ukládají data z formuláře.
echo "<h1>Data z formuláře</h1>";
echo "<ul>";
foreach ($_POST as $name => $value) {
echo "<li><strong>" . htmlspecialchars($name) . ":</strong> " . htmlspecialchars($value) . "</li>";
@jakubboucek
jakubboucek / index.php
Created July 25, 2022 11:08
Subreg.cz SOAP request /w Bearer token
<?php
$token = 'FILL/YOUR/TOKEN/HERE+FILL/YOUR/TOKEN/HERE='; // <-- Fill it
$context = stream_context_create([
'http' => [
'protocol_version' => 1.1,
'header' => "Authorization: Bearer {$token}",
],
]);
@jakubboucek
jakubboucek / upload.php
Created September 13, 2022 10:00
Shottr upload server-side script
<?php
// CONFIGURATION
$uploadPath = 'upload'; // <-- directory to save images
$wwwPath = ''; // <-- url to uplaod directory (optional - will be filled)
$secretKey = ''; // <-- secret key - optional, fill to protect endpoint
// SECURITY CONFIG - do not modify when you not understand consequences
$allowedExts = ['png', 'jpg'];
$allowedChars = '-a-z0-9.';
@jakubboucek
jakubboucek / rejstriky-soudu.json
Created March 1, 2025 08:55
Rejstříky soudů (JSON)
{
"Agendy a rejstříky krajských soudů": {
"Trestní agenda": [
[
"T",
"rejstřík pro věci trestní",
null
],
[
"Tm",