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
分类 | |
SQL注入的攻击方式根据应用程序处理数据库返回内容的不同,可以分为可显注入、报错注入和盲注。 | |
可显注入 | |
攻击者可以直接在当前界面内容中获取想要获得的内容。 | |
报错注入 | |
数据库查询返回结果并没有在页面中显示,但是应用程序将数据库报错信息打印到了页面中,所以攻击者可以构造数据库报错语句,从报错信息中获取想要获得的内容。 | |
盲注 |
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
#!/usr/bin/python3 | |
import socket | |
ip = input('输入要扫描的IP:') | |
#输入的端口值返回的是一个字符串,使用int()将返回的字符串转为整型。 | |
kaishi_prot = int(input('输入要扫描端口的起始位置:')) | |
jieshu_prot = int(input('输入要扫描端口的结束位置:')) | |
#使用for循环结合range()函数生成一个列表对输入的扫描端口进行遍历扫描,并做异常处理。 |
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
列表:list [] | |
>>>s = [213,2312,'aaa'] | |
>>>s | |
[213,2312,'aaa'] | |
>>>type(s) | |
list | |
遍历列表: 同字符串操作相同。 |
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、turtle (自带库)--- 海龟绘图,可以下达指令画各种图(可在python手册内找到这个库的用法)。 | |
2、编程正确的开始,是在得到需求后,把事情考虑清楚要遇到的问题点,提前设计一下思路,再去写,这才是正确的编程思想。 | |
把整个大局规划成一个大包,先去完成一些比较好完成的小任务包,写完善了之后,再一个个拿来集成调用,会比上来就嗖嗖的所有东西写进一个包内几千行代码去想着实现需求强很多倍!谨记。。。 | |
3、变量(标签,把内存中的数据,定一个名字做为标签) | |
4、输入-处理-输出 | |
input():获取用户的变量,是一个未知可变的变量,然后保存这个变量 |
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
switch(四维持): | |
switch 用于编写多分支结构的程序,类似于 (if... elif... else)语句。 | |
switch 语句表达的分支结构比(if... elif... else)语句表达的更清晰,代码的可读性更高。 | |
但是python并没有直接提供switch 语句。 | |
python 可以通过字典实现switch语句的功能。 | |
实现方法分为两步。 | |
-首先,定义一个字典。 | |
-其次,调用字典的get()获取相应的表达式。 |
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
-递归函数 | |
os.walk() 函数 | |
笨办法 | |
################################## | |
1、遍历一个指定的目录wenjiancaozuo | |
path[帕斯]:路径 | |
append() 方法用于在列表末尾添加新的对象。 | |
 |
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
完整代码 | |
:打开文件的方式 | |
2、read(): 读取文件 | |
3、close():关闭文件 | |
4、write('要添加的内容'): 写入内容的参数 | |
#string:字符串 | |
文件对象方法: | |
1、readline(瑞德赖子): | |
FileObject(法乐偶不杰特): 文件对象 |
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 文件读写: |
NewerOlder