MCPcopy Create free account
hub / github.com/LMS57/TempleOfPwn / main

Function main

shellcode/shellcode.c:150–189  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

148}
149
150int main(){
151 char message[16] = ""; //This array will store the messages that are sent by the server
152 setup();
153 int difficulty;
154 printf("How difficult should this be?\n");
155 scanf("%d",&difficulty);
156 printf("%s\n", difficulty?difficulty>1?difficulty==1337?"Only You know what you are capable of":"Execve, Execveat, open, and openat are all blocked":"Execve Will be Blocked":"NO Seccomp Filter applied");
157
158//Now we start handling the connections.
159while(conn = accept(fd, (struct sockaddr *)NULL, NULL)) {
160 int pid;
161 if((pid = fork()) == 0) {
162 switch(difficulty){
163 default:
164 break;
165 case 1:
166 easy_filter();
167
168 break;
169 case 2:
170 difficult_filter();
171 break;
172 case 1337:
173 read(conn,message,250);
174 good_luck_filter();
175
176
177
178 }
179 printf("Connected\n");
180 if(difficulty != 1337)
181 while (read(conn, message, 56)>0) {
182 if(!strncmp("done", message,4))
183 return 0;
184 printf("Message Received: %s\n", message);
185 }
186 }
187}
188
189}

Callers

nothing calls this directly

Calls 4

setupFunction · 0.85
easy_filterFunction · 0.85
difficult_filterFunction · 0.85
good_luck_filterFunction · 0.85

Tested by

no test coverage detected