Befriending Upward describes a tactic or strategy of the ambitious of cultivating the powerful. Consistent with the "loyalty option" of subordinates when dealing with incompetent or irresponsible leaders, this is the sort of behavior encouraged by the followers of Leo Stauss.
For example the editor of the defunct British tabloid News of the World, Rebekah Brooks, was described as "skilled in the art of befriending upward." See Sarah Lyall and Jo Becker. "A Tenacious Rise to the Top in the Brutal Men’s World of Tabloids." The New York Times. July 7, 2011. Source. Brooks would befriend and at times betray elites.
A more amusing fictional example is that of the character INS agent Eli Turnbull, played by David Space, in the 1993 film Coneheads. Finding himself a captive on an alien planet, Turnbull immediately abandons his superior, INS Deputy Commissioner Gorman Seedling, and ingratiates himself with the planet's leader, the Highmaster, played by Dave Thomas.