Tuesday, November 17, 2020

CSS QUIZ 9 ANSWERS

 

Computer system security quiz 9 Solution | Css quiz week 9 Answer with Reason | css quiz aktu

Computer System Security Quiz week  9 Solution

Q:1. Which of the following is correct for CSRF attack?

3.Both 1 and 2

CSRF is an attack that tricks the victim into submitting a malicious request. It inherits the identity and privileges of the victim to perform an undesired function on the victim’s behalf. For most sites, browser requests automatically include any credentials associated with the site, such as the user’s session cookie, IP address, Windows domain credentials, and so forth

Q:2. One of the ways to prevent CSRF attack is that you should use _____ validation.

4.Both 1 and 2

In order to stay safe from Cross-site Request Forgery (CSRF) attacks, make use of the suggested and the most widely used prevention techniques which are known as an anti-CSRF token, also sometimes referred to as the synchronizer tokens.

Q:3. Some of the vulnerability of a websites is/are ?

4.All of the above

Most Common Website Security Vulnerabilities are 1.SQL Injection 2.CSRF (CROSS-SITE REQUEST FORGERY ) 3.Cross Side Scripting (XSS)

Q:4. _________ is a attack in which the script is stored permanently on server.

4.All of the above

XSS is a attack in which the script is stored permanently on server. XSS attacks can be put into three categories: stored (also called persistent), reflected (also called non-persistent), or DOM-based. Stored XSS Attacks The injected script is stored permanently on the target servers. The victim then retrieves this malicious script from the server when the browser sends a request for data.

Q:5. Which of the following is true for DOM-based XSS attack ?

4.None of the above

DOM Based XSS (or as it is called in some texts, “type-0 XSS”) is an XSS attack wherein the attack payload is executed as a result of modifying the DOM “environment” in the victim’s browser used by the original client side script, so that the client side code runs in an “unexpected” manner. That is, the page itself (the HTTP response that is) does not change, but the client side code contained in the page executes differently due to the malicious modifications that have occurred in the DOM environment.

Tuesday, November 3, 2020

AKTU PYTHON QUIZ 8

 

Python Programming Quiz 8th Week Quiz Solution 2020 | python quiz 8 solution 2020

 

Python Programming Quiz – 8th Week Quiz Solution 2020


[1] A class definition in python begins with the keyword –

(a): def , file 
(b): class , object
(c): self , py file
(d): None of these

Answer: (b) class , object

Reason:- Python is an “object-oriented programming language.” This means that almost all the code is implemented using a special construct called classes. ... This is done using the keyword “class,” which is a grouping of object-oriented constructs. By the end of this tutorial you will be able to: Define what is a class.


Q-2. What will be the output of the following  python code ?

class Roll:
def __init__(self, id):
self.id = id
id = 231

return id

val = Roll(321)
print (val.id).

(a): TypeError
(b): 231
(c): 321
(d): None of these
https://youtu.be/w9LXF1MYRes 
please subscribe this channel for the answers of future quizes

Answer: (b): 231
Reason:- its return value id 231 because the id is already is given this code so its output of 231.


[3] What will be the output of following python code?

class X:
def __init__(self):
self.a = 10
self._b = 20
def getB(self):
return self._b

x = X()
x._b = 60
print(x.getB())

(a): 20
(b): 60
(c): Error
(d): Program runs but does not print anything


Answer: (b) 20

Reason:-  20 is  the output of following python code because this code is right .

4.private  method starts with _______ while protected method starts with ________.

(a).#,@
(b).double underscore,single underscore 
(c).single underscore , double underscore
(d).None of these

Answer:- (b).double underscore,single underscore.


Reason:- In Python, there is no existence of Private methods that cannot be accessed except inside a class. However, to define a private method prefix the member name with double underscore  ,The culture in Python is that names starting with underscores mean, "don't use these unless you really know you should." You might choose to begin your "protected" methods with underscores.

5. what will be the output of the following code. code is saved in a file named 'code.py'
f = open(‘file.txt’)
 f, readlines() 
print(f. name) 
print ( f.closed )
 f.close() 
print ( f.closed ).


(a).Error in code 

(b). true
      false
       true

(c). code.py
      False
     True

(d)file.txt
     False
     True

Answer;- (d)file.txt
     False
     True

Reason:-  this is 3 function and first is file.txt and closed , named its is defined The readlines() method returns a list containing each line in the file as a list item. Use the hint parameter to limit the number of lines returned.
The close() method closes an open file. You should always close your files, in some cases, due to buffering, changes made to a file may not show until you close the file

CSS QUIZ 8

 1.Upper case and lower-case letters, numbers and symbols

computer system security quiz 8 solution

                        computer      system security quiz 8 solutio

 

 


 Q:1. Password should be combination of ____. (according to the video lecture).

1.Lower case letters only

2.Memorable names and dates

3.Upper case and lower-case letters, numbers and non letter characters

4.Upper case and lower-case letters, numbers and symbols


Answer:- 4.Upper case and lower-case letters, numbers and symbols

Reason:- The key aspects of a strong password are length (the longer the better); a mix of letters (upper and lower case), numbers, and symbols, no ties to your personal information, and no dictionary words


Q:2. The cookies we use, are sent with ______, which in general, _____ the performance.

1.only when requested,improves

2.every request, degrades

3.extra information, is useless for

4.None of the mentioned


Answer:- 2.every request, degrades


Reason :- typically cookies are used for a variety of purposes: ... Cookies impact performance because every time you make a request to a ... an HTML file, a CSS file, an image) the browser will send the cookie in the request to the server. ... request becomes a little bigger and thus performance begins to degrade.

https://youtu.be/IRfa4p0em0E

please subscribe this channel for further answers of the quiz


Q:3. Which of the following header is used to create cookie ?

1.Create-Cookie

2.Init-Cookie

3.Set-Cookie

4.Start-Cookie


Answer:- 3.Set-Cookie


Reason:- After receiving an HTTP request, a server can send one or more Set-Cookie headers with the response. The cookie is usually stored by the browser, and then the cookie is sent with requests made to the same server inside a Cookie HTTP header.


Q:4. _______ is an attack to inject code, in which malicious SQL code is passed to an instance of SQL Server from ______.

1.SQL injection, user input field

2.code injection, another server

3.both 1 and 2

4.None of the above.


Answer:-1.SQL injection, user input field.


Reason:- SQL injection is a code injection technique, used to attack data-driven applications, in which malicious SQL statements are inserted into an entry field for execution (e.g. to dump the database contents to the attacker).


Q:5. How to prevent SQL injection ?


1.Use parameterized / prepared SQL

2.use string concatenated query

3.Both A and B

4.None of the above


Answer:- 3.Both A and B.


Reason:- The best way to prevent SQL Injections is to use safe programming functions that make SQL Injections impossible: parameterized queries (prepared statements) and stored procedures. Every major programming language currently has such safe functions and every developer should only use such safe functions to work with the database.

CSS QUIZ 9 ANSWERS

  Computer system security quiz 9 Solution | Css quiz week 9 Answer with Reason | css quiz aktu Computer System Security Quiz week  9 Soluti...