website statistics
Yuri Diogenes's Blog - Site Home - TechNet Blogs

Yuri Diogenes's Blog

Thoughts from a Senior Technical Writer @ Microsoft Server and Cloud Division (Solutions Group) - Information Experience

Posts
  • Yuri Diogenes's Blog

    Beyond the Perimeter Article for ISSA Journal

    • 0 Comments

    Today ISSA released the ISSA Journal – September 2009 issue that contains an article that I wrote about unified threat management.

     

     

     

    You can view the online version at:

    https://www.issa.org/Library/Journals/2009/September/ISSA%20Journal%20September%202009.pdf

  • Yuri Diogenes's Blog

    Wspsrv.exe causing random high CPU utilization – how to catch it?

    • 2 Comments

    I was reading the Windows IT Pro Magazine of this month (September 2009) and there I found a nice article written by an Escalation Engineer here from Microsoft Texas (Michael Morales) where he describes how to use ProcDump to catch high CPU utilization. This is an amazing tool that can also help ISA Administrators, mainly for scenarios where we just can’t get the right data (most case dumps) because the issue is random and when it happens there is nobody available to execute a command (for example: launch DebugDiag and choose the option for manual dump the process).

     

    For an ISA Server high CPU utilization scenario a simple example will be dump out the Firewall Service process two times when the CPU for wspsrv.exe is at or exceeds 90 percent for 5 seconds and store the dumps in the c:\dumps folder:

     

    c:\procdump.exe -c 90 -s 5 -n 2 wspsrv.exe c:\dumps

     

    Isn’t that cool?

     

    Make sure to read the article from Michael Morales to fully understand how this tool works:

    http://windowsitpro.com/article/articleid/102479/got-high-cpu-usage-problems-procdump-em.html

     

  • Yuri Diogenes's Blog

    ISA Server Firewall Service crashed…but why?

    • 0 Comments

    1. Introduction

     

    When question that I always receive when working with Firewall Service crashing is: why is it crashing? When the answer is: due a third party application…then the next question is: how is that? I thought each process was running independently and one couldn’t crash the other, right? That’s correct; however you need to remember how things work on ISA core architecture. Let’s step back and review the following diagram:

     

    Figure 1 – ISA Server architecture (from ISA Server 2006 Firewall Core Document)

     

    Notice that Firewall Service (wspsrv.exe) runs in User Mode while Firewall Engine (fweng.sys) runs in kernel mode. While is true that each process has its own address space, security token, etc, it is also true that each process is composed by threads, where each thread can be executing a different set of instructions and interacting with different components. ISA Server 2006 allows third party application to build their proprietary Web Filter (ISA Server supports ISAPI filter development) and by doing so it will somehow interfere in the way that Web Proxy Filter acts by default.

     

    2. Digging in

     

    If you use Process Explorer (or ProcMon) to open the properties of wspsrv.exe process you will see that there are many threads in execution as shown Figure 2:

     

     

    Figure 2 – Threads running in the context of wspsrv.exe process.

     

    If you select one of those threads and click Stack you will see the stack content and the modules in use. A stack is a region of the memory that is used to temporarily store data; it is added and removed in a last-in-first-out base. When you choose the thread and click on the stack you can see what it is in execution on that thread on that moment. Having this foundation understanding let’s take a look in the following diagram to understand how wspsrv.exe process can be affected by a third party filter:

     

     

    Figure 3 – Firewall service process and the threads that belongs to it.

     

    As you can see in this diagram there are some threads within the wspsrv.exe process and I’m using the stack of two of them as example. First stack from thread 1988 just have Microsoft modules and for the purpose of this example let’s focus on the stack that belongs to the thread 1920 which has a third party module (MyWebFilter.dll) loaded into it.

     

    If this module for some reason execute an operation that cause an unhandled exception we might compromised the whole thread and possible crash the process. If you do not have a debugger attached to the process you will not get a dump for the wspsrv.exe, the only thing that will happen is that Firewall Service will crash (process quits from the memory) and an event is registered in the event viewer saying that the Firewall Service crashed. If you want to catch this type of crash you need a debugger attached to the process, to do that you can use an article that I wrote some time back about that, check it out here.

     

    3. Access Violation

     

    For the purpose of this example let's assume that this fake third party filter module did cause Firewall Service to crash and since I did have DebugDiag attached to wspsrv.exe process I was able to catch the second chance crash. In this case here it is the result for this crash by a partial output from !analyze –v command:

     

    0:040> !analyze -v

    *******************************************************************************

    *                                                                             *

    *                        Exception Analysis                                   *

    *                                                                             *

    *******************************************************************************

     

     

    FAULTING_IP:

    ntdll!KiUserExceptionDispatcher+e

    7c82857e 0ac0            or      al,al

     

    EXCEPTION_RECORD:  102cf8cc -- (.exr 0x102cf8cc)

    ExceptionAddress: 10161a50 (MyWebFilter.dll+0x00001a50)

       ExceptionCode: c0000005 (Access violation)

      ExceptionFlags: 00000000

    NumberParameters: 2

       Parameter[0]: 00000000

       Parameter[1]: 10192068

    Attempt to read from address 10192068

     

     

    DEFAULT_BUCKET_ID: STATUS_STACKOVERFLOW

     

    PROCESS_NAME:  wspsrv.exe

     

    ERROR_CODE: (NTSTATUS) 0xc00000fd - A new guard page for the stack cannot be created.

    READ_ADDRESS:  1016caac

     

    NTGLOBALFLAG:  0

     

    APPLICATION_VERIFIER_FLAGS:  0

     

    IP_MODULE_UNLOADED:

    MyFilter+1a50

    10161a50 ??              ???

     

    CONTEXT:  102cf8e8 -- (.cxr 0x102cf8e8)

    eax=102cfe44 ebx=00000000 ecx=10192048 edx=f9b10046 esi=10192048 edi=102cfe38

    eip=10161a50 esp=102cfbb4 ebp=102cfbdc iopl=0         nv up ei pl nz na pe nc

    cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000             efl=00010206

    MyWebFilter.dll+0x1a50:

    10161a50 ??              ???

    Resetting default scope

     

    RECURRING_STACK: From frames 0x7 to 0xa

     

    LAST_CONTROL_TRANSFER:  from 102cfe38 to 10161a50

     

    IP_ON_STACK:

    +102cfe38

    102cfe38 5c              pop     esp

     

    FRAME_ONE_INVALID: 1

     

    STACK_TEXT: 

    WARNING: Frame IP not in any known module. Following frames may be wrong.

    102cfbb0 102cfe38 00000006 00000000 10192048 MyWebFilter.dll+0x1a50

    102cfc2c 776bf813 77796898 00327277 00000000 0x102cfe38

    102cfc30 77796898 00327277 00000000 00000000 ole32!COleStaticMutexSem::Release+0x1a

    102cfe6c 7c83ac6c 00000000 0efd5400 0efd54a8 ole32!gComLock+0x18

    102cfec8 7c83ca92 62251dc0 00000000 0efd5400 ntdll!RtlpWaitOrTimerCallout+0x74

    102cfeec 7c83a857 0efd54a8 7c88b080 0ef88528 ntdll!RtlpAsyncWaitCallbackCompletion+0x37

    102cff44 7c83aa3b 7c83ca5b 0efd54a8 00000000 ntdll!RtlpWorkerCallout+0x71

    102cff64 7c83aab2 00000000 0efd54a8 0ef88528 ntdll!RtlpExecuteWorkerRequest+0x4f

    102cff78 7c839f90 7c83a9fa 00000000 0efd54a8 ntdll!RtlpApcCallout+0x11

    102cffb8 77e6482f 00000000 00000000 00000000 ntdll!RtlpWorkerThread+0x61

    102cffec 00000000 7c839f2b 00000000 00000000 kernel32!BaseThreadStart+0x34

     

    Let see our registers:

     

    0:040> r

    eax=00000000 ebx=00000000 ecx=1016caac edx=7c828786 esi=00000000 edi=00000000

    eip=1016caac esp=102911b0 ebp=102911d0 iopl=0         nv up ei pl zr na pe nc

    cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000             efl=00010246

    MyWebFilter.dll+0xcaac:

    1016caac ??              ???

     

    Now let’s look at the EIP register (which points to where in the program the processor was currently executing the code):

     

    0:040> r eip

    eip=1016caac

     

    Let’s dump it:

     

    0:040> dd eip

    1016caac  ???????? ???????? ???????? ????????

    1016cabc  ???????? ???????? ???????? ????????

    1016cacc  ???????? ???????? ???????? ????????

    1016cadc  ???????? ???????? ???????? ????????

    1016caec  ???????? ???????? ???????? ????????

    1016cafc  ???????? ???????? ???????? ????????

    1016cb0c  ???????? ???????? ???????? ????????

    1016cb1c  ???????? ???????? ???????? ????????

     

    Well, it doesn’t looks good since it is pointing to a bunch of question mark (either invalid or not accessible memory). Let’s see what memory address EIP was pointing to:

     

    0:040> !address eip

        10160000 : 10160000 - 00040000

                        Type     00000000

                        Protect  00000001 PAGE_NOACCESS

                        State    00010000 MEM_FREE

                        Usage    RegionUsageFree

     

    What this PAGE_NOACCESS means? Let’s see the definition from MSDN:

     

    “Pages in the region become guard pages. Any attempt to read from or write to a guard page causes the operating system to raise the STATUS_GUARD_PAGE exception and turn off the guard page status. Guard pages thus act as a one-shot access alarm.  The PAGE_GUARD flag is a page protection modifier. An application uses it with one of the other page protection flags, with one exception: it cannot be used with PAGE_NOACCESS. When an access attempt leads the operating system to turn off guard page status, the underlying page protection takes over. If a guard page exception occurs during a system service, the service typically returns a failure status indicator.”

    From: http://msdn.microsoft.com/en-us/library/aa450977.aspx

     

    One strong hypothesis here (since we don’t have the code for the third party application to debug) is that this module tried to access an invalid memory address and therefore corrupted the stack causing the access violation. This was enough to cause the whole process (wspsrv.exe) to crash.

     

  • Yuri Diogenes's Blog

    Network Monitor Wizard now at CodePlex

    • 0 Comments

    I already talked about Network Monitor Wizard (AKA NetWiz) here some months ago and this is an ongoing project that I have with some friends at Microsoft. Since our original code (written in C#) had some third party components we couldn’t really publish at CodePlex, therefore we completely re-wrote NetWiz with our own code (still in C#) and now we are making it available at http://netwiz.codeplex.com. The source code is also available at http://netwiz.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=31511 and you are free to suggest improvements on this tool.

  • Yuri Diogenes's Blog

    Forefront TMG Email Protection

    • 0 Comments

    When I was system administrator back in 1999 one of the products that I used to work with on the daily basis was Exchange 5.5, I still remember the main components of the network that I used to manage: Windows NT 4, Proxy 2 and Exchange 5.5. I worked with Exchange Server from the version 5.0 to 2003, when 2007 was launched I was already 100% focus on ISA and didn’t have time to explore some features besides the integration with ISA Server. Now with TMG I will have a chance to start dealing with Exchange again to make sure that the SMTP Protection is correctly configured and also to troubleshooting possible mailflow issues (really fun!).

     

    The new Email Protection on TMG is based on Exchange Edge and Forefront Security for Exchange and yesterday we just released a new article for the Tales from the Edge community site that has more details about how this works. Check it out at: http://technet.microsoft.com/en-us/library/ee338733.aspx

     

  • Yuri Diogenes's Blog

    Slow performance while browsing Internet using IE8 through ISA Server 2006

    • 0 Comments

    Sounds familiar? Interesting though is that in this case it was not an ISA issue (really??? J) and was actually fixed using the solution below from IE Team:

    http://blogs.msdn.com/askie/archive/2009/07/17/slow-performance-in-internet-explorer-8-after-installing-the-skype-v4-1-application.aspx

     

    One more issue that is not caused by ISA Server…and counting.

  • Yuri Diogenes's Blog

    Unable to Access some MOSS links when published through ISA Server 2006

    • 0 Comments

    Although ISA Server 2006 has a great Sharepoint Wizard to configure Sharepoint/MOSS Publishing rule sometimes what was supposed to be simple can became a nightmare. Most of the times ISA gets beat first since it is the device that faces Internet and users from outside are the ones that are complaining about. However if there are so many elements that can cause issue of this nature that simply stick in mind that ISA is the culprit is just not realistic.

     

    Recently a friend of mine from MOSS Team wrote an article that fixed an issue where has all the ingredients to make you think that ISA was causing the issue. The problem started because something call disk-based cache, AKA BLOB (see this article for more info). Here it is the scenario and when you read NLB, think about ISA NLB using Web Farm to publish MOSS with a configuration similar to this one for the Web Farm:

     

     

    “One probable and common scenario is that on which you have multiples Web Front End (WFEs) and they are reached via Network Load Balancer (NLB). You did not add any host header when you created the web application and yet you can access the web application using both the local server name (eg. MOSS-WFE01) or the DNS entry (eg. http://myportal.contoso.com). However, when you add blob cache functionality to the site (see how to do this here), the cache does not seem to (and actually does not) work.”

    Read more at http://blogs.msdn.com/rodneyviana/archive/2009/06/24/blobcache-will-not-work-if-the-request-url-is-not-in-the-alternate-access-mapping-list.aspx to fix this problem.

     

    Note: another tip to avoid making tests while the MOSS content is in cache (IIS Cache not ISA) is to use the MOSS Support Explorer (also created by Rodney Viana from MOSS Team).

  • Yuri Diogenes's Blog

    ISA Server 2006 Firewall Service not starting

    • 1 Comments

    1. Introduction

     

    One of the most painful issues to resolve on ISA Server is when the Firewall Service stops and doesn’t come up again. Many times this happens without a previous warning and most of the times is because ISA is failing to load something or to commit some kind of configuration that was made. In this particular scenario, Firewall administrator claims that he didn’t change anything and believe or not he didn’t. ISA Server was untouchable for months and one day, after installing a security patch on Windows and restart the server, Firewall Service didn’t start.

     

    In situations like that is easy to blame the patch, because the first thing that comes in people’s mind is: well, if it was working and after installing a patch stopped working, it got be the patch. Although this makes sense (logically speaking) it might not be true (technically speaking). This particular case confirmed that: after firewall administrator uninstalled the patch (not really a good security recommendation) the issue persisted.

     

    Let’s see the approach to fix this issue.

     

    2. Starting from the Basics

     

    Start from the simplest thing which is: review the event viewer. In this case here the sequence of events that I found it:

     

    Event Type:        Error

    Event Source:    Microsoft ISA Server Web Proxy

    Event Category:                None

    Event ID:              14127

    Date:                     8/2/2009

    Time:                    9:43:36 AM

    User:                     N/A

    Computer:          ISACONTN1

    Description:

    The Web Proxy filter could not initialize (error code 501.3357.5.0.5723.493).

     

    Event Type:        Error

    Event Source:    Microsoft ISA Server Web Proxy

    Event Category:                None

    Event ID:              14127

    Date:                     8/2/2009

    Time:                    9:43:38 AM

    User:                     N/A

    Computer:          ISACONTN1

    Description:

    The Web Proxy filter could not initialize (error code 505.78.5.0.5723.493).

     

    Event Type:        Error

    Event Source:    Microsoft Firewall

    Event Category:                None

    Event ID:              14060

    Date:                     8/2/2009

    Time:                    9:43:38 AM

    User:                     N/A

    Computer:          ISACONTN1

    Description:

    ISA Server could not load the application filter Web Proxy Filter ({4CB7513E-220E-4C20-815A-B67BAA295FF4}). FilterInit failed with the error code 0x80070006. To attempt to activate this application filter again, stop and restart the Firewall service.

     

    Event Type:        Error

    Event Source:    Microsoft Firewall

    Event Category:                None

    Event ID:              14001

    Date:                     8/2/2009

    Time:                    9:43:38 AM

    User:                     N/A

    Computer:          ISACONTN1

    Description:

    Firewall Service failed to initialize. Previous event log entries might help determine the proper action.

     

    In this case these events are very generic and really don’t say much, but it gives us an idea of the sequence of failures that we have.

     

    3. Going Further

     

    On issues related to Firewall Service not starting, one thing that is very handy is understand what is happening during the time that Firewall Service is starting. Which files is he loading? To better see what is happening I used WinDBG to attach to Firewall Service. I did that on a working system to see the sequence that I have and repeated the same in the system that was broken. Here it is the steps that I used on my working system:

     

    0. On the system that is working I stopped Firewall Service.

    1. Open WinDBG (if you don’t have, download it here).

    2. Started Firewall Service, open WinDBG, click on File / Attach to a Process, choose the wspsrv.exe process as shown below and click OK.

     

    Figure 1 – Attaching WiDBG to Firewall Service Process.

     

    3. In the command window type g and press ENTER. The g command will starts executing this process and wait for a manual Break or will break for an external cause (if the process quits for example).

    4. On my working system the following sequence appear:

     

    (e94.1e8): Unknown exception - code 000006d9 (first chance)

    ModLoad: 0c8e0000 0c909000   C:\Program Files\Microsoft ISA Server\authdflt.dll

    ModLoad: 60290000 602f5000   C:\Program Files\Microsoft ISA Server\CookieAuthFilter.dll

    ModLoad: 0c9b0000 0c9ef000   C:\Program Files\Microsoft ISA Server\ACECLNT.dll

    ModLoad: 67de0000 67e05000   C:\Program Files\Microsoft ISA Server\sdmsg.dll

    ModLoad: 71ca0000 71cf8000   C:\WINDOWS\system32\kerberos.dll

    ModLoad: 766e0000 766ec000   C:\WINDOWS\system32\cryptdll.dll

    (e94.1e8): Unknown exception - code 000006d9 (first chance)

    ModLoad: 635e0000 635f7000   C:\Program Files\Microsoft ISA Server\radiusauth.dll

    ModLoad: 0ea10000 0ea2d000   C:\Program Files\Microsoft ISA Server\ldapfilter.dll

    ModLoad: 61470000 614b1000   C:\Program Files\Microsoft ISA Server\LinkTranslation.dll

    ModLoad: 60fe0000 61008000   C:\Program Files\Microsoft ISA Server\HttpFilter.dll

    ModLoad: 72e50000 72f6a000   C:\WINDOWS\system32\msxml3.dll

    ModLoad: 0f480000 0f493000   C:\Program Files\Microsoft ISA Server\complp.dll

    ModLoad: 68100000 68124000   C:\WINDOWS\system32\dssenh.dll

    (e94.998): Unknown exception - code 000006d9 (first chance)

    (e94.998): Unknown exception - code 000006d9 (first chance)

    (e94.998): Unknown exception - code 000006d9 (first chance)

    (e94.998): Unknown exception - code 000006d9 (first chance)

    (e94.998): Unknown exception - code 000006d9 (first chance)

    (e94.998): Unknown exception - code 000006d9 (first chance)

    ModLoad: 633b0000 633c2000   C:\Program Files\Microsoft ISA Server\pptpfltr.dll

    ModLoad: 60780000 60795000   C:\Program Files\Microsoft ISA Server\ftpfltr.dll

    ModLoad: 641c0000 641de000   C:\Program Files\Microsoft ISA Server\StrmFltr.dll

    ModLoad: 61350000 61363000   C:\Program Files\Microsoft ISA Server\issfltr.dll

    ModLoad: 60ae0000 60b16000   C:\Program Files\Microsoft ISA Server\h323fltr.dll

    ModLoad: 609b0000 609e5000   C:\Program Files\Microsoft ISA Server\h323asn1.dll

     

    I repeated the same sequence on the non working system and WinDBG stopped in the following module:

     

    (c38.1b8): Unknown exception - code 000006d9 (first chance)

    ModLoad: 635e0000 635f7000   C:\Program Files\Microsoft ISA Server\radiusauth.dll

    ModLoad: 0ea10000 0ea2d000   C:\Program Files\Microsoft ISA Server\ldapfilter.dll

    ModLoad: 61470000 614b1000   C:\Program Files\Microsoft ISA Server\LinkTranslation.dll

    ModLoad: 60fe0000 61008000   C:\Program Files\Microsoft ISA Server\HttpFilter.dll

    ModLoad: 72e50000 72f6a000   C:\WINDOWS\system32\msxml3.dll

    ModLoad: 0f480000 0f493000   C:\Program Files\Microsoft ISA Server\complp.dll

    ModLoad: 71bd0000 71be1000   C:\WINDOWS\system32\mpr.dll

    (c38.1b8): Unknown exception - code 000006d9 (first chance)

    (c38.1b8): Unknown exception - code 000006d9 (first chance)

    ModLoad: 0eb90000 0eb9f000   C:\Program Files\Common Files\System\Ole DB\SQLOLEDB.RLL

    eax=00000000 ebx=00000000 ecx=0006fdcc edx=00000000 esi=7c822028 edi=00000000

    eip=7c82ed54 esp=0006fe18 ebp=0006ff0c iopl=0         nv up ei pl zr na pe nc

    cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000             efl=00000246

    ntdll!KiFastSystemCallRet:

    7c82ed54 c3              ret

    Missing image name, possible paged-out or corrupt data. ç This happened because the wspsrv.exe process quit since it was not able to start.

     

    Notice that on my working system I do not load this SQLOLEDB.RLL module, which immediately makes me think: what component ISA uses to communicate with SQL (if need)? Answer: Logging. Bingo !!! That was it; my system was using file text for logging while the non working system was using SQL.

     

    4. Wait a minute, how this was working before?

     

    Good question!! After identify that the issue was on the connectivity with SQL we engaged the database administrator that revealed his fault. He performed a migration of the hardware where SQL was located to a new hardware, restored the configuration but failed to give appropriate permissions to the ISA Server computer account. He fixed the issue using KB 838710, in particular the section called “How to set up SQL Server to accept the Open Database Connectivity (ODBC) from the ISA Server or from Microsoft Forefront Threat Management Gateway, Medium Business Edition”, step 7.

     

  • Yuri Diogenes's Blog

    Presentation Highlights

    • 1 Comments

    FGF TV just released this video that covers some highlights of the TMG presentation that I delivered in Brazil last month:

     

  • Yuri Diogenes's Blog

    Error HTTP 400 - Bad Request when accessing a web site through ISA Server

    • 0 Comments

    Why is it a bad request? If you haven’t seen this before, I see quiet often in some scenarios involving ISA Server and guess what: if I remove ISA Server from the picture it works just fine. Well, we all know that when you are wide open to Internet there is nobody inspecting your traffic anyway so you shall pass. Is the same thing as trying to get into your house without the key for the door, you can’t get in, but guess what, if you remove the door you can get in. Oh..so it got be the door the root cause of the problem, right? Better remove the door or look for your key?

     

    In some scenarios when you receive the “400 Bad Request” is because is ISA Server is acting according to RFC 2616 and then sending the HTTP response to the client like this:

     

    - Http: Response, HTTP/1.1, Status Code = 400,

        ProtocolVersion: HTTP/1.1

        StatusCode: 400, Bad request

        Reason: Bad Request ( The data is invalid.  )

        Connection:  Keep-Alive

        Pragma:  no-cache

        Cache-Control:  no-cache

      - ContentType:  text/html

         MediaType:  text/html

        ContentLength:  1852 

        HeaderEnd: CRLF

      - payload: HttpContentType =  text/html

     

    Here it is a piece of the HTTP header with a type of request that can be interpreted by ISA Server as invalid:

     

    HTTP  HTTP:Request

    ...

    ...

    Content-type: multipart/mixed

     

    If the content type is multipart the HEX value might look like this:

     

    49 53 41 2A 30 30 2A 20 20 20 20 20 20 20 20 20 20 2A 30 30 2A 20 20 20 20 20 20 20 20 20 20 2A 31 32 2A 36 31 34 32 37 38 36 35 35 31 20 20 20 20 20 2A 30 38 2A 36 31 31 31 33 35 35 30 30 31 20 20 20 20 20 2A 30 36 30 31 30 35 2A 30 39 35 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20

     

    The value 20 in HEX means space (see http://en.wikipedia.org/wiki/ASCII for more info), which makes perfect sense in this case since the next HTTP packet just continued with a bunch of more spaces at the end, which supposedly will extend to a third packet if ISA haven’t drop that:

     

    20 20 20 20 20 20 20 20 20 20 20 20 30 32 31 30 30 30 31 7E 47 45 2A 31 2A 31 37 32 31 7E 49 45 41 2A 31 2A 30 30 30 30 30 31 37 32 31 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7E 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20

     

    Going back to the RFC 2616 (section 4.2) you will see that this is not a good practice and ISA Server does what is supposed to be done, drop the packet. The best way to fix that is to contact the web site administrator (or application developer) and ask him to fix that. However since in almost of all outbound access you don’t have control of the site that your internal client is trying to access, ISA Server has a workaround to accept that.  To workaround on this problem (since is not an ISA issue) you need should install ISA Server 2006 SP1 and after that make the registry changes suggested in the article below:

     

    941293  Error message when you access a Web site through ISA Server 2006 or Microsoft Forefront Threat Management Gateway, Medium Business Edition: "HTTP 400 - Bad Request"

    http://support.microsoft.com/default.aspx?scid=kb;EN-US;941293

     

     

  • Yuri Diogenes's Blog

    Error 64 - The Specified Network Name is no longer available while Using a Custom Application through ISA Server 2006

    • 2 Comments

    1. Introduction

     

    Error 64 can happen due many situations and I documented one of those situations last year and as you could see sometimes it is not easy to find out why this error happens. The issue that I’m about to describe here was identified while I was troubleshooting a third party application that uses TCP Port 80 to transmit files, but not using HTTP. What?? Yeah, I know. Although IANA has established port 80 for HTTP, anyone can create an application that uses port 80 to send whatever they want. This is fine, as long as you don’t try to use this application behind a Firewall that does application layer inspection and look to that traffic and say: what is that? This is not HTTP Protocol and it is using TCP Port 80…I shall block this traffic!

     

    The firewall administrator was smart to understand that and what he did was, he created a custom protocol using port 80 and didn’t bind Web Proxy filtering to it. Fair enough, but doesn’t fully resolved this issue.

     

    2. The Error

     

    When the client (which had the 3rd party application installed on his computer) started to transmit the file to the destination it received an error and didn’t proceed. Using Logging feature the Firewall Administrator saw the error below:

     

    Figure 1 – Error 64

     

    On the netmon trace we could see that the TCP Handshake was established fine, but after the first HTTP Payload has being sent ISA Server 2006 didn’t like what he saw and the connection was reset.

     

     

    Figure 2 – Connection reset right after first attempt to use TCP Port 80 (with a non compliance HTTP Protocol).

     

    3. Resolution

     

    To resolve this problem what you need to do is not only create a custom protocol and an access rule to use this protocol, but also a deny rule right after this access rule to block the regular HTTP Protocol that has the Web Proxy Filter bind to it. The access rules will look like this:

     

     

    Figure 3 – Access rule with a Deny to HTTP (with filter) Protocol.

     

    Why do I have to do this? Read this post here and you will know the reason:

     

    Why do I need a deny rule to make an allow rule for a custom protocol work correctly?

    http://blogs.technet.com/isablog/archive/2006/09/25/why-do-i-need-a-deny-rule-to-make-an-allow-rule-for-a-custom-protocol-work-correctly.aspx

     

     

  • Yuri Diogenes's Blog

    Debate about Information Security at FGF TV

    • 0 Comments

    FGF University released a short version of the debate that we had on the University Live TV Program that was recorded last month when I was in Brazil. In this program we discussed many IT areas and the security concerns around those areas. The program (full version) will be live tomorrow (07/19) on Channel 14 (NET Brazil) and also Assembleia TV Channel (Brazil).

     

     

     

  • Yuri Diogenes's Blog

    ISA Server Stop Answering Requests and Firewall Service Hangs

    • 1 Comments

    The problem that this post is going to discuss was related to a random issue where certain times of the day the ISA Server was stopping answering requests and when the firewall administrator tried to restart the firewall service the service didn’t start. The only event that we have prior to the issue happens was the one below:

     

    Event Type: Error

    Event Source:     Microsoft ISA Server Web Proxy

    Event Category:   None

    Event ID:   14172

    Date:       13/3/2009

    Time:       18:37:43

    User:       N/A

    Computer:   ISASRV

    Description:

    The cache was not properly initialized.  caching will be disabled (internal code 503.287.4.0.2167.887). Identify the specific reason for the failure from previous relevant event logs. Fix the problem, and then restart the Firewall service to enable caching.

     

    Doing a quick assessment I could see that the Antivirus was scanning all folders, including ISA Folders (not good at all). As a troubleshooting step I disabled the AV but the issue persisted. Using ProcMon I could see that when ISA Storage process (ISAStg.exe) was trying to read a value in register the AV filter drive was still present in kernel mode and intercepting the request.  Here it is the sequence:

     

    ISASTG process:

     

    34408 2:23:05.8643957 PM      isastg.exe  3904  RegEnumValue      HKLM\SOFTWARE\Microsoft\Fpc\Storage\Array-Root\Arrays\{0A8D8F99-6862-47B9-9388-12890728AF1A}\Servers\{B622A644-418A-40E1-988F-C1182B246652}\Proxy-Cache-Directories\Proxy-Cache-Directory1  SUCCESS     Index: 3, Name: msFPCDirectoryName, Type: REG_SZ, Length: 34, Data: D:\urlcache\Dir1

     

    The stack for this process shows the AV filter drive (klif.sys):

     

    0      ntoskrnl.exe  ntoskrnl.exe + 0x17859f    0x8097859f    C:\WINDOWS\system32\ntoskrnl.exe

    1      ntoskrnl.exe  ntoskrnl.exe + 0x146c3c    0x80946c3c    C:\WINDOWS\system32\ntoskrnl.exe

    2      klif.sys      klif.sys + 0xfa1c    0xf685fa1c    C:\WINDOWS\system32\drivers\klif.sys

    3      ADVAPI32.dll  ADVAPI32.dll + 0x12530     0x77f62530    C:\WINDOWS\system32\ADVAPI32.dll

    4      isastg.exe    isastg.exe + 0x8352  0x408352      D:\Program Files\Microsoft ISA Server\isastg.exe

    5      isastg.exe    isastg.exe + 0x9054  0x409054      D:\Program Files\Microsoft ISA Server\isastg.exe

    6      RPCRT4.dll    RPCRT4.dll + 0x30193 0x77c80193    C:\WINDOWS\system32\RPCRT4.dll

    7      RPCRT4.dll    RPCRT4.dll + 0x933e1 0x77ce33e1    C:\WINDOWS\system32\RPCRT4.dll

    8      RPCRT4.dll    RPCRT4.dll + 0x935c4 0x77ce35c4    C:\WINDOWS\system32\RPCRT4.dll

    9      RPCRT4.dll    RPCRT4.dll + 0x2ff7a 0x77c7ff7a    C:\WINDOWS\system32\RPCRT4.dll

    10     RPCRT4.dll    RPCRT4.dll + 0x3042d 0x77c8042d    C:\WINDOWS\system32\RPCRT4.dll

    11     RPCRT4.dll    RPCRT4.dll + 0x30353 0x77c80353    C:\WINDOWS\system32\RPCRT4.dll

    12     RPCRT4.dll    RPCRT4.dll + 0x311dc 0x77c811dc    C:\WINDOWS\system32\RPCRT4.dll

    13     RPCRT4.dll    RPCRT4.dll + 0x312f0 0x77c812f0    C:\WINDOWS\system32\RPCRT4.dll

    14     RPCRT4.dll    RPCRT4.dll + 0x38678 0x77c88678    C:\WINDOWS\system32\RPCRT4.dll

    15     RPCRT4.dll    RPCRT4.dll + 0x38792 0x77c88792    C:\WINDOWS\system32\RPCRT4.dll

    16     RPCRT4.dll    RPCRT4.dll + 0x3872d 0x77c8872d    C:\WINDOWS\system32\RPCRT4.dll

    17     RPCRT4.dll    RPCRT4.dll + 0x2b110 0x77c7b110    C:\WINDOWS\system32\RPCRT4.dll

    18     kernel32.dll  kernel32.dll + 0x24829     0x77e64829    C:\WINDOWS\system32\kernel32.dll

     

    Later on we fail to create the file:

     

    34838  2:23:05.9429702 PM   mspadmin.exe  612    CreateFile    D:\urlcache   SUCCESS       Desired Access: Read Attributes, Read Control, Write DAC, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, Impersonating: S-1-5-21-2611182321-852623426-2620623114-500, OpenResult: Opened

     

    34839  2:23:05.9430612 PM   mspadmin.exe  612    QueryBasicInformationFile  D:\urlcache   SUCCESS       CreationTime: 2/13/2009 1:51:15 PM, LastAccessTime: 2/13/2009 2:23:04 PM, LastWriteTime: 2/13/2009 1:51:15 PM, ChangeTime: 2/13/2009 1:51:15 PM, FileAttributes: D

     

    34840  2:23:05.9431081 PM   mspadmin.exe  612    QuerySecurityFile    D:\urlcache   BUFFER OVERFLOW       Information: Owner, Group, DACL, 0x80000000

     

    We uninstalled the AV and the issue didn’t happen anymore. Since his environment had a requirement to have AV installed on ever single Windows machine we implemented the correct folder exclusion following the article “Considerations when using antivirus software on ISA Server” and the environment got stabilized.

     

    Interesting side of this story is that this article was published exactly one year ago, one year later we still have firewall administrators not following such recommendation and therefore having unexpected downtimes.

  • Yuri Diogenes's Blog

    Information Security and TMG Book Interview

    • 0 Comments

    FGF TV Channel just released the online version of the interview (in Portuguese) that I recorded last week about information security and also about TMG Book.

  • Yuri Diogenes's Blog

    Identifying the Source of the Traffic

    • 0 Comments

    Couple of days ago I was assisting a friend to troubleshoot the infamous 5783 that was causing the authentication prompt issue that we all know about. In this case the problem was happening throughout the night, which was even odder because during the day when the traffic was really high the issue wasn’t happen. The employees on the third shift (which was no more than 20) were receiving authentication prompts randomly.

    The question was: how to get data on this type of case? We don’t know what time it occurs and we don’t have IT people on that time to collect data. We installed a tool called Port Reporter tool that runs as a service and collects pretty much all the information about process and which port is using during that time. Read http://support.microsoft.com/kb/837243 for more information on how to use this amazing tool.

    It boils down that the issue was a piece of malware on those workstations that were sending tons of request to an external URL and drastically affecting ISA Server’s performance.

  • Yuri Diogenes's Blog

    Virtualization Support Wizard

    • 0 Comments

    How many times were you wondering if the Microsoft application that you were running is supported in a virtual environment? That’s a very common question and up to now the answer for this question was not much clear in some cases. The virtualization support team published this month the Virtualization Support Wizard which it was in development and test for months internally. There you will be able to easily identify if the Microsoft product (including ISA Server) that you are looking for is supportable in a virtual environment. Check it out at http://www.windowsservercatalog.com/svvp.aspx?svvppage=svvpwizard.htm

  • Yuri Diogenes's Blog

    Security Talk in an Academic Field

    • 0 Comments

    I’m really happy for the invitation that I received from FGF (Faculdade Grande Fortaleza) Academic Director to deliver a presentation to the professors and students about information security emphasizing TMG role in the network protection. FGF is the university where I graduated and also where I was Professor back in 2003, there I taught two disciplines: Computer Networks and Operating System. It was an amazing time and I hope to see former students, coworkers and professors.

    The presentation will be next Tuesday, June 30th, 6:40 PM at the university’s campus and on the same day I will be also participating in a TV Show (FGF TV Channel) to discuss about information security with other professors and students. For more information check the FGF’s web site at www.fgf.edu.br. A former student of mine also posted about the event in his web site: http://www.jorgebarata.eti.br/269.

     

  • Yuri Diogenes's Blog

    ISA Server Support Life Cycle

    • 0 Comments

    Lately we had received some calls where ISA Server was not using the latest updates, which is fine although is not recommended. However when the subject is Service Pack then it might be a supportability blocker if ISA Server is not running within the supported Service Pack level. ISABPA does a great job in warning an ISA administrator that his ISA Server 2004 is not running with SP3 as shown below:

    But today the issue is not only having the system with the latest update, is really a supportability matter. ISA Server 2004 SP2 is not supported since January 13th 2009 as shown in the table below:

    Products Released

    General Availability Date

    Mainstream Support Retired

    Extended Support Retired

    Service Pack Retired

    Notes

    Internet Security and Acceleration Server 2004 Enterprise Edition

    3/1/2005

    4/13/2010

    4/14/2015

    3/11/2006

    Internet Security and Acceleration Server 2004 Enterprise Edition Service Pack 2

    1/31/2006

    Not Applicable

    Not Applicable

    1/13/2009

    Internet Security and Acceleration Server 2004 Service Pack 1

    3/11/2005

    Not Applicable

    Not Applicable

    4/10/2007

    Internet Security and Acceleration Server 2004 Service Pack 3

    10/29/2007

    Review Note

    Review Note

    Support ends 12 months after the next service pack releases or at the end of the product's support lifecycle, whichever comes first. For more information, please see the service pack policy at http://support.microsoft.com/lifecycle/#ServicePackSupport .

    Internet Security and Acceleration Server 2004 Standard Edition

    9/8/2004

    10/13/2009

    10/14/2014

    3/11/2006

    Internet Security and Acceleration Server 2004 Standard Edition Service Pack 2

    1/31/2006

    Not Applicable

    Not Applicable

    1/13/2009

    From: http://support.microsoft.com/lifecycle/?p1=2108

    Same applies to ISA Server 2006 RTM (without SP1), which the support will end July 14th 2009 as shown in the table below:

    Products Released

    General Availability Date

    Mainstream Support Retired

    Extended Support Retired

    Service Pack Retired

    Notes

    Internet Security and Acceleration Server 2006 Enterprise Edition

    10/17/2006

    1/10/2012

    1/10/2017

    7/14/2009

    Internet Security and Acceleration Server 2006 Service Pack 1

    7/2/2008

    Review Note

    Review Note

    Support ends 12 months after the next service pack releases or at the end of the product's support lifecycle, whichever comes first. For more information, please see the service pack policy at http://support.microsoft.com/lifecycle/#ServicePackSupport .

    Internet Security and Acceleration Server 2006 Standard Edition

    10/17/2006

    1/10/2012

    1/10/2017

    7/14/2009

    From: http://support.microsoft.com/lifecycle/?p1=11928

    So if you are in an unsupported scenario (or about to get into this stage) make sure to plan your update as soon as possible to avoid supportability concerns when opening an incident with Microsoft CSS.

     

  • Yuri Diogenes's Blog

    Another Blog for ISA Community

    • 0 Comments

    A friend of mine from Brazil (Paulo Oliveira) that already contributes a lot with ISA Community answering questions at www.isaserver.org has now his own blog. Paulo has a lot of skills on ISA Server and his contributions throughout the years demonstrate that. Take a look at Paulo’s blog at:

    http://paulooliveirasilva.spaces.live.com/blog/

  • Yuri Diogenes's Blog

    Thank you - Obrigado

    • 0 Comments

    For all of you that were at SEBRAE - CE last Friday I would like to say THANK YOU VERY MUCH (MUITO OBRIGADO). Without your participation this event couldn’t happen. See you again next time.

  • Yuri Diogenes's Blog

    TMG – Making Firewall Management an Easier Task

    • 0 Comments

    1. Introduction

    I was Proxy 2 administrator back in 1997 in a technology school, in 2000 I took my Proxy 2.0 exam and when ISA 2000 was released I was really like: WOW, that’s a huge change. It was indeed a great moving from a simple Proxy to a more robust Proxy with Firewall capabilities. But when I see TMG changes and I compare to ISA 2006, I have a great feeling that this is also a huge step towards an even better firewall with tremendous capabilities. There are so many good things on TMG that sometimes we overlook the hard work that the Product Team had to make the administration and management easier.

    In this post I want really to emphasize some new features that are not related to security, but related to how a Firewall administrator’s experience was improved in this release.

    2. More than a Getting Start Wizard

    Do you know how many times I received a call where the firewall administrator was unable to make the basics? What basics? Allow secure web access for example. I had many situations in the past that creating a rule in the right manner was a nightmare for the administrator with less experience. The idea behind the getting start wizard is really to improve the administrator’s experience with the product and allow him to perform the essential configuration after install the product.

    3. Just Search and Find it

    I have to admit that for an ISA firewall administrator with one hundred rules to manage, look for the rule that he wants to change it was not that easy. When you are administering a firewall where you installed from the scratch and you know all the rules by heart, things are easier. But what about someone that just got a new job as Security Admin and needs to manager ISA with hundreds of rules? Well, that’s complicated.

    The new search feature on TMG is perfect for this scenario and it is pretty accurate on the search result. Don’t have enough rules to try out? Just do this:

    1. Right Click on Firewall Policy

    2. Click View and click Show System Policy Rules

    3. In the Search field type SSTP and hit ENTER

    4. Check it out the result J

     

    4. NLB – Making Multicast Easier

    Who haven’t thought: why we need so many steps to enable Multicast on ISA Server 2006? I heard this question from administrators many times. Although it was a great step making ISA Server 2006 capable to support NLB Multicast, the administrator’s experience to enable that was not smoothly as they want. TMG make things easier on this as well. Now with an option that allows you to change the NLB mode in the UI:

     

    5. Single Place to Administer your Network Adapter

    Why go to Windows to change IP? Why go to Windows to add a static route? TMG makes the administration of those simple tasks even easier. You can change your IP directly from the TMG console and also view/delete or add routes from the same TMG console.

     

    6. What Else?

    Since I know that there are much more tasks that can be accomplished through TMG which are great improvements in the administration’s experience I will leave this question open. What else do you most like on TMG? Write you comment and share with all.

  • Yuri Diogenes's Blog

    More on Troubleshooting SSTP

    • 0 Comments

    A buddy of mine (Daniel Mauser) from PFE (Premier Field Engineer) read my previous post about SSTP and sent me a note about his thoughts on the PKI side of the house (since is his specialty). The notes about the troubleshooting and planning phase from my previous post are:

    ·         For troubleshooting purpose we can disable the CRL Check on the client side (not recommended in the production, as he said: only for troubleshooting purpose). To do that follow http://technet.microsoft.com/en-us/library/dd458982.aspx

    ·         The certificate that I created had URLs for LDAP and HTTP for the CRL. Since the client workstation review those links in that order (top down), the LDAP will be checked first, since it can’t access the LDAP path it will try the HTTP path. This can cause performance issue on the client side. Make sure to change the search order in the CA prior to issue the certificate, this way the CA will issue certificates using the HTTP first.

     

    Thanks Daniel for those tips.

  • Yuri Diogenes's Blog

    Updates from my Friends

    • 1 Comments

    My friend Tom Shinder is inspired this month; he already posted some great info in his Blog the last two weeks. From his recently posts I personally recommend you to review the following ones:

    http://blogs.isaserver.org/shinder/2009/06/14/the-directaccess-challenge-nat-traversal/

    http://blogs.isaserver.org/shinder/2009/06/14/direct-access-versus-directaccess-know-the-difference/

    Another friend of mine that is also helping out the community is Richard Hicks, last month he posted a great article about SQL Logging. Check it out here:

    http://tmgblog.richardhicks.com/2009/05/29/remote-sql-logging-with-microsoft-isa-server-2006/

    Last but not least you have to read this post from Jason Jones about ADAM, very precious piece of information:

    http://blog.msfirewall.org.uk/2009/05/using-adam-sites-tool-with-isa-server.html

     

  • Yuri Diogenes's Blog

    TMG Beta 3 Brings SSTP Capability

    • 2 Comments

    Now that TMG Beta 3 is released you can enjoy the best of both words for VPN access. In the past I was questioned about SSTP on ISA Server 2006 since Windows Server 2008 was capable to do it. The sad answer was that ISA Server 2006 didn’t have this feature built in. But now you can use TMG and select SSTP the same way as another protocol as shown in Figure 1:

     

    Figure 1 – SSTP available in TMG Console.

    When configuring SSTP on TMG you will need to carefully plan:

    ·         Web Listener that will be used by SSTP.

    ·         Certificate that is going to be bound to the Web Listener.

    Besides that you will need Windows Vista with SP1 on the client workstation to test this new feature.

    Troubleshooting Client Access

    Since I’m working remotely some these days I was able to reproduce some of the nice errors that I didn’t have when I was in my home lab. Today for example I got the following error when I was trying to connect from my laptop:

     

    Figure 2 – First error due the cert name.

    That was pretty self explanatory, but just to confirm the name that I used to issue the certificate I got a netmon trace and got the subject name:

    SSL:  Server Hello. Certificate. Server Hello Done.

    Seq=1878717387 - 1878718743, Ack=2650000305, Win=256 (scale factor 0x8) = 65536

    - Ssl:   Server Hello. Certificate. Server Hello Done.

      - TlsRecordLayer:

         ContentType: HandShake

       + Version: TLS 1.0

         Length: 1351 (0x547)

       - SSLHandshake: SSL HandShake TLS 1.0 Server Hello Done(0x0E)

          HandShakeType: ServerHello(0x02)

          Length: 70 (0x46)

        + ServerHello: 0x1

          HandShakeType: Certificate(0x0B)

          Length: 1269 (0x4F5)

        - Cert: 0x1

           CertOffset: 1266 (0x4F2)

         - Certificates:

            CertificateLength: 1263 (0x4EF)

          - X509Cert: Issuer: contoso-DC01-CA,contoso,com, Subject: vpn.contoso.com,IT,Contoso,Dallas,Texas

           + SequenceHeader:

           - TbsCertificate: Issuer: contoso-DC01-CA,contoso,com, Subject: vpn.contoso.com,IT,Contoso,Dallas,Texas

            + SequenceHeader:

            + Tag0:

            + Version: v3 (2)

            + SerialNumber: 0x6168a464000000000002

            + Signature: Sha1WithRSAEncryption (1.2.840.113549.1.1.5)

            + Issuer: contoso-DC01-CA,contoso,com

            + Validity: From: 06/15/09 21:03:46 UTC To: 06/15/10 21:13:46 UTC

            + Subject: vpn.contoso.com,IT,Contoso,Dallas,Texas

            + SubjectPublicKeyInfo: RsaEncryption (1.2.840.113549.1.1.1)

            + Tag3:

            + Extensions:

           + SignatureAlgorithm: Sha1WithRSAEncryption (1.2.840.113549.1.1.5)

           + Signature:

          HandShakeType: Server Hello Done(0x0E)

          Length: 0 (0x0)

    To quick fix this I edited my host file and created a manual entry there. But then right after that I got:

     

    Figure 3 – Now is the CRL.

    Looking to the properties of the certificate it was possible to see that the CRL was poiting to my internal CA: 

     

    Figure 4 – The CRL for my internal CA.

    To resolve this I created a web publishing rule to publish my CRL and after that all worked fine.

    Additional Resources

    While testing those settings I got some great links from the RRAS team (which is the component that TMG uses for VPN capability). Check it out the links below:

    http://blogs.technet.com/rrasblog/archive/2007/09/26/how-to-debug-sstp-specific-connection-failures.aspx

    http://blogs.technet.com/rrasblog/archive/2007/01/17/sstp-faq-part-2-client-specific.aspx

    http://blogs.technet.com/rrasblog/archive/2007/01/25/sstp-faq-part-3-server-specific.aspx

    You might be wondering: how did you get access to those things if you were unable to establish the VPN connection? The answer is: through my backup PPTP connection :)

  • Yuri Diogenes's Blog

    MS FOR SEC DAY NOW WITH TMG BETA 3

    • 3 Comments

    When I first planned this presentation I was thinking to talk about Forefront TMG Beta 2 features, but now with TMG Beta 3 available, I’m also going to cover some of the cool features available in this release. We already have 150 people enrolled, so if you didn’t enroll better to do it quickly because the venue is almost full. Enroll at:

    http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032416163&Culture=pt-BR

Page 11 of 17 (417 items) «910111213»