The wireless nature of mobile networks makes it vulnerable to all kinds of attacks. Therefore, designing a secure method for detecting intrusive nodes in this type of network seems necessary. Among the types of attacks on mobile ad-hoc networks, the Grayhole attack is one of the most dangerous attacks. In this type of attack, a malicious node absorbs network traffic and then selectively deletes a number of received packets. In this paper, a method called RSA-GRAY HOLE is used to detect and isolate the Grayhole attack. The proposed method not only detects the malicious node, but also disconnects it from the network and does not allow it to participate in the next routing process. The proposed method detects a malicious node in two steps; in the first step, it examines the validity of the nodes of a route to select a valid route. In the second step, the destination node detects the presence of malicious nodes in the route and after detecting the malicious nodes, disconnects them from the network. To demonstrate the efficiency of the proposed RSA-GRAY HOLE method, the NS-2 simulator was used and this method was compared with the DSR protocol under Grayhole attack. The simulation results show the superior performance of the proposed RSA-GRAY HOLE method compared to the Grayhole DSR method in terms of throughput (23%), package delivery rate (26%), average delay (19%) and number of lost packets (20%).