Cooperative coordination in multiagent systems has been a topic of interest in networked control theory in recent years. In contrast to cooperative agents, Byzantine agents in a network are capable to manipulate their data arbitrarily and send bad messages to neighbors, causing serious network security issues. This paper is concerned with resilient tracking consensus over a time-varying random directed graph, which consists of cooperative agents, Byzantine agents, and a single leader. The objective of resilient tracking consensus is the convergence of cooperative agents to the leader in the presence of those deleterious Byzantine agents. We assume that the number and identity of the Byzantine agents are not known to cooperative agents, and the communication edges in the graph are dynamically randomly evolving. Based upon linear system analysis and a martingale convergence theorem, we design a linear discrete-time protocol to ensure tracking consensus almost surely in a purely distributed manner. Some numerical examples are provided to verify our theoretical results.