Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > .NET Languages
You last visited: Today at 13:41

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Login bot

Discussion on Login bot within the .NET Languages forum part of the Coders Den category.

Reply
 
Old   #1
 
ssamko's Avatar
 
elite*gold: 1908
Join Date: Jan 2013
Posts: 828
Received Thanks: 629
Login bot

Hello guys,
I want to do login script to Dark Orbit(they have changed web to https). So what I want are 2 things
1) Log in script (with name+password) -> post+get
2) Log in script just with session -> get+cookies

I know how requests work and right now I work on the 2nd solution but after adding cookies to that request it seems that it ignores them.(for http it works)
I am hopeless. I was able to do this Session login for ssl in php and python, but in C# it doesnt work, and I have no idea why. Do you have some kind of solution or tip ?

Thnx for your help.

PS: 100 EG to person who will succesfully help me with both types of login throught http requests(I dont want browser-object login)

My main code:
Code:
//string name = "jasomdarkorbit";
        //string pass = "123456";
        const string URL = "https://www.darkorbit.com";

        string html = "";
        string url = URL + "/indexInternal.es?action=internalStart";

        //For getting fresh session for this request go to darkorbit.com log in with: name=jasomdarkorbit, password=123456.
        string cookies = "dosid=63660eb0d3b6fdc9dcc868c19cf3bf96;";

        html = GET(url, cookies);
        Debug.WriteLine(html);
My get method code:
Code:
public static string GET(string url, string cookie = null)
    {
        HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
        request.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36";
        request.Headers.Set(HttpRequestHeader.Cookie, cookie);

        HttpWebResponse response = (HttpWebResponse)request.GetResponse();

        Stream responseStream = response.GetResponseStream();
        StreamReader reader = new StreamReader(responseStream);

        string result = reader.ReadToEnd();

        responseStream.Close();
        reader.Close();
        response.Close();

        return result;
    }
ssamko is offline  
Old 03/10/2017, 17:49   #2
 
ecks de's Avatar
 
elite*gold: 0
The Black Market: 180/0/1
Join Date: Apr 2016
Posts: 1,452
Received Thanks: 201
Try to initialize a Cookie Container like this:
Code:
CookieContainer einkeks = new CookieContainer();
pass it to the WebRequest like this:
Code:
request.CookieContainer = einkeks;
and then get the response stream.

or do it with selenium XD
ecks de is offline  
Old 03/10/2017, 18:00   #3
 
ssamko's Avatar
 
elite*gold: 1908
Join Date: Jan 2013
Posts: 828
Received Thanks: 629
Quote:
Originally Posted by Uncle Tom View Post
Try to initialize a Cookie Container like this:
Code:
CookieContainer einkeks = new CookieContainer();
pass it to the WebRequest like this:
Code:
request.CookieContainer = einkeks;
and then get the response stream.

or do it with selenium XD
you mean this ? (doesnt work)
Code:
            CookieContainer einkeks = new CookieContainer();
            request.CookieContainer = einkeks;
            request.CookieContainer.Add(new Uri("https://darkorbit.com"), new Cookie("dosid", "4ad14a3d9de4a91508d8c4ca67a32215"));
I am gonna check that selenium

EDIT: I dont wanna GET cookies from response but SET them in request
ssamko is offline  
Old 03/30/2017, 11:20   #4
 
elite*gold: 300
Join Date: Apr 2013
Posts: 3,234
Received Thanks: 1,205
How are you getting the first cookies?

I think you have to save them in a cookiecontainer and use it later.
#Saiirex is offline  
Old 03/30/2017, 16:46   #5
 
Ludder231's Avatar
 
elite*gold: 0
Join Date: Aug 2010
Posts: 880
Received Thanks: 113
check this out(not mine)
Ludder231 is offline  
Reply


Similar Threads Similar Threads
Shaiya External Login V2 - Website login & Secure password saver
09/30/2020 - Shaiya PServer Guides & Releases - 8 Replies
Hello everyone... Here is an enhanced version of my old small tool: http://www.elitepvpers.com/forum/shaiya-pserver-gu ides-releases/4143912-release-external-shaiya-logi n-sytem.html Now you are able to: Link the login fields with a PHP webste and its member area Save the password hash (so players will be able to login without password if needed) Secure server-side hash Automatic in-game login Small app loading screen
Hot ice Down oder login Server down!!Wenn ja sagt wolfi bescheid dass login down ist
01/01/2010 - Metin2 Private Server - 1 Replies
hallo kann jmnd bescheid sagen bitte



All times are GMT +2. The time now is 13:41.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.