实习Day25

2019.7.30

实习第二十五天

早上继续调Websocket脚本,取数据时一直报Cookie无效,之前的认证方式应该是不能使用的

学习了Zoho ManageEngine OpManager OF SQL Injection(CVE-2018-9088)

新任务: 新安排了两个CVE的签名开发,参考telues

今天完成了一个(Atlassian JIRA Template Injection Code Execution)

开会测评Snort规则

晚上发现认证的Cookie居然是永久有效的…这应该是服务器BUG吧…随便取一个浏览器里的Cookie居然能取到数据了…

由于不清楚用户对于该路径下两个文件的具体需求,以下给出几种可能关注的情况及解决办法: ### 文件是否存在 可以使用 Python 代码来检查文件是否存在: ```python import os path = r'C:\Users\wuhuilan\Desktop\25\五邑大学22电子信息实习\上课笔记\day5\project' # 假设两个文件名分别为 file1.txt 和 file2.txt file1 = os.path.join(path, 'file1.txt') file2 = os.path.join(path, 'file2.txt') if os.path.exists(file1): print(f"{file1} 存在") else: print(f"{file1} 不存在") if os.path.exists(file2): print(f"{file2} 存在") else: print(f"{file2} 不存在") ``` ### 查看文件属性 可以使用 Python 查看文件的大小、创建时间等属性: ```python import os import time path = r'C:\Users\wuhuilan\Desktop\25\五邑大学22电子信息实习\上课笔记\day5\project' file1 = os.path.join(path, 'file1.txt') file2 = os.path.join(path, 'file2.txt') if os.path.exists(file1): file_stats = os.stat(file1) print(f"{file1} 文件大小: {file_stats.st_size} 字节") print(f"{file1} 创建时间: {time.ctime(file_stats.st_ctime)}") if os.path.exists(file2): file_stats = os.stat(file2) print(f"{file2} 文件大小: {file_stats.st_size} 字节") print(f"{file2} 创建时间: {time.ctime(file_stats.st_ctime)}") ``` ### 读取文件内容 若两个文件是文本文件,可以使用 Python 读取其内容: ```python path = r'C:\Users\wuhuilan\Desktop\25\五邑大学22电子信息实习\上课笔记\day5\project' file1 = os.path.join(path, 'file1.txt') file2 = os.path.join(path, 'file2.txt') if os.path.exists(file1): with open(file1, 'r', encoding='utf-8') as f: content = f.read() print(f"{file1} 内容:\n{content}") if os.path.exists(file2): with open(file2, 'r', encoding='utf-8') as f: content = f.read() print(f"{file2} 内容:\n{content}") ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值