
security
文章平均质量分 62
guilanl
这个作者很懒,什么都没留下…
展开
-
openssl.exe 生成 signature
命令如下:openssl dgst -sha256 -out hello.sig -sign key.pri -keyform PEM hello.txt其中:hello.sig 就是 生成的signaturehello.txt 就是源文件注:private key 用来生成 signature原创 2015-05-11 11:30:04 · 704 阅读 · 0 评论 -
ROP攻击技术
原文地址:http://blog.youkuaiyun.com/linyt/article/details/48738757背景前面介绍了ret2libc和ret2plt,这两个攻击技术的相通点是函数参数是通过压栈来传递,这也是i386架构的调用约定。然而随着64位服务器的普及,以及后来越来越广泛,以致几乎所有服务器都升级到64位的硬件上。x86原创 2017-03-14 14:58:03 · 5038 阅读 · 1 评论 -
Ret2Libc 攻击技术
1. DEP 技术对stack overflow 的保护:Data Execution Prevention: 去掉 stack 上的执行权限,可以阻止一部分基于 stack 的攻击。 2. Ret2Libc 攻击原理 Return-to-library technique 简称“Ret2Lib”,这种技术可以绕过DEP的保护,其核心思想是把原创 2017-03-13 17:00:11 · 5733 阅读 · 0 评论 -
format string attack
下面的这两篇文章都讲得很好:https://www.exploit-db.com/docs/28476.pdfhttp://codearcana.com/posts/2013/05/02/introduction-to-format-string-exploits.html现将上文的第二篇文章摘录如下:How do format string转载 2017-03-30 11:26:10 · 2576 阅读 · 0 评论 -
intel-amt-vulnerability-- memcmp and strncmp function calls can be skipped due to incorrect buffer l
原文如下:https://www.embedi.com/news/what-you-need-know-about-intel-amt-vulnerability攻击原理如下:As the paper describes, the code checks user response as: if(strncmp(computed_respon原创 2017-05-15 16:08:30 · 745 阅读 · 0 评论 -
integer overflow to buffer overflow --- 例子
看下面的例子:unsigned int a ;unsigned int b;int *ptr = (int *)malloc(a+b);memcpy(ptr, buf, a);有可能 a+b 发生 integer overflow, 导致 ptr 申请到比较小的内存区域,memcpy 的时候发生溢出。原创 2017-05-16 10:47:46 · 1095 阅读 · 0 评论 -
发现一个安全牛人的博客, mark 一下
http://blog.youkuaiyun.com/ioio_jy?viewmode=contents原创 2017-05-16 11:05:46 · 852 阅读 · 0 评论 -
整型提升(integer promotion)
什么是integer promotion:Integer PromotionsInteger types smaller than int are promoted when an operation is performed on them. If all values of the original type can be represented as anin原创 2017-04-25 14:58:22 · 1612 阅读 · 0 评论 -
CWE --- Time-of-check Time-of-use (TOCTOU) 例子 和 mitigation
原文地址:https://cwe.mitre.org/data/definitions/367.htmlExample 1The following code checks a file, then updates its contents.(Bad Code)Example Languages: C and C++原创 2017-05-09 11:45:10 · 3528 阅读 · 0 评论 -
CWE -- Out-of-bounds Write 例子
原文地址:https://cwe.mitre.org/data/definitions/787.html1. 什么是 out-of-bound write Description SummaryThe software writes data past the end, or before the beginning, of the intended bu原创 2017-05-09 13:09:11 · 1575 阅读 · 0 评论 -
CWE --- NULL Pointer Dereference -- 例子
原文地址:https://cwe.mitre.org/data/definitions/476.htmlDescription SummaryA NULL pointer dereference occurs when the application dereferences a pointer that it expects to be valid,转载 2017-05-09 15:25:02 · 2662 阅读 · 0 评论 -
CWE -- memory or buffer overflow --- 例子
原文链接:https://cwe.mitre.org/data/definitions/119.htmlDescriptionDescription SummaryThe software performs operations on a memory buffer, but it can read from or write to a memory l转载 2017-05-09 16:15:47 · 865 阅读 · 0 评论 -
CWE -- 不要误用 sizeof (pointer) -- 例子
原文地址:https://cwe.mitre.org/data/definitions/467.htmlDescription SummaryThe code calls sizeof() on a malloced pointer type, which always returns the wordsize/8. This can produce a转载 2017-05-09 16:49:38 · 2538 阅读 · 0 评论 -
如何解决 a+b >c 和 a*b 和 a-b 的 integer overflow 问题
注: a 和 b 都是 int 型 的。To create a conforming program you need to test for overflowbefore generating said overflow. The method can be used with unsigned integers too// for addition#include原创 2017-05-10 11:18:31 · 916 阅读 · 0 评论 -
CWE -- Incorrect Calculation of Buffer Size
http://cwe.mitre.org/data/definitions/131.html#Demonstrative%20ExamplesDemonstrative ExamplesExample 1The following code allocates memory for a maximum number of widgets. It then g原创 2017-05-10 16:47:48 · 537 阅读 · 0 评论 -
cwe ---Improper Restriction of Excessive Authentication Attempts
http://cwe.mitre.org/data/definitions/307.html#Demonstrative%20ExamplesDescription SummaryThe software does not implement sufficient measures to prevent multiple failed authentication转载 2017-05-10 16:53:06 · 681 阅读 · 0 评论 -
copy_from_user 和 toctou
copy_from_user 是把数据从用户空间 copy 到 内核空间。 driver 先 把数据从用户空间copy 到内核空间,然后再进行 check. 因为如果数据在user 空间 check 之后再copy 到内核,check 后到copy 之间的时间,数据有可能会被改变。参见TOCTOU 问题。 所以把数据 copy 到 内核空间,内核空间不太容原创 2017-05-03 15:26:04 · 754 阅读 · 0 评论 -
secure boot 的知识
ARM TrustZone 使用这种boot方式。1. 什么是 secure boot?5.2.2. Secure bootA secure boot scheme adds cryptographic checks to each stage of the Secure world boot process. This process aims to原创 2017-05-03 12:58:16 · 7632 阅读 · 0 评论 -
线程安全 thread safe
什么是线程安全:The first class of approaches focuses on avoiding shared state, and includes:Re-entrancy Writing code in such a way that it can be partially executed by a thread, reexecuted by t原创 2017-04-20 15:54:07 · 922 阅读 · 0 评论 -
老阳推荐的博客
关于一些security basic concept, 先收藏:http://www.cubrid.org/blog/dev-platform/understanding-encryption-security-through-java-cryptography-architecture/原创 2015-12-15 13:18:59 · 642 阅读 · 0 评论 -
software security training 的一些总结
公司里牛人的security software培训, 去听了一下,很多没有听懂,security 不是三言两语就能完全搞明白的,必须花很大的力气啊。还是先把主要纲要记录一下,方便以后翻看。主要介绍了这几个方面的内容:1. memory corruption 包括stack overflow and heap overflow.2. integer w原创 2016-05-25 12:57:58 · 403 阅读 · 0 评论 -
栈溢出攻击
1. 什么是栈溢出攻击 向缓冲器填入过多的数据,超出边界,导致数据外溢。 同时利用缓冲器溢出改写数据、改变程序执行流程。 执行shellcode。 之所以会有缓冲区溢出的可能,主要是因为栈空间内保存了函数的返回地址。该地址保存了函数调用结束后后续执行的指令的位置,对于计算机安全来说,该信息是很敏感的。如果有人恶意修改了这个返回地址,并使该返回地址指向了原创 2016-07-12 11:03:16 · 7946 阅读 · 0 评论 -
android安全学习之1—什么是数字签名、数字证书
概对加解密机制进行了学习,以下是自己对一些概念的理解。加密:加密就是为了让别人看不懂,加密前的东东称为明文,加密后的为密文。例如我把写给susan的信进行了加密,明文是:12,经过加密后变成了:56,这就是加密。加密是结合加密算法和密钥完成的。密钥:就是密码嘛,微信密码啥的,一样的道理。加密算法:就是如何去加密,例如上面将12加密变成56,我的加密算转载 2016-08-16 16:16:08 · 1939 阅读 · 0 评论 -
Security -- Format string attack
DescriptionThe Format String exploit occurs when the submitted data of an input string is evaluated as a command by the application. In this way, the attacker could execute code, read the stack,原创 2016-12-09 10:18:22 · 834 阅读 · 0 评论 -
toctou race condition
说的比较好的文章在这里:http://www.cis.syr.edu/~wedu/Teaching/IntrCompSec/LectureNotes_New/Race_Condition.pdfTOCTOU: time of check - time of use攻击发生在 check 和 use 之间。具体的 countermeasure 在上面提到转载 2017-03-28 15:03:45 · 1870 阅读 · 1 评论 -
Linux 堆溢出 分析
1. Linux堆管理算法 Linux系统通过glibc程序库提供堆内存管理功 能,存在两种堆管理算法. glibc2.2.4及以下版本是使用Doug Lea的实现方法 tcmalloc . glibc2.2.5及以上版本采用了Wolfram Gloger的 ptmalloc/ptmalloc2代码。ptmalloc2代码是从 Doug Lea原创 2017-03-21 16:52:17 · 2242 阅读 · 0 评论 -
trust boundary violation
这个violation 形成的原因,就是mix use trusted and untrusted data in the same data structure. 14. Trust Boundary ViolationDescription: Web applications often mistakenly mix trusted and untrusted da原创 2017-03-29 14:01:42 · 8916 阅读 · 0 评论 -
栈溢出漏洞及栈溢出攻击
1. 栈溢出的原因栈溢出(stack-based buffer overflows)算是安全界常见的漏洞。一方面因为程序员的疏忽,使用了 strcpy、sprintf 等不安全的函数,增加了栈溢出漏洞的可能。另一方面,因为栈上保存了函数的返回地址等信息,因此如果攻击者能任意覆盖栈上的数据,通常情况下就意味着他能修改程序的执行流程,从而造成更大的破坏。这种攻击方法就是栈溢出攻击(stack原创 2017-03-13 16:38:14 · 12988 阅读 · 0 评论 -
什么是 shellcode
缓冲区溢出的攻击思路已经很清晰了:首次是找到对准EIP的位置,然后覆盖 EIP跳到注入的shellcode 里执行。前面例子只是简单展示了shellcode长什么样子,事实上shellcode是攻击的核心所在。漏洞触发后执行的操作完全由shellcode来决定,因此学会编写shellcode是黑客的基本功。下面从Wiki摘录这来的定义:In computer s转载 2017-03-14 16:07:09 · 5769 阅读 · 0 评论 -
stack canary 的认识
在前面的博客里面,已经介绍了 stack overflow 的攻击原理,其中也设计到了 GCC 编译器的 stack canary 技术,用于预防 stack overflow.现在再来详细了解一下stack canaries 的种类,已经他们的作用吧。如果能在运行时检测出 stack overflow 破坏,就有可能对函数栈进行保护。目前的堆栈保护实现大多使用基于 “Cana原创 2017-03-15 11:33:48 · 9226 阅读 · 0 评论 -
Heap Spray
Heap Spray 定义基本描述Heap Spray 并没有一个官方的正式定义,毕竟这是漏洞攻击技术的一部分。但是我们可以根据它的特点自己来简单总结一下。 Heap Spray 是在 shellcode 的前面加上大量的 slide code (滑板指令),组成一个注入代码段。然后向系统申请大量内存,并且反复用注入代码段来填充。这样就使得进程的地址空间被大量的注入代码所占据。然后结合其他转载 2017-04-17 15:13:35 · 1134 阅读 · 0 评论 -
UAF (use after free) 漏洞
Use After Free 如上代码所示,指针p1申请内存,打印其地址,值然后释放p1指针p2申请同样大小的内存,打印p2的地址,p1指针指向的值Gcc编译,运行结果如下: p1与p2地址相同,p1指针释放后,p2申请相同的大小的内存,操作系统会将之前给p1的地址分配给p2,修改p2的值,p1也被修改了。由此我们可以知道:1.在f原创 2017-03-22 11:25:53 · 4557 阅读 · 0 评论 -
ret2plt 介绍
转自:http://blog.youkuaiyun.com/linyt/article/details/47429823背景前面介绍ret2libc攻击技术,原理很简单,只需要将system函数的地址填充到eip的位置,然后再把”/bin/bash”地址填充到eip + 8的位置即可以实现攻击。很快安全专家提出了ASCII armoring保护机制。该方转载 2017-04-18 13:43:02 · 2949 阅读 · 0 评论 -
[转]简谈高通Trustzone的实现
从trust zone之我见知道,支持trustzone的芯片会跑在两个世界。普通世界、安全世界,对应高通这边是HLOS,QSEE。如下图:如下是HLOS与QSEE的软件架构图HLOS这两分为kernel层,user层。user层的通过qseecom提供的API起动trustzone那边的app。qseecom driver 除了提供API,还调用scm函数做世界切换。scm driver 那边接...转载 2018-06-06 15:59:11 · 2060 阅读 · 0 评论