A preserved archive of the Logical Gamers community forums, 2009-2025. The original threads and posts, served read-only. Registration, posting and private messages are gone for good.

[PYTHON] Gaia Auth

2k views · started by zzGoWR ·
#1
Gaia Login Authorization [AutoIt, Python, etc.]
vb.net wrote:
Dim strHTML As String
Dim vbwrapper As Wrapper = New Wrapper()
If (txtUsername.Text = vbNullString) Then
lblLogin.Text = "Please enter a username!"
Exit Sub
ElseIf (txtPassword.Text = vbNullString) Then
lblLogin.Text = "Please enter a password!"
Exit Sub
End If

lblLogin.Text = "Logging in..."
btnLogin.Enabled = False
txtUsername.Enabled = False
txtPassword.Enabled = False

strHTML = vbwrapper.Request("POST", "http://login.gaiaonline.com/gaia/login.php?username=" & txtUsername.Text & "&password=" & txtPassword.Text & "&x=21&y=8&submit=Login&redirect=%2F", "http://login.gaiaonline.com/gaia/login.php")
strHTML = vbwrapper.Request("GET", "http://www.gaiaonline.com/forum/", vbwrapper.LastPage)
If strHTML.Contains("Gold:") Then
lblLogin.Text = "Logged In!"
Else
btnLogin.Enabled = True
txtUsername.Enabled = True
txtPassword.Enabled = True
lblLogin.Text = "Failed Login. Please try again."
End If


Python wrote:
import urllib
import urllib2
import cookielib
import re
import time
import hashlib

cookieJar = cookielib.LWPCookieJar()
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cookieJar))
opener.addheaders = [('User-agent', "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 ( .NET CLR 3.5.30729; .NET CLR 4.0.20506)")]

username = raw_input("Please Enter Username:")
password = raw_input("Please Enter Password:")

username = { "username" : username }
User = urllib.urlencode(username)

URL = "http://www.gaiaonline.com/auth/login/"
HTML = urllib2.Request(URL, User)
Page = opener.open(HTML)
Content = Page.read()

Token = Content
gToken = Token[Token.index('token" value="') + 14:Token.index('"', (Token.index('token" value="') + 14))]

HTML = urllib2.Request(URL, User + "&password=" + password + "&token=" + gToken + "&sid=&redirect=http%3A%2F%2Fwww.gaiaonline.com%2F&chap=")
Page = opener.open(HTML)
Content = Page.read()

SessionID = cookieJar._cookies[".gaiaonline.com"]["/"]["gaia55_sid"].value
if ">Welcome back <span" in Content:
print "Session ID:", SessionID
raw_input("Press<Enter>")


AutoIt wrote:
;Made by zzGoWR
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <URLEncode.au3>

AutoItSetOption("GUIOnEventMode", 1)
$oHTTP = ObjCreate("winhttp.winhttprequest.5.1")
$GaiaForm = GUICreate("GaiaOnline Login", 200, 100, -1, -1, BitOR($WS_SYSMENU, $WS_CAPTION), $WS_EX_CLIENTEDGE)
GUISetBkColor(0x000000)
$GaiaInput1 = GUICtrlCreateInput("Username", 40, 15, 120, 20, BitOR($ES_CENTER, $ES_AUTOHSCROLL))
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlSetColor(-1, 0x2E9AFE)
$GaiaInput2 = GUICtrlCreateInput("Password", 40, 40, 120, 20, BitOR($ES_CENTER, $ES_PASSWORD, $ES_AUTOHSCROLL))
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlSetColor(-1, 0x2E9AFE)
$GaiaButton = GUICtrlCreateButton("Login", 60, 65, 80, 20, BitOR($BS_CENTER, $BS_VCENTER, $WS_GROUP))
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlSetColor(-1, 0x2E9AFE)
GUISetState()

GUISetOnEvent($GUI_EVENT_CLOSE, "Close", $GaiaForm)
GUICtrlSetOnEvent($GaiaButton, "GaiaLogin")
GUICtrlSetOnEvent($GaiaInput2, "GaiaLogin")

While 1
Sleep(1000)
WEnd

Func GaiaLogin()
$sUser = GUICtrlRead($GaiaInput1);Read the username input
$sPass = GUICtrlRead($GaiaInput2);Read the password input
$oHTTP.Open("GET", "http://www.gaiaonline.com/", False);Load the login page
$oHTTP.SetRequestHeader("User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5");Set the user agent
$oHTTP.SetRequestHeader("Connection", "Close");Set connection type
$oHTTP.Send();Send the data
$Token = __StringBetween($oHTTP.ResponseText, '<input type="hidden" name="token" value="', '" />');Grab the Token from the home page
$Frob = __StringBetween($oHTTP.ResponseText, '<input type="hidden" name="frob" value="', '" />');Grab the 'Frob' whatever that means. I just know it's needed.
;Okay, we're done with the first part. We have the info we need to login. So let's do it.

$oHTTP.Open("POST", "http://login.gaiaonline.com/gaia/login.php", False);This time it's a post. We'll login with this one.
$oHTTP.SetRequestHeader("User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5");User agent
$oHTTP.SetRequestHeader("Connection", "Close");Connection type
$oHTTP.SetRequestHeader("Referer", "http://gaiaonline.com/");Set the referrer to the page the data was on
$oHTTP.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded");Set the content type. Necessary for any POST
$oHTTP.Send("token=" & $Token & "&sid=&frob=" & $Frob & "&toolbar_id=&redirect=http%3A%2F%2Fwww.gaiaonline.com%2F&username=" & $sUser & "&password=" & $sPass & "&SignInButton="); Send the data with out login info attatched.

If StringInStr($oHTTP.ResponseText, '"logout') Then ;Check for the login successfull text
MsgBox(0, "Login Success!", "You have been successfully logged in.")
Exit
Else
MsgBox(0, "Login Failed", "You have entered invalid login info.")
EndIf
EndFunc ;==>GaiaLogin

Func __StringBetween($s, $from, $to)
$x = StringInStr($s, $from) + StringLen($from)
$y = StringInStr(StringTrimLeft($s, $x), $to)
Return StringMid($s, $x, $y)
EndFunc ;==>__StringBetween

Func Close()
Exit
EndFunc ;==>Close


AutoIt is mine, Python isn't.
#2
Will You Please explain to me how this works.?
#3
These are just code you have to explain what they do.....and how to use them......
#4
He doesn't have to do shit...

And if you aren't a programmer, than this isn't helpful, because I'm pretty sure this is solely for programmers, it's not a user type thing, it's a part of a program that you would make...

He just made this part so you don't have to...
#5
Random, and this is gonna sound like a jerk thing to say, but if you're clever enough to write a Gaia program, you shouldn't have any trouble writing an auth for LG.
It might help with some users who don't understand this sort of thing, but in those cases, there really needs to be some explanation, you know?
#6
Personoid wrote:
Random, and this is gonna sound like a jerk thing to say, but if you're clever enough to write a Gaia program, you shouldn't have any trouble writing an auth for LG.
It might help with some users who don't understand this sort of thing, but in those cases, there really needs to be some explanation, you know?


We have an authorization for LG already. It's doesn't use the vBulletin login. Also, I've seen this post some where before. I'm pretty sure it's leaked.
#7
Chad wrote:
We have an authorization for LG already. It's doesn't use the vBulletin login. Also, I've seen this post some where before. I'm pretty sure it's leaked.

I think you must have missed my point because your response had little to do with mine
#8
Personoid wrote:
I think you must have missed my point because your response had little to do with mine


If your point is, if he can make a gaiaonline login on his own with wrappers and what not, he should be able to create an LG authorization via the login here as well. Then yes, I understand it.