Myluzh Blog

Strive to become a dream architect.

整理了一些IP地址查询API接口

2020-5-2 myluzh NOTE

0x01国内 ###搜狐接口 http://pv.sohu.com/cityjson    #默认GBK http://pv.sohu.com/cityjson?ie=utf-8    #可设置编码 ###太平洋接口 http://whois.pconline.com.cn/ipJson.jsp?ip=xxx.xxx.xxx.xxx&json=true 0x02国外 ###ip-api http://ip-api.com/json/    # 国际化英文显示 http://ip-api.com/json/?lang=zh-CN  # 中文显示 http://ip-api.com/json/xxx.xxx.xxx.xxx?lang=zh-CN  # 查询某个ip的信息 ###hostip http://api.hostip.info/get_html.php?ip=xxx.xxx.xxx.xxx

阅读全文>>

标签: IP接口

评论(0) (609)

Swaks伪造邮件发信人

2020-4-20 myluzh SECURE

Swaks是由John Jetmore编写和维护的一种功能强大,灵活,可脚本化,面向事务的SMTP测试工具。可向任意目标发送任意内容的邮件。 发布网站http://www.jetmore.org/john/code/swaks/ 到此网站查看更新日志,帮助,并找到最新版本的下载链接。 注意:脚本需要在Linux下运行 一些参数: -t –to 目标地址 -t test@test.com -f –from 来源地址 (发件人) -f "text<text@text.com>" -h –helo 邮件头(不明) –timeout 设置超时,单位是秒,默认30s –protocol 设定协议(未测试) -d –data 设定邮件内容,\n换行(可从其他邮件获得内容原文复制粘贴到这里) 一些常用内容: To:收件人\n From:发件人\n Subject:主题\n Date:日期\n Subject:标题\n ...

阅读全文>>

标签: Swaks 伪造 邮件

评论(0) (1018)

python使用requests库实现HTTP请求

2020-4-15 myluzh Python

requests是原生的http库,比urllib3更容易使用,语法格式如下: requests.request.method(url,**kwargs) 参数 说明 methodw 接收string。表示请求类型,例如GET,无默认值 url 接收string。表示请求的URL,无默认值 **kwargs 接收dict或其他python类型数据。根据具体需要添加的参数 实例: import requests url = 'http://www.xxx.com/index.html' head = {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like G...

阅读全文>>

标签: python requests

评论(0) (858)

python使用urllib3库实现HTTP请求

2020-4-15 myluzh Python

使用urllib3库生成一个完整的http请求,请求应该包含请求方式、请求连接、请求头、超时时间和重试次数。通过request方法可以创建一个请求,该方法返回http响应对象,语法如下: urllib3.request(method,url,headers,timeout) 参数 说明 method 接收string。表示请求类型,例如GET,无默认值 url 接收string。表示请求的URL,无默认值 headers 接收dict。请求头,默认为None data 接收dict。POST提交的数据 timeout 接收float。设置请求超时时间 ...

阅读全文>>

标签: python urllib3

评论(0) (785)

python3对字符串进行md5加密

2020-4-11 myluzh Python

# 由于MD5模块在python3中被移除 # 在python3中使用hashlib模块进行md5操作 import hashlib # 输入待加密字符串 str = input('Please enter the string to be MD5 encrypted:\n') # 创建md5对象 m = hashlib.md5() # Tips # 此处必须encode # 若写法为m.update(str) 报错为: Unicode-objects must be encoded before hashing # 因为python3里默认的str是unicode # 或者 b = bytes(str, encoding='utf-8'),作用相同,都是encode为bytes b = str.encode(encoding='utf-8') m.update(b) str_md5 = m.hexdigest() #输出md5加密后的值 print('After MD5 encryption:\n' + str_md5)

阅读全文>>

标签: python md5

评论(0) (573)

python更换国内的pip源

2020-4-8 myluzh Python

0x01 国内pip源地址 阿里云 http://mirrors.aliyun.com/pypi/simple/ 豆瓣 http://pypi.douban.com/simple/ 清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/ 中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/ 0x02 临时使用pip源 在使用pip时候,后面加上参数-i 镜像地址,例如: pip3 install pygame -i http://mirrors.aliyun.com/pypi/simple/ 0x03 永久更换pip源 1.Linux下,修改 ~/.pip/pip.conf 没有就创建一个文件夹及文件。文件夹要加“.”,表示是隐藏文件夹。内容如下: [global] index-url = https://pypi.tuna.tsinghua.edu.cn/simple [install] trusted-host = https://pypi.tuna.tsinghua.edu.cn 2.window...

阅读全文>>

标签: python pip

评论(0) (689)