In order to resist wormhole attacks and improve localization performance, a secure neighbor discovery based DV-HOP(NDDV) algorithm was proposed. Based on the abnormal hop number in the network node communication when wormhole attack occurs, NDDV can detect two kinds of wormhole links according to the path hop number difference between nodes, then search, find and filter wormhole links to ensure the correctness of DV-HOP hop number and hop distance, mitigate the impact of wormhole attacks, and enhance the node localization accuracy. In the simulation experiments, 144 nodes were positioned 150 times with different locator ratios. The results show that when the mean locator ratio is more than five, NDDV can effectively filter the wormhole links and improve the node localization accuracy. With the same average localization accuracy, NDDV has the locator ratio 17.5% smaller than LBDV (label-based DV-HOP localization against wormhole attacks).