Knox shot a second round seven-under 65 to move to 12 under and two off leader Kevin Kisner, who carded a 66.
Northern Ireland's McIlroy, who is playing despite struggling this week with food poisoning, fell 10 behind the lead after shooting a 72.
Matthew Fitzpatrick is the highest-placed Englishman on seven under.
Fellow countrymen Ross Fisher and Tommy Fleetwood are a shot further behind, while Paul Casey, James Morrison and Danny Willett are five under.
World ranked number two Jordan Spieth had a mixed round of four birdies and four bogeys as the American finished with a 72 as he tumbled down the leaderboard.
Knox, however, is making the most of being a late entrant into the event, having only found out he would be making his WGC debut while playing in the CIMB Classic in Malaysia last Friday.
The 30-year-old from Inverness praised his wife Andrea for making the necessary arrangements - and also stepping in as a temporary caddie.
"My wife was a superstar and she filled out all the forms for us," said Knox.
"While we were playing on Friday she took all the stuff to the Chinese embassy in Kuala Lumpur and had it processed.
"We flew here on Tuesday morning but my caddie didn't have proof of accommodation so he was a day behind us. So when we got here my wife caddied for me.
"We got a stand bag from the pro here and chucked the clubs in and played the quickest practice round ever and she complained heavily for the last nine holes."
Scotland's Russell Knox moved into second place at the WGC-HSBC Champions event in Shanghai as Rory McIlroy's struggles continued.