Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

Information Security Group

School of Engineering, Physical and Mathematical Sciences

Year 2023-24

Approved coursework for:  IY5610/4610 – Security Testing Theory and Practice

CW Assignment: Summative Coursework 1 of 1

Word Count/Time Limit:  Maximum 6000 words (written work will only to be read and marked up to the maximum word limit).

Contribution to final module grade: 40%

Submission type and Deadline: Your answers should be submitted by 2 pm BST on Thursday 11th April 2024 in the appropriate submission box on the module’s Moodle page. The assignment must be submitted as One PDF, including all code samples and supplementary materials as clearly marked appendices.

Note on good academic practice:  Please  make sure that any resource you use is acknowledged

(including that of generative AI, where appropriate).  All work you submit must be solely your own work. For more information on Referencing, Citing and Structuring Bibliographies, please click here.

Assignment Information:

This coursework is aimed to have you engage with 3 activities (2 theoretical questions and 1 practical activity) which will test your ability to think logically about computer systems and apply appropriate forensic and investigative techniques to identify and exploit vulnerabilities. The purpose of this coursework is to test your ability to engage in independent research, using the course materials as a foundation, while also presenting you with practical challenges which will test your ability to use host, service, and vulnerability enumeration tools, and exploitation toolchains. The essay format of the coursework will test your ability to compile understandable and informative documentation – a key requirement of any security testing report.

Please make sure that any resource you use is acknowledged. All work you submit must be solely your own work.  For more information on Referencing, Citing and Structuring Bibliographies please click here. Learning outcomes assessed are:

.  Have gained an understanding of common approaches and methodologies used for carrying out and managing a security and penetration testing, as well as of the legal aspects involved in such audits.

.  Have gained an understanding of the vulnerabilities in existing protocols, systems, and applications, and common forms of attack; in addition, an understanding of the security technologies designed to mitigate these vulnerabilities

.  Have gained practical experience of how these vulnerabilities may be exploited in practice to penetrate a system.

You are expected abide by the established ethical practice guidelines at all times (only perform security testing tasks against networks expressly named in this coursework).

Instructions to students.    The coursework comprises three (3) questions.  These questions will involve practical exercises focusing on the following areas:

.  Theory:  Network Mapping and  Info Gathering

.  Theory:  Systems-based Security Testing

.  Practical:  Security Testing in  Practice

A consistent referencing style is expected throughout your submission.  It is NOT sufficient to merely attach a bibliography. You must indicate where sources were used in your work with an appropriate referencing style (Harvard, IEEE, etc.). You should also cite where you source figures and tables from, if they are not your own work.

.  Each question will be marked out of 25, giving a total of 75 marks for the coursework.  Your final result will be shown as a percentage grade on Moodle.   This total mark awarded will represent a contribution of 40% toward your final grade (with the final exam providing the

remaining 60%).

.  Your answers should be descriptive, and you are encouraged to make use of diagrams, charts and tables where appropriate. You must also provide evidence in the form of code generated for your  answers, output logs, and (where necessary) screenshots).  Failure to provide evidence to support  your answers will impact marks, as this is a practical exercise.

.  You are encouraged to refer to the course materials and resources and conduct your own,

independent, research to help you answer the questions.  Provide a list of references in your submission. You should cite your references, using a consistent referencing style of your choice.

.  A Turnitin submission box will be created on Moodle:you are expected to submit all answers in PDF format as one single document.  Please include any (optional) supplementary materials as  an appendix in your submission, not as a separate file.

.  As this is an individual exercise, please ensure all answers you provide are your own work and that all sources are correctly cited.

The learning outcomes that you are assessed on are that you:

.  Have gained an understanding of common approaches and methodologies used for carrying out and managing a security and penetration testing, as well as of the legal aspects involved in such audits.

.  Have gained a detailed understanding of network protocols, relevant computer; system architectures, and web application systems.

.  Have gained an understanding of the vulnerabilities in existing protocols; systems, and applications, and common forms of attack; in addition, an understanding of the security technologies designed to mitigate these vulnerabilities;

.  Have gained practical experience of how these vulnerabilities may be exploited in practice to penetrate a system.

Assessment Criteria

Students will be assessed on their demonstrated understanding of security testing procedures.  Specifically, you will be assessed on your ability to:

.  Identify, follow, and justify specific security testing methodologies;

.  Use appropriate  RFCs, CVEs, and community resources to discuss the feasibility and impact of specific security threats;

.  Explain the required  knowledge and steps needed to leverage specific vulnerabilities;

.  Recognise and explain vulnerabilities in simple code (C++ functions);

.  Discuss mitigations and prevention measures against identified security issues,  providing a clear rationale for suggested courses of action;

.  Use of reference material (academic papers, white papers, reputable blogs, etc.)  to support and substantiate your own findings.


Theoretical Exercises

Question 1 - Network Mapping and Info Gathering [25 marks]

This question tests your understanding of the theoretical principles of network mapping and information gathering. You are expected to provide referenced research to support and/or challenge your assertions,   and provide reasoned, logical answers. You are encouraged to use pentest3 or your own test environment to demonstrate concepts.

(a).  Before commencing a security assessment, a  project scope must be established.  Providing appropriate examples, explain how pre-engagement activities and OSINT contribute to  developing a scoping statement.  Be sure to include the following:

.  One example of information that can be obtained passively.

.  A brief (1-2 sentence) statement regarding the types of scanning (passive or active) that are most appropriate at this stage and why.

.  Two relevant examples of services and tools you’d use to perform pre-engagement information gathering.

.  A clear explanation of the risks associated with information gathering and how passive methods minimize risk.

Close your answer with a brief discussion of the importance of an fact-based and mutually agreed project scope, and how your chosen methods would allow you to reach agreement with a client.  [6]

(b).  Explain, providing relevant examples, how one would identify client-facing or web-facing  hosts in a target network. You must consider:  IP addresses, DNS records, port numbers, and hosted

content, in your answer.  Provide one example (1-2 sentences) for each, explaining how you’d probe for such information, and what kind of results would confirm a publicly reachable host.                   [4]

(c).  Explain, using appropriate diagrams, how you would conduct a scan of a target network to  identify open service ports, without revealing your IP address (a proxy scan). Your answer should

include the following:

.  How you ensure that your  IP address is never observed by the target host;

.  Any requirements you must meet to successfully receive stateful information about target ports;

.  All communication flows involved.


Be sure to explain any limitations of your approach and how it satisfies the requirements of the question.   [6]


(d).  Subdomain enumeration enables penetration testers to begin mapping IP addresses and domain

names in a meaningful manner.  However, automated scans may provide out of scope results.  Assume that a client has requested that you conduct a subdomain enumeration that achieves the following:

.  Identify subdomains in the zones royalholloway.ac.uk and rhul.ac.uk, reachable by individuals external to Royal Holloway networks.

.  Identify A records for subdomains up to a depth of 3 (e.g.  x.y.z.rhul.ac.uk);

.  Split results into 2 files - one for A record IP addresses within Royal Holloway CIDR block and one for all other IP addresses;

.  An initial probe for live hosts within the Royal Holloway CIDR block.

Your script may invoke any tools of your choice (cite their developers).  It is vital that your answer

explains the order of execution of your script, and explains how outputs of previous steps are taken as arguments in subsequent steps.  Close your answer, with an explanation as to why you   didn’t scan hosts outside the Royal Holloway CIDR block.                     [9]


Question 2 - Systems-based Security Testing [25 marks]

This question tests your understanding of the theoretical principles of systems security.  You are expected to provide referenced research to support and/or challenge your assertions, and provide reasoned, logical  answers. You may use pentest3 or your own test environment to demonstrate concepts, if you choose.

(a).  Identify the attack in the following C code:

1                   #include  <stdio . h>

2

3                    void   orphan  function ()   {

4                                      print f (”You   have   executed   the   orphaned   function !/n” ) ; 5                    }

6

7                    int   main ( int   argc ,   char   * argv [ ] )   {

8                                      char   input [ 5 0 ] ;

9                                      print f (” Enter   your   name :   ” ) ;

10                                      scanf (”%s” ,   input ) ;

11                                      print f ( input ) ;

12

13                                      void   (* function   ptr )()  = &orphan   function ;

14                                      function   ptr ( ) ;

15

16                                      return   0;

17                    }

Identify and name the code bug that enables you to reach orphan function() without an explicit call to that function.  Describe the steps required (including all inputs and knowledge) by the attack. Briefly (in 1-2 sentences) describe ONE mitigation that would help resolve this attack.               [6]

(b).  Port enumeration is only one way of identifying services within a target network.  Identify one

exploit (and appropriate CVE) that allows you to identify TCP sessions between hosts on a Local Area Network (LAN). Provide a step-by-step walk-through of how your chosen exploit

functions. You may assume that you have already gained access to a host with the vulnerable service required for successful deployment of your exploit.  Clearly state all relevant assumptions (e.g.  Operating Systems, Services, Port states).                                                           [5]

(c).  Explain the difference between Common Weakness  Enumeration (CWE) and Common

Vulnerabilities and Exposures (CVE), both maintained by the MITRE corporation. Your answer should discuss the role of each during vulnerability enumeration, and any relationship between them.  Finish your answer by specifying expected objects of study (e.g.  hosts, services, hardware,   or software) for a vulnerability enumeration using CWE data.                                                             [4]

(d).  Despite having password and credential management policies in place, it’s common for organizations to encounter devices that still utilize default credentials.  In a brief (1-2 page) report, you must address several key points:

•  Identify a class of devices that often ship with default credentials and how attackers exploit this vulnerability to gain unauthorized access.

•  Explain the difference between static and  randomly generated default credentials and the effects of each approach on the scope of potential attacks.

•  Write a script (pseudocode or code of your choice - specify clearly in your answer) that scans a local network (e.g., 192.168.0.0/24) for devices using default credentials. You may assume that you have access to the LAN.

.  Identify the potential impact of a known-credential attack against your specified device type. .  A brief remediation plan, explaining how devices should be safely enrolled on the LAN.

You may use any methods covered in this course, but must clearly explain what services you’re targeting. You must provide referenced evidence of devices and services utilising default credentials  (e.g. data sheets, manufacturer specifications).                       [10]

Practical Exercise

Question 3 - Security Testing in Practice [25 marks]

This question requires that you use the pentest3.isg.rhul.ac.uk environment.  Please respect your fellow colleagues and leave the environment as you found it.

Before proceeding with this question, please note that you should not use exploits known to

crash hosts in the pentest3 network.  Please avoid exploits that explicitly crash the host after exiting session (e.g.  CVE-2009-2698).

You MUST NOT change user credentials or modify the filesystem of any host on the pentest network for any reason.  No question will ask you to change  passwords or access rights.

Remember to back up all of your work to linux.cim.rhul.ac.uk after each session.

(a).  Using a tool of your choice, enumerate all the SMB shares and SMB  Users (NOT users on 192.168.0.16) in the IP range 192.168.0.0/24 on the pentest network. Then, using the

information you have gathered, attempt a brute force login, using a tool of your choice.  Identify and download an appropriate password dictionary file to use in your brute force attempt.

Report all findings, including error states, and the reasons for obtaining (or failing to obtain) account passwords. You must:

.  Clearly explain all steps taken, citing and linking all sources you use.

.  Report  usernames and passwords for all SMB user accounts that you can find.

.  Comment on the limitations of your approach.  This may include completeness of wordlists, computational resources for hash cracking, or other aspects of your chosen approach.

.  Attempt to log in to other services and hosts within the network using recovered credentials and report your findings.    [10]

(b).  Explain  in 1 or 2 paragraphs why passwords should be salted before being stored.  Explain   how passwords are stored in contemporary Linux distributions, providing appropriate examples.  Use the pentest environment, and the command echo -n  “unsalted”|md5sum, to demonstrate how salts benefit password security.  Be sure to clearly state what makes a good salt, from the perspective of password security, and what privileges are required to access specific password files.

Consider using Activity 2 from IY5610/4610 Lab 3 as a starting point, and demonstrate how you can recover passwords from the hashdump of accounts from host 192.168.0.32.  [5]

(c).  Using an appropriate tool demonstrate how Cross-Site Scripting (XSS) functions.  Remember that the pentest environment does not have web access - this task will require use of a Linux

VM. You must compile a report, including screenshots of your work and clear instructions on how to reproduce it, including the following:

.  Vulnerabilities that can be used to develop a XSS attack.

.  An example of how a file upload could be used to launch an XSS attack.

.  An example of Reflected XSS.

.  An example of Stored XSS.

.  Provide at least TWO examples of how the attacker may utilise XSS (by any method above) to their benefit. Clearly explain the lifecycle of both attacks, from identification of the vulnerability, to achieving the final goal of the exploit (and state explicitly what that goal is).

Remember that your aim is to provide a report that demonstrates your understanding and allows the reviewer to reproduce your attack, so be clear in your write up. You must provide screenshots demonstrating your own work, and cite all sources that contribute to it.                                         [10]