找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 39|回复: 4

whmcs7.4.1全解版解密不全啊

[复制链接]

54

主题

122

回帖

458

积分

中级会员

积分
458
发表于 2018-12-19 21:43:29 | 显示全部楼层 |阅读模式
https://github.com/catding/WHMCS-7.4.1-decoded
有一个文件:whmcs/vendor/whmcs/whmcs-foundation/lib/Security/Middleware/Authorization.php
未解密。有大侠能解吗?
回复

使用道具 举报

2

主题

28

回帖

84

积分

注册会员

积分
84
发表于 2018-12-19 22:21:10 | 显示全部楼层
网上找的~
[ol]
  • setRequest($request);
  •                 return $this->delegateProcess($request, $delegate);
  •         }
  •         public function _process(\WHMCS\Http\Message\ServerRequest $request, \Interop\Http\ServerMiddleware\DelegateInterface $delegate)
  •         {
  •                 $user = $request->getAttribute('authenticatedUser');
  •                 return $this->assertAuthorization($request, $user);
  •         }
  •         public function assertAuthorization(\WHMCS\Http\Message\ServerRequest $request, \WHMCS\User\UserInterface $user = NULL)
  •         {
  •                 if (!$this->hasValidCsrfToken()) {
  •                         return $this->responseInvalidCsrfToken();
  •                 }
  •                 $anyPermission = array_filter($this->getRequireAnyPermission());
  •                 $allPermission = array_filter($this->getRequireAllPermission());
  •                 if (empty($anyPermission) && empty($allPermission)) {
  •                         return $request;
  •                 }
  •                 if (!$user instanceof \WHMCS\User\UserInterface) {
  •                         throw new \WHMCS\Exception\Authorization\AccessDenied('Authentication Required');
  •                 }
  •                 try {
  •                         foreach ($allPermission as $permissionName) {
  •                                 if (!$user->hasPermission($permissionName)) {
  •                                         return $this->responseMissingMultiplePermissions($allPermission);
  •                                 }
  •                         }
  •                 }
  •                 catch (\Exception $e) {
  •                         return $this->responseMissingMultiplePermissions($allPermission);
  •                 }
  •                 if (empty($anyPermission)) {
  •                         return $request;
  •                 }
  •                 $isAllowed = false;
  •                 try {
  •                         foreach ($anyPermission as $permissionName) {
  •                                 if ($user->hasPermission($permissionName)) {
  •                                         $isAllowed = true;
  •                                         break;
  •                                 }
  •                         }
  •                 }
  •                 catch (\Exception $e) {
  •                 }
  •                 if (!$isAllowed) {
  •                         return $this->responseMissingPermission($anyPermission);
  •                 }
  •                 return $request;
  •         }
  •         protected function responseInvalidCsrfToken()
  •         {
  •                 throw new \WHMCS\Exception\Authorization\InvalidCsrfToken('Invalid CSRF Protection Token');
  •         }
  •         protected function responseMissingMultiplePermissions(array $permissionNames = array())
  •         {
  •                 throw new \WHMCS\Exception\Authorization\AccessDenied('Invalid Permissions. Requires "' . implode('", "', $permissionNames) . '".');
  •         }
  •         protected function responseMissingPermission(array $permissionNames = array())
  •         {
  •                 throw new \WHMCS\Exception\Authorization\AccessDenied('Invalid Permissions. Requires at least one of the following: "' . implode('", "', $permissionNames) . '".');
  •         }
  •         public function requireCsrfToken(array $csrfRequestMethods = NULL, $csrfNamespace = NULL)
  •         {
  •                 $this->setCsrfCheckRequired(true);
  •                 if (is_null($csrfRequestMethods)) {
  •                         $csrfRequestMethods = $this->getDefaultCsrfRequestMethods();
  •                 }
  •                 $this->setCsrfRequestMethods($csrfRequestMethods);
  •                 if (is_null($csrfNamespace)) {
  •                         $csrfNamespace = $this->getDefaultCsrfNamespace();
  •                 }
  •                 $this->setCsrfNamespace($csrfNamespace);
  •                 return $this;
  •         }
  •         public function hasValidCsrfToken()
  •         {
  •                 if (!$this->isCsrfCheckRequired()) {
  •                         return true;
  •                 }
  •                 $requestMethod = $this->getRequest()->getMethod();
  •                 if (!in_array($requestMethod, $this->getCsrfRequestMethods())) {
  •                         return true;
  •                 }
  •                 $token = $this->getRequest()->get('token');
  •                 try {
  •                         check_token($this->getCsrfNamespace(), $token);
  •                 }
  •                 catch (\WHMCS\Exception\ProgramExit $e) {
  •                         return false;
  •                 }
  •                 return true;
  •         }
  •         public function getRequest()
  •         {
  •                 return $this->request;
  •         }
  •         public function setRequest(\WHMCS\Http\Message\ServerRequest $request)
  •         {
  •                 $this->request = $request;
  •                 return $this;
  •         }
  •         public function getDefaultCsrfNamespace()
  •         {
  •                 return 'WHMCS.default';
  •         }
  •         public function getDefaultCsrfRequestMethods()
  •         {
  •                 return array('POST');
  •         }
  •         public function getCsrfRequestMethods()
  •         {
  •                 return $this->csrfRequestMethods;
  •         }
  •         public function setCsrfRequestMethods(array $csrfRequestMethods)
  •         {
  •                 $this->csrfRequestMethods = $csrfRequestMethods;
  •                 return $this;
  •         }
  •         public function getCsrfNamespace()
  •         {
  •                 return $this->csrfNamespace;
  •         }
  •         public function setCsrfNamespace($csrfNamespace)
  •         {
  •                 $this->csrfNamespace = $csrfNamespace;
  •                 return $this;
  •         }
  •         public function isCsrfCheckRequired()
  •         {
  •                 return $this->csrfCheckRequired;
  •         }
  •         public function setCsrfCheckRequired($checkRequired)
  •         {
  •                 $this->csrfCheckRequired = (bool) $checkRequired;
  •                 return $this;
  •         }
  •         public function getRequireAnyPermission()
  •         {
  •                 return $this->requireAnyPermission;
  •         }
  •         public function setRequireAnyPermission(array $permissions = array())
  •         {
  •                 $this->requireAnyPermission = $permissions;
  •                 return $this;
  •         }
  •         public function getRequireAllPermission()
  •         {
  •                 return $this->requireAllPermission;
  •         }
  •         public function setRequireAllPermission(array $permissions = array())
  •         {
  •                 $this->requireAllPermission = $permissions;
  •                 return $this;
  •         }
  • }
  • ?>[/ol]复制代码
  • 回复

    使用道具 举报

    113

    主题

    457

    回帖

    1301

    积分

    金牌会员

    积分
    1301
    发表于 2018-12-19 22:48:04 | 显示全部楼层
    略屌
    回复

    使用道具 举报

    28

    主题

    366

    回帖

    864

    积分

    高级会员

    积分
    864
    发表于 2018-12-19 22:49:16 | 显示全部楼层
    是滴 云路花钱解一下吧
    回复

    使用道具 举报

    54

    主题

    122

    回帖

    458

    积分

    中级会员

    积分
    458
     楼主| 发表于 2018-12-22 19:56:29 | 显示全部楼层

    dnser 发表于 2018-12-19 22:21

    网上找的~

    破解不对吧,不能运行
    回复

    使用道具 举报

    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    Archiver|手机版|小黑屋|Discuz! X

    GMT+8, 2025-5-10 10:07 , Processed in 0.017029 second(s), 4 queries , Gzip On, Redis On.

    Powered by Discuz! X3.5

    © 2001-2024 Discuz! Team.

    快速回复 返回顶部 返回列表