Obtain DLL-encrypted news content using ASP

Source: Internet
Author: User
First of all, I would like to thank csdn's elders for their selfless dedication. So I learned something and applied it to me. Secondly, I wrote this article to study "It's not right ".

The following code is used:
<%
On Error resume next
Dim objxmlhttp, XML
Set xml = server. Createobject ("Microsoft. XMLHTTP ")
XML. Open "get", "http://chanye.finance.sina.com.cn/yj/2005-01-05/236914.shtml", false
XML. Send
Tmpstr = xml. responsetext
Ep = clng (instr (1, tmpstr, "meta_data2") + 18
Tmpstr = Replace (tmpstr, vbcrlf ,"")
Tmpstr = Replace (tmpstr, CHR (9 ),"")
Tmpstr = Replace (tmpstr, CHR (32 ),"")
Mydata = mid (tmpstr, 1, EP)
Recfilen = server. mappath ("tempstr.txt ")
Set astream = server. Createobject ("ADODB. Stream ")
Astream. type = 2
Astream. mode = 3
Astream. Open
Astream. charset = "gb2312"
Astream. Position = 0
Astream. writetext mydata, 1
Astream. savetofile recfilen, 2
Astream. Close
Set astream1 = server. Createobject ("ADODB. Stream ")
Astream1.type = 2
Astream1.mode = 3
Astream1.charset = "gb2312"
Astream1.open
Astream1.loadfromfile (recfilen)
ASSP = astream1.size
Crttmpstr = astream1.readtext (ASSP)
Astream1.close
SP1 = clng (instr (1, crttmpstr, "meta_data1") + 16
EP1 = clng (instr (SP1, crttmpstr, "name = meta_data2")-7
Lth1 = ep1-sp1
Newdata = mid (crttmpstr, SP1, lth1)
%>
<HTML>
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312">
<Style>
Body {
Font-size: 12px
}
TD {
Font-size: 12px
}
</Style>
<Title> obtain DLL-encrypted news content using ASP </title>
<Table width = "540" border = "0" align = "center" cellpadding = "0" cellspacing = "0">
<Tr>
<TD> Update Time: <% = now %> length of retrieved content: <% = lth1 %>
Bytes
Note that http: // 127.0.0.1/ip1htmlview. dll must be downloaded first ?!
<Object ID = htmlip1view codebase = http://image2.sina.com.cn/cj/chanye/Ip1HtmlView.dll#version=1,0,1,14 classid = CLSID: D854FC15-D3EA-496A-B2A0-A772A3DE1D09>
<Param name = "meta_data1" value = "<% = newdata %>">
<Param name = "meta_data2" value = "">
<Param name = "meta_data3" value = "">
<Param name = "meta_data4" value = "">
<Param name = "meta_data5" value = "">
<Param name = "meta_data6" value = "">
<Param name = "meta_data7" value = "">
<Param name = "meta_data8" value = "">
<Param name = "baseurl" value = "111">
<Param name = "random" value = "111">
</Object> </TD>
</Tr>

</Table>

</Body>
</Html>

Code Description: the reason for using ADODB. stream, because the directly obtained content is always unable to achieve the desired effect, the EP position is always much longer than expected, and I tried to use limit B, functions such as midb also get confusing results, so I had to make the best effort and look at it with high fingers (alas, how do I feel sour ). Of course, it is only effective for the current location. You can modify other settings, or even directly generate pages and record them to the database to become your own. It should be enough to write the database with the above.
It is not difficult to prevent DLL downloads. You can add one for IIS. dll ISAPI extension. The action of selecting a DLL file for an executable file is limited to "null". (You can do whatever you want. You can just enter the file without any need .). If the DLL doesn't work for the external site, you can't talk about it. To prevent news from being stolen, check request. servervariables ("http_referer.
In addition, because I have not graduated from college, I have learned to fight hard, so there must be a lot of junk places. Please leave it blank. Thank you.
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.