Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Part 2 : Write a series of attacks against our insecure reference monitors. . Requirement 1 : You will need to write one or more
Part : Write a series of attacks against our insecure reference monitors.
Requirement : You will need to write one or more attack files which successfully circumvent each of the reference monitors we have defined. A successful attack is one where you are able to circumvent the requirements from part Examples include causing an invalid file to be saved, reading the "write to file, or writing to the backup file we read from. In general abusing any functionality and causing the reference monitor to behave the way it was not supposed to Preferably with an advantage to an attacker.
Requirement : Do NOT trigger the secure reference monitor. This monitor is not susceptible to any known attacks. If your attack against this monitor returns true, it is likely an error in the logic and not because your attack was successful. This will also earn you points on this portion until you correct your code.
In this assignment you will learn how to attack a reference monitor. The reference monitor you will be testing uses the security layer framework encasement library, etc. for the Seattle testbed. It is possible to do this assignment separately, but it is recommended that this assignment be completed after Part One.
You will submit a zip file containing all of the tests you have created. You will gain points for every student's reference monitor you find a flaw in It is good if multiple tests of yours break a student's reference monitor, but you gain the same number of tests whether one or more tests break the layer.
The result of my tests:
Tests on a working reference monitor that has an issue with threading defenses.
Tests on a working reference monitor that has an issue with file lengths.
Tests on a barely working reference monitor that tests bare functionality.
Tests on a working reference monitor that has poor defenses.
Below is another example of a test case you may want to consider.
# New File Operation
# Clean up of existing file
if "testfile.txta in listfiles:
removefiletestfiletxta
if "testfile.txtb in listfiles:
removefiletestfiletxtb
# Open File Function Call
myfileABopenfiletestfiletxtTrue #Create an AB file
try:
# EmptyNew File should have contents SE satisfying the requirement
assertSE myfile.readat
# Close the file:
myfile.close
except:
myfile.close
# Error Handle or Failure Condition
logEmpty file is not handled properly!"
The reference monitor from Part One:
class ABFile:
def initselffilename,create:
# globals
mycontextdebug False
# local per object reference to the underlying file
self.Afn filenamea
self.Bfn filenameb
self.length
#Make the files and add SE to the Readat file...
if create:
if self.Afn in listfiles:
self.Afile openfileselfAfn,create
self.Bfile openfileselfBfncreate
self.Bfile.writeatselfAfile.readatNone
else:
self.Afile openfileselfAfn,create
self.Bfile openfileselfBfncreate
self.Afile.writeatSE
else:
if self.Afn in listfiles:
self.Afile openfileselfAfn,True
self.Bfile openfileselfBfnTrue
self.Bfile.writeatselfAfile.readatNone
else:
raise FileNotFoundError
def writeatselfdata,offset:
filesize lenselfBfile.readatNone
# Check for invalid writes
if offset filesize:
self.Bfile.writeatxoffset filesize filesize
self.Bfile.writeatdataoffset
def readatselfbytes,offset:
# Read from the A file using the sandbox's readat...
data self.Afile.readatbytesoffset
return data
def closeself:
ifisvalidcontentselfAfile and isvalidcontentselfBfile:
copy self.Bfile.readatNone
self.Afile.writeatcopy
# if a file is not valid then we will discard it ie replace B file with A file.
else:
copy self.Afile.readatNone
self.Bfile.writeatcopy
self.Afile.close
self.Bfile.close
def ABopenfilefilename create:
# First method that is called in the reference monitor when a file is opened.
return ABFilefilenamecreate
def isvalidcontentfile:
firstchar file.readat
if firstchar S:
i
try:
whileTrue:
filesize file.readati
i i
except Exception as e:
lastchar file.readati
if lastchar E:
return True
else:
return False
Step by Step Solution
There are 3 Steps involved in it
Step: 1
The question is incomplete because it involves writing a detailed series of attacks against insecure reference monitors without further context or exp...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started