Just fix the lighting - it's so simple! It's almost always easier to prevent the problem than to fix it with software and that is definitely the case here.
If you don't want to get the job done in the most sensible, easy, straightforward, and best way (by fixing the illumination), then there are more complicated ways that you can do it, but you have to make some assumptions, like on the size of the hand, or its color, or on the smoothness of the background, or things like that. Some fix you make for one situation might not work for another. Like if you have that picture and then another where the hand is in front of a flesh colored screen, or a screen with a paisley background - those may all take different algorithms.
For what it's worth, I attach a background correction demo.