Chapter 07: Programming for Security Professionals
Which of the following takes you from one area of a program (a function) to another area? Branching Dividing Testing Looping
Branching
Which of the following is a markup language rather than a programming language? Perl PHP HTML C
HTML
A way of having your program repeat an action a certain number of times
While loop
In the C programming language, which variable type holds the value of a single letter? Float String Const Char
Char
In the Perl programming language, comment lines begin with the which of the following character(s)? $ # // %
#
Which of the following statements in the C programming language is used to load libraries that hold the commands and functions used in your program? package #import use #include
#include
Which of the following logical operators in the C programming language is evaluated as true if both sides of the operator are true? || == = &&
&&
Which of the following mathematical operators in the C programming language increments the unary value by 1? + ++ % &
++
Takes you from one area of a program (a function) to another area
Branching
The print command for Perl is almost identical to the print command used in which of the following programming languages? C Smalltalk PHP Java
C
An object-oriented programming structure that holds pieces of data and functions
Class
Most programming languages have a way to branch, loop, and test. True False
True
In the C programming language, which of the following show where a block of code begins and ends? brackets parenthesis braces dashes
braces
Carelessly reviewing your program's code might result in having which of the following in your program code? bug variable branch virus
bug
In the C programming language, which statement tells the compiler to keep doing what is in the brackets over and over and over? do(forever) for(;;) continue loop($)
for(;;)
Which of the following is a mini-program within a main program that carries out a task? loop script branch function
function
In object-oriented programming, a function contained in a class is called which of the following? test function label function variable function member function
member function
Which of the following is a backdoor initiated from inside the target's network that makes it possible to take control of the target even when it's behind a firewall? reverse port back shell reverse shell reverse door
reverse shell
An error that causes unpredictable results
Bug
You must always add "//" at the end of comment text when using C language. True False
False
Which of the following is the act of performing a task over and over? Remembering Branching Testing Looping
Looping
When a compiler finds errors, it usually indicates what they are so you can correct the code and compile the program again. True False
True
Represents a numeric or string value
Variable
You can use the syntax /* and */ to accomplish what function when working with large portions of text? run comment execute erase
comment
Bugs are worse than syntax errors because a program can run successfully with a bug, but the output might be incorrect or inconsistent. True False
True
Security professionals often need to examine Web pages and recognize when something looks suspicious. True False
True
Which of the following special characters is used with the printf() function in the C programming language to indicate a new line? \0 \l \n \t
\n
If you want to know what the Perl print command does, you can use which of the following commands? perldoc -f print perl -h print perl -h man perl print
perldoc -f print
In the Perl programming language, which of the following keywords is used in front of function names? proc declare func sub
sub
Program that converts a text-based program called source code, into executable or binary code
Compiler
Tells the compiler how to convert the value in a function
Conversion Specifier
In object-oriented programming, which of the following are structures that hold pieces of data and functions? keyword classes objects variable
classes
In a Perl program, to go from one function to another, you simply call the function by entering which of the following in your source code? variable comment name keyword
name
Writing programs in this language is easier than in machine language
Assembly language
UNIX was first written in assembly language. However, it was soon rewritten in what programming language? Perl Smalltalk C Python
C
Performs an action first and then tests to see whether the action should continue to occur
Do loop
An English-like language you can use to help create the structure of your program
Psuedocode
In the Perl programming language, variables begin with which of the following characters? % ! * $
$
Which of the following logical operators in the C programming language is used to compare the equality of two variables? && = == ||
==
In HTML, each tag has a matching closing tag that is written with which of the following characters? ampersand (&) forward slash (/) bang (!) backward slash (\)
forward slash (/)