-
Notifications
You must be signed in to change notification settings - Fork 37
/
hide-.c
135 lines (117 loc) · 3.29 KB
/
hide-.c
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
/*
* hide.c - USE LIGHTAIDRA AT YOUR OWN RISK!
*
* Lightaidra - IRC-based mass router scanner/exploiter.
* Copyright (C) Federico Fazzi, <[email protected]>.
*
* example: ./hide -encode "127.0.0.1:6667"
* ./hide -decode ">@.C<C<C>U,,,." <- copy into config.h
* CHANGE THE POSITION OF ENCODES[] VALUES IF YOU WANT YOUR PRIVATE ENCODING.
*/
#include <stdio.h>
#include <string.h>
char *servers[] = { // List the servers in that format, always end in (void*)0
">-:y-@y@<<y>.;",
">@.y<y<y>",
">@.y<y<y@",
(void*)0
};
char *server;
int numservers=3;
char s_copy[512];
int encirc =1;
/*
char encodes[] = {
'<', '>', '@', '_', ';', ':', ',', '.', '-', '+', '*', '^', '?', '=', ')', '(',
'|', 's', 'q', '&', 'o', '$', '3', '"', '7', 'K', 'k', 'C', 'x', 'F', 'v', 'u',
't', 'A', 'r', 'B', 'p', '%', 'n', 'm', 'l', 'i', 'h', 'g', 'f', 'e', '6', 'c',
'b', 'a', '~', '1', '2', 'D', '4', '5', 'd', '!', '8', '9', 'z', 'U', 'y', 'w'
};
char decodes[] = {
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f',
'g', 'h', 'i', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'z', 'y',
'w', 'k', 'x', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'L', 'M', 'N', 'O',
'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'Z', 'Y', 'W', 'K', 'X', '|', ':', '.', ' '
};
*/
char encodes[] = {
'x', 'm', '@', '_', ';', 'w', ',', 'B', '-', 'Z', '*', 'j', '?', 'n', 'v', 'E',
'|', 's', 'q', '1', 'o', '$', '3', '"', '7', 'z', 'K', 'C', '<', 'F', ')', 'u',
't', 'A', 'r', '.', 'p', '%', '=', '>', '4', 'i', 'h', 'g', 'f', 'e', '6', 'c',
'b', 'a', '~', '&', '5', 'D', 'k', '2', 'd', '!', '8', '+', '9', 'U', 'y', ':'
};
char decodes[] = {
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f',
'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v',
'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '.', ' '
};
char encoded[512], decoded[512];
void encode(char *str)
{
int x = 0, i = 0, c;
memset(encoded, 0, sizeof(encoded));
while(x < strlen(str))
{
for(c = 0; c <= sizeof(decodes); c++)
{
if(str[x] == decodes[c])
{
encoded[i] = encodes[c];
i++;
}
}
x++;
}
encoded[i] = '\0';
return;
}
void decode(char *str)
{
int x = 0, i = 0, c;
memset(decoded, 0, sizeof(decoded));
while(x < strlen(str))
{
for(c = 0; c <= sizeof(encodes); c++)
{
if(str[x] == encodes[c])
{
decoded[i] = decodes[c];
i++;
}
}
x++;
}
decoded[i] = '\0';
return;
}
int main(int argc, char *argv[])
{
if(argv[1] == 0 || argv[2] == 0)
{
printf("./lighthide [-encode|-decode] [string]\n");
return(1);
}
else if(!strncmp(argv[1], "-encode", 7))
{
encode(argv[2]);
decode(encoded);
printf("encoded[%s]:\n%s\n", decoded, encoded);
}
else if(!strncmp(argv[1], "-decode", 7))
{
decode(argv[2]);
encode(decoded);
printf("decoded[%s]:\n%s\n", argv[2], decoded);
}
else if(!strncmp(argv[1], "-test", 7))
{
server=servers[rand()%numservers];
if (encirc != 0){
decode(server);
encode(decoded);
strncpy(s_copy, decoded, sizeof(s_copy));
printf("decoded[%s]:\n%s\n", argv[2], s_copy);}
}
return(0);
}