penetration test – How to steal cookies and bypass two factor authentication?

Im new at cyber security and i want to know how hackers bypassing two factories authentication with metasploit.

I downloaded my test computer’s cookies file from this path:

C:UserssadettinAppDataLocalGoogleChromeUser DataDefaultCookies

and i restored it with my own cookies files and tried login with password but it doesn’t work.

Im getting two factor authentication page again. How hackers does that? and How it works?