silktide / wappalyzer-wrapper
此包已被废弃且不再维护。没有建议的替代包。
此包最新版本(1.0.1)的许可证信息不可用。
Wappalyzer 技术检测的包装器。
1.0.1
2020-10-25 09:45 UTC
Requires
- php: ^7.1
- composer-plugin-api: ^2.0.0
- mikehaertl/php-shellcommand: ^1.2
Requires (Dev)
- composer/composer: ~2
- phpunit/phpunit: ^6.4
This package is auto-updated.
Last update: 2021-06-11 14:43:47 UTC
README
由于调用 Wappalyzer 内部(非常不稳定)的 API,因此已被弃用
wappalyzer-wrapper
一个简单的 PHP 包装器,用于 Wappalyzer 技术检测,它将 wappalyzer-cli 命令行客户端包装起来,以便作为易于安装的 composer 依赖项使用。
此库现在还允许您选择绕过 Wappalyzer 使用 zombie 下载页面,而您可以传递自己的 HTML、头部等。
简单用法
//Build required classes (can also use DI) $resultFactory = new \Silktide\WappalyzerWrapper\Result\ResultFactory(); $technologyResultFactory = new \Silktide\WappalyzerWrapper\Result\TechnologyResultFactory(); $parser = new \Silktide\WappalyzerWrapper\Result\ResultProcessor($resultFactory, $technologyResultFactory); $commandFactory = new \Silktide\WappalyzerWrapper\CommandFactory(); $jsonFileWriter = new \Silktide\WappalyzerWrapper\Request\JsonFileWriter(); // Create client $client = new \Silktide\WappalyzerWrapper\Client($commandFactory, $parser, $jsonFileWriter); // Get the analysis results for a site $result = $client->analyse('https://silktide.com'); // Output all technologies found foreach ($result->getTechnologyResults() as $technologyResult) { echo "\nFound ".$technologyResult->getName(); } // Output just something from a specific category foreach ($result->getTechnologyResultsByCategory('Analytics') as $technologyResult) { echo "\nFound ".$technologyResult->getName(); }
使用现有页面数据
此客户端还可以与您已经拥有的现有页面数据一起使用,绕过 Wappalyzer 使用 Zombie 下载页面。您需要主机名、URL、响应头、HTML 和环境变量。Wappalyzer 环境变量应该是页面访问窗口对象的键的列表,例如 ['jQuery', 'ga']
。
//Build required classes (can also use DI) $resultFactory = new \Silktide\WappalyzerWrapper\Result\ResultFactory(); $technologyResultFactory = new \Silktide\WappalyzerWrapper\Result\TechnologyResultFactory(); $parser = new \Silktide\WappalyzerWrapper\Result\ResultProcessor($resultFactory, $technologyResultFactory); $commandFactory = new \Silktide\WappalyzerWrapper\CommandFactory(); $jsonFileWriter = new \Silktide\WappalyzerWrapper\Request\JsonFileWriter(); // Set up request from existing page data $existingPageDataRequest = new \Silktide\WappalyzerWrapper\Request\ExistingPageDataRequest(); $existingPageDataRequest->setHostname('example.com'); $existingPageDataRequest->setUrl('https://example.com'); $existingPageDataRequest->addHeader('Content-Type', 'application/json'); $existingPageDataRequest->addWindowObjectKey('ga'); $existingPageDataRequest->setHtml('<html><head><meta name="generator" content="Amiro"></head><body></body></html>'); // Create client $client = new \Silktide\WappalyzerWrapper\Client($commandFactory, $parser, $jsonFileWriter); // Get the analysis results for a site $result = $client->analyseFromExistingData($existingPageDataRequest); // Output all technologies found foreach ($result->getTechnologyResults() as $technologyResult) { echo "\nFound ".$technologyResult->getName(); } // Output just something from a specific category foreach ($result->getTechnologyResultsByCategory('Analytics') as $technologyResult) { echo "\nFound ".$technologyResult->getName(); }