Skip to content

Instantly share code, notes, and snippets.

View SoftCreatR's full-sized avatar
👻
Boo!

Sascha Greuel SoftCreatR

👻
Boo!
  • Gladbeck, Germany
  • 18:54 (UTC +01:00)
View GitHub Profile
@SoftCreatR
SoftCreatR / facebook-deauth.php
Created November 19, 2024 08:33
PHP script that securely processes a Facebook-signed request to reset a WoltLab Suite user's password by verifying the signature, updating user data with a reset key, and sending a password reset email.
<?php
/*
* Copyright by SoftCreatR.dev.
*
* License: https://softcreatr.dev/license-terms
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@SoftCreatR
SoftCreatR / HelloWorld.php
Created November 19, 2024 01:48
This script serves as an exaggerated example of over-engineering a simple "Hello World" application in PHP. It incorporates numerous design patterns, interfaces, traits, and a rudimentary dependency injection container to demonstrate how complexity can be artificially introduced into a basic task.
<?php
/*
* Copyright by SoftCreatR.dev.
*
* License: https://softcreatr.dev/license-terms
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@SoftCreatR
SoftCreatR / README.md
Created May 25, 2024 13:57
This is a proof of concept (PoC) for Hetzner's "Heray" Proof of Work (PoW) Captcha. Please note that this is neither functional nor the original code. It simply demonstrates how the system could work based on observed patterns and assumptions.

Proof of Concept for Hetzner's "Heray" PoW Captcha

This is a proof of concept (PoC) for Hetzner's "Heray" Proof of Work (PoW) Captcha. Please note that this is neither functional nor the original code. It simply demonstrates how the system could work based on observed patterns and assumptions.

Overview

Hetzner's "Heray" PoW Captcha likely requires the client to solve a computational puzzle as a form of CAPTCHA, where a specific condition must be met for the challenge to be accepted. The solution involves generating a specific mainbytes value based on given uuid and hsum values.

Process

@SoftCreatR
SoftCreatR / tor-exit.csv
Last active December 1, 2024 00:17
Tor exit nodes geo data
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 4.
IP,Network Prefix,ASN,Organization,City Name,Continent Code,Continent Name,Country ISO Code,Country Name,Is Country in European Union,Location Accuracy Radius,Location Latitude,Location Longitude,Location Time Zone,Postal Code,Registered Country ISO Code,Registered Country Name,Is Registered Country in European Union,Subdivision ISO Code,Subdivision Name
"2a0a:3840:8078:0022:0000:504e:16da:1337","2a0a:3840:8078:22:0:504e:16da:1337/64",39287,"""ab stract ltd""","","EU","Europe","FI","Finland",true,200,60.1717,24.9349,"Europe/Helsinki","","FI","Finland",true,"",""
"2a0a:c801:0001:0005:0000:0000:0000:0057","2a0a:c801:1:5::57/64",39798,"""MivoCloud SRL""","Chisinau","EU","Europe","MD","Moldova",false,20,47.0042,28.8574,"Europe/Chisinau","MD-2000","MD","Moldova",false,"CU","Chișinău Municipality"
"2a0b:4140:6c6c:0000:0000:0000:0000:0002","2a0b:4140:6c6c::2/64",210644,"""Aeza International Ltd""","Amsterdam","EU","Europe","NL","The Netherlands",true,100,52.3759,4.8975,"Europe/Amsterdam","1012","RU","Russia",false,"
@SoftCreatR
SoftCreatR / README.md
Last active February 13, 2023 09:11
RFC 2822 Regex PHP example

EmailValidator Class

The ScEmailValidator class provides a static method for validating email addresses using a regular expression.

The regular expression used by this class is based on the pattern defined in RFC 2822 for email addresses. The regular expression is designed to match a wide range of valid email addresses, including email addresses with domain names that contain IP addresses, internationalized domain names (IDNs), and new top-level domain names. The regular expression also supports email addresses with local parts that contain special characters, such as periods, plus signs, and quoted strings.

[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]][([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((!![]+[])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+!+[]]+([]+[])[(![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(!![]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[][(![]+[]
@SoftCreatR
SoftCreatR / gist:303513be9b85f83a2819443fa7b422f3
Created April 15, 2022 21:23
Date Regex (dd.mm.yyyy) incl. leap years, etc.
^(?:(?:31\.(?:0?[13578]|1[02]))\.|(?:(?:29|30)\.(?:0?[13-9]|1[0-2])\.))(?:(?:1[6-9]|[2-9]\d)?\d{2})$|^(?:29\.0?2\.(?:(?:(?:1[6-9]|[2-9]\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00))))$|^(?:0?[1-9]|1\d|2[0-8])\.(?:(?:0?[1-9])|(?:1[0-2]))\.(?:(?:1[6-9]|[2-9]\d)?\d{2})$
@SoftCreatR
SoftCreatR / blurhash.js
Last active November 10, 2023 13:10
Strapi 4 Blurhash
// ./src/extensions/blurhash.js
const plaiceholder = require('plaiceholder')
const _ = require('lodash')
module.exports = {
generatePlaceholder (strapi) {
strapi.contentType('plugin::upload.file').attributes.placeholder = {
type: 'text'
}
@SoftCreatR
SoftCreatR / fake-speedtest.php
Created September 18, 2021 11:29
Generate Fake Stats for speedtest.net
<?php
$down = (!empty($_GET['down']) ? (int)$_GET['down'] : mt_rand(1000, 5000)) * 1000;
$up = (!empty($_GET['up']) ? (int)$_GET['down'] : mt_rand(1000, 5000)) * 1000;
$ping = !empty($_GET['ping']) ? (int)$_GET['ping'] : mt_rand(0, 20);
$server = !empty($_GET['server']) ? (int)$_GET['server'] : 6601; // https://c.speedtest.net/speedtest-servers-static.php
$accuracy = 8;
$headers = [
'POST /api/api.php HTTP/1.1',
name: Main
on: [push]
jobs:
build:
name: Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.4
- name: Setup Node.js
uses: actions/setup-node@v2.4.0