You are on page 1of 2

Roll Number:

Thapar University, Patiala


Department of Computer Science and Engineering
MID SEMESTER EXAMINATION

M. E. CSE (First Year): Semester-II Course Code: PIS105


Course Name: Secure Coding
March 17, 2018 Saturday, 13:00 —15:00 Hrs
Time: 2 Hours, M. Marks: 25 Name Of Faculty: Tarunpreet Bhatia

Note: Attempt all questions. Assume missing data, if any, suitably. This paper consists of 2 pages

Q.1 Thapar Institute of Engineering and Technology is installing a new website to provide
online access to library personnel, students and staff. Staff and students will be able to
log in and search for books, and staff members can request books. Librarians will be able
to log in, add books, add users, and search for books. The external dependencies are
given as below:
• Server type will be Linux
• Site will have to be off-campus accessible
• MySQL database
• Database server will be the existing library server
• Private network between web server and database server
• Both servers must be behind the campus firewall
• All communications over TLS
a) Identify the assets and potential 3 threats against the system using threat trees. (3.5)
b) Determine the risk for each identified threat and prioritize (if needed). (2)
c) Discuss the mitigation techniques that can prevent each threat previously identified via (1.5)
threat analysis from being realized.
Q.2 What do you mean by DNS spoofing attack? Assume IP and MAC addresses as given in (3)
Figure I, show steps to launch this attack. Give spoofed packet format also. How to
thwart this attack?

hge
Gateway Victim Machine
IP 192.168.1.5 IP 192.168.1.19
MAC 00:1E:30:DC:35:6E MAC 00:58:21:64:FB:63

Attacker Machine
IP 192.168.1.6
MAC 00:C4:67:AB:34:6E

Figure 1

Q.3 a) Suppose you know that a particular web site uses a backend database to implement (2)
authentication. Given a login page with usemame and password fields, what would you
type into these fields to try to perform SQL injection to bypass proper authentication?
Explain why your approach would work.

P. 1". 0
b) Discuss 3 approaches to mitigate SQL injection attack with examples. (3)

Q.4 You have been appointed as a penetration tester in a company. You are provided two
machines A and B with following configurations.
Machine A: Windows XP SP 3, IP address 192.56.31.4, Minishare 1.4.1
Machine B: Kali Linux, IP address 192.56.31.7
a) identify the vulnerability in Minishare app and how will you verify it. (2)
b) How can this vulnerability be exploited to open the command shell of Machine A on (4)
Machine B? Give detail steps.

Q.5 Explain the following secure coding practices with examples: (4*1=4)
a) Defense in depth
b) Avoid security by obscurity
c) Fail securely
d) Security Features != Secure Features

You might also like