The visitors resumed the day-night match under clear skies on a precarious 39 for three with Masood not out 14 and Shafiq on eight.
Adelaide: Spin king Nathan Lyon removed dangerous half-century makers Shan Masood and Asad Shafiq Monday as Australia edged closer to victory inside four days at the second Test in Adelaide despite stubborn Pakistan resistance.
The visitors resumed the day-night match under clear skies on a precarious 39 for three with Masood not out 14 and Shafiq on eight after being bowled out for 302 in their first innings and forced to follow on.
It followed Australia's mammoth 589 for three declared, built around David Warner's exceptional 335 not out -- the 10th highest Test score of all-time.
Needing 248 to make Australia bat again and avoid a second successive innings defeat, Pakistan reached 167 for five after the first session, having whittled down the deficit to 120.
On a flat pitch offering little in the way of swing or seam for the fast bowlers, Iftikhar Ahmed and Mohammad Rizwan were both on 10. Masood made 68 and Shafiq 57.
Masood, who models himself on England's Alastair Cook, played some glorious strokes, including a six off Lyon, as he assumed a leadership role after Babar Azam and captain Azhar Ali fell cheaply on Sunday evening.
His sixth Test 50, in his 17th Test, arrived with a boundary off Lyon, his sixth four, before he chipped the spinner to mid-off where Mitchell Starc collected an easy catch.
Shafiq, who has 12 Test hundreds to his name, proved to be Masood's equal and brought up his 25th half-century with a single off Hazlewood.
But Lyon struck again, with Shafiq getting a thin edge to a flighted ball that carried to Warner at slip.
Surprise first-innings century-maker Yasir Shah is yet to bat as Pakistan face another heavy loss after their innings and five runs defeat in the first of the two-Test series at Brisbane.