312-92 - EC-Council Certified Secure Programmer v1

Go back to ECCouncil

Example Questions

What type of encryption will be used from the following code? Dim Publickey As Byte() = {214,46,220,83,160,73,40,39,201 155,19,202,3,11,191,178,56,74,90,36,248,103, 18,144,170,163,145,87,54,61,34,220,222,207, 137,149,173,14,92,120,206,222,158,28,40,24, 30,16,175,108,128,35,203,118,40,121,113,125, 216,130,11,24,9,0,48,194,240,105,44,76,34,57, 249,228,125,80,38,9,136,29,117,207,139,168,181, 85,137,126,10,126,242,120,247,121,8,100,12,201, 171,38,226,193,180,190,117,177,87,143,242,213, 11,44,18,0,113,93,106,99,179,68,175,211,164,116, 64,148,226,254,172,147} Dim Exponent As Byte() = {1,0,1} Dim Encrypted SymmetricKey() As Byte Dim Encrypted SymmetricIV() As Byte Dim RSA as New RSACryptoServiceProvider() Dim RSAKeyInfo As New RSAParameters() RSAKeyInfo.Modules = PublicKey RSAKeyInfo.Exponent = Exponent RSA.ImportParameters(RSAKeyInfo) Dim RM As New RijendaelManaged() EncryptedSymmetricKey = RSA.Encrypt(RM.Key,False) EncryptedSymmetricIV = RSA.Encrypt(RM.Key,False) Fred has just finished developing a number of ASP pages that will be posted to his company's website. Fred does not want the page's source code viewed by anyone, so he decided to encode the pages to make the source code unusable. What will the following command accomplish? screnc /e asp *.* c:\tmp George is writing an application in Java and is using DES in the code to implement the encryption and decryption of data that will be passed. In the following code snippet, what will be accomplished? FileOutputStream out = newFileOutputStream (f); out.write(rawkey); Peter is writing a program that has a GUI front-end and uses a MS SQL database as a backend. Peter's application will repeatedly update and call upon specific tables in the database on a regular basis. Peter wants to make sure that his program always has the ability to update the database and that no other calls or updates can touch the database tables used at the same time. How could Peter accomplish this in his application? Simon is writing an application that will use RPC to talk between a client and server. He will use authentication, but in his application the server does not have to know the RPC caller’s identity. What type of RPC authentication can Simon use for this application? Tyler is in the applicaion testing phase of a particular project. He has decided to use the White Box testing method. Tyler has made a number of changes to his code after some initial tests found some bugs. Tyler now needs to test the code with those changes in place. What type of testing is Tyler getting ready to perform? David is a developer that has created an application using the secure RPC protocol. Before anyone can actually use the program, where must David add entries for the users so that they can gain access? Yancey has just finished downloading the Valgrind suite to use in his application development. Yancey is most concerned about the possibility of memory-management issues in his programs. What tool included in Valgrind suite can Yancey use to detect memory-management related issues? What security package is implemented with the following code? dwStatus = DsMakSpn ( "ldap", "MyServer.Mydomain.com", NULL, 0, NULL, &pcSpnLength, pszSpn ); rpcStatus = RpcServerRegisterAuthInfo ( psz RPC_C_AUTHN_GSS_NEGOTIATE, NULL, NULL ); Megan has just build a new kernel using the command make bzImage. Where can Megan go now to see the newly created kernel? William is the lead programmer for Gummerson, Inc., a software company located in San Francisco. Gummerson is looked upon as one of the leading software development companies for medical and health related applications. William believes that his company is so successful because they believe in involving the user or client in the design and development of the programs. What software development methodology does Gunnerson, Inc. use when creating applications for clients? Fred is planning on using the windows socket application ClientApp.exe program to create a client-side application that his employees will use. This program will access backend programs from two different remote sites over WAN connections. If Fred does not make any modifications to the ClientApp.exe default settings, what port must he have the network engineer open in order for the application to communicate? Harold is programming an application that needs to be incorporate data encryption. Harold decides to utilize an encryption algorithm that uses 4-bit working registers instead of the usual 2-bit working registers. What encryption algorithm has Harold decided to use? Harold is writing a client-side socket program that will create a TCP connection to a remote server to retrieve data. What function should Harold use to create this connection? Devon is writing the following code to avoid what? <script language=”vb” runat=”server”> Sub Application_BeginRequest(Sender as object, E as EventArgs) If (Request.Path.Indexof(chr(92)) >= 0 OR _ System.IO.Path.GetFullPath (Request.PhysicalPath) <> Request.PhysicalPath) then Throw New HttpException(404, “Not Found” End If End Sub </script> David is an applications developer working for Dewer and Sons law firm in Los Angeles David just completed a course on writing secure code and was enlightened by all the intricacies of how code must be rewritten many times to ensure its security. David decides to go through all the applications he has written and change them to be more secure. David comes across the following snippet in one of his programs: #include <stdio.h> int main(int argc, char **argv) { int number = 5; printf(argv[1]); putchar(`\n'); printf("number (%p) is equal to %d\n", &value, value); } What could David change, add, or delete to make this code more secure? Travis is writing a website in PHP but is worried about its inherent vulnerability from session hijacking. What function could Travis use to protect against session hijacking in his PHP code? What functionality of the Oracle Identity Management system facilitates real-time integration of multiple directories and user repositories through a single LDAP service? Kyle is a web developer for Innovative Incorporated, a web development and graphics designing company in Dallas. Kyle is currently working on a web-based application for a client that wants dynamic and rich content on their site. Kyle is going to use java applets and flash animation to make the website really stand out. The client was adamant though about making sure the site used security features to ensure that the site itself and visitors alike would not have issues. What Java security feature can Kyle use in the development of the site to add security? If a developer wrote the following code, what would the script be vulnerable to? #include <stdio.h> int main(int argc, char **argv) { int number = 5; printf(argv[1]); putchar('\n'); printf("number (%p) is equal to %d\n", &value, value); } Devon is writing the following code to avoid what? <script language="vb" runat="server"> Sub Application_BeginRequest(Sender as object, E as EventArgs) If (Request.Path.Indexof(chr(92)) >= 0 OR _ System.IO.Path.GetFullPath (Request.PhysicalPath) <> Request.PhysicalPath) then Throw New HttpException(404, "Not Found" End If End Sub </script> What compression library is used by wiretap, the packet analyzer reader for Wireshark? What is the following PERL script trying to accomplish? sub mycode_string { join("" map('$_ > 255 ? sprintf("\\x{%04x]", $_) : chr($_) = ~ /[[:cntrl:]]/ ? sprintf(\\x%02X", $_) : chr($_) } unpack("u*", $_[0]))l } Gregory is a system administrator who oversees 15 Mac OS X servers for his company. Three of his servers are at remote sites, but they still need to replicate and communicate with the servers at the main office. Gregory wants to use SSL to protect the LDAP traffic between all servers for security. For this to work properly, what port must be opened on the firewalls so that the SSL LDAP traffic can pass through? Victor has completed writing his software application and is now working on error messages that will be displayed in case of any kind of failure or problem. He has written code that will display a pop-up message where there is an error. He has also written code that explain the error that has occurred. What is the last aspect of error messages that Victor needs to create for his application? Jonathan is creating an XML document and needs to sign data streams. In his code, Jonathan creates a signature node that is contained within the signed datastream. What type of signature signing has Jonathan employed here? Harold is writing a J2ME program that run an inventory application on his company's PDAs. Employees will use their PDA to scan barcodes into the program Harold is writing. Harold is very concerned about securing his program's code and ensuring its integrity once it is utilized. Harold particularly wants to stop the execution of class files loaded in the virtual machine in any way, what is not allowed by java virtual machine specification. What level of J2ME security should Harold implement to accomplish this? What will the following command accomplish? c:\signtool12winnt\signtool ­L ­d a:\tmpcert:a:\cert What vulnerability is the following code susceptible to? CREATE OR REPLACE PROCEDURE demo (name in VARCHAR2) as cursor_name INTEGER; rows_processed INTEGER; sql VARCHAR2(150); code VARCHAR2(2); BEGIN ... sql := 'SELECT postal_code FROM states WHERE state_name = ''' || ''''; cursor_name := dbms_sql.open_cursor; DBMS_SQL.PARSE(cursor_name, sql, DBMS_SQL.NATIVE); DBMS_SQL.DEFINE_COLUMN(cursor_name, 1, code, 10); row_processed := DMBS_SQL.EXECUTIVE(cursor_name); DBMS_SQL.CLOSE_CURSOR(cursor_name); Fred wants to create his web page using AJAX to make them dynamic and give them the ability to use and share data. After an internal auditor examines the compliance of Fred's page, he says that they cannot be used if external visitors will be accessing the pages. Why would the auditor not let Fred publish the pages written with AJAX? What function can be used with SQL to encrypt user suppliedpasswords so that they can be compared with the encrypted passwords stored on the SQL server? Jayson is the head developer of a team working on an inventory tracking and maintenance program. Jayson and his team are in the third phase of the software development life cycle, designing the program. In their current development phase, what material would be considered the input for their program? What programming threat model with six categories includes repudiation, spoofing identity, information disclosure and so on? Why would a software development firm want to fix any issues with a program at the design stage as opposed to fixing issues with a program through a patch release? Jacob is the system administrator for his company, managing over 20 Linux-based servers. Jacob wants to ensure that his servers are secure so he decides to add the following line to the /etc/sysctl.conf file: net.ipv4.conf.all.rp_filter = 1 What will this line accomplish? Versions Unlimited, a software design company in Seattle, has just finished development of a new mapping software product. They have completed testing the internal code and are now ready to involve users other than programmers in the testing. Versions Unlimited invites internal employees and some external users to come to their company and test the product in a controlled environment. What type of testing is Versions Unlimited currently undertaking? Kenny is the CIO for Fredrickson Entertainment, a gaming software company in Omaha. The developers in Kenny's company have just finished creating a 3D first person shooter game that will be released to the market within the next couple of months. Kenny is trying to decide what type of license or activation code structure they should use for the game to prevent piracy and protect their product. Kenny decides to go with an approach that will allow each sold copy to be activated online up to five times because he knows his users might have multiple PCs or might need to reinstall the product at some point. What type of activation policy has Kenny decided to go with? What type of error will result from the following statement? int main(int argc, char* argv[]) { char i[7]; strncpy(i, “sdfusdofof”, sizeof(i)); } David is an applications developer working for Dewer and Sons law firm in Los Angeles. David just completed a course on writing secure code and was enlightened by all the intricacies of how code must be rewritten many times to ensure its security. David decides to go through all the applications he has written and change them to be more secure. David comes across the following snippet in one of his programs: #include <stdio.h> int main(int argc, char **argv) { int number = 5; printf(argv[1]); putchar(‘\n’); printf(“number (%p) is equal to %d\n”, &value, value); } What could David change, add, or delete to make this code more secure? Steve is using the libcap library to create scripts for capturing and analyzing network traffic. Steve has never used libcap before and is struggling with finding out the correct functions to use. Steve is trying to pick the default network interface in his script and does not know which function to use. Which function would he use to correctly choose the default interface in the script? What will the following ASP script accomplish on a webpage? <% Response.CacheControl = “no-cache” Response.AddHeader “Pragma”, “no-cache” Response.Expires = -1 if session(“UID”)=”” then Response.Redirect “Logon.asp” Response.End end if %> Mathew is working on a Fedora machine and is having issues with some shellcode he wrote that is producing errors. Mathew decides to download and use Ktrace to debug the shellcode to see where the errors are originating from. Why will his plan not work? What is the new lightweight audit framework that is built into Red Hat Linux Enterprise? What will the following ASP script accomplish on a webpage? <% Response.CacheControl = "no-cache" Response.AddHeader "Pragma", "no-cache" Response.Expires = -1 if session("UID")="" then Response.Redirect "Logon.asp" Response.End end if %> Lyle is writing some code in VB.NET and is implementing some build-in security. What type of .NET security is Lyle using in the following code? public class Myclass1 Public Sub New() End Sub Public Sub MyMethods() Dim Perm As New MyPermission() Perm.Demand() End Sub Pub Sub YourMethod() End Sub End Class What two encryption methods are used by the Secure Electronic Transaction system? 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; } What is one of the dominant factors that lead to insecure programming? When the following code is compiled and run is a program what size block will be used to hold name string? #include <stdio.h> int main(int argc, char **argv) { char target[5]="TTTT"; char attacker[11]="AAAAAAAAAA"; strcpy(attacker, " DDDDDDDDDDDDDD"); printf("% \n", target); return 0; } Although software companies despise software piracy, they often realize that illegal release of their product parallel to the legal release can actually increase the item's user base. These illegal versions of the software can oftentimes increase actual legal buyers. What is this process called where illegal copies are released to the public along with the legal versions?