Mobile agents (MA) are autonomous software entities that are able to migrate across heterogeneous network execution environments. Mobility and autonomy compensate the deficiencies of distributed technology pretty well. Thus, mobile agents have wide application prospects. But security is an important issue for the widespread deployment of mobile agents applications. Especially the protection of mobile agents from attacks of malicious hosts is a unique security problem of mobile agent systems. It is difficult to solve this problem because agent is completely exposed in remote host and it is easy to be isolated and attacked by the malicious host. A protection scheme of mobile agents based on obfuscated agent data variables and time checking technology is presented in this paper. A method of how to obtain related data in time checking is given also. The idea of the time checking is based on limiting the execution time of the MA on the destination hosts. The original host checks three inequalities for the security of the hosts on the itinerary during the execution of the MA. If any of them is not satisfied, the hosts on both sides are suspicious. Through this time checking scheme, all the malicious hosts can be detected. The protection scheme is tested in actual network management environment, which can effectively identify the malicious host. The MA protection ratio reaches over 95%.