The paper investigates a consensus problem of connected vehicle systems (CVSs) under cyber-attacks. In real application, dynamics and amplitude of cyber attacks are unknown and stochastic. From the defender's perspective, the neighbouring matrix based on threshold defence mechanism is designed to exclude exogenous and large enough attacks. For cyber-attacks whose amplitude lies in the measurement range, the dynamics is assumed to be an unknown nonlinear function of the states of the attacks and the vehicles. Based on such attack model, the neighbouring matrix and the control protocols of the vehicles, a state space model is first established for the CVSs. Then, an interaction network between the platoon layer in the original CVSs and the hidden layer in the virtual systems is constructed. By designing competitive interact matrices, stability of the overall system is ensured such that the state errors converge into a bounded range when the platoon layer suffers from cyber-attacks. The results still hold for the worst case, for example, both the platoon layer and the hidden layer are attacked simultaneously. The effectiveness and superiority of the method are illustrated by simulations.