This paper presented the cause of the replay attack and how to prevent it.Analysed a modified security protocol,and it had no error.But based on the analysis of premise assumption could find a replay attack.Also could find replay attacks based on the limitation of authentication test.