Exemple #1
0
    def __call__(self, context):
        client = ImposterClient(context)
        mh = MessageHelper(context)
        fuzzer = Fuzzer(context)

        handshake_request = client.handshake()
        print mh.unpack_request(handshake_request)

        # Fuzz a read request
        for m in fuzzer.fuzz(handshake_request):
            print mh.unpack_request(m)[0]
            client.send(m)
            response_raw = client.receive()
            response = client.unpack(response_raw, m)
            print response
    def __call__(self, context):
        client = ImposterClient(context)
        mh = MessageHelper(context)
        fuzzer = Fuzzer(context)

        handshake_request = client.handshake()
        print mh.unpack_request(handshake_request)

        # Fuzz a read request
        for m in fuzzer.fuzz(handshake_request):
            print mh.unpack_request(m)[0]
            client.send(m)
            response_raw = client.receive()
            response = client.unpack(response_raw, m)
            print response
Exemple #3
0
  def __call__(self, context):
    client = ImposterClient(context)
    client.do_full_handshake()
    options = XOpenRequestOption.kXR_open_updt | XOpenRequestOption.kXR_delete

    open_request = client.kXR_open(path='/eos/opstest/jsalmon/file1', options=options)
    client.send(open_request)
    response_raw = client.receive()
    response = client.unpack(response_raw, open_request)
    print response

    if response.status == XResponseType.kXR_redirect:
        # We got redirected
        print 'Got redirected to %r' % response.host

        write_request = client.kXR_write(data='lol')
        client.send(write_request)
        response_raw = client.receive()
        print '%r' % response_raw
        response = client.unpack(response_raw, write_request)
        print response
Exemple #4
0
    def __call__(self, context):
        client = ImposterClient(context)
        client.do_full_handshake()
        options = XOpenRequestOption.kXR_open_updt | XOpenRequestOption.kXR_delete

        open_request = client.kXR_open(path='/eos/opstest/jsalmon/file1',
                                       options=options)
        client.send(open_request)
        response_raw = client.receive()
        response = client.unpack(response_raw, open_request)
        print response

        if response.status == XResponseType.kXR_redirect:
            # We got redirected
            print 'Got redirected to %r' % response.host

            write_request = client.kXR_write(data='lol')
            client.send(write_request)
            response_raw = client.receive()
            print '%r' % response_raw
            response = client.unpack(response_raw, write_request)
            print response
  def __call__(self, context):
    client = ImposterClient(context)

    # The following line will to the equivalent of the rest of this method,
    # using sensible default values.
    #
    # sess_id = client.do_full_handshake()
    handshake_request = client.handshake()
    client.send(handshake_request)
    response_raw = client.receive()
    response = client.unpack(response_raw, handshake_request)
    print response

    protocol_request = client.kXR_protocol()
    client.send(protocol_request)
    response_raw = client.receive()
    response = client.unpack(response_raw, protocol_request)
    print response

    login_request = client.kXR_login(username='******')
    client.send(login_request)
    response_raw = client.receive()
    response = client.unpack(response_raw, login_request)
    sessid = response.sessid
    print response

    # Check if we need to auth
    if len(response.sec):
      auth_request = client.kXR_auth(authtoken=response.sec)
      client.send(auth_request)
      response_raw = client.receive()
      response = client.unpack(response_raw, auth_request)
      print response

      # Check if we need to authmore
      while response.status == XResponseType.kXR_authmore:
        print 'Client %s: more authentication needed' % context['streamid']
        auth_request = client.kXR_auth(contcred=response.data)
        client.send(auth_request)
        response_raw = client.receive()
        response = client.unpack(response_raw, auth_request)
        print response

    if response.status == XResponseType.kXR_ok:
      print "Client %s: logged in successfully" % context['streamid']
    else:
      print "Client %S: login failed (%s): %s" % \
            (context['streamid'], response.status, response.errmsg)
    def __call__(self, context):
        client = ImposterClient(context)

        # The following line will to the equivalent of the rest of this method,
        # using sensible default values.
        #
        # sess_id = client.do_full_handshake()
        handshake_request = client.handshake()
        client.send(handshake_request)
        response_raw = client.receive()
        response = client.unpack(response_raw, handshake_request)
        print response

        protocol_request = client.kXR_protocol()
        client.send(protocol_request)
        response_raw = client.receive()
        response = client.unpack(response_raw, protocol_request)
        print response

        login_request = client.kXR_login(username='******')
        client.send(login_request)
        response_raw = client.receive()
        response = client.unpack(response_raw, login_request)
        sessid = response.sessid
        print response

        # Check if we need to auth
        if len(response.sec):
            auth_request = client.kXR_auth(authtoken=response.sec)
            client.send(auth_request)
            response_raw = client.receive()
            response = client.unpack(response_raw, auth_request)
            print response

            # Check if we need to authmore
            while response.status == XResponseType.kXR_authmore:
                print 'Client %s: more authentication needed' % context[
                    'streamid']
                auth_request = client.kXR_auth(contcred=response.data)
                client.send(auth_request)
                response_raw = client.receive()
                response = client.unpack(response_raw, auth_request)
                print response

        if response.status == XResponseType.kXR_ok:
            print "Client %s: logged in successfully" % context['streamid']
        else:
            print "Client %S: login failed (%s): %s" % \
                  (context['streamid'], response.status, response.errmsg)