We give a new computational method to obtain symmetries of ordinary differential equations. The proposed approach appears as an extension of a recent algorithm to compute variational symmetries of optimal control problems [Comput. Methods Appl. Math. 5 (2005), no. 4, pp. 387-409], and is based on the resolution of a first order linear PDE that arises as a necessary and sufficient condition of invariance for abnormal optimal control problems. A computer algebra procedure is developed, which permits to obtain ODE symmetries by the proposed method. Examples are given, and results compared with those obtained by previous available methods.