How to use the webtech.target.Target function in webtech

To help you get started, we’ve selected a few webtech examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kaiiyer / webtech / webtech / webtech.py View on Github external
def start_from_exchange(self, exchange):
        """
        Start webtech on a single target from a HTTP request-response exchange as Object
        """
        target = Target()

        target.parse_http_response(exchange['response'])
        target.parse_http_request(exchange['request'], replay=False)

        return self.perform(target)
github kaiiyer / webtech / webtech / webtech.py View on Github external
def start_from_url(self, url, headers={}, timeout=None):
        """
        Start webtech on a single URL/target

        Returns the report for that specific target
        """
        timeout = timeout or self.timeout
        target = Target()

        parsed_url = urlparse(url)
        if "http" in parsed_url.scheme:
            # Scrape the URL by making a request
            h = {'User-Agent': self.USER_AGENT}
            h.update(headers)
            target.scrape_url(url, headers=h, cookies={}, timeout=timeout)
        elif "file" in parsed_url.scheme:
            # Load the file and read it
            target.parse_http_file(url)
        else:
            raise ValueError("Invalid scheme {} for URL {}. Only 'http', 'https' and 'file' are supported".format(parsed_url.scheme, url))

        return self.perform(target)
github ShielderSec / webtech / webtech / webtech.py View on Github external
def start_from_url(self, url, headers={}, timeout=None):
        """
        Start webtech on a single URL/target

        Returns the report for that specific target
        """
        timeout = timeout or self.timeout
        target = Target()

        parsed_url = urlparse(url)
        if "http" in parsed_url.scheme:
            # Scrape the URL by making a request
            h = {'User-Agent': self.USER_AGENT}
            h.update(headers)
            target.scrape_url(url, headers=h, cookies={}, timeout=timeout)
        elif "file" in parsed_url.scheme:
            # Load the file and read it
            target.parse_http_file(url)
        else:
            raise ValueError("Invalid scheme {} for URL {}. Only 'http', 'https' and 'file' are supported".format(parsed_url.scheme, url))

        return self.perform(target)
github ShielderSec / webtech / webtech / webtech.py View on Github external
def start_from_exchange(self, exchange):
        """
        Start webtech on a single target from a HTTP request-response exchange as Object
        """
        target = Target()

        target.parse_http_response(exchange['response'])
        target.parse_http_request(exchange['request'], replay=False)

        return self.perform(target)