Infrared Search and Tracking (IRST) is challenged by detecting dim and small targets in complex backgrounds. In the context of moving small target detection, a perturbed, highly illuminated background is prone to engendering a high rate of false alarms. Furthermore, the variance in movement speed and scale of the targets can easily undermine the robustness of detection methods when extracting inter-frame information. In order to overcome these inadequacies, an effective method that leverages spatial and temporal profile information is proposed. In the spatial domain, targets are enhanced by computing the ratio difference as local contrast, and layered gradient kernel preprocessing along with gray difference calculations are applied to mitigate the impact of highly illuminated background. In the time domain, a tri-layer window for temporal profile of target pixels is utilized as an enhancement. By combining detections from both domains, target extraction is achieved through simple adaptive thresholding segmentation. The experimental results demonstrate that the proposed method is capable of effectively extracting slowly moving infrared dim small targets in complex backgrounds. Compared to existing spatiotemporal joint detection methods, the robustness is enhanced, false alarm rates are reduced, and higher computational efficiency is achieved.