Image
 
linkedin_logo.png rss_logo.jpg
twitter_logo.png youtube_logo.jpg
Latest Additions
 
EH-Net Login
Welcome Guest.






Lost Password?
No account yet? Register
Who's Online
We have 57 guests and 1 member online
 
Advertisement

You are here: Home arrow Ethical Hacking Discussions and Related Certificationsarrow Programmingarrow HTTP 401 << AnyOne with HTTP ???
EH-Net
May 18, 2013, 10:07:41 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Go back to The Ethical Hacker Network Online Magazine Home Page
 
   Home   Help Calendar Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: HTTP 401 << AnyOne with HTTP ???  (Read 5829 times)
0 Members and 1 Guest are viewing this topic.
teamer
Newbie
*
Offline Offline

Posts: 9


View Profile
« on: June 28, 2008, 12:45:23 PM »

hi friends ,i have some problems with the HTTP protocol , scually am not very familiar with HTTP , but i developed a software which has an option of retrieving webpage source code , but some pages are 401 forbidden , i tried to see the data that IE sends to the server when i input a username and password , acually i found that it just sends a normal GET request without any existance of a username or a password !!! can any one help me with this ? my question is how can i send a username and password to a 401 forbidden page Huh , thank you .
Logged
shakuni
Jr. Member
**
Offline Offline

Posts: 80


View Profile
« Reply #1 on: June 28, 2008, 04:19:33 PM »

Quote
my question is how can i send a username and password to a 401 forbidden page
This question should be restated as
How should I send a username and password to a web resource so that I do not get 401.
Actually the language of question shows that you have very superficial understanding of HTTP protocol. So go read rfc 2616 first, especially status codes that are described here- http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html.
Logged

There is no rule, law or tradition that apply universally... including this one.
jimbob
Guest
« Reply #2 on: June 30, 2008, 01:47:29 PM »

Usually what is being asked for it HTTP basic authentication. Your program will need to sent an Authorization: HTTP header, assuming you know the username and password. Take a look at the example on the Wikipedia page.

http://en.wikipedia.org/wiki/Basic_access_authentication

Regards,
Jimbob
Logged
teamer
Newbie
*
Offline Offline

Posts: 9


View Profile
« Reply #3 on: July 04, 2008, 03:08:59 AM »

How should I send a username and password to a web resource so that I do not get 401.

hahaha thanks shakuni , acually am very bad in english , second how you will know if that web resource would send you a 401 page or a normal 200 page if you didn't send the normal GET headers first !.

but really thank you , and thank you jimbob too , that wiki was very usefull also , they should merge the 2 sources together somehow .

Thanks
Logged
jimbob
Guest
« Reply #4 on: July 04, 2008, 08:56:56 AM »

[quote author=teamer link=topic=2641.msg12197#msg12197
how you will know if that web resource would send you a 401 page or a normal 200 page if you didn't send the normal GET headers first !.
[/quote]
What happens is you send the normal GET request and the web servers sends back a 401 response. In the response headers there is information about the authenication required to access the page. If I access my home ADSL router for example I get offered Basic and Digest authentication for the realm SpeedTouch.

Code:
HTTP/1.x 401 Unauthorized
Content-Length: 139
WWW-Authenticate: Digest realm="SpeedTouch", nonce="0732JT3ED:00-14-7F-F7-06-1F:480233:22601", qop="auth"
WWW-Authenticate: Basic realm="SpeedTouch"

This is how your web browser knows to prompt you for a username and password. When your browser receives the WWW-Authenticate header it prompts you for a username and password which it then sends along with the next request.

Jimbob
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines
Joomla Bridge by JoomlaHacks.com
Valid XHTML 1.0! Valid CSS!
Page created in 0.088 seconds with 23 queries.
 
Exclusive Deal

sansfire13_245x90_cw90.jpg
SANSFIRE 2013
June 15 - 22

5% Off w/ Code: EHN_5

SANS Deals 4 EH-Netters
5% OFF Any SANS Course in Any Format!
Coupon Code: EHN_5 Including SANS Rocky Mountain 2013 & SANS Boston 2013
Polls
Compared to this year, 2013 will be:
 
Recent Forum Topics
EH-Net News Feeds
Latest Additions
 
         
Advertisement

© 2013 The Ethical Hacker Network
Joomla! is Free Software released under the GNU/GPL License.