一九年五月总结


学习博客

1.漏洞挖掘大佬blackwolf博客

2.mntn0x的博客

Tomcat密码爆破

使用Metasploit实现Tomcat密码爆破

1.启动

msfconsole

2.搜索模块

search tomcat

3.调用模块

use auxiliary/scanner/http/tomcat_mgr_login

4.配置

1
2
3
4
5
6
配置RHOST,RHOST是目标主机IP
> set RHOST X.X.X.X
配置RPORT,RPORT是目标主机端口
> set RPORT XXXX

更改字典:可以通过设定PASS_FILE和USER_FILE配置项的路径进行更改(通常情况默认就行了)

5.运行

run

参考文章

1.Tomcat密码爆破小记

next主题倒腾

官方文档:点击进入

报错解决:

ENOENT: no such file or directory, open ‘D:\ myBlog\ themes\ next\ layout\ scripts\ schemes. swig’

原因是配置文件 _config.yml有问题,我这是友情链接后没空格的原因

参考文章

工具

图片在线设计

感谢专业大神orangice的指导

在线图片设计fotor:地址

visual studio 2012 安装

推荐一个高速下载还提供密钥的站点:点击进入

C-Free 5下载

下载网址:点击进入

注册码:

用户名:tianfang
邮箱:`quart@163.com注册码:2NnUqd3shO2agta0xNjcusfK1LXO`

参考文章

注意事项

C-Free 5安装好后记得改文件夹名把中间的空格去掉,否则会报以下错误

[Error] g++.exe: 5\mingw\lib\: No such file or directory

[Error] g++.exe: 5\mingw\mingw32\lib\: No such file or directory

[Error] g++.exe: 5\mingw\bin\: No such file or directory

[Error] g++.exe: 5\mingw\mingw32\bin\: No such file or directory

参考文章

C程序

线性表综合题

1.按照输入的顺序建立顺序表
2.对顺序表进行排序(直接插入、冒泡、选择、快速、合并)
3.按照由大到小的顺序建立一个单链表
4.链表逆置
5.将顺序表和链表合并成一个有序表。
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
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
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
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
261
262
263
264
#include <stdio.h>
#include <stdlib.h>
#include <malloc.h>

typedef struct { /*链表节点*/
int data;
struct Node *next;
}Node;

int array[100]; /*线性表用数组存储*/
int count; /*顺序表计数器*/

int createList (int arr[]) { /*建立顺序表*/
int i;
arr[0] = 0;
printf("请输入顺序表长度:");
scanf("%d", &count);
for (i = 1; i <= count; i++) {
printf("请输入顺序表第%d节点数据:",i);
scanf("%d", &arr[i]);
}
return 1;
}

int printList(int arr[]) { /*打印顺序表*/
int i;
for (i = 1; i <= count; i++) { /*打印排序结果*/
printf("%d ", arr[i]);
}
printf("\n");
return 1;
}

int sort(int arr[]) { /*排序列表*/
int M = 1, N = count, i, ch;/*建立快速,归并排序所需数组*/
int r1[N + 1], r2[N + 1];
for (i = 1; i <= N; i++) {
r1[i - 1] = arr[i];
}
//system("CLS");
printf("1.直接插入排序\n");
printf("2.冒泡排序\n");
printf("3.直接选择排序\n");
printf("4.快速排序\n");
printf("5.归并排序\n");
printf("请输入你的选择:");
scanf("%d", &ch);
switch(ch) {
case 1:insertSort(arr);break;
case 2:bubbleSort(arr);break;
case 3:selectionSort(arr);break;
case 4:quickSort(arr, M, N);break;
case 5:mergeSort(r1, r2, 0, N - 1);
for (i = 1; i <= N; i++) {
arr[i] = r1[i - 1];
}break;
}
}

int insertSort(int arr[]) { /*直接插入排序*/
int i, j;
for (i = 2; i <= count; i++) {
arr[0] = arr[i]; /*array[0]作为监督哨*/
j = i - 1;
while (arr[0] < arr[j]) { /*从后向前找到第一个关键字不小于arr[0]的记录*/
arr[j + 1] = arr[j];
j--;
}
arr[j + 1] = arr[0];
}
return 1;
}

int bubbleSort(int arr[]) { /*冒泡排序*/
int i, j, temp;
for (i = 1; i <= count; i++) {
for (j = 1; j <= count - i; j++) {
if (arr[j] > arr[j + 1]) {
temp = arr[j + 1];
arr[j + 1] = arr[j];
arr[j] = temp;
}
}
}
return 1;
}

int selectionSort(int arr[]) { /*直接选择排序*/
int i, j, temp, m;
for (i = 1; i <= count; i++) {
m = i;
for (j = i + 1; j <= count; j++) { /*找到最小的数字*/
if(arr[j] < arr[m]) {
m = j;
}
if (i != m) {
temp = arr[i];
arr[i] = arr[m];
arr[m] = temp;
}
}
}
}

int quickSort(int arr[], int M, int N) { /*快速排序*/
int i, j, x;
i = M, j = N;
x = arr[i];
do {
while ((arr[j] >= x) && (j > i)) {
j--;
}
if (i < j) {
arr[i] = arr[j];
i++;
while (arr[j] <= x && (i < j)) {
i++;
}
if (i < j) {
arr[j] = arr[i];
j--;
}
}
}while (i != j);
arr[i] = x;
i++;
j--;
if (M < j) {
quickSort(arr, M ,j);
}
if (i < N) {
quickSort(arr, i, N);
}
}

int merge(int r[], int r2[], int S, int M, int N) {
int i,k,j;
i = S, k = S, j = M + 1; /*从S开始*/
while ((i != M + 1) && (j != N + 1)) { /*当两个表都有内容未排完时*/
if (r[i] > r[j]) {
r2[k] = r[j];
j++;
} else {
r2[k] = r [i];
i++;
}
k++;
}
while (i != M + 1) { /*将剩下的全部放入*/
r2[k++] = r[i++];
}
while (j != N + 1) {
r2[k++] = r[j++];
}
for (i = S; i <= N; i++) {
r[i] = r2[i];
}
}

int mergeSort(int r[], int r2[], int S, int N) { /*归并排序*/
int M;
if (S < N) {
M = (S + N)/2;
mergeSort(r, r2, S, M);
mergeSort(r, r2, M + 1, N);
merge(r, r2, S, M, N);
}
}

int createNode(Node *L) { /*建立链表*/
Node *q;
int m, n, i; /*节点个数为m,节点数据为n*/
printf("请输入链表节点个数:");
scanf("%d", &m);
for (i = 0; i < m; i++) {
q = (Node*)malloc(sizeof(Node));
printf("请输入第%d节点数据:",i+1);
scanf("%d", &n);
q -> data = n;
L -> next = q;
L = q;
}
L -> next = NULL; /*尾标识为NULL*/
printf("\n");
return 1;
}

int sortNode(Node *L) { /*对链表节点进行排序,仅交换数据*/
int i, j, tempData;
Node *head, *point; /*辅助指针point帮助指向head的下一个节点*/
head = L;
head = head -> next;
int length = 0;
while (head -> next != NULL) { /*计算链表长度*/
head = head -> next;
length++;
}
for (i = 0; i < length; i++) { /*冒泡排序*/
head = L; /*将head复位*/
head = head -> next;
for(j = i; j < length; j++) {
point = head -> next;
if(head -> data >= point -> data) {
tempData = head -> data;
head -> data = point -> data;
point -> data = tempData;
}
head = head -> next;
}
}
head = L; /*指针回到开头*/
head = head -> next;
while (head != NULL) { /*将排序后的线性表显示出来*/
printf("%d ", head -> data);
head = head -> next;
}
printf("\n");
return 1;
}
int combine(int arr[], Node *L2) { /*结合两张表*/
int a[100];
int i, j, temp;
for (i = 1; i <= count; i++) {
a[i - 1] = arr[i];
}

while (L2 != NULL) {
a[count] = L2 -> data;
count++;
L2=L2->next;
}
for (i = 0; i <= count; i++) {
for (j = 0; j <= count - i; j++) {
if (a[j] > a[j + 1]) {
temp = a[j + 1];
a[j + 1] = a[j];
a[j] = temp;
}
}
}
for (i = 0; i <count-1; i++) {
printf("%d ", a[i]);
}
}

int main() {
int choose;
Node *L2;
L2 = (Node*)malloc(sizeof(Node));
while(1) {
printf("1.建立顺序表\n");
createList(array);printList(array);
printf("2.顺序表排序\n");
sort(array);printList(array);
printf("3.建立链表\n");
createNode(L2);
printf("4.逆置链表\n");
sortNode(L2);
printf("5.合并顺序表与链表\n");
combine(array,L2);
}
printf("\n");

}

飞机票预订系统

可在同一文件夹下创建Customer.txt文件存储信息。不过用来读取信息不能实现。

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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
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
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
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
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <malloc.h>

typedef struct customer { /*乘客结构体*/
char name[20];
int id;
int seat;
char sex[10];
char goal[10];
char type[1];
}Customer;

typedef struct list { /*将乘客规划为数组*/
Customer *array[25]; /*最大存放25人*/
int length;
}sqList;

typedef struct node { /*将飞机规划为链表*/
int number;
int input;
struct node *next;
}Node;

int temp1 = 0; /*航班计数器*/
int temp2 = 0; /*人数计数器*/

int createPlane(Node *L) { /*创建飞机链表*/
int x, y;
do {
printf("请输入飞机序号(序号为0时输入完毕):");
scanf("%d", &x);
if (x != 0) {
printf("请输入登机口:");
scanf("%d", &y);
Node *q; /*定义新节点*/
q = (Node*)malloc(sizeof(Node));
temp1++;
q -> number = x;
q -> input = y;
L -> next = q;
L = q;
}
}while(x != 0); /*飞机序号为0时结束*/
L -> next = NULL;
return 1;
}

int deleteNode(Node *L) { /*删除飞机节点*/
int num;
Node *q;
q = L;
Node *r = q;
q = q -> next;
printf("请输入要删除的飞机序号(警告该飞机下的乘客全部删除!):");
scanf("%d", &num);
while(q != NULL) {
if (q -> number == num) {
r -> next = q -> next;
free(q);
temp1--;
return 1;
} else {
q = q -> next;
r = r -> next;
}
}
printf("未找到该飞机!");
return 0;
}

int initSqList (sqList *S) { /*容器初始化*/
S -> length = 0;
return 1;
}

int createSqList (Node *L, sqList *S) { /*构造乘客容器*/
int x, y, i;
Node *q;
q = L;
q = q -> next;
printf("请输入乘客所在飞机号:");
scanf("%d", &x);
while (q != NULL) {
if (q -> number == x) {
printf("该飞机共有几名乘客:");
scanf("%d", &y);
for (i = temp2 + 1; i <= y; i++) {
S -> array[i] = createCustomer(i);
S -> length ++;
temp2++;
}
return S;
} else {
q = q -> next;
}
}
printf("未找到该飞机序号!");
return 0;
}

int createCustomer(int i) { /*创建新乘客*/
Customer *q;
q = (Customer*)malloc(sizeof(Customer));
printf("请输入乘客身份识别号:");
scanf("%d", &(q -> id));
printf("请输入乘客姓名:");
scanf("%s", &(q -> name));
printf("请输入座位号:");
scanf("%d", &(q -> seat));
printf("请输入乘客性别:");
scanf("%s", &(q-> sex));
printf("请输入目的地:");
scanf("%s", &(q -> goal));
printf("请输入舱位种类: ");
scanf("%s", &(q -> type));
return q;
}

int searchPlane(Node *L) { /*搜寻航班*/
int x, y;
Node *q;
q = L;
printf("请输入航班序号:");
scanf("%d", &x);
while (q != NULL) {
if (x == q -> number) {
printf("找到该航班!\n");
printf("航班序号:%d, 登机口:%d\n", q -> number, q -> input);
return 1;
} else {
q = q -> next;
}
}
printf("未找到该航班\n");
return 0;
}

int searchCustomer(Node *L, sqList *S) { /*搜寻乘客*/
int x, y, i;
char s;
Node *q;
q = L;
q = q -> next;
printf("请输入乘客所在飞机号:"); /*检测飞机是否存在*/
scanf("%d", &x);
while(q != NULL) {
if (q -> number == x) {
break;
} else {
q = q -> next;
}
}
if (q == NULL) {
printf("未找到该飞机\n");
return 0;
}
printf("请输入乘客身份识别号:");
scanf("%d", &y);
for (i = 1; i <= temp2; i++) {
if (y == S -> array[i] -> id) {
printf("找到乘客,打印出数据:\n");
printf("乘客姓名:%s\n", S -> array[i] -> name);
printf("乘客身份识别号:%d\n", S -> array[i] -> id);
printf("乘客座位号:%d\n", S -> array[i] -> seat);
printf("乘客目的地: %s\n", S -> array[i] -> goal);
printf("舱位种类:%s\n", S -> array[i] -> type);
return 1;
}
}
printf("未找到该乘客\n");
return 0;
}

int reserve(Node *L, sqList *S) {
int i;
L = L -> next;
FILE *fp = NULL;
if ((fp = fopen("Customer.txt", "w")) == NULL) {
printf("不能打开文件!");
return 0;
}
fprintf(fp, "%d\n", temp1);
fprintf(fp, "%d\n", temp2);
while (L != NULL) { /*保存飞机节点*/
fprintf(fp,"%d %d\n", L -> number, L -> input);
L = L -> next;
}
for (i = 1; i <= temp2; i++) { /*保存乘客节点*/
fprintf(fp, "%s %d %d %s %s %s\n", S -> array[i] -> name, S -> array[i] -> id, S -> array[i] -> seat,
S -> array[i] -> sex, S -> array[i] -> goal, S -> array[i] -> type);
}
fprintf(fp, "%d\n", S -> length);
fclose(fp);
printf("成功完成");
return 1;
}

int read(Node *L, sqList*S) {
FILE *fp = NULL;
int i = 0;
Node *q;
if ((fp = fopen("Customer.txt", "r")) == NULL) {
printf("不能打开文件!");
return 0;
}
fscanf(fp, "%d\n", &temp1);
fscanf(fp, "%d\n", &temp2);
for (i = 0; i < temp1; i++) { /*读取飞机数据*/
q = (Node*)malloc(sizeof(Node));
fscanf(fp, "%d %d\n", &q -> number, &q -> input);
L -> next = q;
L = q;
}
for (i = 1; i <= temp2; i++); {
Customer *temp;
temp = (Customer*)malloc(sizeof(Customer));
fscanf(fp,"%s %d %d %s %s %s\n", &temp -> name, &temp -> id, &temp -> seat, &temp -> sex, &temp -> goal,
&temp -> type);
S -> array[i] = temp;
}
fscanf(fp ,"%d\n", &S -> length);
fclose(fp);
printf("成功完成");
return 1;
}

int main() {
Node *L;
sqList *S;
L = (Node*)malloc(sizeof(Node));
S = (sqList*)malloc(sizeof(sqList));
initSqList(&S);
int ch;
while (1) {
printf(" --------飞机票预订系统--------\n");
printf(" 1.创建航班\n");
printf(" 2.创建乘客\n");
printf(" 3.查询航班信息\n");
printf(" 4.查询乘客信息\n");
printf(" 5.保存信息\n");
printf(" 6.读取信息\n");
printf(" 7.删除飞机信息\n");
printf(" 0.退出系统\n");
printf("请输入您的选择:");
scanf("%d", &ch);
switch (ch) {
case 1:createPlane(&L);break;
case 2:S = createSqList(&L, &S);break;
case 3:searchPlane(&L);break;
case 4:searchCustomer(&L, S);break;
case 5:reserve(&L, S);break;
case 6:read(&L, &S);break;
case 7:deleteNode(&L);break;
case 0:exit(0);
}
}
}

源码参考

-------------The End-------------