15.01.2014 Views

An Ontology for Digital Forensics in IT Security Incidents - OPUS

An Ontology for Digital Forensics in IT Security Incidents - OPUS

An Ontology for Digital Forensics in IT Security Incidents - OPUS

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

7.6. SPARQL 59<br />

PREFIX rdfs :< http :// www . w3 . org /2000/01/ rdf - schema #><br />

PREFIX rdf :< http :// www . w3 . org /1999/02/22 - rdf - syntax - ns #><br />

PREFIX usr :< http :// www . example . org / user #><br />

PREFIX hw :< http :// www . example . org / hardware #><br />

PREFIX fs :< http :// www . example . org / filesystem #><br />

PREFIX sw :< http :// www . example . org / software #><br />

PREFIX pro :< http :// www . example . org / process #><br />

PREFIX reg :< http :// www . example . org / registry #><br />

PREFIX <strong>for</strong> :< http :// www . example . org / <strong>for</strong>ensic #><br />

PREFIX net :< http :// www . example . org / network #><br />

PREFIX mem :< http :// www . example . org / memory #><br />

PREFIX cnt :< http :// www . w3 . org /2011/ content #><br />

PREFIX fsfn :< http :// www . example . org / filesystem / fsfilename #><br />

PREFIX base :< http :// www . example . org /><br />

List<strong>in</strong>g 7.2: SPARQL Prex<br />

ied to be the result. The DISTINCT keyword elim<strong>in</strong>ates duplicates <strong>in</strong> the<br />

result set. L<strong>in</strong>e three tells that the object that is bound to the variable ?file<br />

has to be of type fs:FSFileName. In l<strong>in</strong>e four the value of the fsfn:name<br />

property of the variable ?file is required to be the same as FILENAME.<br />

1 SELECT DISTINCT ? file<br />

2 WHERE {<br />

3 ? file rdf : type fs : FSFileName .<br />

4 ? file fsfn : name " FILENAME ".<br />

5 }<br />

List<strong>in</strong>g 7.3: Simple F<strong>in</strong>d le Query<br />

A problem with this simple query is that the full path of the le has to<br />

be specied <strong>in</strong> order to nd the FileName entry.<br />

<strong>An</strong> advanced query that solves this problem is shown <strong>in</strong> list<strong>in</strong>g 7.4. It uses<br />

regular expressions to nd les where only parts of the name are known. The<br />

query will list all les that conta<strong>in</strong> the specied str<strong>in</strong>g <strong>in</strong> the full path. What<br />

we want to get is the name of a le and a reference to the related File Name<br />

entry <strong>for</strong> further <strong>in</strong>spection of the properties of the le. The variables ?name<br />

and ?file will conta<strong>in</strong> this <strong>in</strong><strong>for</strong>mation. In l<strong>in</strong>e three the variable ?file<br />

is ensured to be of the type fs:FSFileName. L<strong>in</strong>e four b<strong>in</strong>ds the value<br />

of the fsfn:name eld of the variable ?file to the variable ?name. The<br />

fth l<strong>in</strong>e lters <strong>for</strong> the specied le name(FILENAME). The function str(a)<br />

returns the str<strong>in</strong>g representation of the variable a and regex(a,b) returns<br />

true if str<strong>in</strong>g a matches pattern b. The regex(a,b,f) function accepts<br />

additional ags. For example ag i causes case <strong>in</strong>sensitive match<strong>in</strong>g so<br />

regex("WiNdOwS","w<strong>in</strong>dows","i") returns true.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!