This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
我们在一些重大的安全事件发生后,经常会在相关新闻或文档中看到一些相关的安全术语,比如:VUL、CVE、Exp、PoC 等。今天我们就来对这些常用术语的具体含义和用途做一个基本的了解,以便于以后不会在傻傻分不清这些术语的含义。 | |
什么是 VUL | |
VUL,Vulnerability 的缩写,泛指漏洞。 | |
什么是 0day 漏洞 和 0day 攻击 | |
0day 漏洞,又称零日漏洞 「zero-day」。是已经被发现 (有可能未被公开),而官方还没有相关补丁的漏洞。通俗地讲就是除了漏洞发现者,没有其他的人知道这个漏洞的存在,并且可以有效地加以利用,发起的攻击往往具有很大的突发性与破坏性。 | |
零日攻击或零时差攻击「zero-dayattack」则是指利用这种漏洞进行的攻击,提供该漏洞细节或者利用程序的人通常是该漏洞的发现者。零日漏洞的利用程序对网络安全具有巨大威胁,因此零日漏洞不但是黑客的最爱,掌握多少零日漏洞也成为评价黑客技术水平的一个重要参数。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
迭代遍历、 变量序列 | |
偏移指数(索引): | |
 | |
1、 | |
 | |
函数就是完成特定功能的一个语句组,这组语句可以做为一个单位使用,并且给它取一个名字。 | |
我们可以通过函数名在程序的不通地方多次执行和使用(这通常叫做函数调用) | |
自定义函数(自己编写的) | |
预定义函数(python系统自带的函数,也可以是其它程序员写的一些函数,我们都可以直接拿来使用) | |
使用函数可以降低编程的难度,代码重复用。。。 | |
############################################################ | |
函数的定义和调用: | |
语法: | |
def 函数名 (参数列表): # 可以没有参数 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
局部变量和全局变量: | |
python中的任何变量都有其特定的作用域; | |
1、只能在函数内部使用,这些只能在程序的特定部分使用的变量我们称之为局部变量; | |
2、在文件顶部定义的变量可以供该文件中的任何函数调用,这些可以为整个程序所使用的变量称为全局变量。 | |
 | |
函数返回值: | |
函数被调用后会返回一个指定的值: | |
函数调用后默认返回None: | |
return(语句) 返回值: | |
返回值可以是任意类型:(任何序列、元祖、列表、字典) | |
return执行后,函数终止 : | |
>>> def a(x,y): | |
... if x<y: #做一个判断当x小于y,返回值为1 | |
... return 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
案例:(多类型传值、传值冗余) | |
多类型传值: | |
1、向函数传元祖和字典 (传值的时候,*一个代表元祖,**两个代表字典) | |
2、处理多余实参 | |
############################################# | |
>>> print "%s : %s" % (12,23) # 一个%s 代表一个元素, 用%来传 | |
12 : 23 | |
print打印的值是最后赋给它的用("%s : %s" %)的形式传值,值也要用括号() 来定义。 | |
>>>t = 'name',"milo" #t 等于两个字符串 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
匿名函数: | |
lambda是快速定义单行的最小函数; | |
>>> x = lambda a,s:a*s #用lambda参数定义一个匿名函数x, 形参是a和s, 调用的时候取相乘的结果。 | |
>>> x(5,6) #实参 为 5和6 值为相乘 | |
30 | |
1、使用python写一些执行脚本时,使用lambda可以省去定义函数的过程,让代码更加精简。 | |
2、对于一些抽象的,不会别的地方在复用的函数,有时候给函数起个名字也是个难题,使用lambda不需要考虑命名的问题。 | |
3、使用lambda在某些时候让代码更容易理解。、 |