The 26-year-old Hafez became a free agent after his deal with Turkish side Yeni Malatyaspor expired in July as his former team was relegated to the second division of the Turkey Super Lig.
The former Wadi Degla and Pharaohs defender spent most of football career overseas, playing for Belgium giants Lierse SK and three Turkish sides: Kasimpasa, Basaksehir, and Malatyaspor.
He played in 33 games with Yeni Malatyaspor last season.
Since 2015, Hafez played 7 games for the Pharaohs, participating in the 2017 Africa Cup of Nations in Gabon.
(For more sports news and updates, follow Ahram Online Sports on Twitter at @AO_Sports and on Facebook at AhramOnlineSports.)