Skip to content

Instantly share code, notes, and snippets.

View s3b4stian's full-sized avatar
🏭
I'm reducing technical debt!

Sebastian Rapetti s3b4stian

🏭
I'm reducing technical debt!
  • Olbia, Italy
View GitHub Profile
; =================================================
; Password protected x64 TCP Reverse Shell
; Author: Alan Vivona
; =================================================
global _start
; Syscall numbers
syscalls.socket equ 0x29
syscalls.bind equ 0x31
@s3b4stian
s3b4stian / ordutf8_test.php
Created December 9, 2017 10:44
ordutf8 refactor spet test
<?php
function ordutf8_step1(string $char) : int
{
$code = ord(substr($char, 0, 1));
if ($code >= 128) {
if ($code < 224)
$bytesnumber = 2;
/**
* Convert number given as string to the proper type (int or float).
* https://secure.php.net/manual/en/language.types.type-juggling.php
*
* @param string $string Number as string ex '1.0', '0.9' etc
* @return int|float
*/
function strtonum(string $string)
{
if (fmod((float)$string, 1.0) === 0.0){
/**
* Check if value is between given range.
*
* @param mixed $value
* @param mixed $min
* @param mixed $max
*
* @return bool
*/
function in_range($value, $min, $max): bool {
import hashlib as hasher
import datetime as date
# Define what a Snakecoin block is
class Block:
def __init__(self, index, timestamp, data, previous_hash):
self.index = index
self.timestamp = timestamp
self.data = data
self.previous_hash = previous_hash
<?php
//change for point to correct directory
include '../linna-array/src/TypedArray.php';
include '../linna-array/src/TypedObjectArray.php';
use Linna\TypedArray;
use Linna\TypedObjectArray;
$cicles = 500000;
@s3b4stian
s3b4stian / password_get_appropriate_cost.php
Created February 21, 2017 21:37
Get appropriate cost for password hashing
/**
* Get appropriate cost
*
* This code will benchmark your server to determine how high of a cost you can
* afford. You want to set the highest cost that you can without slowing down
* you server too much.
*
* @param int $time_limit Time limit in milliseconds
* @param int $algo Algoritm, default PASSWORD_DEFAULT
* @return int
@s3b4stian
s3b4stian / array_flatten.php
Created February 21, 2017 21:35
Function for flatten an array
/**
* Flatten an array
* Example array [1, [2, 3, 4], [5, 6], [7, [8, 9]], 10] becomes
* [1, 2, 3, 4, 5, 6, 7, [8, 9], 10]
* Work only for one level
*
* @param array $array Array to flatten
* @return array
*/
function array_flatten(array $array): array
@odan
odan / xampp_php7_xdebug.md
Last active April 17, 2024 05:36
Installing Xdebug for XAMPP