mars.run
读懂PHP opcode及其在webshell检测中的应用 | Mars' blog
http://mars.run/2015/12/Understanding_PHP_opcode_and_it_apply_in_webshell_detection
Opcode在PHP内核中是如何生成的可以参考 : http:/ www.php-internals.com/book/? 我们可以通过PHP扩展vld来查看PHP脚本的opcode,可以参考( http:/ blog.csdn.net/21aspnet/article/details/7002644)。 ZEND API zend op array *(*zend compile file)(zend file handle *file handle, int. Type TSRMLS DC);. Zend op array *op array TSRMLS DC). VLD就是通过HOOK Zend Engine中的这两个函数来实现dump opcode,来看看它的代码. PHP RINIT FUNCTION(vld){. Old compile file = zend compile file;. PHP MAJOR VERSION 5. PHP MAJOR VERSION = 5. PHP MINOR VERSION = 2. Old execute = zend execute;. Zend ...
mars.run
N-gram 在安全领域的应用 | Mars' blog
http://mars.run/2016/05/N-gram_in_security_application
N-Gram是一种在自然语言处理(NLP)中常用的一种概率语言模型(Probabilistic Language Model),常用于语音 手写识别、机器翻译、拼写纠错等等领域。 T 是由 W1,W2,W3,W4,W5 . Wn组成的一个句子。 P(T) = P(W1,W2,W3,W4,W5 . Wn) / 这个句子出现的概率是里面每一个词出现的概率的叠加。 P(W5 W1,W2,W3,W4) / 已经出现第1个至第4个的词的情况下,第5个词出现的概率。 I am working 后面很有可能出现. P(its water is so transparent that). P(A,B) = P(A B)P(B). P(A,B,C,D) = P(A)P(B A)P(C A,B)P(D A,B,C). P(X1,X2,X3,.,Xn) = P(X1)P(X2 X1)P(X3 X1,X2).P(Xn X1,.,Xn-1). 所以为了简化这个问题,我们引入马尔科夫假设 Markov Assumption 一个词的出现仅仅依赖于它前面出现的一个或者有限的几个词。 42/746 = 0.25. 见 Anagram:...
mars.run
理解PHP内存管理 | Mars' blog
http://mars.run/2016/01/Understanding-PHP-memory-management
另外,应用程序向系统申请内存,释放内存的时候会引发系统调用,系统调用提供用户程序与操作系统之间的接口,他会触发0x80 号中断 int 0x80 将CPU从用户态切换到内核态,执行完毕再切换回用户态。 介于以上原因,PHP实现了自己的内存管理器 ZendMM , 所以在编写PHP脚本的时候我们不需要对内存进行管理。 The goal of the new memory manager (available since PHP 5.2) is to reduce memory. Allocation overhead and speedup memory management. PHP的内存管理是分层的,它分为三层 存储层 storage 、堆层 heap 和接口层 emalloc/efree。 存储层通过 malloc()、mmap() 等函数向系统真正的申请内存,并通过 free() 函数释放所申请的内存。 在存储层共有4种内存分配方案: malloc,win32,mmap anon,mmap zero。 The Zend MM can be. ZEND MM SEG SIZE environment.
mars.run
Mars' blog
http://mars.run/page/2
谈谈对WordPress 3.8.2 cookie伪造漏洞以及Python使用urllib2出现30x跳转的问题. WordPress 3.8.2 cookie伪造漏洞再分析 http:/ drops.wooyun.org/papers/1409. The dangers of type coercion and remote management plugins. Http:/ joncave.co.uk/2013/03/dangers-of-type-coercion-and-remote-management/. WordPress 3.8.2修复的一个重要漏洞是cookie伪造漏洞 (CVE-2014-0166). Format String Exploitation 格式化字符漏洞. 注意 因为NX, ASLR以及内核的一些安全措施,下面的Exploit在现在操作系统下无法重现。 格式化字符串包含ASCIIZ字符串和格式化参数,如 printf( my name is.%s n , saif ); 它可以告诉程序以什么样的格式输出字符串。 Easy RM to MP3 Converter 下载.
mars.run
分类 | Mars' blog
http://mars.run/categories
主题 - NexT.Muse.
mars.run
分类: 心有所想 | Mars' blog
http://mars.run/categories/心有所想
The arts of origami. 主题 - NexT.Muse.
mars.run
分类: 编程开发 | Mars' blog
http://mars.run/categories/编程开发
Python2.7 Pyqt4 实现12306登陆以及自动抢票. 主题 - NexT.Muse.