??????? ????? ???????? ?????? ???????

???? ???????: 910439 - ??? ???????? ???? ????? ????? ??? ???????.
???? ????? ??? .NET ASP

?????? ??????? ??????? ??????? ????????

?????? ??? ?????? ??? ?????????? ??? ???? ???? ?????? ??????? ??? ???????? ???? ???? ? ??????? ???????? ???? ???? ???? ?????? ????? ??????? ?? ???????? ???????? ????? ?????. ????? ????? ???????? ????? Ask For It ??????? ??????????. ???? ????? ?????? ??? ??????? ?? ???? ??? ??????.
????? ???? | ?? ????

?? ??? ??????

?????? ?? ?? ???? ????? ??? ASP.NET! ???? ????? ????? ?? Jerry Orman. ?? ?? Microsoft ???? ?? 5 ????? ?? ???? ???? ????? ?????? ?? ???? ??? ?????? ??? ??? ????? ??? Microsoft FrontPage ??????? Microsoft SharePoint ?????. ???? ????? ?? Microsoft ASP.NET ??? ????? ??? ?? ????? ??????. ????? ??? ????? ?? ??? ???? ? ???? ????? ???? ????? ??????? ????? "?????? ???????" ?? Microsoft ASP.NET.

?????? ??????? ??????? ??????? ????????

??? ??????? "?????? ???????" ?? ??? ??????? ASP.NET ?? ??? ??? ?? ??????? ??? ??????? ????? ???? ???? ??? ???????? ????? ????? ???????? ??? ???? ????? ??????. ???? ??? ??????? ?? ???? ????? ?????? ???? ?????? ????? ???? ????? ? ?????? ???????. ?? ????? ??????? ??? ???? ????? ??? ?????? ?? ??????. ???????? ????? ?????? ??? ??? ????? ??? ????? ??????? ????? ??????? ???? ????? ????? ????? ?????.

?? ??? ?????? ????? ??? ??????? ???? ??????? "?????? ???????". ??? ??? ?? ???? ?? ????? ????????? ???? ???? ??? ?????? ??? ????? ?????? ??? ???? ????? ?????? ?????? ?????? ???????? ???????? ??? ???????. ??? ???? ????? ???? ????? ????? ????? IHttpModule ?????? ??????? "?????? ???????".

???? ???? ?????? ???????

??? ?????? ?????? ??? ???? ??? ???????? "?????? ???????" ? ?????? ?????? ??? ????? ??????. ???? ??? ????? ???????? ????? ?????? ????? ?????. ??? ????? ??? ????? ???????? ??? ?????? ?? ?? ??? ??? ??????? ? ????? FormsAuthenticationModule ?? ????? ???? ??? ????? ???????? ????? ?? ??? ??? ???????? ????? ?? ??.

?????????? FormsAuthenticationModule ????? ??? ?? ????? Machine.config. ??? FormsAuthenticationModule ?????? ????? FormsAuthentication.

?????? ????? ?? ????? Machine.config: modules? ?other
<httpModule>
     ?other modules?
     <add name="FormsAuthentication"
         type="System.Web.Security.FormsAuthenticationModule" />
     ?other modules?
</httpModule>
???? ???? HTTP ??? ??????? ???????? "?????? ???????" ???? ?????? ??? ???:
  1. ???? ?????? HTTP GET ??? Default.aspx. ??? ????? ?? ??? ????? ???????? ?????? ???????.
  2. ???? ?????? ??????? 302 (????? ?????) Login.aspx.
  3. ???? ?????? HTTP POST ??? Login.aspx. ??? ????? ??????? ????? ??????.
  4. ???? ?????? ??????? 302 (????? ?????) Default.aspx. ??? ????? ??? ????? ???????? ?????? ???????.
  5. ???? ?????? HTTP GET ??? Default.aspx. ????? ??? ??? ????? ???????? ?????? ???????.
?????? ??? ???? ?? ????????? ??? ????? ?????? ??????? ?????? ????? ??? MSDN ??????:
http://msdn2.microsoft.com/en-us/library/7t6b43z4.aspx
http://msdn2.microsoft.com/en-us/library/system.web.security.formsauthentication(vs.71).aspx
http://msdn2.microsoft.com/en-us/library/system.web.security.formsauthenticationticket(vs.71).aspx
?????? ??? ???? ?? ????????? ??? ?????? ????? ????? ???????? ?????? ??????? ?? ?????? ???? ??? ASP.NET ???????:
http://quickstarts.asp.net/QuickStartv20/aspnet/doc/security/formsauth.aspx

??????? ???? ?? ??? ????? ?????? ??? ???? ????? ??????

??? ????? ??? ????? ???????? ?????? ???????

????????? 1

?? ??? ?????????? ?????? ???? ?????? ??? ???? ???. ??? ???? ??? ???? ?????? ??? ??? ?????? ? ?? ????? ??? FormsAuthenticationModule ??? ????? ????????. ????? ????? ??? ??? ?????? ?? ????? ??? ??? ????? ???????? ?????? ????? ????? ????? ???????? ????? ?? Microsoft Internet ??????? Services (IIS). ?????? ????? ???? ??????? ???????:
  1. ?? ???? IIS ???? ???? ????? Microsoft (MMC).
  2. ???? ??? ?????? ?????? ??? ???? ??? ?? ???? ??? ?????.
  3. ???? ??? ????? ??????? ???? ??? ?? ???? ??? ????? ???????.
  4. ???? ?? ?? ????? ??? W3C ?????? ????? ??? ???.
  5. ???? ??? ?????.
  6. ???? ??? ????? ??????? ?????? ?????? ?? ???? ??? ????? ?????.
  7. ??? ????? ????? ? ???? ?????? ???? ???????? Cookie(cs(Cookie)) ? Referer (cs(Referer)) ???? ????????.
??? ???? ??? ???????? ??? ?????? ???? ???? ??????? ?????? IP ??? ??????. ???? ????? ????? IIS ??? ??? ?????? ????? IP ?????? ????? <??? ????? ???????? > ??????.

?????? ????? ??????? "???? ???" ????? ????? IIS. ?????? "???? ???" ?? ?????? ???? Microsoft ?????? ??? ?????:
http://www.microsoft.com/downloads/details.aspx?FamilyID=890cd06b-abf8-4c25-91b2-f8d975cf8c07
??? ?? ????? ???? ????? ??????? ?? ??? ???????? ????? ????? ?? ??????? ??? ???? ????? ??????. ???? ?? ????? ?????? ??? ??? ?????? ????? ???? ??????? ??? ???? ????? ?????. ??? ??? ??? ????? ?????? ??? ??? ?????? ??? ?? ???? ??? ????? ???????? ?? ??? ????? ??? ????? ???????? ??? ???? ??????? ??? ?????? ???????.

??? ?? ????? ?????? ??????.
?? ??? ??????????? ??? ??????
????????????????????? ????? ????????
??????/Default.aspx302 (????? ?????)?? ???? ????? ????? ????????
??????/Login.aspx200 (??????)?? ???? ????? ????? ????????
???/Login.aspx302 (????? ?????)?? ???? ????? ????? ????????
??????/Default.aspx???? 200 ().aspxauth
??????/SomePage.aspx302 (????? ?????)?? ???? ??? ????? ???????? .ASPXAUTH
??? ?? ??????? ?????? ??????? ??? ??? ???? ?? ???? ???? ??? ????? ???????? .ASPXAUTH.
?? ??? ??????????? ??? ??????
????????????????????? ????? ????????
??????/SomePage.aspx302 (????? ?????)?? ???? ??? ????? ???????? .ASPXAUTH
??????/Login.aspx200 (??????)?? ???? ??? ????? ???????? .ASPXAUTH
???/Login.aspx302 (????? ?????)?? ???? ??? ????? ???????? .ASPXAUTH
??????/SomePage.aspx???? 200 ().aspxauth

?????? ??? ?????? ?? ??? ???????? ??? ??????? ?? ???? ???? ??? ????? ?????? ?????? ????? ??? ?? ??? ?????? ??? ????? ?????? ?????. ??? IIS ??? ????? ?? ????? ????? ???????? ???? ?? ?????? ?? ?????. ???? ??? ????? ??? ??? ????? ???????? ?????? ??????? ?? ???? ???? ??? ????? ??? ?????? ????? ???? ?????.
????????? 2

???? ?? ???? ??? ????? ???????? ?????? ??????? ????? ??? ????? ?? ??? ????? ???????? ?????? ???????. ???? ?? Microsoft Internet Explorer ?? 20 ????? ????? ????????. ??? ????? ??? ????? ???????? 20th ??? ?????? ??? ????? ????? ????? ???????? ?????? ?? ?????? ??????. ??? ??? ????? ??? ????? ???????? .ASPXAUTH ? ???? ????? ????? ???????? ??? ???? ????? ?????? ??? ?????? ????? ??????.

???? ??????? ??? ???????????? ????? ???? ???????. ???? ??? ????? ??? ??? ????? ??????? ??? ???? ????? ??????. ??? ????? ??? ??? ?????? ?????? ????? ????? ???????? ? ?????? ??? ??? ?????.

????? ?? ?????????? ???? ??? ??? ??????? ?????? ?????? ?? "????? ??????? ?? Microsoft:
306070??? ????? ??? ?? ??? ????? ???????? ?? Internet Explorer

???? ??????? Fiddler ??? ???? ????? HTTP ???? ??? ??????? ??? ??????. ??? ?????? ???? ?????? ???? ????? ??????? ??? ??? ??? ?? ???? ??? ???? ??????? ??? ????? ??? ????? ????????. ??? ??? ???? ????? ???? ????? ?????? ??? ????? ??? ????? ???????? ?? ??????? ????? ?????? ???????.

?????? Fiddler ?? ?????? ???? ????? Fiddler ???????:
http://www.fiddlertool.com/fiddler/
????????? 3

??? ????? ???? ??????, ???? ????? ?????? ???? ?? ???? ??? ????? ???? ??? ?????. ?????? ?? ??? ??? ???? ???? ??? ????? ??? ????? ???????? ???? ?????? ???? ???? ????? ??? ?????? ??????? ?? ???? ?? ???? ??????? ???? ??? ????? ????????. ????? ??? ????? ?? ??? ?????? ?????? ?? ????? ??? cookie ????? ?? ???? ?????? ?????? ?? ???? ?????? ??? ????? ????????.

??? ??????

??? ??? GET ??? ?????? ????????. ??? ????? ??????? ????? ???????? ??????? ?????? ??????. ??? ???? ?? ??????? ??? ????? ???????? ??? ??????. When you use a network capture tool, like Netmon, you see the traffic that actually went through the adapter.
47 45 54 20 68 74 74 70-3a 2f 2f 6c 6f 63 61 6c   GET http://local
68 6f 73 74 2f 46 6f 72-6d 73 41 75 74 68 4c 6f   host/FormsAuthLo
67 54 65 73 74 2f 57 65-62 46 6f 72 6d 31 2e 61   gTest/WebForm1.a
73 70 78 20 48 54 54 50-2f 31 2e 31 0d 0a 41 63   spx HTTP/1.1..Ac
63 65 70 74 3a 20 69 6d-61 67 65 2f 67 69 66 2c   cept: image/gif,
?Other headers of the GET request?
63 68 65 0d 0a 43 6f 6f-6b 69 65 3a 20 2e 41 53   che..Cookie: .AS
50 58 41 55 54 48 3d 33-43 45 46 39 42 39 41 30   PXAUTH=3CEF9B9A0
43 33 37 41 44 46 36 33-45 36 42 44 33 37 42 36   C37ADF63E6BD37B6
39 43 44 41 32 35 30 30-30 46 38 30 37 32 38 46   9CDA25000F80728F
35 31 43 39 35 36 36 44-31 34 43 35 34 31 34 35   51C9566D14C54145
38 31 43 39 33 45 32 41-30 31 44 44 43 44 45 46   81C93E2A01DDCDEF
32 34 41 31 37 34 32 39-34 31 30 43 30 39 37 34   24A17429410C0974
42 33 45 43 42 30 36 34-32 32 38 45 33 35 33 39   B3ECB064228E3539
39 41 38 32 32 42 33 42-39 33 36 44 46 30 38 46   9A822B3B936DF08F
42 41 42 44 33 45 31 30-32 44 30 30 32 31 30 43   BABD3E102D00210C
32 45 31 33 39 38 30 37-39 42 32 33 35 32 39 46   2E1398079B23529F
34 46 35 44 37 34 41 3b-20 50 72 6f 66 69 6c 65   4F5D74A; Profile
3d 56 69 73 69 74 6f 72-49 64 3d 62 32 34 65 62   =VisitorId=b24eb
Server-side request

??? ????? ??? ??? ?????? ??? ?????? ???? ???? ?????? ?? ???? ?????? ??? ????????? ??????? ??????. ??? ?? ???? ?????? ??? ??? ????????? ??? ?????? ?? ??????? ?????? ??? ???? ??????? ?????? ??? ??? ????? ??? ????? ????????.

?????? ?? ???? ????? ?? ?????? ????? ????? ISAPI ????? ????? ????? ????????. ?????? ?? ?? ???? ??? ???? ??? ????? ???????? ???? ?? ??? ??? ??? ????? ???????? ?? ????? IIS ???? ?? ????? ????? ISAPI. ?? ???? ????? ????? ????? ??????? ?????? ?? ??? ??? ?? ?? ?? ???????.

????? ???? ????? ???????? ???????

???? ????? ??????? ?????? ???????? ????? ??? ????? ??? ?????? ??????? ?????? ???????. ???? ????? ???????? ??????? ???? ????????. ???? ????????? ????? ??? ??? ?????? ?????? ???????? ?????. ?? ?????? ?????? ?????? ????? ???????? ??? ?????? ??? ?????? ??? ?????? ????????. ??? ???? ??????? ????? ?????? ?????? 20 ????? ??? ??? ?????????? ?????? ?????? ?? ?????? 2: 00 ?. ???? ????? ????? ???????? ??? ???? ????? ?????? ??? ??? ???????? ?????? ?????? ??? 2: 20 ?.

??? ??? ?????? ???????? ?????? ???????? ????????? ?????? ???? ???????. ??? ????? ??? ????? ???????? ?? ????? ?????? ??? ???????? ?????? ?????? ??? ??? ?????? ?????? ?????. ??? ???? ??????? ??? ????? ?????? ?????? 20 ????? ???????? ???????? ?????? ????????. ??? ?????????? ?????? ?????? ?? ?????? 2: 00 ? ? ????? ???????? ??? ????? ?????? ???? ?? ????? ?????? ?????? ?? 2: 20 ?. ??? ????? ?????? ?????? ??? ??? ??? ???????? ?????? ?????? ??? 2: ?? ?. ??? ??? ???????? ?????? ?????? ?? 2: 09 ?, ?? ??? ????? ??????? ???? ?? ?????? ??? ??? ?????? ????????. ??? ?? ???????? ????? ????? 12 ????? ?????? ?? 2: 21 ?, ???? ?????? ???????. ??? ????? ????? ???????? ??? ???? ????? ??????.

?????? ???? ??? ??????? ??? ????? ?? ??????? ????? ??????? ??? ????? ???????? "?" ????? ???????? ???????. ???? ???????? ????? ?????? ??? ?? ???? ??? ????? ???????? ?? ???? IIS ? ?? ?????. ????? ?????? ???? ?? ???? ????? HttpModule ?? ????? ??? ?????? ??????? ??? ?? ???????? ?????. ?? ??? ????? ????????? ???????? ??????? ????? ?? ?????? ??? ????????? ???? ???????.

????? ??????? ???? ?? Microsoft .NET Framework 1.1 ?? .NET Framework 2.0 ????? ????????? ????. ????? ??????? ??????? ???????:
  • FormsAuthEvents.cs: ????? ???? ???? IHttpModule ???? ??? ????? Application_BeginRequest.
  • FormsAuthInfo.cs: ????? ???? ??????? ??? ????? ???????? ?? ????? ????? ???????? ???????. ????? ????? ????? ??? Web.config ??????? ?????? ?? ??????? ???? ????????.
  • FormsAuthConfig.cs: ??? ???? ????????? ?? ??? FormsAuthLogger.config.
  • Log.cs: ????? ???? ???? stringbuilder ?????? ????? ??? ??? ???.
  • FormsAuthLogger.config: ??? XML ???? ??????? ?????? ??? Log.cs. ??? ?? ???? ?? ?????? /bin ?? DLL ????? ??? ?????. ???? ????? ????? ?? ???:
    • ??????? ??? IP: ???? ???? ????? ???????? ???????? ??? IP ??????. ???? ???????? ????? ????? ??? ????? ?? ???? ????? ??? ????? ????? ???????. ???? ???? ??? ?????.
    • ??? ????????: ??? ????? ???? ??? ?????. ????????? ?? ???? Temporary Files ASP.NET ???? ????? ??? ??? ?? ???? ????? ?? ???? ??????? ??????? ?? ?????? ??? ??????? ??? ??????.
?????? ??? ????? ?????? ????? ????????? ???????? ?? ????? FormsAuthLogger.zip.

??? ??????? ???? ??????? ???????? ???:
  1. ????? ??? ???? ???? ??????? IHttpModule.
    public class FormsAuthEvents : IHttpModule 
    {
    		?code?
    }
  2. wire ????? ????? ???? ???? ????. ?? ??? ?????? ??? ??????? ????? Application_BeginRequest. ???? ??????? ???? ???? ?????? ?? ?? ??? ?? ????? ?? ??? ??? ????? ??? ??? ????? ???????? ?????? ??????? ?????? FormsAuthenticationTicket ??? ??? ??? ????? ???????? ????.
    public void Init(HttpApplication application) 
    {
    	//Wire up the BeginRequest event
    	application.BeginRequest += (new EventHandler(this.Application_BeginRequest));
    }
  3. ????? ????? Application_BeginRequest. ???
    private void Application_BeginRequest(Object source, EventArgs e)
    {	
       ?code to log the ticket?
    }
    
  4. ??????? ??? ????? ???????? ?????? ??????? ??? ?? ??????.
  5. ????? ?????. ???? ????? ??????? ???????? ??? ??????? ???????. ??? ????? ?? ?? ??????? ?????? ??????? ?????? ?? ??? ????? IIS ??? ??? ?????:
    • ???????: ???? "??? ????? ??????.
    • RequestType: ???? ?? ??? ??? ????? ??? Get ?? ???.
    • URL: ???? ??? ????? ??? ??? ???????.
    • ??????
    • ClientIP: ???? ?? ??????? ????? ????.
????? ?? ????????? ??? "?????? ???????" ????? ????? ??????? ????? FormsAuthLogger ???????:
?? ??? ??????????? ??? ??????
Download
Download the FormsAuthLogger.exe package now.

????? ????? ?? ????? ??????? ??? ???????? ???? ???? ???????? ?? ???????? ????? ?? ?? ??????? ???????? ????? Ask For It.

???????

???? ???????: 910439 - ????? ??? ??????: 14/????? ??????/1428 - ??????: 1.5
????? ???
  • Microsoft ASP.NET 1.1
  • Microsoft ASP.NET 1.0
  • Microsoft ASP.NET 2.0
????? ??????: 
kbmt kbtshoot kbiis kbcode kbasp KB910439 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????910439

????? ???????