The ghoul has long been one of my favorite types of D&D undead. It doesn't even matter that the original ghul of Arabian folklore is a demon instead. Cannibalism - especially a compulsion to commit same - is a kind of horror that seriously unsettles me, so I love stories about monsters along those lines. As a result, one of Dust to Dust's common monster types is the ghul - not undead, but still voraciously hungry, and able to copy powers and knowledge from creatures that it eats.
In D&D, ghouls are pack predators, one of the first cunning and actively malicious undead that PCs are likely to encounter. Their paralyzing touch has always been one of their key features, along with the elven immunity to same. The thing about a paralyzing touch is that it's a great equalizer, especially in 3.x - even high-level PCs might get hit and fail a Fort/Con saving throw, and once that happens, you're in coup de grace land (3.x), or just advantage-and-auto-crit (5e). I know of high-level teams that got TPKed by ghouls as a result of not taking them as serious threats, and I have watched my group's barbarian go from Perfectly Fine to Highly Dead in one round from a pair of ghouls and a natural 1 on a saving throw. Naturally, this is all the more true in 5e's bounded accuracy environment.
Understand, then, that I find a lot to like (as a DM) or hate (as a player) in the baseline ghoul stat block. Even so, there's a time and a place for tougher ghouls, and for those with more varied abilities. In this post, I've put together baseline ghoul stats for CR 4 and CR 8, representing ghouls that have been hunting and feeding successfully for years - even centuries. Further, I've created traits and special attacks to add to those ghouls more or less a la carte. You'll still need to pay attention to balance and think about CR adjustment, if you award XP based on CR of monsters defeated.
Medium undead, chaotic evil
Armor Class 14 (natural armor)
Hit Points 117 (18d8 + 36)
Speed 35 ft
Str 16 (+3) Dex 14 (+2) Con 14 (+2) Int 10 (+0) Wis 12 (+1) Cha 6 (-2)
Bite. Melee Weapon Attack: +5 to hit, reach 5 ft., one creature. Hit:14 (3d6 +3) piercing damage and 9 (2d8) poison damage.
Claw.Melee Weapon Attack: +7 to hit, reach 5 ft., one creature. Hit: 10 (3d4 + 3) slashing damage. If the target is a creature other than an elf or undead, it must succeed on a DC 14 Constitution saving throw or be paralyzed for 1 minute. The target can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success.
Medium undead, chaotic evil
Armor Class 16 (natural armor)
Hit Points 180 (24d8 + 72)
Speed 40 ft.
Str 18 (+4) Dex 14 (+2) Con 16 (+3) Int 10 (+0) Wis 12 (+1) Cha 8 (-1)
Multiattack. The wizened ghoul makes one claw attack and one bite attack, or two claw attacks. Bite. Melee Weapon Attack: +7 to hit, reach 5 ft., one creature. Hit:18 (4d6 +3) piercing damage and 9 (2d8) poison damage.
Claw.Melee Weapon Attack: +9 to hit, reach 5 ft., one creature. Hit: 13 (4d4 + 3) slashing damage. If the target is a creature other than an elf or undead, it must succeed on a DC 16 Constitution saving throw or be paralyzed for 1 minute. The target can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success.
Modify the MM ghoul or the two stat blocks provided above with one or more traits and/or one or more actions.
Burrower. As a result of eating a purple worm, the ghoul gains a burrow speed equal to half its speed, and tremorsense with a range of 30 ft. If covered entirely in dirt, stone, or other natural materials, it can hold its breath for up to 12 hours. (CR unchanged)
Heart of Ice. As a result of eating a white dragon, the ghoul gains resistance to cold damage, and its bite attack deals an additional 1d8 (CR 1), 2d8 (CR 4), or 3d8 (CR 8) cold damage. Further, it can move across and climb icy surfaces without needing to make an ability check. Difficult terrain composed of ice or snow doesn't cost it extra movement. (CR increases by 2)
Jotunblud. As a result of eating a giant or several ogres, the ghoul becomes Large, adding 5 ft. to the reach of its attacks. Its bite attack deals an additional 1d6 piercing damage, and its claw attack deals an additional 1d4 damage. (CR increases by 1)
Tactical Command. As a result of eating an inspiring commander, the ghoul's Charisma score becomes 16 (+3) and it grants 5 (CR 1), 15 (CR 4), or 30 (CR 8) temporary hit points to allied sentient creatures. It may spend its action to command an ally to attack; the ally spends a reaction and makes an attack, dealing an additional 1d10 damage of the same type on a hit. (CR increases by 2)
Red Frenzy. As a result of eating sahuagin or demonic flesh, the ghoul gains advantage on attacks against creatures whose current hit points are less than their maximum. (CR increases by 1)
All actions use the same attack bonus as the ghoul's bite attack. Saving throws against their effects are DC 10 (CR 1), DC 14 (CR 4), or DC 16 (CR 8).
Eruption of Flesh. The ghoul has consumed an enormous number of leeches, beetles, or the like. As an action, it causes them to erupt out of its skin and latch onto nearby creatures. The ghoul suffers damage equal to 25% of its maximum hit points. All non-undead creatures within 10 feet must make a Constitution saving throw, suffering 2d10 (CR 1), 4d10 (CR 4), or 7d10 (CR 8) acid damage on a failed save, or half damage on a success. (CR increases by 1)
Fire Breath (Recharge 6). The ghoul has consumed a chimera or hell hound. As an action, it exhales fire in a 15-foot cone. Each creature in the area must make a Dexterity saving throw, taking 2d8 (CR 1), 4d8 (CR 4), or 8d8 (CR 8) fire damage on a failed save, or half damage on a success. (CR increases by 1)
Petrifying Gaze (Recharge 5-6). The ghoul has consumed a basilisk. As an action, the ghoul forces one creature within 30 feet whose eyes are not averted and who is not blinded to make a Constitution saving throw. On a failed save, the creature magically begins to turn to stone and is restrained. It must repeat the saving throw at the end of its next turn. On a success, the effect ends. On a failure, the creature is petrified. (CR increases by 1)
Shield (Recharge 4-6). The ghoul has consumed a sorcerer or wizard. Its Intelligence or Charisma ability scores (as appropriate) become 16 (+3). As a reaction when it is hit by an attack or targeted by magic missile, it casts shield.
Tentacles. The ghoul has consumed a grick, octopus, or other tentacled creature, and tentacles sprout from its shoulders or chest. It makes two tentacle attacks, with a reach of 5 ft., targeting a single creature. On a hit, it deals 1d6 + 2 (CR 1), 3d6 + 3 (CR 4), or 4d6 + 3 (CR 8) bludgeoning damage. If it hits with a tentacle attack, it may make a bite attack against the same creature as a bonus action. (CR increases by 2)
These are just a few ideas, taken from skimming through the Monster Manual and thinking about what kinds of features would make the ghoul even more horrible to fight. CR increases are wild guesses - I could try to calculate everything, but not only is it hard, it's also imprecise because of some restrictions I've built in. Personally, I don't worry too much about CRs in my campaign, and XP awards have nothing whatsoever to do with CR. I would encourage everyone else to do the same - stop rewarding players for killing things, just reward them for engaging with the setting and the story. (Milestone XP is the easy-mode version of this, and there are good reasons that WotC is recommending it in published adventures these days.)
I think all of these additions are more interesting if heavily telegraphed through description of the creature's appearance or behavior (or by showing gnawed carcasses), rather than keeping them as a Gotcha moment. Giving players a little more time to worry about what's coming probably increases the scene's tension more than a sudden surprise does.