Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php namespace App\Ufw\Command; use App\System\Command; use App\Ufw\Firewall\Allow..
Decoded Output download
<?php
namespace App\Ufw\Command;
use App\System\Command;
use App\Ufw\Firewall\AllowTcpRule as TcpRule;
class AllowTcpRule extends Command
{
private TcpRule $tcpRule;
private bool $dryRun = false;
public function __construct(TcpRule $tcpRule)
{
$this->tcpRule = $tcpRule;
}
public function getCommand(): string
{
goto d0bfd;
ed572:
return $this->command;
goto Cadc4;
ee816:
b86a3:
goto ed572;
E94da:
$this->command = sprintf("/usr/bin/sudo /usr/sbin/ufw %s allow proto tcp from %s to any port %s", true === $dryRun ? "--dry-run" : '', $ip, $portRange);
goto ee816;
a2c2c:
$portRange = $this->tcpRule->getPortRange();
goto D9bf1;
D9bf1:
$dryRun = $this->getDryRun();
goto E94da;
Bc8b4:
$ip = $this->tcpRule->getIp();
goto a2c2c;
d0bfd:
if (!(true === is_null($this->command))) {
goto b86a3;
}
goto Bc8b4;
Cadc4:
}
public function setDryRun($flag): void
{
$this->dryRun = (bool) $flag;
}
public function getDryRun(): bool
{
return $this->dryRun;
}
public function isSuccessful(): bool
{
goto A37bf;
A37bf:
$output = $this->getOutput();
goto D9036;
D9036:
$isSuccessful = false === str_contains($output, "ERROR") ? true : false;
goto D42ce;
D42ce:
return $isSuccessful;
goto fef19;
fef19:
}
}
?>
Did this file decode correctly?
Original Code
<?php
namespace App\Ufw\Command;
use App\System\Command;
use App\Ufw\Firewall\AllowTcpRule as TcpRule;
class AllowTcpRule extends Command
{
private TcpRule $tcpRule;
private bool $dryRun = false;
public function __construct(TcpRule $tcpRule)
{
$this->tcpRule = $tcpRule;
}
public function getCommand(): string
{
goto d0bfd;
ed572:
return $this->command;
goto Cadc4;
ee816:
b86a3:
goto ed572;
E94da:
$this->command = sprintf("\x2f\x75\163\162\x2f\x62\x69\156\x2f\163\x75\x64\157\x20\57\165\x73\162\57\x73\142\x69\x6e\x2f\165\146\x77\40\45\163\x20\x61\154\x6c\157\167\40\160\x72\157\164\x6f\x20\164\x63\160\40\146\162\157\155\40\x25\x73\40\x74\157\x20\x61\156\x79\40\x70\x6f\162\164\x20\45\x73", true === $dryRun ? "\55\x2d\144\162\x79\55\162\x75\156" : '', $ip, $portRange);
goto ee816;
a2c2c:
$portRange = $this->tcpRule->getPortRange();
goto D9bf1;
D9bf1:
$dryRun = $this->getDryRun();
goto E94da;
Bc8b4:
$ip = $this->tcpRule->getIp();
goto a2c2c;
d0bfd:
if (!(true === is_null($this->command))) {
goto b86a3;
}
goto Bc8b4;
Cadc4:
}
public function setDryRun($flag): void
{
$this->dryRun = (bool) $flag;
}
public function getDryRun(): bool
{
return $this->dryRun;
}
public function isSuccessful(): bool
{
goto A37bf;
A37bf:
$output = $this->getOutput();
goto D9036;
D9036:
$isSuccessful = false === str_contains($output, "\105\x52\x52\x4f\122") ? true : false;
goto D42ce;
D42ce:
return $isSuccessful;
goto fef19;
fef19:
}
}
Function Calls
None |
Stats
MD5 | 26900c54535aa8aa5840033f9253748d |
Eval Count | 0 |
Decode Time | 59 ms |