Batch export/read IIS domain names

Source: Internet
Author: User

For example, when the server has more than 300 sites, it is impossible to check them one by one. After searching the Internet, there is a program that is suitable, but the exported website name is the website name. I changed it to the list of exported domain names, at the same time, it solves the problem of exporting a website to bind multiple domain names, and is more suitable for your own applications. The original program cannot find the source code. Based on the open source principle, the modified source code is now released, I hope it will be useful to you.
Usage:
1. Export the xml configuration file in IIS. See the following figure. Right-click the website, select all tasks, and save to a file. For example, save as iis. xml.


 

2. Copy the following program to notepad and save it as an asp file, for example, iis. asp, which can be executed in a directory on the website with the script execution permission. At the same time, you need to put the exported xml file in the same directory.
<% Option explicit
Dim fso
Set FSO = Server. CreateObject ("Scripting. FileSystemObject ")
Dim ts
Set ts = fso. OpenTextFile (server. MapPath ("iis. xml"), 1) 'modify the iis backup file name.
Dim content
Content = ts. ReadAll
Content = split (content, "<IIsWebServer ")
Function getdomain (str)
Dim reg, readstr, matches, matkers
Set reg = new Regexp
Reg. Multiline = True
Reg. Global = false
Reg. IgnoreCase = true
Reg. Pattern = "ServerComment (. *) \ s"
Set matches = reg.exe cute (str)
For Each matches
Readstr = match1.Value
Next
Set matches = Nothing
Set reg = Nothing
Getdomain = replace (readstr, "ServerComment = ","")
Getdomain = replace (getdomain ,"""","")
End function
Function GetKey (HTML, Start, Last)
Dim filearray, filearray2
Filearray = split (HTML, Start)
Filearray2 = split (filearray (1), Last)
GetKey = filearray2 (0)
End function
Function Clear (content)
Dim arr, I
Arr = split (content ,":")
For I = 0 to ubound (arr)
If instr (arr (I), ".")> 0 then
Clear = Clear & arr (I)
End if
Next
End function
Response. Clear ()
Dim I
For I = 0 to ubound (content)
If instr (content (I), "ServerBindings")> 0 then
Response. write (I) & "Description:" & getdomain (content (I) & "<br> Host Header:" & Clear (GetKey (content (I ), "ServerBindings =" ",") & "<br>"
End if
Next
%>
Note: The security settings of the server for revenge may not be enabled. In fact, we can use this vulnerability when hackers intrude into the server, you can go to the bypass site or use a tool to check and then export it, such as the new yujian,

Selecting Microsoft Bing is more accurate. Of course, this method must be indexed by search engines (no first method is available). If the website just bound cannot be found
This article comes from: Xiaoyao revenge

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.