2011-12-30 11:34:39 +01:00
|
|
|
from euscan.handlers import generic, php, pypi, rubygem, kde
|
2011-08-31 15:38:32 +02:00
|
|
|
|
2011-12-30 11:34:39 +01:00
|
|
|
handlers = [ kde, php, pypi, rubygem, generic ]
|
2011-08-31 15:38:32 +02:00
|
|
|
|
|
|
|
def find_best_handler(cpv, url):
|
|
|
|
for handler in handlers:
|
|
|
|
if handler.can_handle(cpv, url):
|
|
|
|
return handler
|
|
|
|
return None
|
|
|
|
|
|
|
|
def scan(cpv, url):
|
|
|
|
handler = find_best_handler(cpv, url)
|
|
|
|
if handler:
|
|
|
|
return handler.scan(cpv, url)
|
|
|
|
return []
|
|
|
|
|
|
|
|
def brute_force(cpv, url):
|
|
|
|
handler = find_best_handler(cpv, url)
|
|
|
|
if handler:
|
|
|
|
return handler.brute_force(cpv, url)
|
|
|
|
return []
|