Login to TechLifeForum X
Board Index Go to Reboot.Pro
  • Account Login
  • Register
TechLifeForum
  • Home
  • Members
  • Awards
  • Rules
  • Help
  • Donate
  • Live IRC
TechLifeForum / Programming and Development / .Net Framework Programming v
« Previous 1 ... 16 17 18 19 20 ... 44 Next »
/  Webrequest help[Advanced Search]
Reply to thread
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

[VB.Net] Webrequest help

06-25-2012, 01:05 AM
Post: #1
unknown18 Offline
Member
**
Posts: 143
Joined: Feb 2012
Reputation: 0
Webrequest help
I trying to login a site from my vb app and it keeps saying login failed

Dim postData As String = "action=do_login&url=http%3A%2F%2FSITESIP%2F~soulvpsc%2Findex.php&quick_login=1&quick_username=" & TextBox1.Text & "&quick_password=" & TextBox2.Text & "&submit=Login&quick_remember=yes"
Dim bytes() As Byte = ASCIIEncoding.UTF8.GetBytes(postData)
Dim postReq As HttpWebRequest = WebRequest.Create("http://Sitesip/~soulvpsc/index.php")
postReq.Method = "POST"
postReq.KeepAlive = True
postReq.CookieContainer = mainCookie
postReq.ContentType = "application/x-www-form-urlencoded"
postReq.Referer = "http://SITEIP/~soulvpsc/index.php"
postReq.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13 ( .NET CLR 3.5.30729; .NET4.0E)"
postReq.ContentLength = bytes.Length
Dim postStream As Stream = postReq.GetRequestStream()
postStream.Write(bytes, 0, bytes.Length)
postStream.Close()
Dim postResponse As HttpWebResponse
postResponse = postReq.GetResponse()
mainCookie.Add(postResponse.Cookies)
Dim reader As New StreamReader(postResponse.GetResponseStream())
Dim strSource As String = reader.ReadToEnd
If strSource.Contains("Welcome," & TextBox1.Text & "!") Then
MessageBox.Show("Login Successful")
Else
MessageBox.Show("Login Failed")
End If
Find
Reply
06-25-2012, 09:04 AM (This post was last modified: 06-25-2012 09:05 AM by KoBE.)
Post: #2
KoBE Offline
¯\_(ツ)_/¯
*******
Administrators
Posts: 4,132
Joined: Jun 2011
Reputation: 47
RE: Webrequest help
This looks as though you're trying to login to a MyBB forum correct?

You might read through the source and make sure that it's not asking you for a captcha. After a few failed attempts, it will ask for a captcha to prevent automated attempts such as this. In that case, it would not appear to be working.

-> TechLifeForum on Facebook<- 
-> TechLifeForum on YouTube<-
-> TechLifeForum on Twitter<-

Tech.Reboot.Pro
WWW Find
Reply
06-25-2012, 10:12 PM
Post: #3
unknown18 Offline
Member
**
Posts: 143
Joined: Feb 2012
Reputation: 0
RE: Webrequest help
(06-25-2012 09:04 AM)KoBE Wrote:  This looks as though you're trying to login to a MyBB forum correct?

You might read through the source and make sure that it's not asking you for a captcha. After a few failed attempts, it will ask for a captcha to prevent automated attempts such as this. In that case, it would not appear to be working.
pmed you for some help
Find
Reply
06-25-2012, 10:35 PM
Post: #4
AceInfinity Offline
∞ IҊϜIɴITϵ ☭
*******
Administrators
Posts: 8,572
Joined: Jun 2011
Reputation: 60
RE: Webrequest help
(06-25-2012 10:12 PM)unknown18 Wrote:  
(06-25-2012 09:04 AM)KoBE Wrote:  This looks as though you're trying to login to a MyBB forum correct?

You might read through the source and make sure that it's not asking you for a captcha. After a few failed attempts, it will ask for a captcha to prevent automated attempts such as this. In that case, it would not appear to be working.
pmed you for some help
lol why not just make use of this thread which is already open so that more than one person can help? What?



Microsoft MVP .NET Programming - (2012 - Present)
®Crestron DMC-T Certified Automation Programmer


Development Site: aceinfinity.net
WWW Find
Reply
06-25-2012, 10:54 PM
Post: #5
unknown18 Offline
Member
**
Posts: 143
Joined: Feb 2012
Reputation: 0
RE: Webrequest help
(06-25-2012 10:35 PM)AceInfinity Wrote:  
(06-25-2012 10:12 PM)unknown18 Wrote:  
(06-25-2012 09:04 AM)KoBE Wrote:  This looks as though you're trying to login to a MyBB forum correct?

You might read through the source and make sure that it's not asking you for a captcha. After a few failed attempts, it will ask for a captcha to prevent automated attempts such as this. In that case, it would not appear to be working.
pmed you for some help
lol why not just make use of this thread which is already open so that more than one person can help? What?
because i dont want to post the link i trying to login to on here for every 1 to try an access
Find
Reply
06-25-2012, 10:57 PM
Post: #6
AceInfinity Offline
∞ IҊϜIɴITϵ ☭
*******
Administrators
Posts: 8,572
Joined: Jun 2011
Reputation: 60
RE: Webrequest help
You don't have to post credentials at all... Just fake the data and let them know that you're not giving it out for confidentiality reasons. Simple, i'd never give anybody a login of mine if that's what the link contained for POST data or anything like that.



Microsoft MVP .NET Programming - (2012 - Present)
®Crestron DMC-T Certified Automation Programmer


Development Site: aceinfinity.net
WWW Find
Reply
06-25-2012, 11:37 PM
Post: #7
unknown18 Offline
Member
**
Posts: 143
Joined: Feb 2012
Reputation: 0
RE: Webrequest help
well it not a my bb site so idk how i would post it
Find
Reply
06-26-2012, 12:22 AM
Post: #8
AceInfinity Offline
∞ IҊϜIɴITϵ ☭
*******
Administrators
Posts: 8,572
Joined: Jun 2011
Reputation: 60
RE: Webrequest help
I didn't even really see the code you initially posted to be honest. You didn't use code tags... I'll see what KoBE responds to you first before making an attempt here.



Microsoft MVP .NET Programming - (2012 - Present)
®Crestron DMC-T Certified Automation Programmer


Development Site: aceinfinity.net
WWW Find
Reply
06-26-2012, 09:56 AM
Post: #9
KoBE Offline
¯\_(ツ)_/¯
*******
Administrators
Posts: 4,132
Joined: Jun 2011
Reputation: 47
RE: Webrequest help
Ok, I've looked at the site. I'm almost certain you are not sending the correct post data.

I can't test this out at work, but go through the steps of capturing the headers as layed out in this thread: http://tech.reboot.pro/showthread.php?tid=61

After that you will probably notice you need to modify this line:
Code: (SELECT ALL CODE)
Dim postData As String = "action=do_login&url=http%3A%2F%2FSITESIP%2F~soulvpsc%2Findex.php&quick_login=1&quick_username=" & TextBox1.Text & "&quick_password=" & TextBox2.Text & "&submit=Login&quick_remember=yes"

-> TechLifeForum on Facebook<- 
-> TechLifeForum on YouTube<-
-> TechLifeForum on Twitter<-

Tech.Reboot.Pro
WWW Find
Reply
06-26-2012, 11:42 PM
Post: #10
KoBE Offline
¯\_(ツ)_/¯
*******
Administrators
Posts: 4,132
Joined: Jun 2011
Reputation: 47
RE: Webrequest help
Ok, well I had a look now that I'm on my laptop w/ Live HTTP Headers.

All the post data you should be sending is:
Code: (SELECT ALL CODE)
username=user&password=pass

-> TechLifeForum on Facebook<- 
-> TechLifeForum on YouTube<-
-> TechLifeForum on Twitter<-

Tech.Reboot.Pro
WWW Find
Reply
Reply to thread


Possibly Related Threads...

Thread: Author Replies: Views: Last Post
   How would i do this useing webrequest unknown18 16 938 08-24-2012 01:20 AM
Last Post: unknown18
   Help Basic Webrequest ReDDeMiSe 8 554 12-30-2011 06:52 PM
Last Post: AceInfinity
  [Vb.net]MegaUpload Login Using webrequest [Source Code][Vb.net] ekrozzz 2 1,237 12-23-2011 02:31 AM
Last Post: AceInfinity

  • View a Printable Version
  • Send this Thread to a Friend
  • Subscribe to this thread
Forum Jump:


Users browsing this thread
1 Guest(s)
Youtube Facebook Twitter Digg
Return to Top
All content © copyright TechLifeForum
Powered By MyBB, © 2002-2013 MyBB Group
Designed by ThemeFreak
Mobile Version