This paper aims to propose a new trust-based Intrusion Detection system (IDS) for wireless, ad-hoc networks with or without mobility of nodes. In fact, the proposed solution not only detects intrusions but also proactively responds towards route setup avoiding the compromised nodes. It could be extended for mesh or hybrid networking environment too. Trust is evaluated as the weighted sum of direct evaluation of the neighboring nodes as well as from the indirect references. A sliding window is defined on the time scale and the IDS is to be evoked after every time slice. Indirect reference is derived from the recommendations of those 1-hop neighbors of the target node that are also neighbors of the evaluating node. The performance of the proposed algorithm has been evaluated using the Qualnet network simulator. Simulation results also establish superiority of the proposed algorithm over HIDS, another recent trust-based IDS for wireless ad-hoc network. © 2012 IFIP International Federation for Information Processing.