nerdexam
EC-Council

312-92 · Question #59

312-92 Question #59: Real Exam Question with Answer & Explanation

Sign in or unlock 312-92 to reveal the answer and full explanation for question #59. The question stem and answer options stay visible for context.

Question

Devon is an applications developer that just got back from a conference on how to correctly write code. Devon has a number of programs he has written that access data across WAN links, so he is particularly concerned about their security. Devon writes a script in C++ to check the security of the programs running on his internal servers. What will the following code from Devon's script accomplish? #include <iostream> #include <socket.cpp> #include <util.h> using namespace std; bool tryPort(int p); string target(""); int main(int argC, char *argV[]) { printf("PlagueZ port scanner 0.1\n"); int startPort = getInt("start Port: "); int endPort = getInt("end Port: "); target = getString("Host: "); printf("[Processing port %d to %d]\n", startPort, endPort); for(int i=0; i<endPort; i++) { printf("[Trying port: %d]\n", i); if(tryPort(i)) // port open printf("[Port %d is open]\n", i); } printf("------Scan Finished-------\n"); system("pause"); return 0; } bool tryPort(int p) { SocketClient *scan; try { scan = new SocketClient(target, p); } catch(int e) { delete &scan; return false; } delete &scan; return true; }

Options

  • AScan the perimeter firewall for DoS vulnerabilities
  • BCreate socket connections to the remote sites to check their security
  • CClose off any ports used by malicious code
  • DScan for open ports

Unlock 312-92 to see the answer

You've previewed enough free 312-92 questions. Unlock 312-92 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.

Full 312-92 Practice