EvilZone

Programming and Scripting => Projects and Discussion => : Huntondoom May 04, 2011, 07:46:22 PM

: [Solved]needs some help with: Webbrowser or Webclient
: Huntondoom May 04, 2011, 07:46:22 PM
Hello,

as Im working on a program for my band
this program should update the following:
myspace stuff
facebook stuff
hyves stuff
youtube stuff

but the problem is once I use webbrowser on Myspace I get a page that
says that the browser is incompatible :(
is there a way to undo this sort of stuff?

and:

Im using webbrowser cause I know how to use that with Username and Password
but how would I do that with Webclient?
(since Webclient is beter and faster then Webbrowser)
: Re: [problem]needs some help with: Webbrowser or Webclient
: Satan911 May 05, 2011, 12:19:11 AM
Spoof your user agent? Should work..
: Re: [problem]needs some help with: Webbrowser or Webclient
: Huntondoom May 05, 2011, 02:38:40 PM
Spoof your user agent? Should work..
and Any idea how I would that?
: Re: [problem]needs some help with: Webbrowser or Webclient
: ande May 05, 2011, 05:16:34 PM
If it says the browser is incompatible, chances are it is. And changing the user-agent wont help anything. Either way...;

You can use the net.webclient to all web related stuff, login, logout, post things, check things, upload stuff, upload files etc etc etc etc. You name it.

You use the webclient.headers.add() to add different HTTP header flags, like cookies, user agent and more. And a byte array of POST data and webclient.uploaddate(url, "POST", bytedata) if you want to perform POST stuff(99,99% logins and such will be POST).

I can help you out later, but I am EXTREMELY busy these days. Ill check back on this topic later if I remember it. Most likely I will not so you will have to remind me, but later. Much later.
: Re: [problem]needs some help with: Webbrowser or Webclient
: Huntondoom May 05, 2011, 08:43:59 PM
You use the webclient.headers.add() to add different HTTP header flags, like cookies, user agent and more. And a byte array of POST data and webclient.uploaddate(url, "POST", bytedata) if you want to perform POST stuff(99,99% logins and such will be POST).

so I have to look for the method on the website right?
cause On the Evilzone forum I found:
:
<form id="guest_form" action="http://evilzone.org/login2/" method="post" where the method is post, so you use Post (just to check)

and I used this:
:
Dim Browser As New WebClient
        Browser.Headers.Add(HttpRequestHeader.UserAgent, "Google Chrome")
        Dim Page As String = Browser.DownloadString("http://www.myspace.com/")
        Console.WriteLine(Page)
        Console.ReadLine()
and It worked, got the website
thanks All!
: Re: [Solved]needs some help with: Webbrowser or Webclient
: Stackprotector May 07, 2011, 09:50:25 AM
huntodoom,.
you have POST and GET as methods, GET is like (most commonly) evilzone.org/index.php?id=myfile.
Then the variable id is set to myfile when reqeusting the GET method in php.
That is the reason why logins are not in GET but in POST, otherwise it would be like this evilzone.org/index.php?username=huntodoom&password=justingbieber.

Hope this helps you out.
: Re: [Solved]needs some help with: Webbrowser or Webclient
: Satan911 May 09, 2011, 09:27:01 AM
If it says the browser is incompatible, chances are it is. And changing the user-agent wont help anything. Either way...;

Why not? The user agent is "the term most notably refers to applications that access the World Wide Web". If you are using application and the user agent is not recognized, spoofing the user agent to like "Firefox 4.1 Windows NT" will fool the server making it think you are using Firefox. Maybe I'm missing something but that should solve the problem no?
: Re: [Solved]needs some help with: Webbrowser or Webclient
: ande May 09, 2011, 12:11:39 PM
Why not? The user agent is "the term most notably refers to applications that access the World Wide Web". If you are using application and the user agent is not recognized, spoofing the user agent to like "Firefox 4.1 Windows NT" will fool the server making it think you are using Firefox. Maybe I'm missing something but that should solve the problem no?

You might fool the server, but you cant fool the browser into thinking it is something else, and therefore work with various plugins, functions and so on.
: Re: [Solved]needs some help with: Webbrowser or Webclient
: Huntondoom June 12, 2011, 09:05:14 PM
argh T.T

I Tried to make something that would login into myspace
but it failed T.T

any one has a good example/snippet on how to login onto a site?
: Re: [Solved]needs some help with: Webbrowser or Webclient
: ande June 13, 2011, 12:08:18 AM
argh T.T

I Tried to make something that would login into myspace
but it failed T.T

any one has a good example/snippet on how to login onto a site?

Bump this thread sometime tomorrow or late late late late tonight when I have my machine back and running and ill help ya ;)
: Re: [Solved]needs some help with: Webbrowser or Webclient
: Huntondoom June 13, 2011, 06:30:34 PM
I declare here by: Bump
: Re: [Solved]needs some help with: Webbrowser or Webclient
: ande June 13, 2011, 06:33:50 PM
lolfuu

Computer still fucked up :P ETA 3-4 hours
: Re: [Solved]needs some help with: Webbrowser or Webclient
: Huntondoom June 17, 2011, 12:55:01 AM
Omg I forgot!
Bump!
: Re: [Solved]needs some help with: Webbrowser or Webclient
: Huntondoom June 21, 2011, 12:03:25 AM
bump?
: Re: [Solved]needs some help with: Webbrowser or Webclient
: ande June 21, 2011, 12:18:05 AM
bump?

Okay yah. This one is a bit tricky. First you have to query the page once to get some sort of hash from the page in order to be able to perform a valid login attempt. Then you have to send the actual logins. Ill try a few mins and tell you the results.

EDIT:

Okay, myspace is a fucking mess. The guys who designed that thing deserves to get shoot. They cannot have any idea what they are doing and are generally just clashing things together. Or they are simply trying to make it impossible for others to make anything other than humans/browsers login there.

The easiest way to login to myspace would be using the webbrowser control. Its not something I like to use, in fact I try to avoid it. Anyway. You can use the webbrowser.document.all.item("name_of_input").setattribute("value", "some_value") for username and password. Then use webbrowser.document.all.item("button_name").invokmember("click") to click the login button.

You CAN do this with webclient instead, but it would require a lot of trail and error.
: Re: [Solved]needs some help with: Webbrowser or Webclient
: xor June 21, 2011, 03:15:21 PM
Can't you just monitor the form data and see what it sends to which page? Then you just have to handle sessions and cookies.
: Re: [Solved]needs some help with: Webbrowser or Webclient
: ande June 21, 2011, 03:38:33 PM
Can't you just monitor the form data and see what it sends to which page? Then you just have to handle sessions and cookies.

Yes, but no. I dont know what to answer. Its what I just did. And I said everything you need to care about.
: Re: [Solved]needs some help with: Webbrowser or Webclient
: Huntondoom June 21, 2011, 10:46:20 PM
ugh Webbrowser control is not supported :S

facebook, myspace need something better then Webbrowser Control
dammit...