DebateFort - Where Warriors Come To Debate
RAGECRY - Funny, Amusing, Interesting, Trending & Viral Videos and Images
GameOrc - Free Flash Games Online
Page 1 of 2 1 2 LastLast
Results 1 to 15 of 20
  1. #1
    The Russian
    Donator
    Rakuuza's Avatar
    Join Date
    Mar 2012
    Gender
    male
    Location
    Melbourne
    Posts
    93
    Reputation
    52
    Thanks
    35
    My Mood
    Relaxed

    [C#][Help] MPGH Login

    Hello,
    How would I be able to login to MPGH via C# or even VB.Net. As I am trying to make a browser purely based on MPGH and feature towards it, but at the moment to no avail can I get the login to work. I have located the code for everything else, but it's all useless since it can't do a remote login (eg. through the program and not navigating to the webpage)

    I have tried so many methods of coding, from injecting a cookie to filling in the forms manually, but it doesn't help. Could I please get some help on this matter?

    Thanks in advanced.
    Last edited by Rakuuza; 05-02-2012 at 10:07 PM.

  2. #2
    Such pain... Why now?!
    Editor - Manager
    Newsforce
    Contributor
    Donator
    Minionforce
    Cocksucker
    Jorndel's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Hidden from your eyes
    Posts
    7,690
    Reputation
    619
    Thanks
    14,276
    My Mood
    Angelic
    Quote Originally Posted by Rakuuza View Post
    Hello,
    How would I be able to login to MPGH via C# or even VB.Net. As I am trying to make a browser purely based on MPGH and feature towards it, but at the moment to no avail can I get the login to work. I have located the code for everything else, but it's all useless since it can't do a remote login (eg. through the program and not navigating to the webpage)

    I have tried so many methods of coding, from injecting a cookie to filling in the forms manually, but it doesn't help. Could I please get some help on this matter?

    Thanks in advanced.
    I suggest you to look on this:
    HttpWebRequest Class (System.Net)

    Code I found: (No credit to me, just found)
    Code:
    using System; 
        using System.Web;
        using System.Net; 
        using System****;
        using System.Web.UI;
        using System.Web.UI.WebControls; 
    
    namespace Foo
    {
        public partial class _Default : System.Web.UI.Page
        {
            protected void Page_Load(object sender, EventArgs e)
            {
    
    
                HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create("Site"); 
                req.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.0.3705;)"; 
                req.Method = "POST";
                req.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8";
                req.Headers.Add("Accept-Language: en-us,en;q=0.5");
                req.Headers.Add("Accept-Encoding: gzip,deflate");
                req.Headers.Add("Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7");
                req.KeepAlive = true;
                req.Headers.Add("Keep-Alive: 300");
                req.Referer ="Site";
    
                req.ContentType = "application/x-www-form-urlencoded"; 
    
                String Username = "username";
                String PassWord = "Password";
    
                StreamWriter sw = new StreamWriter(req.GetRequestStream());
                sw.Write("application=portal&url=" + Username + "&password=" + password + "");
                sw.Close();
    
                HttpWebResponse response = (HttpWebResponse)req.GetResponse();
    
    
                StreamReader reader = new StreamReader(response.GetResponseStream());
                string tmp = reader.ReadToEnd();
    
                foreach (Cookie cook in response.Cookies)
                {
                    tmp += "\n" + cook.Name + ": " + cook.Value;
                }
    
    
                Response.Write(tmp);
                Response.End();
    
            }
        }
    }
    You need to write it yourself tho
    Last edited by Jorndel; 05-03-2012 at 01:52 AM.

    YouTube
    Twitter
    Facebook



    Contact Me - MPGH
    [VM] [PM]



    My Junior
    Jorndel Jr.


    Feel free to Donate
     
    Contributor 01.27.2012 - Current
    Donator 07-17-2012 - Current
    Editor/Manager 12-16-12 - Current
    Minion 01-10-2013 - Current
    Former Staff 09-20-2012 - 01-10-2013
    Cocksucker 20-04-2013 - Current

  3. #3
    Threadstarter
    The Russian
    Donator
    Rakuuza's Avatar
    Join Date
    Mar 2012
    Gender
    male
    Location
    Melbourne
    Posts
    93
    Reputation
    52
    Thanks
    35
    My Mood
    Relaxed
    Quote Originally Posted by Jorndel View Post
    I suggest you to look on this:
    HttpWebRequest Class (System.Net)

    Code I found: (No credit to me, just found)
    Code:
    using System; 
        using System.Web;
        using System.Net; 
        using System****;
        using System.Web.UI;
        using System.Web.UI.WebControls; 
    
    namespace Foo
    {
        public partial class _Default : System.Web.UI.Page
        {
            protected void Page_Load(object sender, EventArgs e)
            {
    
    
                HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create("Site"); 
                req.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.0.3705;)"; 
                req.Method = "POST";
                req.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8";
                req.Headers.Add("Accept-Language: en-us,en;q=0.5");
                req.Headers.Add("Accept-Encoding: gzip,deflate");
                req.Headers.Add("Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7");
                req.KeepAlive = true;
                req.Headers.Add("Keep-Alive: 300");
                req.Referer ="Site";
    
                req.ContentType = "application/x-www-form-urlencoded"; 
    
                String Username = "username";
                String PassWord = "Password";
    
                StreamWriter sw = new StreamWriter(req.GetRequestStream());
                sw.Write("application=portal&url=" + Username + "&password=" + password + "");
                sw.Close();
    
                HttpWebResponse response = (HttpWebResponse)req.GetResponse();
    
    
                StreamReader reader = new StreamReader(response.GetResponseStream());
                string tmp = reader.ReadToEnd();
    
                foreach (Cookie cook in response.Cookies)
                {
                    tmp += "\n" + cook.Name + ": " + cook.Value;
                }
    
    
                Response.Write(tmp);
                Response.End();
    
            }
        }
    }
    You need to write it yourself tho
    Have done similar methods but to no avail did they work. I'll try that one though. Thanks

  4. #4
    Such pain... Why now?!
    Editor - Manager
    Newsforce
    Contributor
    Donator
    Minionforce
    Cocksucker
    Jorndel's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Hidden from your eyes
    Posts
    7,690
    Reputation
    619
    Thanks
    14,276
    My Mood
    Angelic
    Quote Originally Posted by Rakuuza View Post
    Have done similar methods but to no avail did they work. I'll try that one though. Thanks
    I am not sure but as I understand.
    You don't want to use the webbrowser to type the username & password for you.

    Code found: (No credit to me, I just found )
    Code:
    private void btnLogin_Click(object sender, EventArgs e)
    {
        HtmlElement ele = webBrowser1.Document.GetElementById("username");
        if (ele != null)
            ele.InnerText = "Set Username";
    
        ele = webBrowser1.Document.GetElementById("password");
        if (ele != null)
            ele.InnerText = "Set Password";
    
        ele = webBrowser1.Document.GetElementById("Login Click");
        if (ele != null)
            ele.InvokeMember("click");
    }

    YouTube
    Twitter
    Facebook



    Contact Me - MPGH
    [VM] [PM]



    My Junior
    Jorndel Jr.


    Feel free to Donate
     
    Contributor 01.27.2012 - Current
    Donator 07-17-2012 - Current
    Editor/Manager 12-16-12 - Current
    Minion 01-10-2013 - Current
    Former Staff 09-20-2012 - 01-10-2013
    Cocksucker 20-04-2013 - Current

  5. #5
    Threadstarter
    The Russian
    Donator
    Rakuuza's Avatar
    Join Date
    Mar 2012
    Gender
    male
    Location
    Melbourne
    Posts
    93
    Reputation
    52
    Thanks
    35
    My Mood
    Relaxed
    Quote Originally Posted by Jorndel View Post
    I am not sure but as I understand.
    You don't want to use the webbrowser to type the username & password for you.

    Code found: (No credit to me, I just found )
    Code:
    private void btnLogin_Click(object sender, EventArgs e)
    {
        HtmlElement ele = webBrowser1.Document.GetElementById("username");
        if (ele != null)
            ele.InnerText = "Set Username";
    
        ele = webBrowser1.Document.GetElementById("password");
        if (ele != null)
            ele.InnerText = "Set Password";
    
        ele = webBrowser1.Document.GetElementById("Login Click");
        if (ele != null)
            ele.InvokeMember("click");
    }
    Thank you as I am home I shall test both methods, I know the second method works but that uses the web browser idea. if the first method doesn't work I'll use a suppressed web browser idea.

    Thank you or the great help!!

  6. #6
    Gimme Dem Boobies...
    MPGH Member
    ლ(ಠ_ಠლ)'s Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    trolololololo
    Posts
    6,831
    Reputation
    188
    Thanks
    1,337
    My Mood
    Angry
    You could access the users Database....Oh wait...
    Ask me any kind of questions!
    _________________________________________________
    ~ TeamWork v2.0 ~

    A real-time text editor.
    Work with your group of coders on the same project in real-time! Submit and receive code updates, build the software instantly with MSBuild shortcut.
    Supports: C++, C# and VB .NET.

    Current Progress Percentage: 40%.

    _________________________________________________

    The fear of never fallin' in love
    And the tears after losin' the feelings of what you thought love was
    Like the dirt still up under the rug (My life be like)
    Bad characteristics covered in Christs blood
    The joy of new birth and the pain of growin' up
    The bliss between givin' my all and givin' up
    The highs and lows
    Paths and roads I chose
    In the cold I froze
    Tryin' to ease my woes
    In this world of sin
    Clothes to thin to fend
    So to God I send
    Words of help to win
    In grumblings so deep letters could never express
    So the sound of Ooh Aah beneath my breath projects

  7. #7
    Threadstarter
    The Russian
    Donator
    Rakuuza's Avatar
    Join Date
    Mar 2012
    Gender
    male
    Location
    Melbourne
    Posts
    93
    Reputation
    52
    Thanks
    35
    My Mood
    Relaxed
    Quote Originally Posted by Richard Nixon View Post
    You could access the users Database....Oh wait...
    Yeah, that would make things simple but Dave wouldn't allow it lol. So I have to try inject the user and pass to the php script

  8. #8
    Gimme Dem Boobies...
    MPGH Member
    ლ(ಠ_ಠლ)'s Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    trolololololo
    Posts
    6,831
    Reputation
    188
    Thanks
    1,337
    My Mood
    Angry
    Quote Originally Posted by Rakuuza View Post
    Yeah, that would make things simple but Dave wouldn't allow it lol. So I have to try inject the user and pass to the php script
    Yes and what then? You won't have access to any kind of information....Well you will but it would be so fucking complicated. (and probably will take time)
    Ask me any kind of questions!
    _________________________________________________
    ~ TeamWork v2.0 ~

    A real-time text editor.
    Work with your group of coders on the same project in real-time! Submit and receive code updates, build the software instantly with MSBuild shortcut.
    Supports: C++, C# and VB .NET.

    Current Progress Percentage: 40%.

    _________________________________________________

    The fear of never fallin' in love
    And the tears after losin' the feelings of what you thought love was
    Like the dirt still up under the rug (My life be like)
    Bad characteristics covered in Christs blood
    The joy of new birth and the pain of growin' up
    The bliss between givin' my all and givin' up
    The highs and lows
    Paths and roads I chose
    In the cold I froze
    Tryin' to ease my woes
    In this world of sin
    Clothes to thin to fend
    So to God I send
    Words of help to win
    In grumblings so deep letters could never express
    So the sound of Ooh Aah beneath my breath projects

  9. #9
    Threadstarter
    The Russian
    Donator
    Rakuuza's Avatar
    Join Date
    Mar 2012
    Gender
    male
    Location
    Melbourne
    Posts
    93
    Reputation
    52
    Thanks
    35
    My Mood
    Relaxed
    Quote Originally Posted by Richard Nixon View Post
    Yes and what then? You won't have access to any kind of information....Well you will but it would be so fucking complicated. (and probably will take time)
    I understand that but if I only make a basic / intermediate one then maybe Dave might give me access. If not I'll try the complicated method

  10. #10
    Gimme Dem Boobies...
    MPGH Member
    ლ(ಠ_ಠლ)'s Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    trolololololo
    Posts
    6,831
    Reputation
    188
    Thanks
    1,337
    My Mood
    Angry
    Quote Originally Posted by Rakuuza View Post
    I understand that but if I only make a basic / intermediate one then maybe Dave might give me access. If not I'll try the complicated method
    I don't think that Dave will allow that. Since having access to the database consists in a high risk for MPGH. Let's be honest nobody knows how things will go, maybe some kind of hacker will decompile your code and have access to the databases delete users, get the head admin password, or whatever else.
    Ask me any kind of questions!
    _________________________________________________
    ~ TeamWork v2.0 ~

    A real-time text editor.
    Work with your group of coders on the same project in real-time! Submit and receive code updates, build the software instantly with MSBuild shortcut.
    Supports: C++, C# and VB .NET.

    Current Progress Percentage: 40%.

    _________________________________________________

    The fear of never fallin' in love
    And the tears after losin' the feelings of what you thought love was
    Like the dirt still up under the rug (My life be like)
    Bad characteristics covered in Christs blood
    The joy of new birth and the pain of growin' up
    The bliss between givin' my all and givin' up
    The highs and lows
    Paths and roads I chose
    In the cold I froze
    Tryin' to ease my woes
    In this world of sin
    Clothes to thin to fend
    So to God I send
    Words of help to win
    In grumblings so deep letters could never express
    So the sound of Ooh Aah beneath my breath projects

  11. #11
    Threadstarter
    The Russian
    Donator
    Rakuuza's Avatar
    Join Date
    Mar 2012
    Gender
    male
    Location
    Melbourne
    Posts
    93
    Reputation
    52
    Thanks
    35
    My Mood
    Relaxed
    Quote Originally Posted by Richard Nixon View Post
    I don't think that Dave will allow that. Since having access to the database consists in a high risk for MPGH. Let's be honest nobody knows how things will go, maybe some kind of hacker will decompile your code and have access to the databases delete users, get the head admin password, or whatever else.
    That's 100% true that's why my current method is the hard way, that way I didn't rely on any type of access only php post methods which this forum runs on. And being vbbulletin it isn't as hard as a custom build forum as you can find resources on all functions.

    Secondly I wouldn't be stupid enough to put database details in the program . Secondly vbbulletin only allows access from a white list

  12. #12
    Gimme Dem Boobies...
    MPGH Member
    ლ(ಠ_ಠლ)'s Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    trolololololo
    Posts
    6,831
    Reputation
    188
    Thanks
    1,337
    My Mood
    Angry
    Quote Originally Posted by Rakuuza View Post
    That's 100% true that's why my current method is the hard way, that way I didn't rely on any type of access only php post methods which this forum runs on. And being vbbulletin it isn't as hard as a custom build forum as you can find resources on all functions.

    Secondly I wouldn't be stupid enough to put database details in the program . Secondly vbbulletin only allows access from a white list
    Didn't know about that white list thingy. Anyways if you want to connect to a database you must put the database info somewhere...
    Ask me any kind of questions!
    _________________________________________________
    ~ TeamWork v2.0 ~

    A real-time text editor.
    Work with your group of coders on the same project in real-time! Submit and receive code updates, build the software instantly with MSBuild shortcut.
    Supports: C++, C# and VB .NET.

    Current Progress Percentage: 40%.

    _________________________________________________

    The fear of never fallin' in love
    And the tears after losin' the feelings of what you thought love was
    Like the dirt still up under the rug (My life be like)
    Bad characteristics covered in Christs blood
    The joy of new birth and the pain of growin' up
    The bliss between givin' my all and givin' up
    The highs and lows
    Paths and roads I chose
    In the cold I froze
    Tryin' to ease my woes
    In this world of sin
    Clothes to thin to fend
    So to God I send
    Words of help to win
    In grumblings so deep letters could never express
    So the sound of Ooh Aah beneath my breath projects

  13. #13
    Threadstarter
    The Russian
    Donator
    Rakuuza's Avatar
    Join Date
    Mar 2012
    Gender
    male
    Location
    Melbourne
    Posts
    93
    Reputation
    52
    Thanks
    35
    My Mood
    Relaxed
    Quote Originally Posted by Richard Nixon View Post
    Didn't know about that white list thingy. Anyways if you want to connect to a database you must put the database info somewhere...
    Correct, I would connect to a php script for database, most secure method. As it is the same way 99% of the forums do.

  14. #14
    We are the MINIONFORCE
    MPGH Member
    'Bruno's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Portugal
    Posts
    2,832
    Reputation
    235
    Thanks
    957
    My Mood
    Busy
    You guys do realize that you can "restrict" users database access and such right? .___. Such as write/read on a table, etc..

    So, you could actually have a user whom can only do queries to a table on a DB. (Which i dont see any risk about knowing the credentials by getting hacked or something)
    Just not sure of how much freedom you have on a VBulletin forum/dbs/etc...
    Light travels faster than sound. That's why most people seem bright until you hear them speak.

  15. #15
    Threadstarter
    The Russian
    Donator
    Rakuuza's Avatar
    Join Date
    Mar 2012
    Gender
    male
    Location
    Melbourne
    Posts
    93
    Reputation
    52
    Thanks
    35
    My Mood
    Relaxed
    Quote Originally Posted by Brinuz View Post
    You guys do realize that you can "restrict" users database access and such right? .___. Such as write/read on a table, etc..

    So, you could actually have a user whom can only do queries to a table on a DB. (Which i dont see any risk about knowing the credentials by getting hacked or something)
    Just not sure of how much freedom you have on a VBulletin forum/dbs/etc...
    Really probably is easier using a web scraping method!!

Page 1 of 2 1 2 LastLast

Similar Threads

  1. MPGH Login Script(Help)
    By ShadowPwnz in forum Visual Basic Programming
    Replies: 7
    Last Post: 02-21-2010, 08:16 AM
  2. [Announcement] (To all In My Opinion.) Please Help MPGH Minions!
    By shnarg in forum Combat Arms Discussions
    Replies: 32
    Last Post: 09-18-2009, 05:13 AM
  3. [Help]MPGH Public Hack
    By Saga778 in forum CrossFire Hacks & Cheats
    Replies: 15
    Last Post: 06-30-2009, 03:42 PM
  4. Help MPGH Pub Hack Error
    By ALLCAPONE in forum Combat Arms Hacks & Cheats
    Replies: 7
    Last Post: 01-03-2009, 11:47 AM
  5. [Help] MPGH PU
    By ihm3d43 in forum Combat Arms Hacks & Cheats
    Replies: 13
    Last Post: 10-16-2008, 04:16 PM