search
Homephp教程php手册跟我学小偷程序之成功偷取首页(第三天)

跟我学小偷程序之成功偷取首页(第三天)

Jun 13, 2016 pm 12:44 PM
htdifferenthostanalyzesuccessusofprogramneedfront page


今天我们教,偷取首页.不同的首页需要不同的偷法,主要是分析HTML代码.函数以及方法前面2天介绍的很清楚了.今天我们在实践中讲解和使用.

还是拿华军软件园开刀.
打开华军软件园首页
http://www.onlinedown.net/index.htm
用Dreamweaver新建一个index.php的页子.
注意:
先做好你要的首页模板,然后开始偷首页.由于考虑到对初学者的教程.所以先把模板和PHP处理代码放在同一个网页中.
以后教大家HTML和PHP的分离.

模板建立好以后,我们就开偷.

的上方插入PHP代码,如下形式:

require './commom.php';
update("index.htm");
$file=readfromfile("cache/index.htm");

?>
解释
require './commom.php'//引入commom.php文件
update("index.htm")//读取写入index.htm网页
$file=readfromfile("cache/index.htm")//从本地文件夹cache中读取index.htm
这里的$file是一个变量,你可以随便取名.也可以叫它 $html
但是后面用到的时候要统一.

上面代码,没有处理任何东西,也没有输出任何的东西.如果说输出$file的话,那么就是index.htm的所有html代码.
下面就开始到index.htm中拿我们想要的东东.

1 拿国外软件更新的代码.
大家可以取一个变量名为 $gwrj   //国外软件 名字随便取
怎么从这个index.htm拿出这个我们想要的国外软件呢?这里拿出我们上一节讲过的cut函数
$gwrj = cut($file,"

","");
解释
$xxx = cut($file,"$first","$end");
如何工作的呢?就是把$file(index.htm)从$first处切割取下面部分,在切割$end取上面部分.
比如说:
$file = "111222333444";
$xxx = cut($file,"1","3");//结果是11222 这样的解释应该明白吧?
注意:
""
在" "内的内容 如果也有 " 的话,需要在前面加 \
例子
" "
成为
" "
下面这段代码就是成功偷取了国外软件:

require './commom.php';
update("index.htm");
$file=readfromfile("cache/index.htm");
$gwrj = cut($file," ","");
?>
然后在你的html模板中,在需要显示的地方插入代码
echo $gwrj; ?>

其他偷取也一样.
注意:
这里拿出来的HTML需要更换为自己的代码,可以总的更换,也可以一个一个更换.
我们讲单独更换代码就是:
$gwrj = cut($file,"","");
$gwrj = str_replace("soft/","soft.php?id=",$gwrj);
$gwrj = str_replace(".htm","",$gwrj);
解释:
就是把偷过来的国外软件中的代码更换.
原来的

变为了现在的


基本差不多了,多菜鸟讲来应该很详细咯.先做好首页模板,然后一个一个的挖出来你想要的东西.
想一个问题.
index.htm中,有很多分类资讯的,都是调用JS显示的内容,你怎么把它拿过来显示在你的首页中.
希望大家偷的都很顺利.
简单讲下分类的偷取.和偷取首页一样.代码如下:

require './commom.php';

if($soft){
        update("${soft}.htm","soft");
        $file=readfromfile("cache/${soft}.htm");
}
?>
soft.php
其中$soft就是从前面传递过来的soft.php?id=1234
如果传递过来1234
那么就是更新读取update("1234.html","soft");
今天讲到这里,明天教模板.
Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.