









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!










A variable in Prolog must start with either an upper-case letter or an underscore (_). - ANSTrue A Web site that allows users to enter text, such as a comment or a name, and then stores it and later displays it to other users, is potentially vulnerable to a kind of attack what attack is it... Cross-site scoring scripting Cross-site request forgery Cross-site scripting Two-factor authentication None of these - ANSCross-site scripting An attack on a website that stores and displays text to a user is known as _______ attack. SQL attack XSS attack XRP attack None of the above - ANSXSS attack An attacker of return-oriented programming may overflow the buffer by appending only one fake calling frame
appending one or more fake calling frames appending only the fake address of a system function. none of the above - ANSappending one or more fake calling frames Backtracking is necessary for Prolog programs to provide multiple answers. - ANSTrue Code injection is caused when untrusted user data unexpectedly becomes code. - ANSTrue Control flow integrity (CFI) is a security mechanism that allows changes to the original control flow graph of a compiled binary. - ANSFalse Control flow integrity (CFI) is provided by the compiler and adds instrumentation into the binary during compile time. - ANSTrue Control flow integrity cannot be defeated by modifying the code labels to allow the desired control flow. - ANSTrue For the PROLOG goal: ?-[[X,Y],Z|R]=[[a,b],[1,2],[c,d]] .Which binding apply? X=a Y=b Z=[1,2] R=[[c,d]] none, because the goal fails X=a Y=b Z=1 R=[2,c,d] X=a Y=b Z=[c,d] R=[c,d] - ANSX=a Y=b Z=[1,2] R=[[c,d]] Functions are considered first-class citizens in the functional programming languages, implying that:
The EIP can jump to the Heap The EIP can jump to the Stack The EIP can jump to executable regions none of the above - ANSThe EIP can jump to executable regions In Prolog, in what manner is a state-space tree for a backtracking algorithm constructed? Depth-first search Breadth-first search Twice around the tree Nearest neighbor first - ANSDepth-first search In return-oriented programming, a return from a hijacked function can not be controlled by the hijacker. - ANSFalse In ROP, it is possible to invoke an arbitrary function simply by placing a fake frame in stack memory. - ANSTrue It determines what resources a class can access such as reading and writing to the local disk. Bytecode Verifier JVM Classloader Security Manager - ANSSecurity Manager
Prolog was developed primarily for applications in science and engineering. - ANSFalse Protection domains cannot be established by the class loader - ANSFalse Reflected XSS occurs when an attacker gets a victim to send a request with malicious input to a server which includes the unsanitized input in the HTML output it produces. - ANSTrue Return-oriented programming may exploit a stack buffer overflow. - ANSTrue Return-oriented programming may exploit shellcode or injected code - ANSFalse Singed by an untrusted principal remote java code has very restricted access to computer resources. - ANSTrue The cut (in Prolog) is a goal, written as !, which always succeeds, but cannot be backtracked. - ANSTrue The lambda special form can be used to define "anonymous" functions in Lisp. - ANSTrue The Same Origin Policy prevents XSS attacks if a browser implements it correctly. - ANSFalse The sandbox restrictions provide strict limitations on which system resources the applet can request or access. - ANSTrue
What is the output of the following LISP program? (define (b p) (+ p p) )(define z 1)(b z) 2 1 3 error - ANS What is the output of the following statement? (define p .6)(cond ((> p .75) 'very-likely) ((> p .5) 'likely) ((> p .25) 'unlikely) (else 'very-unlikely)) Very-likely Likely Unlikely Very-unlikely - ANSLikely What is the output of the following statement? (define x 'outside) (let ((x 'inside) (y x)) (list x y)) '(outside) '(inside) '(inside outside) '(outside inside) - ANS'(inside outside) What is the output of the following statements?
(define (aaa-x x) (lambda(y)(+ x y)))(define add-d (aaa-x 7))(add-d 15) 7 14 22 error - ANS What is the output of the following statements? (define meals '(breakfast lunch tea dinner))(cons (first (rest meals)) '( )) '(breakfast) '(lunch) '(dinner) '(lunch tea) - ANS'(dinner) What is the output of the following statements? (define mystery (lambda (proc1 proc2 x) (proc2 (proc1 x))))(mystery sqrt sqr
9 3 81 error - ANS What is the output of the following statements? (define thing 'sphere) (define r 2)(cond ((eq? thing 'circle) (* 3 r r)) ((* 4 3 r r)))
new Error - ANS What is the output of this racket program? (define (multiply p q) (* p q))(cons 4 (multiply 2 4)) '(8. 8) '(4. 4) '(4. 8) '(8. 4) - ANS'(4. 8) what is the use of 'is' in prolog programming? unification arithmetic evaluation reduction None of above - ANSarithmetic evaluation What relationship does the following Prolog program represent? r(X, Y) :- parent(Z,X), parent(Z,Y), male(X), X = Y. X is the father of Y X is the brother of Y Y is the sister of X. X and Y are NOT related - ANSX is the brother of Y
What S-expression consists of? Atoms and Lists Numeric only Literals only Atoms only - ANSAtoms and Lists What will be the output of the following racket statements? (define root 'a)(eq? root 'a) (cons nil nil) #t nill error - ANS#t What will be the output of the following statement? (cons (car '(a b)) (cdr '(p q))) '(p q) '(a b) '(a q) '(a p) - ANS'(a q) What would the output of the following Prolog query be? ?- f(a,b) = f(Y,X)
Which of the following is a challenge in program behavior-based detection: Determining the control flow graph of the program Detecting deviations from the control flow graph of the program All of the above None of the above - ANSAll of the above Which of the following is not a Java feature? Dynamic Architecture Neutral Use of pointers Object-oriented - ANSUse of pointers Which of the following is not an example of an XSS attack? Stored XSS DNS XSS Reflected XSS DOM-based XSS - ANSDNS XSS Which of the following is wrong about Java Byte Code Verifier? Checks that variables are initialized before they are used. Checks that rules for accessing private data and methods are not violated. Checks that the runtime stack does not overflow. Checks that the computer resources are available
Non of the above - ANSChecks that the computer resources are available Which of the following option leads to the portability and security of Java? Bytecode is executed by JVM The applet makes the Java code secure and portable Use of exception handling Dynamic binding between objects - ANSBytecode is executed by JVM Which of the following racket expressions would be interpreted as #f when evaluated: nil; -1; (car '(0 1)); '(); none of the above. - ANSnone of the above Which one from the options would return true/yes for the following prolog program? boy(john,123).girl(jane,234).student(john,123). ?- girl(jane,x). ?- boy('john',123). All of the above. None of the above - ANS?- boy('john',123).