Beispiel #1
0
        private async Task ScanTarget(ScanRequest request, CancellationToken cancellationToken, Target target,
                                      ScanResults results)
        {
            var rules          = target.Rules;
            var requestMessage = await _requestHelper.ToGetRequestMessageAsync(target, request.Host);

            if (rules.AllowPassive)
            {
                var response = await _httpClientWrapper.TrySendRequest(requestMessage, cancellationToken);

                if (response != null)
                {
                    var tasks = _passiveScanners.Where(x => x.IsEnabled()).Select(passiveScanner =>
                                                                                  RunScanner(results, passiveScanner, response)).ToList();

                    await Task.WhenAll(tasks.ToArray());
                }
            }
        }