⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sorter.1

📁 linux下开发的针对所有磁盘的数据恢复的源码
💻 1
字号:
.TH SORTER 1 .SH NAMEsorter \- Sort files in an image into categories based on file type.SH SYNOPSIS.B [-b.I size.B ] [-e] [-E] [-h] [-l] [-md5] [-s] [-sha1] [-U] [-v] [-V] [-a.I hash_alert.B ] [-c .I config.B ] [-C .I config.B ] [-d.I dir.B ] [-m.I mnt.B ] [-n.I nsrl_db.B ] [-x.I hash_exclude.B ] [-i imgtype] [-o imgoffset] [-f fstype] image [image] [meta_addr].SH DESCRIPTION.B sorteris a Perl script that analyzes a file system to organize theallocated and unallocated files by file type.  It runs the 'file'command on each file and organizes the files according to the rulesin configuration files.  Extension mismatching is also done toidentify 'hidden' files.  One can also provide hash databases forfiles that are known to be good and can be ignored and files that areknown to be bad and should be alerted.By default, the program uses the configuration files in the directorywhere The Sleuth Kit was installed.   Those can be overruled withrun-time options.  There is a standard configuration file for allfile system types and then a specific one for a given operatingsystem..SH ARGUMENTSThe required arguments are as follows.  This will analyze one or more images and either save the results in the '-d' directory or listthe results to STDOUT (if '-l' is given).  .IP "-d dir"Specify the location of where all files should be written.  This includesthe index files and subdirectories if the '-s' flag is given.  This MUST be given, unless the '-l' list flag is given.  .IP -lList information to STDOUT (no files are ever written).  This is usefulfor Incident Response, with the use of 'netcat'.  This cannot be usedif '-d' is used.  .IP imagesThe file names of the image(s) to analyze.  .PPThe options are as follows:.IP "-f fstype"Specify the file system type of the image(s).  This is the sametype that The Sleuth Kit uses.  .IP "-i imgtype"Specify the image type in which the file system is located.  Thisis the same type that The Sleuth Kit uses..IP "-o imgoffset"Specify the sector offset from the beginning of the image to the start of the file system..IP "-b size"Specify the minimum size of file to process.  All files less than this sizewill be ignored..IP "-c config"Specify the location of an additional configuration file.  This filewill be loaded in addition to the standard ones in the install directory.  These settings willhave priority over the standard files.  .IP "-C config"Specify the location of the ONLY configuration file.  The standard configfiles will not be loaded if this option is given.  For example, in the\'share/sort\' directory there is a file called 'images.sort'.  This filecontains only rules about graphic images.  If it is specified with -C, thenonly images will be saved about the image.  .IP "-m mnt"Specify the mounting point of the image being analyzed.  This is onlyfor cosmetic reasons.  When the entries in the output files are written,the files will have a the full path instead of just the relative path.If this is given, then only one image can begiven.  .IP "-a hash_alert"Specify the location a hash database with entries of known 'bad' files.If any file is found with an MD5 hash value in this database, it willbe placed in a special alert file.  This database must have beenindexed for MD5 using 'hfind' in The Sleuth Kit before it is used by sorter..IP "-n nsrl_db"Specify the location of the NIST National Software Reference Library(NSRL) database (www.nsrl.nist.org).  Any file found in the NSRLwill be ignored and not placed into a category.  The database mustbe indexed for MD5 with 'hfind' in The Sleuth Kit before it is used by sorter.The database file is currently called 'NSRLFile.txt'.  .IP "-x hash_exclude"Specify the location a hash database with entries of known 'good'files.  If any file is found with an MD5 hash value in this database,it will be ignored and not processed or saved to the category files.This database must have been indexed for MD5 using 'hfind' in The Sleuth Kit beforeit is used by sorter..IP -ePerform extension mismatch checks on (no category index files are generated).IP -iPerform category indexing only (no extension mismatch checks).IP -UDo no save data about unknown file types.  By default, an 'unknown'file is created for files where the 'file' output is not known.  This allowsone to refine their configuration.  If this is not desired, use this flag..IP -hCreate category files in HTML.IP -md5Calculate the MD5 value for each file and save it in the category file.  This will be done automatically when any of the databases are given.  .IP -sha1Calculate the SHA-1 value for each file and save it in the category file..IP -sSave the actual file content to sub-directories in the directory specified by '-d'.  For example, all JPG and GIF files would actually besaved in the 'images' directory.  If '-h' is also given, thumbnails ofgraphic images are also created.  .IP -vDisplay verbose information.IP -VDisplay version..IP [meta_addr]The meta data address of the directory to start with.  By default,the root directory is used.  If this is given, then only one imagecan be given..SH HIGH-LEVEL OVERVIEW OF PROCESS.B sorteris a Perl script that interacts with other The Sleuth Kit tools.  It startsby reading the configuration files from the installation directory.There is a general configuration file and a specific one for eachoperating system.  The specific one is determined from the '-f'flag.  Each configuration file contains rules for processing theoutput of the 'file' command.  One type of line identifies whichcategory (i.e. 'images') a given 'file' output belongs to (i.e.\'image data\') (using regular expressions).  Another rule shows thefile extensions (i.e. .txt) that belong to a 'file' output (i.e.ASCII(.*?)text).  See the Rules section below.The program then runs the 'fls' tool in The Sleuth Kit to identify the filesin the file system image.  Each identified file is viewed usingthe 'icat' tool.  If a hash database is given, the hash of the file iscalculated and looked up.  If it is found in an 'alert' database,then it is added to a special 'alert.txt' file.  If it is found inthe NSRL or 'exclude' database, then it is ignored as a known goodfile.  Excluded files are recorded in an 'exclude' file for futurereference but it is not saved in the category files.The 'file' command is then run to identify the file type (based onheader information).The configuration file rules are used to identify which categoryit belongs to.  An entry is added to the corresponding categoryfile (in the '-d dir' directory).  If the '-s' flag is given, thena copy of the file is saved in a subdirectory of the same name asthe category.  If the HTML format is used, then hyper-links willallow one to easily view saved files and view what is in eachcategory.Files that do not have a category are recorded in the 'unknown'category and the 'data' category.  'data' is for files with astructure that 'file' does not know and 'unknown' is for files witha structure that 'file' knows about.  These are saved for futurereference, but the unknown category can be ignored by usingthe '-U' flag.A copy of the files can be saved by using the '-s' flag.  If so,then the files are saved in a subdirectory that is named withthe category name.  Each file is named using the file system imagename followed by the meta data address and the original fileextension.  The category index file can be used to translate theactual name to the saved name.  The HTML format makes viewing easieras there are links to each file from the category index file.The program will also consult the rules about the file extension.If the file has an extension at the end of it (anything after a\'.\'), it will be compared to the rules.  If the extension is notfound in the rules as a valid extension for the file type, it willbe added to the file of 'mismatch'.  If the file does not have anextension it will not be entered even if the file type has validextensions.  This check is done even if the file is found in oneof the known good hash databases.  If it is found in one of those,it will be added to a special file.  Files of type 'data' haveno extension checks done by default (as they have an unknownstructure).  The program repeats the above procedures using the output of the 'ils' command as well.  This allows 'sorter' to examine the contents ofunallocated files that still have pointers to the data units (not allfile systems will produce data from this step).  .SH CONFIGURATION FILESConfiguration files are used to define what file types belong in whichcategories and what extensions belong to what file types.  Configurationfiles are distributed with the 'sorter' tool and are located in theinstallation directory in the 'share/sorter' directory.  The 'default.sort' file is used by any file system type.  It containsentries for common file types.  A specific operating system file alsoexists, which is useful for extensions that are specific to a given OS.  By default, the default file and the OS specific one will be used.  Usingthe '-c' flag, an additional file can be used.  If the '-C' flag is used,then only the supplied configuration file is used.There are two rule types in the configuration files.  Each rule startswith a header that specifies which rule type it is (category or ext).Both rule types have two additional columns that can be separated byany white space.  The category rule has the category name as the second column and aPerl regular expression in the third column.  The category name cannot have any spaces in it and can only be letters and numbers.  The regular expressionis used to examine the output of 'file'.  The regular expression willbe used case insensitive.  More than one rule can exist fora category, but only one category can exist for a given file output.  For example:This saves all file output with 'image data' anywhere in it to the\'images\' category:      category        images          image dataThis saves all file output that has 'ASCII' followed by anything andthen 'text' to be saved to the 'text' category:    category        text            ASCII(.*?)textThis saves all file output that is just 'data' to the 'data' category (the ^ and $ define the boundaries in Perl).  The 'data' value iscommon in the output of file for unknown binary data.      category        data            ^data?There is a special category of 'ignore' that is used to skip overfiles of this type.  This is mainly a time and space saver. The extension rule is similar except that the second column has thevalue extensions for the file output.  Multiple rules can exist forthe same file type.  The comparison will be done case insensitive.  If no extension is valid for the file type, a rule does not need tobe made.  That is already assumed.  For example, the ASCII is used for several file extensions so the following rules could exist:    ext             txt,log         ASCII(.*?)text    ext             c,cpp,h,js      ASCII(.*?)textPlease email me any rules that you find useful for standard investigationsand I will incorporate them into future releases (carrier at sleuthkit dot org).  .SH EXAMPLESTo run sorter with no hash databases, the following can be used:    # sorter -f ntfs -d data/sorter images/hda1.dd	    # sorter -d data/sorter images/hda1.dd    # sorter -i raw -f ntfs -o 63 -d data/sorter images/hda.ddTo include the NSRL, an exclude, and an alert hash database:    # sorter -f ntfs -d data/sorter -a /usr/hash/rootkit.db \	  -x /usr/hash/win2k.db -n /usr/hash/nsrl/NSRLFile.txt \	  images/hda1.ddTo just identify images using the supplied 'images.sort' file:    # sorter -f ntfs -C /usr/local/sleuthkit/share/sort/images.sort \	  -d data/sorter -h -s images/hda1.dd.SH REQUIREMENTSThe NIST National Software Reference Library (NSRL) can be found atwww.nsrl.nist.gov..SH LICENSEDistributed under the Common Public License, found in the .I cpl1.0.txtfile in the The Sleuth Kit licenses directory..SH AUTHORBrian Carrier <carrier at sleuthkit dogt org>Send documentation updates to <doc-updates at sleuthkit dot org>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -