Skip to content

Instantly share code, notes, and snippets.

View enygma's full-sized avatar

Chris Cornutt enygma

View GitHub Profile
@enygma
enygma / bugcrowd-vuln-rating.json
Created March 30, 2018 13:39
A JSON formatted document of the Bugcrowd Vulnerability Rating Taxonomy v1.3
[
{
"category": "Server Security Misconfguration",
"vulnerabilities": [
{
"name": "Using Default Credentials",
"priority": "P1",
"variants": [
{ "type": "Production Server", "priority": "P1" },
{ "type": "Staging/Development Server", "priority": "P2" }
@enygma
enygma / gist:2697434
Created May 14, 2012 21:41
Hashing in REST Requests (with FuelPHP)
<?php
class Controller_User extends Controller_Rest
{
protected function validateHash()
{
$request = file_get_contents('php://input');
$requestHeaders = apache_request_headers();
if (!isset($requestHeaders['X-Auth']) || !isset($requestHeaders['X-Auth-Hash'])) {
$this->response('fail!',401);
$itemId = $id.$_GET['SN'];
if (isset($_SESSION['productsR'][$itemId]) {
$itemCount = $_SESSION['productsR'][$itemId] + 1;
} else {
$itemCount = $_SESSION['productsR'][$itemId] = 1;
}
@enygma
enygma / iterator-error.php
Created October 22, 2016 15:19
Is this a bug with the iterator handling and foreach?
<?php
/**
* In the example below, I make an iterator and assign three values to it: "foo", "bar" and "baz".
* I then manually remove the first one (index 0) and pass the rest into foreach. I expected it
* to just start with index 1 and go on and loop through the rest but there's no output at all.
*
* Is this a bug?
*/
class Items implements \Iterator
@enygma
enygma / soundtracks.md
Created October 13, 2016 14:32
Soundtracks to get shit done

A partial list from the cache:

  • Interstellar - S.T.A.Y (movie)
  • Transistor (video game)
  • Destiny Soundtrack (video game)
  • Bastion (video game)
  • FTL Faster Than Light (video game)
  • Ori and the Blind Forest - Soundtrack (video game)
  • JOURNEY OST (video game)
  • Deus Ex (video game)
@enygma
enygma / gist:a448090fdd955ef5b54c30db926175f8
Created October 13, 2016 14:29
Soundtracks to get shit done.
Interstellar - S.T.A.Y (movie)
Transistor (video game)
Destiny Soundtrack (video game)
Bastion (video game)
FTL Faster Than Light (video game)
Ori and the Blind Forest - Soundtrack (video game)
JOURNEY OST (video game)
Deus Ex (video game)
Shadow of the Colossus - Soundtrack (video game)
Undertale Soundtrack (video game)
@enygma
enygma / sountracks.md
Created October 13, 2016 14:30
Soundtracks to get shit done

Interstellar - S.T.A.Y (movie) Transistor (video game) Destiny Soundtrack (video game) Bastion (video game) FTL Faster Than Light (video game) Ori and the Blind Forest - Soundtrack (video game) JOURNEY OST (video game) Deus Ex (video game) Shadow of the Colossus - Soundtrack (video game) Undertale Soundtrack (video game)

Generating optimized autoload files
> post-update-cmd: Illuminate\Foundation\ComposerScripts::postUpdate
> post-update-cmd: php artisan optimize
Script php artisan optimize handling the post-update-cmd event returned with an error
[RuntimeException]
Error Output:
Exception trace:
() at phar:///var/www/parseci/releases/20160715023715/composer.phar/src/Composer/EventDispatcher/EventDispatcher.php:226
@enygma
enygma / implements problem
Created January 22, 2016 16:06
implements problem
<?php
$set = new StrategySet();
class StrategySet implements Countable
{
public function count()
{
return 0;
}
@enygma
enygma / verify-example.php
Created December 21, 2015 21:55
example of a more refined Verify syntax (powered by PropAuth)
<?php
$user = (object)[
'username' => 'ccornutt',
'password' => password_hash('test1234', PASSWORD_DEFAULT),
'permissions' => ['test1', 'test2', 'edit']
];
$subject = new \Psecio\Verify\Subject\Simple($user);
$gate = new Gateway($subject);