Thursday, November 26, 2015

DLL used by ISAPI [Internet Server Application Programming Interface]

DLL used by ISAPI:

POST operations are made to one of several Internet Server Application Programming Interface (ISAPI) DLLs. The ISAPI DLL is loaded by Microsoft Internet Information Server (IIS) when the URL of that DLL is specified in a GET, POST, etc. The following table describes the functionality of the server-side DLLs used on a team Web site.
Name
Description
admin.dll
The ISAPI extension that implements administrative operations such as creating and deleting subwebs, and managing users through the FrontPage permissions dialog box.
author.dll
The ISAPI extension that implements authoring operations, such as uploading files, applying themes, renaming and deleting documents, and so forth.
Path: http://www.server.com/subweb/_vti_bin/_vti_aut/author.dll
fpadmdll.dll
The ISAPI extension that implements the Administration pages, including the display of those pages and the execution of administrative operations from the browser.
Path: http://www.server.com/subweb/_vti_bin/_vti_adm/fpadmdll.dll
owssvr.dll
The ISAPI extension that implements SharePoint Team Services functionality, such as list creation, deletion, and authoring, as well as the HTML page-rendering system. It is used directly from the browser (for example, creating a list by making an HTTP POST tohttp://www.server.com/subweb/_vti_bin/owssvr.dll?Cmd=NewList) and it is used programmatically through a client API when FrontPage interacts with the functionality of a team Web site.
Path: http://www.server.com/subweb/_vti_bin/owssvr.dll
shtml.dll
The SmartHTML interpreter that is used to perform the FrontPage Server Extensions browse-time functionality, such as saving the results of HTML form submissions to a document in the user's team Web site. It doubles as the DLL that implements operations that can be performed by browsers against team Web sites on the server, such as determining what site a particular document lies within or the server extensions version.
Path: http://www.server.com/subweb/_vti_bin/shtml.dll/_vti_rpc

 

Rendering - SharePoint List

Rendering

Rendering refers to the process of producing an HTML document to display in the browser. For example, posting the following URL command,http://STSServer1/_vti_bin/owssvr.dll?Using=Lists/Announcements/AllItems.htm opens the Announcements list.

Once a command is posted, Microsoft Internet Information Server (IIS) starts up the SharePoint Team Services request, passing the URL to owssvr.dll. 

When the site page is opened, FrontPage components on the page (for example, ListView, ListForm, or ListProperty) are expanded and draw in the list's data and view definition from the database.

Client-side JavaScript on the page executes and hides this internal URL that is sent to the server, displaying instead the Web URL of the site page, for example, http://STSServer1/Lists/Announcements/AllItems.htm.

In addition, the script writes a <FRAMESET> tag in the document stream that causes the current page to be re-loaded, using owssvr.dll to process the page instead of loading the raw HTML page in the browser.


The file owssvr.dll reads in the contents of the page and starts looking for CAML regions, those that begin with <ows:, in order to render the page.

Process architecture - creating a new list in SharePoint


Process of creating a new list in SharePoint



Example : creation of a new announcements list involves the following actions by the server:
  1. The browser posts a request to owssvr.dll on the server to create the list, specifying the title and description of the list. The POST specifies the key value pair, Cmd=NewList, along with such parameters as ServerTemplate, which specifies a number identifying which list template to instantiate (for example, 104 indicates the Announcements list).
  2. The server opens ONET.XML in the /Program Files/Common Files/Microsoft Shared/web server extensions/50/Templates/1033/xml folder and looks for the list template corresponding to the number specified in step 1. When it finds the template, it knows the location in the Layouts folder where the files for that template are stored. For example, a template definition in ONET.XML might look like the following:
<ListTemplate Name="announce" DisplayName="Announcements" Type="104"
  BaseType="0" Default="TRUE" OnQuickLaunch="FALSE" SecurityBits="111"
  Description="An announcement list makes it easy for team members to post
  news and information for the rest of the team to see."
Image="_layouts/images/itann.gif"/>

This definition tells the server that the corresponding list template is stored in the Announce directory of the /Program Files/.../web server extensions folder.

  1. The server opens a second file in the /Program Files/.../web server extensions area, in this case SCHEMA.XML of the Announce folder. This file includes the set of fields that constitute the list, which is combined with a set of universal built-in fields defined in ONET.XML (such as for ID number, author, editor, and last modified) to construct a CREATE TABLE statement that is responsible for creating the actual database table.
  2. A directory is created for the new list in the /wwwroot/Lists folder, and the HTML site pages are copied from the setup area (/Program Files/Common Files/Microsoft Shared/web server extensions/50/1033/Templates/Layouts folder) to the new directory. The folder metadata for the directory (in the .fp_folder_info file of the /_vti_cnf subfolder) is initialized with the internal name of the list, the type of list, and the display name of the list.
  3. The server creates a record in the List of Lists table for the new list, filling in all the columns based on the information specified in the NewListrequest and the instructions in SCHEMA.XML. The tp_RootFolder column contains the URL ID of the directory created in step 4, and the tp_Fields column contains field definitions that are drawn from both ONET.XML and SCHEMA.XML. The field definitions include display patterns that define computed fields, such as the title links for items displayed in AllItems.htm. (The LinkTitle field type, a field defined in ONET.XML, surrounds the values from a table's Title field with <A> tags to produce title links.)
  4. In SCHEMA.XML, the server locates the Views and Forms sections and copies each view and form definition into the tp_View column of the Views table. Rows are created for each of the list's HTML site pages (AllItems.htm, DispForm.htm, EditForm.htm, and NewForm.htm), and the View column contains the schemas for rendering each of these pages. (The site pages contain FrontPage components that expand in the browser to pull in these view schemas from the database.)

How to Disable the Windows Explorer View in SharePoint

Windows Explorer view does have several inherent security holes and these holes do pose significant risk to customers in the military or DOD environments. For example, if SharePoint permissions only give a user read access to a file, often users are still able to rename the file through the Windows Explorer view. In some cases users with read access to certain files are even able to delete those files.
As well, Microsoft has stated that when using claims based authentication with SAML security tokens that the Windows Explorer view in SharePoint 2010 does not work: http://technet.microsoft.com/en-us/library/hh706161.aspx. 
With SharePoint 2013, this option is even more viable because the web view now allows users to drag and drop files from their Windows desktop into the web browser and have those files copied into the SharePoint library. 
Below are the methods for preventing end users from accessing these Windows Explorer view. 

Method : 1

Administrators can disable access to the Windows Explorer view by modifying the “User Permissions” on the web application. This is done within Central Administration:
  • Click Manage Web Applications and select your web application
  • Click the User Permission button in the ribbon
  • Find the “Use Remote Interfaces” permission in the list and uncheck it (this will also automatically uncheck the “Use Client Integration Features” permission as well)

This will disable the “Open in Explorer” button in the SharePoint ribbon for all libraries in all sites in the web application.

There is a problem with this method though - it also disables all access to open documents in SharePoint from the open dialog in MS Office applications. As well, access from SharePoint Designer and access from all client object model applications will be also be disabled. Please note that the Open Dialog, like the Windows Explorer view also does not fully respect SharePoint permissions. So, this method may or may not work for your environment.

While opening this permission page which have url like http://Siteurl/_admin/vsmask.aspx?WebApplicationId=webappGUID&IsDlg=1
In body MS setted scroll = No , so need not to panic if you are unable to find vertical scroll bar

Find “Use Remote Interfaces” in the page & uncheck the checkbox

Method : 2

I have found that simply removing the “Open in Explorer” button all together from the SharePoint ribbon can be an effective way to prevent access through the Explorer view.

Following are the steps to remove this button from Ribbon
·         Create an empty SharePoint 2010 Solution, you may give your favorite name to it
·         Add a feature by right clicking on the Features in Solution Explorer
·         Right click on the Project and add a new item, choose empty element and name it
·         Open the Elements.xml file from the newly added item
·         Copy & paste the following XML into the Elements.xml file
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
   <CustomAction Id="RemoveRibbonButton" Location="CommandUI.Ribbon">
      <CommandUIExtension>
         <CommandUIDefinitions>
           <CommandUIDefinition Location="Ribbon.Library.Actions.OpenWithExplorer" />
         </CommandUIDefinitions>
      </CommandUIExtension>
    </CustomAction>
</Elements>
Deploy the Solution and observe that “Open with Explorer” button will be removed from the Ribbon.

This method is effective because you open Windows Explorer on your desktop and paste the URL to a SharePoint library Windows will automatically open a web browser and navigate to the SharePoint web view of the library. It does not actually open in Windows Explorer. This allows the open dialog in Windows to still navigate to a file in a SharePoint library and open it, but prevents users from effectively using the Explorer view.

This method of course may not be fool proof, meaning a malicious user may still find a way around it. However it would cover 95% of cases where end users are simply trying to open documents that they are permitted to access. As well, this method still allows users to open SharePoint documents from the Open dialog in MS Office applications, SharePoint Designer and client object model applications.
Method : 3
A third method that is effective and allows you to still maintain client object model access and access through the Microsoft Office open dialog is the following procedure which modifies the permissions required to access the Open in Explorer button. This procedure will result in the “Open in Explorer” button in the SharePoint web interface to still be visible and enabled, but to only be accessible by users that have the “ManageWeb” permission on the site. This would allow you to configure SharePoint to allow site owners to have access to the Windows Explorer interface, but not regular users that only have contribute permissions. Follow these steps to accomplish this:

·                     On the SharePoint 2010 server navigate to the folder \Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\CONTROLTEMPLATES
·                     Make a copy of the file DefaultTemplates.ascx
·                     Open DefaultTemplates.ascx in Notepad:
·                     Search for the following string ID=”OpenInExplorer”
·                     Below that string change PermissionString=”UseClientIntegration” to PermissionString=”ManageWeb”
·                     You will find 2 instances of ID=”OpenInExplorer” – you’ll need to make the change in both places
·                     Save the file and issue an IIS Reset
You’ll then find that a user that is a site owner can click on the “Open in Explorer” button and still access SharePoint through the Explorer interface, but users that are not site owners (or who do not have the Manage Web Site permission) can click on the button but they’ll get an “Access Denied” message. This works even if a user tries to create a shortcut to a URL and access the Explorer view from that shortcut, or if they try to map a network drive to the SharePoint library URL - if they don't have appropriate permissions they will receive an "access denied" 

Method : 4
This method probably more extreme method is to in fact disable WebDAV itself on the IIS Web Server. To accomplish this follow these steps:

·         Click the Windows "Start" button on your Web server, and select "Administrative Tools." Click "Internet Information Services Manager" to open the configuration utility. Or type inetmgr on run.
·         Click the Web server name in the left panel. A list of websites expands. Click the website name you want to edit, and click "Web Services Extensions" in the website directory.


  • Select disable WebDAV on the top right side of the screen



  • A message that WebDAV is disabled should be shown.
Remove WebDAV handler mappings and modules
  • Select the virtual directory in which the WebDAV elements should be removed
  • Double click the handler mappings icon
  • Select WebDAV in the list and click remove at the right site of the screen to remove it
  • Select the virtual directory again
  • This time double click the modules icon
  • Select "WebDAV module" in the list and click remove at the right site of the screen to remove it
Check web.config
  • Open the directory where Exact Synergy Enterprise is installed and which is used by the virtual directory in which you removed the WebDAV elements
  • Open the web.config file
  • Check at the end of the file is the lines as shown in the picture below are added. If not, then add them manually


WebDAV (Web Distributed Authoring and Versioning)

WebDAV is a simple extension to the HTTP protocol based on a public specification. It provides an extended vocabulary that defines how basic file functions, such as copy, move, delete, and create folder, are performed across HTTP.

Please note: I have not tested this last method myself so your mileage may be different. Ensure that if you go this route that you fully test the SharePoint server and determine if access to files through other mechanisms (MS Office Open dialog, SharePoint Designer, client object model applications) is also affected. As well, these instructions may vary slightly depending on your version of IIS.