Exemplo n.º 1
0
 def test_packet_dcerpc_15(self):
     packet = traffic.Packet(
         "0.0\t11\t1\t1\t2\tdcerpc\t15\tAlter_context_resp\t")
     # Set user_creds MUST_USE_KERBEROS to suppress the warning message.
     self.context.user_creds.set_kerberos_state(MUST_USE_KERBEROS)
     self.assertFalse(
         p.packet_dcerpc_15(packet, self.conversation, self.context))
Exemplo n.º 2
0
    def test_packet_kerberos(self):
        """Kerberos packets are not generated, but are used as a hint to
        favour kerberos.
        """
        packet = traffic.Packet("0.0\t11\t1\t1\t2\tkerberos\t\t\t")
        self.assertFalse(
            p.packet_kerberos_(packet, self.conversation, self.context))
        self.assertEqual(MUST_USE_KERBEROS,
                         self.context.user_creds.get_kerberos_state())
        self.assertEqual(MUST_USE_KERBEROS,
                         self.context.user_creds_bad.get_kerberos_state())
        self.assertEqual(MUST_USE_KERBEROS,
                         self.context.machine_creds.get_kerberos_state())
        self.assertEqual(MUST_USE_KERBEROS,
                         self.context.machine_creds_bad.get_kerberos_state())
        self.assertEqual(MUST_USE_KERBEROS,
                         self.context.creds.get_kerberos_state())

        # Need to restore kerberos creds on the admin creds otherwise
        # subsequent tests fail
        self.credentials.set_kerberos_state(DONT_USE_KERBEROS)
Exemplo n.º 3
0
 def test_packet_dcerpc_02(self):
     packet = traffic.Packet("0.0\t11\t1\t1\t2\tdcerpc\t2\tResponse\t")
     self.assertFalse(
         p.packet_dcerpc_2(packet, self.conversation, self.context))
Exemplo n.º 4
0
 def test_packet_cldap_03(self):
     packet = traffic.Packet("0.0\t11\t1\t2\t1\tcldap\t3\tsearchRequest\t")
     self.assertTrue(
         p.packet_cldap_3(packet, self.conversation, self.context))
Exemplo n.º 5
0
 def test_packet_samr_68(self):
     packet = traffic.Packet("0.0\t06\t1\t2\t1\tsamr\t68\t\t")
     self.assertFalse(
         p.packet_samr_68(packet, self.conversation, self.context))
Exemplo n.º 6
0
 def test_packet_samr_44(self):
     packet = traffic.Packet("0.0\t06\t1\t2\t1\tsamr\t44\tGetUserPwInfo\t")
     self.assertFalse(
         p.packet_samr_44(packet, self.conversation, self.context))
Exemplo n.º 7
0
 def test_packet_samr_39(self):
     packet = traffic.Packet(
         "0.0\t06\t1\t2\t1\tsamr\t39\tGetGroupsForUser\t")
     self.assertTrue(
         p.packet_samr_39(packet, self.conversation, self.context))
Exemplo n.º 8
0
 def test_packet_samr_36(self):
     packet = traffic.Packet("0.0\t06\t1\t2\t1\tsamr\t36\tQueryUserInfo\t")
     self.assertTrue(
         p.packet_samr_36(packet, self.conversation, self.context))
Exemplo n.º 9
0
 def test_packet_samr_05(self):
     packet = traffic.Packet("0.0\t06\t1\t2\t1\tsamr\t5\tLookupDomain\t")
     self.assertTrue(
         p.packet_samr_5(packet, self.conversation, self.context))
Exemplo n.º 10
0
 def test_packet_samr_03(self):
     packet = traffic.Packet("0.0\t06\t1\t2\t1\tsamr\t3\tQuerySecurity\t")
     self.assertTrue(
         p.packet_samr_3(packet, self.conversation, self.context))
Exemplo n.º 11
0
 def test_packet_samr_01(self):
     packet = traffic.Packet("0.0\t06\t1\t2\t1\tsamr\t1\tClose\t")
     self.assertTrue(
         p.packet_samr_1(packet, self.conversation, self.context))
Exemplo n.º 12
0
 def test_packet_rpc_netlogon_45(self):
     packet = traffic.Packet(
         "0.0\t06\t1\t2\t1\trpc_netlogon\t45\tNetrLogonSamLogonWithFlags\t")
     self.assertTrue(
         p.packet_rpc_netlogon_45(packet, self.conversation, self.context))
Exemplo n.º 13
0
 def test_packet_rpc_netlogon_40(self):
     packet = traffic.Packet(
         "0.0\t06\t1\t2\t1\trpc_netlogon\t40\tDsrEnumerateDomainTrusts\t")
     self.assertTrue(
         p.packet_rpc_netlogon_40(packet, self.conversation, self.context))
Exemplo n.º 14
0
 def test_packet_rpc_netlogon_39(self):
     packet = traffic.Packet(
         "0.0\t06\t1\t2\t1\trpc_netlogon\t39\tNetrLogonSamLogonEx\t")
     self.assertTrue(
         p.packet_rpc_netlogon_39(packet, self.conversation, self.context))
Exemplo n.º 15
0
 def test_packet_rpc_netlogon_34(self):
     packet = traffic.Packet(
         "0.0\t06\t1\t2\t1\trpc_netlogon\t34\tDsrGetDcNameEx2\t")
     self.assertFalse(
         p.packet_rpc_netlogon_34(packet, self.conversation, self.context))
Exemplo n.º 16
0
 def test_packet_samr_25(self):
     packet = traffic.Packet(
         "0.0\t06\t1\t2\t1\tsamr\t25\tQueryGroupMember\t")
     self.assertTrue(
         p.packet_samr_25(packet, self.conversation, self.context))
Exemplo n.º 17
0
 def test_packet_samr_34(self):
     packet = traffic.Packet("0.0\t06\t1\t2\t1\tsamr\t34\tOpenUser\t")
     self.assertTrue(
         p.packet_samr_34(packet, self.conversation, self.context))
Exemplo n.º 18
0
 def test_packet_samr_07(self):
     packet = traffic.Packet("0.0\t06\t1\t2\t1\tsamr\t7\tOpenDomain\t")
     self.assertTrue(
         p.packet_samr_7(packet, self.conversation, self.context))
Exemplo n.º 19
0
 def test_packet_samr_37(self):
     packet = traffic.Packet("0.0\t06\t1\t2\t1\tsamr\t37\tSetUserInfo\t")
     self.assertFalse(
         p.packet_samr_37(packet, self.conversation, self.context))
Exemplo n.º 20
0
 def test_packet_samr_08(self):
     packet = traffic.Packet(
         "0.0\t06\t1\t2\t1\tsamr\t8\tQueryDomainInfo'\t")
     self.assertTrue(
         p.packet_samr_8(packet, self.conversation, self.context))
Exemplo n.º 21
0
 def test_packet_samr_40(self):
     packet = traffic.Packet(
         "0.0\t06\t1\t2\t1\tsamr\t40\tQueryDisplayInfo\t")
     self.assertFalse(
         p.packet_samr_40(packet, self.conversation, self.context))
Exemplo n.º 22
0
 def test_packet_samr_14(self):
     packet = traffic.Packet("0.0\t06\t1\t2\t1\tsamr\t14\tCreateDomAlias\t")
     self.assertFalse(
         p.packet_samr_14(packet, self.conversation, self.context))
Exemplo n.º 23
0
 def test_packet_samr_64(self):
     packet = traffic.Packet("0.0\t06\t1\t2\t1\tsamr\t64\tConnect5\t")
     self.assertTrue(
         p.packet_samr_64(packet, self.conversation, self.context))
Exemplo n.º 24
0
 def test_packet_samr_15(self):
     packet = traffic.Packet(
         "0.0\t06\t1\t2\t1\tsamr\t15\tEnumDomainAliases\t")
     self.assertTrue(
         p.packet_samr_15(packet, self.conversation, self.context))
Exemplo n.º 25
0
 def test_packet_srvsvc_21(self):
     packet = traffic.Packet(
         "0.0\t06\t1\t2\t1\tsrvsvc\t21\tNetSrvGetInfo\t")
     self.assertTrue(
         p.packet_srvsvc_21(packet, self.conversation, self.context))
Exemplo n.º 26
0
 def test_packet_samr_16(self):
     packet = traffic.Packet(
         "0.0\t06\t1\t2\t1\tsamr\t16\tGetAliasMembership\t")
     self.assertTrue(
         p.packet_samr_16(packet, self.conversation, self.context))
Exemplo n.º 27
0
 def test_packet_cldap_05(self):
     packet = traffic.Packet("0.0\t11\t1\t1\t2\tcldap\t5\tsearchResDone\t")
     self.assertFalse(
         p.packet_cldap_5(packet, self.conversation, self.context))
Exemplo n.º 28
0
 def test_packet_samr_18(self):
     packet = traffic.Packet("0.0\t06\t1\t2\t1\tsamr\t18\tLookupRids\t")
     self.assertTrue(
         p.packet_samr_18(packet, self.conversation, self.context))
Exemplo n.º 29
0
 def test_packet_dcerpc_03(self):
     packet = traffic.Packet("0.0\t11\t1\t1\t2\tdcerpc\t3\t\t")
     self.assertFalse(
         p.packet_dcerpc_3(packet, self.conversation, self.context))
Exemplo n.º 30
0
 def test_packet_samr_19(self):
     packet = traffic.Packet("0.0\t06\t1\t2\t1\tsamr\t19\tOpenGroup\t")
     self.assertTrue(
         p.packet_samr_19(packet, self.conversation, self.context))