sohu的数据库也会罢工啊

2008年01月24日 星期四

sohu的数据库也会罢工啊

sohu的数据库也会罢工啊

银行ATM机系统崩溃

2007年12月29日 星期六

200712291753_00014.jpg

200712291754_00015.jpg

200712291755_00016.jpg

200712291756_00017.jpg

image_00013.jpg

破解非图片验证码,模拟浏览器提交数据

2007年11月03日 星期六

应网友 dzjzmj 的题目,编写了一个模拟浏览器提交数据的代码。

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?php
include	"HttpClient.class.php";

$url[1] = "http://coderhome.net/?action=add";
$url[2] = "http://coderhome.net/ajax.php";
$url[3] = "http://coderhome.net/?action=save";

$client = new HttpClient();
$client->useGzip(true);
$client->setDebug(true);
$client->setPersistCookies(true);
$client->setPersistReferers(true);

// 打开提交页面
echo "<b>打开提交页面:</b>\r\n“;
$client->get($url[1]);

// 获取时间戳和cookie
echo “<b>获取时间戳和:</b>cookie\r\n<br />”;
$client->referer = $url[1];
$client->get($url[2]);
$html = $client->getContent();
$cookie = $client->getCookies();
print_R($cookie);
preg_match(”/(\d{6,15})/”, $html, $tmp);
$time = intval($tmp[1]);

// 提交表单
echo “<b>提交表单:</b>\r\n<br />”;
$cookie[’ltime’] = time() . “235″;
$client->setCookies($cookie);

$post[’title’] = “测试表单提交漏洞”;
$post[’content’] = “测试表单提交漏洞,野马留下脚印一个。”;
$post[’url’] = “http://www.yemaol.com/”;
$post[’downurl’] = “http://www.yemaol.com/blog/wp-content/uploads/2007/10/simpledevelop-v20315.rar”;
$post[’license’] = ”;
$post[’cat_id’] = 29;
$post[’image’] = ”;
$post[’submit’] = “保 存”;
$post[’ts’] = $time;

$client->post($url[3], null, $post);
$html = $client->getContent();

echo “<pre>” . str_replace(”< ", "<", $html) . "</pre>“;

?>

运行结果:

运行结果

PHP模拟浏览器的HTTP协议类

2007年11月03日 星期六

PHP模拟浏览器的HTTP协议类

支持http和https

支持自定义端口

支持COOKIE、GET、POST

类包下载

Simple Develop v2.0.3.15

2007年10月31日 星期三

修正了config类不能解析多个同名标签的问题。

增加了对关联表的addwhere功能(由pengguanfa完成) 。

增强了对mysql的数据理性兼容。

增强了缩略图功能(增加了一种缩放策略)。

simpledevelop-v2.0.3.15

安装sysstat笔记

2007年10月13日 星期六

下载systat的最新版本:

http://perso.orange.fr/sebastien.godard/sysstat-8.0.1.tar.gz

[root@localhost software]# tar zxf sysstat-8.0.1.tar.gz [root@localhost software]# cd sysstat-8.0.1 [root@localhost sysstat-8.0.1]# ./configure [root@localhost sysstat-8.0.1]# make [root@localhost sysstat-8.0.1]# make install [root@localhost sysstat-8.0.1]# ln /usr/local/bin/sar /usr/bin/sar [root@localhost sysstat-8.0.1]# ./sysstat start [root@localhost sysstat-8.0.1]# sar -V sysstat version 8.0.1 (C) Sebastien Godard (sysstat orange.fr) [root@localhost sysstat-8.0.1]# sar -u 1 10 Linux 2.6.9-5.ELsmp (himynews.himynews) 10/13/2007 10:48:52 AM CPU %user %nice %system %iowait %steal %idle 10:48:53 AM all 7.23 0.00 3.49 0.50 0.00 88.78 10:48:54 AM all 18.95 0.00 6.23 0.00 0.00 74.81 10:48:55 AM all 21.50 0.00 3.50 11.75 0.00 63.25 10:48:56 AM all 9.23 0.00 2.24 0.00 0.00 88.53 10:48:57 AM all 2.26 0.00 3.76 0.00 0.00 93.98 10:48:58 AM all 0.25 0.00 0.00 0.50 0.00 99.25 10:48:59 AM all 1.00 0.00 0.25 0.25 0.00 98.50 10:49:00 AM all 4.01 0.00 6.27 0.00 0.00 89.72 10:49:01 AM all 1.24 0.00 0.75 13.43 0.00 84.58 10:49:02 AM all 0.75 0.00 0.00 0.25 0.00 99.00 Average: all 6.64 0.00 2.65 2.67 0.00 88.04 [root@localhost sysstat-8.0.1]#

至此安装成功

发布 Simple Develop v2.0.2

2007年10月10日 星期三

 修正了编码问题,修正后可以在配置文件和数据库表映射类设置编码。

如配置文件:

<database type=”Mysql” host=”localhost” port=”3306″ username=”village” password=”village” database=”village” character=”utf8″ />

和表映射类

public function __construct() { parent::__construct(”job”, 0, “utf8″); }

配置文件会是每一个表的默认编码,表映射类的编码设置会覆盖配置文件的设置,不过仅限于当前表。

SimpleDevelop v2.0.2.rar

SimpleDevelop v2.0.1 发布

2007年10月08日 星期一

 SimpleDevelop v2.0.1 提供下载

SimpleDevelop v2.0.1

帮网友写了一个IP地址到二进制(文本)之间转换的的代码

2007年10月05日 星期五
< ?php

$ipstr = "172.88.70.7";
echo "$ipstrrn";
$ipbin = ip2bin($ipstr);
echo "$ipbinrn";
$ipstr = bin2ip($ipbin);
echo "$ipstrrn";

$ipstr = "255.255.255.255";
echo "$ipstrrn";
$ipbin = ip2bin($ipstr);
echo "$ipbinrn";
$ipstr = bin2ip($ipbin);
echo "$ipstrrn";

$ipstr = "127.0.0.1";
echo "$ipstrrn";
$ipbin = ip2bin($ipstr);
echo "$ipbinrn";
$ipstr = bin2ip($ipbin);
echo "$ipstrrn";

function ip2bin($ipstr) {
        $ipArr = split(".", $ipstr);
        $binArr = array();
        foreach($ipArr as $item) {
                $binArr[] = sprintf("%08b", $item);
        }
        return implode($binArr);
}

function bin2ip($ipbin) {
        $binArr = split("n", chunk_split($ipbin, 8, "n"), 4);
        foreach($binArr as $key => $item) {
                $binArr[$key] = base_convert($item, 2, 10);
        }
        return implode(".", $binArr);
}

?>

命令行测试:

shall>php test.php 172.88.70.7 10101100010110000100011000000111 172.88.70.7 255.255.255.255 11111111111111111111111111111111 255.255.255.255 127.0.0.1 01111111000000000000000000000001 127.0.0.1

配置Zend Debugger,可以在PHP5.2.0以上环境调试

2007年10月04日 星期四

下载Zend Optimizer:http://downloads.zend.com/optimizer/3.3.0a/ZendOptimizer-3.3.0a-Windows-i386.exe

下载Zend Debugger:http://downloads.zend.com/pdt/server-debugger/ZendDebugger-5.2.10-cygwin_nt-i386.tar.gz

下载Zend Studio:http://downloads.zend.com/studio/5.5.0b/ZendStudio-5_5_0b.zip

安装 Zend Optimizer 和 Zend Studio,逐步执行即可装好。

ZendDebugger-5.2.10-cygwin_nt-i386.tar.gz解压(以解压到D:\Zend\为例)。

进入D:\Zend\,将类似于4_3_x_comp的文件夹都改名为php-4.3.x,一一对应,不可以把数字搞错。

打开php.ini,如果你是windowsxp,应该在C:\Windows\下面,在最后加入一下配置:

zend_extension_manager.debug_server_ts=”D:\zend” zend_debugger.expose_remotely=allowed_hosts zend_debugger.allow_hosts=127.0.0.0/32,192.168.1.0/24,192.168.0.0/24 zend_debugger.allow_tunnel=127.0.0.0/32

保存php.ini,从新启动apache,查看phpinfo,有以下信息为正确安装:

optimizer.PNG

debugger.PNG

将D:\Zend\dummy.php 复制到网站根目录。

然后设置Zend Studio:

工具->选项->调试

调试方式选服务器;server url内填写调试的服务器url地址; 其他不用改,保存即可。

剩下的调试过程就和以前使用Zend studio server时一样了,不再赘述。