This paper presents novel statistical algorithms for detecting and defending against malicious attacks in the iTrust information retrieval network. The novel detection algorithm determines empirically the probabilities of the exact numbers of matches based on the number of responses that the requesting node receives. It calculates analytically the probabilities of the exact numbers of matches and the probabilities of one or more matches when some proportion of the nodes have been subverted or are non-operational. It compares the empirical and analytical probabilities to estimate the proportion of subverted or non-operational nodes. The novel defensive adaptation algorithm then increases the number of nodes to which the metadata and the requests are distributed to maintain the same probability of a match when some of the nodes are subverted or non-operational as when all of the nodes are operational. Experimental results substantiate the effectiveness of the statistical algorithms for detecting and defending against malicious attacks.