PDA

View Full Version : [sockets] login to site


Empowers
06-27-2010, 14:52
I want to login(enter email & password) to this site http://cp.gaming-service.com via sokets.

I have this link it enters email and password:

http://cp.gaming-service.com/login.php?email=test%40gmail.com&password=mypassword123

But how can i press enter key?

joropito
06-27-2010, 14:57
I want to login(enter email & password) to this site http://cp.gaming-service.com via sokets.

I have this link it enters email and password:

http://cp.gaming-service.com/login.php?email=test%40gmail.com&password=mypassword123

But how can i press enter key?

Check this out, may it helps you

http://forums.alliedmods.net/showthread.php?t=117744

http://forums.alliedmods.net/showthread.php?t=117748

http://forums.alliedmods.net/showthread.php?t=116095

Empowers
06-27-2010, 15:27
Check this out, may it helps you

http://forums.alliedmods.net/showthread.php?t=117744

http://forums.alliedmods.net/showthread.php?t=117748

http://forums.alliedmods.net/showthread.php?t=116095
Nice tuts man :) But for me steel doesn't work ;( help me pls


socket5 = socket_open("cp.gaming-service.com", 80, SOCKET_TCP, error)
if(socket5 > 0)
{
formatex(plain, charsmax(plain), "[email protected]:mypassword123")
encode64(plain, encoded, charsmax(encoded))

formatex(request, charsmax(request), "GET /servermanage.php?task=restart&serverid=24 HTTP/1.0^n")
formatex(request2, charsmax(request2), "%sHost: cp.gaming-service.com^n", request)
formatex(request, charsmax(request), "%sAuthorization: Basic %s^n", request2, encoded)
formatex(request2, charsmax(request2), "%sUser-Agent: %s - %s - %s^n^n", request, PLUGIN_NAME, PLUGIN_AUTHOR, PLUGIN_VERSION)
socket_send(socket5, request2, charsmax(request2))
server_print("%s",request2)
}

joropito
06-27-2010, 15:29
But you're not sending your email/password in your code

xPaw
06-27-2010, 15:38
you gotta send POST headers

Empowers
06-27-2010, 15:46
But you're not sending your email/password in your code

// i encode it
formatex(plain, charsmax(plain), "[email protected]:mypassword123")
encode64(plain, encoded, charsmax(encoded))

//and then parse on this line
formatex(request, charsmax(request), "%sAuthorization: Basic %s^n", request2, encoded)

Whats wrong with that?

joropito
06-27-2010, 15:52
// i encode it
formatex(plain, charsmax(plain), "[email protected]:mypassword123")
encode64(plain, encoded, charsmax(encoded))

//and then parse on this line
formatex(request, charsmax(request), "%sAuthorization: Basic %s^n", request2, encoded)

Whats wrong with that?

Right but in your example (first post) you show user/pass as parameters and not as http authorization challenge.

Empowers
06-27-2010, 15:55
Right but in your example (first post) you show user/pass as parameters and not as http authorization challenge.
ahh my English, can u give a little example how to do it correct please :cry::cry::cry:

joropito
06-27-2010, 15:59
You should use POST as method and the correct url is /process.php
Then add the parameters as POST variables.

Try to read an http protocol tutorial to understand how to do it

http://www.jmarshall.com/easy/http/#othermethods


EDIT:

You need to edit you HTTP REQUEST (POST blahblah HTTP/1.0^nHost: blabla^n^nvariable=dasd&variable2=value2^n^n)

Empowers
06-27-2010, 16:02
http://cp.gaming-service.com/[email protected]&password=password123&task=login
if i enter that to my browser it says wrong password or email even if its ok. Why is that so?

You should use POST as method and the correct url is /process.php
Then add the parameters as POST variables.

Try to read an http protocol tutorial to understand how to do it

http://www.jmarshall.com/easy/http/#othermethods

Oh god ;( my english is very pour i understand only part of words there, can you please give me a small example how should I do that. pleasseee man

joropito
06-27-2010, 16:10
POST /process.php HTTP/1.0
Host: cp.gaming-service.com
User-Agent: HTTPTool/1.0
Content-Type: application/x-www-form-urlencoded
Content-Length: 32

task=login&return=&[email protected]&password=yourpassword


You must change that 32 to the lenght of the last string (task=*)

Empowers
06-27-2010, 16:25
POST /process.php HTTP/1.0
Host: cp.gaming-service.com
User-Agent: HTTPTool/1.0
Content-Type: application/x-www-form-urlencoded
Content-Length: 32

task=login&return=&[email protected]&password=yourpassword


You must change that 32 to the lenght of the last string (task=*)

I'm noobb :oops::oops: That doesn't work :( I checked everything several times, I thing i haven't got errors. What is then wrong?


socket5 = socket_open("cp.gaming-service.com", 80, SOCKET_TCP, error)

formatex(request, charsmax(request), "POST /process.php HTTP/1.0^n")
formatex(request2, charsmax(request2), "%sHost: cp.gaming-service.com^n",request)
formatex(request, charsmax(request), "%sContent-Type: application/x-www-form-urlencoded^n",request2)
formatex(request2, charsmax(request2), "%sContent-Length: 58^n^n", request)
formatex(request, charsmax(request), "%stask=login&return=&[email protected]&password=password^n^n", request2)
socket_send(socket5, request, charsmax(request))
server_print("%s",request)

//go to cp.gaming-service.com/servermanage.php?task=restart&serverid=24
formatex(request, charsmax(request), "POST /servermanage.php HTTP/1.0^n")
formatex(request2, charsmax(request2), "%sHost: cp.gaming-service.com^n",request)
formatex(request, charsmax(request), "%sContent-Type: application/x-www-form-urlencoded^n",request2)
formatex(request2, charsmax(request2), "%sContent-Length: 30^n^n", request)
formatex(request, charsmax(request), "%stask=restart&serverid=24^n^n", request2)
server_print("%s",request)

socket_send(socket5, request, charsmax(request2))

joropito
06-27-2010, 16:36
I think what you're trying to do (with that site) is not possible because you have to manage cookies.

Empowers
06-27-2010, 16:42
I think what you're trying to do (with that site) is not possible because you have to manage cookies.
here is the answer from server. Does that mean it needs cookies?

HTTP/1.1 302 Found
Date: Sun, 27 Jun 2010 20:39:10 GMT
Server: Apache/2.2.15 (Debian)
X-Powered-By: PHP/5.3.2-1
Set-Cookie: PHPSESSION=u8445k6d590vjd39tv4phhtr23; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must

xPaw
06-27-2010, 17:05
You sir, nonsteam

Empowers
06-27-2010, 17:08
You sir, nonsteam
I was just testing it from 47\48 protocol server. Does that plays any role? On my steam server it doesn't work too. By the way message on steam server is the same, so how do you know I was testing it from nosteam?

xPaw
06-27-2010, 17:23
Maybe it play role that you have all around your server dproto's, setmasters to non-steam ips etc ? :D

Empowers
06-27-2010, 17:45
Maybe it play role that you have all around your server dproto's, setmasters to non-steam ips etc ? :D
I can't understand why setmasters added on server start can be the problem?
Anyway on steam it's the same.

DruGzOG
06-27-2010, 20:43
I can't understand why setmasters added on server start can be the problem?
Anyway on steam it's the same.

Doesn't matter.

You support non-steam and contribute to it. Take a hike

Empowers
06-28-2010, 07:19
Doesn't matter.

You support non-steam and contribute to it. Take a hike
For me that doesn't matter are players steam or not. My server gets full in 10 minutes after staring with dproto. And on steam it's always almost empty. Thats the reason why I use 47/48 protocol.

xPaw
06-28-2010, 09:07
For me that doesn't matter are players steam or not. My server gets full in 10 minutes after staring with dproto. And on steam it's always almost empty. Thats the reason why I use 47/48 protocol.
That's the reason you don't get help here

Empowers
06-28-2010, 11:50
That's the reason you don't get help here
But I use steam man

DruGzOG
06-28-2010, 11:52
But I use steam man

Go read the fucking rules.