会员
周边
众包
新闻
博问
闪存
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
WLinux的随笔
博客园
首页
新随笔
联系
订阅
管理
随笔 - 26
文章 - 0
评论 - 2
阅读 -
24044
上一页
1
2
3
下一页
2020年11月24日
利用Python指定DNS解析域名
摘要: 该内容用于使程序使用指定的DNS去解析特定的站点。 import dns Server='114.114.114.114' Port=53 dns_query=dns.message.make_query('www.baidu.com','a') respone=dns.query.udp(dns_
阅读全文
posted @ 2020-11-24 21:47 魔阳工
阅读(1437)
评论(0)
推荐(0)
2020年6月20日
python多进程-进程池模式退出异常解决办法
摘要: 在执行python脚本的多进程程序时,会随机性的触发程序执行完,无法主动退出的情况。尤其是当进程数足够大时,处理的数据量足够多时。出现退出异常的概率越大。下面的脚本用于解决退出异常问题。 import argparse import requests import getpass from mult
阅读全文
posted @ 2020-06-20 20:53 魔阳工
阅读(2575)
评论(0)
推荐(0)
2020年5月1日
Wireshark抓包确定下一跳
摘要: 使用抓包分析网络时,是无法直接看到具体的下一跳的,要想看到下一跳,需要结合此时抓包设备的arp缓存的mac地址去做分析。 先说一下数据流量到达网络层时,此时的流量转发依靠IP路由进行转发。由路由表来确定该数据包的下一跳地址。然后进入数据链路层,使用该下一跳的mac地址进行数据包的封装。从这里可以看出
阅读全文
posted @ 2020-05-01 10:02 魔阳工
阅读(1112)
评论(0)
推荐(0)
2020年4月26日
简单的扫描工具
摘要: import nmap import argparse def get_parameter(): parser=argparse.ArgumentParser(description='该脚本用于探查主机存活情况') parser.add_argument('-n',dest='networkPre
阅读全文
posted @ 2020-04-26 22:45 魔阳工
阅读(137)
评论(0)
推荐(0)
2020年4月25日
Python利用api接口查询IP地址归属地
摘要: import requests import argparse import json def get_parameter(): parser=argparse.ArgumentParser(description='该脚本用于查看IP的归属地') parser.add_argument('-a',
阅读全文
posted @ 2020-04-25 17:54 魔阳工
阅读(647)
评论(0)
推荐(0)
2020年3月31日
利用Python获取文件类型
摘要: 这里选择使用使用filetype获取文件的类型。 使用filetype之前,先用pip安装filetype。 #!/usr/bin/python3 import filetype import argparse import sys def get_parameter(): parser=argpa
阅读全文
posted @ 2020-03-31 23:01 魔阳工
阅读(3347)
评论(0)
推荐(0)
2019年11月4日
删除目录和文件
摘要: 删除空目录 删除目录及其子目录和内容
阅读全文
posted @ 2019-11-04 22:56 魔阳工
阅读(128)
评论(0)
推荐(0)
创建目录和空文件
摘要: import os import sys path = sys.argv[1] file = sys.argv[2] if not os.path.exists(path): os.makedirs(path) print("目录创建成功") else: print("该目录已经存在") os.chdir(path) print(os.getcwd()) newfil...
阅读全文
posted @ 2019-11-04 22:35 魔阳工
阅读(410)
评论(0)
推荐(0)
2019年11月3日
读取文件内容
摘要: 利用for循环按行读取文件 import sys input_file = sys.argv[1] fileread = open(input_file, 'r', encoding='UTF-8') line_number = 0 for a in fileread: line_number +=
阅读全文
posted @ 2019-11-03 20:01 魔阳工
阅读(133)
评论(0)
推荐(0)
2019年10月13日
sort方法
摘要: 作用:对列表进行排序 对列表进行排序,且不改变列表id
阅读全文
posted @ 2019-10-13 00:23 魔阳工
阅读(113)
评论(0)
推荐(0)
上一页
1
2
3
下一页
公告
昵称:
魔阳工
园龄:
5年8个月
粉丝:
0
关注:
2
<
2025年6月
>
日
一
二
三
四
五
六
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
1
2
3
4
5
6
7
8
9
10
11
12
点击右上角即可分享