nerdexam
EC-Council

312-92 · Question #59

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…

The correct answer is D. Scan for open ports. EC-Council 312-92 Exam

Network Forensics

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

How the community answered

(44 responses)
  • A
    7% (3)
  • B
    2% (1)
  • C
    14% (6)
  • D
    77% (34)

Explanation

EC-Council 312-92 Exam

Topics

#port scanning#socket programming#network reconnaissance#C++

Community Discussion

No community discussion yet for this question.

Full 312-92 Practice