Recently Wireless Sensor Networks are used in applications that are "close to human" (healthcare, context sensing etc.) as well as "close to the environment" (weather sensing, seismic activity sensing, disaster warning etc.). Many of these applications are prone to security threats. Due to lightweight processors, limited battery etc. sophisticated encryption algorithms could not be applied in such networks. Moreover, a device may change its nature in runtime. In this paper a trust management scheme is proposed that works with directed diffusion routing protocol and is able to mitigate threats like selective forwarding, bad mouthing and good mouthing. The protocol is simulated in NS-2. The results show the effectiveness of the scheme in moderately hostile network.