jerrygu625 发表于 2016-8-12 11:36:05

询问问题

问个问题
index.html
<!doctype html>
<html>
<head>
<title>版本</title>
<meta charset="utf8">
<script src="js/a.js"></script>
</head>
<body>
<script language="javascript">document.write(navigator.userAgent.toLowerCase());</script>
<script language="javascript">document.write(B);</script>
</body>
</html>

js/a.js
B=(function x(){})[-5]=='x'?'FF3':(function x(){})[-6]=='x'?'FF2':/a/[-1]=='a'?'FF':'\v'=='v'?'IE':/a/.__proto__=='//'?'Saf':/s/.test(/a/.toString)?'Chr':/^functiom \(/.test([].sort)?'Op':'Unknow'

open index.html with 2345explorer
mozilla/5.0 (windows nt 6.3; wow64) applewebkit/537.36 (khtml, like gecko) chrome/47.0.2526.108 safari/537.36 2345explorer/7.0.0.12291
Unknow

open index.html with Firefox
mozilla/5.0 (windows nt 6.3; wow64; rv:47.0) gecko/20100101 firefox/47.0
Unknow

为什么B总是为Unknow,网站说比navigator.userAgent更准确

梦想家 发表于 2016-8-12 13:33:00

你先说是什么软件呗

Miss_love 发表于 2016-8-12 13:51:58

你想做什么?什么情况下做的,描述清楚些,不然别人怎么帮你呢

jingzizx 发表于 2016-8-14 07:21:40

什么意思

jerrygu625 发表于 2016-8-15 11:43:35

BS产品,介绍一般说执行了alert(/XX/)就能被CSS攻击了,有何意义

jerrygu625 发表于 2016-8-15 11:47:32

Miss_love 发表于 2016-8-12 13:51
你想做什么?什么情况下做的,描述清楚些,不然别人怎么帮你呢

执行:<script language="javascript">document.write(B);</script>为什么总返回unknow,请参见:http://www.cnblogs.com/wangzhanjianshe/archive/2009/10/20/2326907.html
页: [1]
查看完整版本: 询问问题