DOS

From St. Louis Hackerspace Wiki

(Difference between revisions)
Jump to: navigation, search
(Created page with ''''DOS''' (or Disk Operating System or Dynamic Operating System) is a shorthand term for several closely related operating systems that dominated the IBM PC compatible market bet...')
 
Line 83: Line 83:
|}
|}
There are other commands, but the ones listed in the table above are probably the most important to know.
There are other commands, but the ones listed in the table above are probably the most important to know.
 +
 +
== Using DOS to hide files inside images ==
 +
A simple hack that one can do with DOS is hide files inside of images. For example, suppose you wanted to hide a secret file inside an image.  You would want to do the following.
 +
# Compress the file into a <tt>.zip</tt> either using Windows Explorer or [[7-zip]].  We will refere to the secret file as <tt>Secret.zip</tt>
 +
# Take an image (preferilby <tt>.jpg</tt>) and copy or save it to the directory that <tt>Secret.zip</tt> is in.
 +
# In the DOS Command Prompt, type the following command. <pre>copy /b Image.jpg + Secret.zip Image.jpg</pre>
 +
 +
In [[7-zip]] (NOT WINDOWS EXPLORER!), go to the directory that <tt>Image.jpg</tt> is in, then double click on <tt>Image.jpg</tt>. Windows Explorer would show you the image, but in the case of <tt>Image.jpg</tt>, you can see the contents of <tt>Secret.zip</tt> hidden inside of Image.jpg.
 +
 +
Keep in mind that <tt>.zip</tt> compression is not the best way to use this hack.  Using <tt>.tar.gz</tt>, <tt>.tar.bz2</tt> or <tt>.7z</tt> would be recommended.  Using different compression format, you can hid the same file without overly increasing <tt>Image.jpg</tt>'s file size. YMMV.
 +
===How it works===
 +
The command you used in step three uses the <tt>copy</tt> command to copy a binary file (<tt>/b</tt>) by appending <tt>Secret.zip</tt> to the end of <tt>Image.jpg</tt> (<tt>Image.jpg + Secret.zip</tt>) then save it as <tt>Image.jpg</tt>.
== References ==
== References ==
Line 92: Line 104:
[[Category:Shells]]
[[Category:Shells]]
[[Category:Operating systems]]
[[Category:Operating systems]]
 +
[[Category:Hacks]]

Current revision as of 18:43, 5 June 2010

DOS (or Disk Operating System or Dynamic Operating System) is a shorthand term for several closely related operating systems that dominated the IBM PC compatible market between 1981 and 1995, or until about 2000 if one includes the partially DOS-based Microsoft Windows versions 95, 98, and Millennium Edition.

Since Microsoft Vista, Microsoft has opted to use a new proprietary program called PowerShell, which has been about as warmly accepted by programmers as a wet Q-tip in the ear.

Older programmers and more experienced programmers still like using DOS to write Batch Files (.bat) to execute various scripts in the DOS Prompt.

Contents

Launching a DOS Command Prompt

Despite the fact that Microsoft has just about abandoned MS-DOS, it is still there and is as still relevant today as it has been to previous generations of computer geeks.

The fastest way to open up a Command Prompt is to key WINDOW KEY+R, which launches the Run Prompt, then type cmd or cmd.exe.

Commands you should know

Command What it does UNIX equivalent
help Display documentation of various commands used in DOS. help, man, info
doskey Enhances DOS by allowing arrow keys to be used to scroll through past commands used. Generally enabled, but if not, you may want to type this command. It also allows you to use the tab key to complete entering arguments as well as scroll through them using the tab key. None.
cd Change Directory. Remember, Windows uses backslashes \. cd
cls Clear screen. clear
copy Copies one or more files to another location. cp
date Display or set the date. date
del Deletes one or more files rm
dir Displays a list of the files and subdirectories in a directory. ls or more specifically ls -l
echo Displays messages, or toggles command echoing echo
exit Quit cmd.exe exit
mkdir Create a directory mkdir
more Display output one screen at a time. more, less
move Move one or more files from one directory to another. mv
ren Rename a file or files. mv
rmdir Remove a directory. (Use with caution!) rmdir
type Displays the contents of a text file. cat

There are other commands, but the ones listed in the table above are probably the most important to know.

Using DOS to hide files inside images

A simple hack that one can do with DOS is hide files inside of images. For example, suppose you wanted to hide a secret file inside an image. You would want to do the following.

  1. Compress the file into a .zip either using Windows Explorer or 7-zip. We will refere to the secret file as Secret.zip
  2. Take an image (preferilby .jpg) and copy or save it to the directory that Secret.zip is in.
  3. In the DOS Command Prompt, type the following command.
    copy /b Image.jpg + Secret.zip Image.jpg

In 7-zip (NOT WINDOWS EXPLORER!), go to the directory that Image.jpg is in, then double click on Image.jpg. Windows Explorer would show you the image, but in the case of Image.jpg, you can see the contents of Secret.zip hidden inside of Image.jpg.

Keep in mind that .zip compression is not the best way to use this hack. Using .tar.gz, .tar.bz2 or .7z would be recommended. Using different compression format, you can hid the same file without overly increasing Image.jpg's file size. YMMV.

How it works

The command you used in step three uses the copy command to copy a binary file (/b) by appending Secret.zip to the end of Image.jpg (Image.jpg + Secret.zip) then save it as Image.jpg.

References

Personal tools