找回密码
 立即注册
查看: 8734|回复: 1

实例讲解QQ空间莫名欺骗的图片获取QQ号及昵称原理+源码

[复制链接]
发表于 2013-11-4 21:12:24 | 显示全部楼层 |阅读模式
QQ空间获取当前用户名最近很流行在qq空间里转载带有当前用户的一些图片,简单研究一下其实就是利用php来创建的一个简单的图片。  o+ m) M7 a( V: F/ W. [& a
生成图片 image.php:
4 h& h5 f9 u, l1 @# \[mw_shl_code=php,true]<!--?php
: M: v: i  B% c9 Z$ment =  $_SERVER["HTTP_REFERER"];$ i$ f) R  s. \3 Y! x* I& p
4 j8 g. }/ t  U
if($ment == 'http://cnc.qzs.qq.com/qzone/newblog/v5/editor.html'){/ M2 W7 b' a0 ?, u# I
        header("HTTP/1.0 500 Internal Server Error");
  }3 _: B! n1 e% u' Hexit;}( x$ B( k$ K. F+ y4 Q
preg_match("#[0-9]{5,11}#",$ment,$rr);+ y  t2 A- z% |# \- r& \" p
$r=$rr[0];; e+ ^+ d: L( k4 j/ U# n! J
$webtext=file_get_contents('http://www.phperzone.cn/qqinfo-service.php?qq='.$r);5 ?& c2 U, X6 F' \, @9 }
preg_match('#"nickname":"(.*?)"#',$webtext,$rr);
( P6 ]+ l4 e# h1 r8 m$rrr=$rr[1];
* h; v, }9 S( ?1 b% Z6 Uob_clean();  ]; z' j9 Q2 W  e) E
header("Content-type:image/png");
  B: _( w# f) x) j0 @0 a$im=imagecreatefromjpeg("1.jpg");
. d$ y% C0 ^  `2 Z- W: k/ A$black = ImageColorAllocate($im, 56,73,136);
' \9 O4 L' n4 f( `5 M$rrr = mb_convert_encoding($rrr, "utf-8","UTF-8");
; O5 _6 g& O; T8 D6 u' |! @imagettftext($im,20,0,90,68,$black,"./simsun.ttc",$rrr);
, t* s. ~% o1 [5 R8 Z/ t5 K' E' \& ]imagettftext($im,26,0,87,125,$black,"./simsun.ttc",$r);
! N. r' r+ h- Jimagejpeg($im);
) a/ Z0 ^! i, Q. O  h* }+ k5 uimagedestroy($im);
) A: |$ V% w8 P( a5 h?-->[/mw_shl_code]3 S8 l; E; K' u/ W) V( U

" P& n: ]' B1 L0 h0 \9 }4 I; V* z5 J( U7 r/ s& `/ L
接口文件 qqinfo-service.php:
/ C3 Z$ q( N: T0 K4 ]$ V. u[mw_shl_code=php,true]<!--?php
5 e& A+ [1 d, x! a$ W7 oheader("Content-Type:text/html;charset=utf-8");' c/ r4 I+ R& j, s
$qq = $_GET ["qq"];5 L6 g4 b' P, b
echo htmlspecialchars(file_get_contents('http://r.qzone.qq.com/cgi-bin/user/cgi_personal_card'. "?uin=" . $qq));
3 _' e( r4 B& Y7 O( B1 t  k?-->[/mw_shl_code]& ~+ V7 q% A7 E3 e$ o  S& x

" T! l1 H9 A+ c- i
9 H6 g; a: u1 ~* i* @源码下载 上传PHP空间
$ C7 U$ s" z2 c" i/ G: l2 c* U- D! e/ V% v  m  i: c6 b

6 [- ~, G% v4 r( O5 k5 s* d
游客,如果您要查看本帖隐藏内容请回复

. |" p. H: f/ i7 b% w
发表于 2013-11-22 11:50:59 | 显示全部楼层
看了LZ的帖子,我只想说一句很好很强大!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|第一站论坛 ( 蜀ICP备06004864号-6 )

GMT+8, 2024-4-17 00:32 , Processed in 0.073964 second(s), 22 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表