Wireless Sensor Networks (WSNs) are an ideal solution for miscellaneous applications of surveillance and control, such as traffic control, environmental monitoring, and battlefield surveillance. The wireless sensor nodes have limited memory and processing capability. The Sybil Attack is a serious threat in which a malicious node creates multiple fake identities in order to mislead the other sensor nodes. This attack can have influence on routing protocols and the operations like voting and data aggregation. In this paper, we present a dynamic and lightweight algorithm with a confidence-aware trust approach. The Algorithm uses the trust value of each sensor node to reduce the false alarm rates and detect indirect Sybil attacks in WSNs. The simulation results demonstrate that the average detection and wrong detection rates are 92% and 0.08% respectively.