Example #1
0
        def run(self):
            class S(BaseHTTPRequestHandler):
                @staticmethod
                def do_GET():
                    LOG.info('Server received a request from vulnerable machine')
                    self.get_requests += 1
            LOG.info('Server waiting for exploited machine request...')
            httpd = HTTPServer((self.local_ip, self.local_port), S)
            httpd.daemon = True
            self.lock.release()
            while not self._stopped and self.get_requests < self.max_requests:
                httpd.handle_request()

            self._stopped = True
            return httpd