⚡️ What MIME-Types are
If a server says “This is text/html”, the client can say “Ah, this is an HTML document, I can render it internally”. If the server says “This is application/pdf”, the client can say “Ah, I need to start the Foxit PDF Reader plugin that the user has installed and that has registered as an application/pdf handler”.
You specify the MIME type when you import or export files - no matter where in your application. Something like this:
<!DOCTYPE html>
<html lang="de">
<head>
<script src="./scripts/logic.js" type="text/javascript"></script> <!-- Hier wird MIME-Type angegeben: type="text/javascript"> -->
<title>Document</title>
</head>
<body>
<!-- Hier Markup -->
</body>
</html>
If you write an AJAX request in JQuery, you should also specify the MIME type here. The following example sends JSON data to a database endpoint:
$.ajax({
url: 'https://yourserver.com/api/submit',
type: 'POST', // use POST to send datta
contentType: 'application/json', // Set MIME-Type to JSON
data: JSON.stringify({funny_name: "Willy"}), // Convert JSON to String
success: function(response) {
console.log('Data send successfully:', response);
// Handle successful response here
},
error: function(jqXHR, textStatus, errorThrown) {
console.error('Error at submission:', textStatus, errorThrown);
// Handle error response here
}
});
Overview of common MIME-Types
MIME Type | File Format(s) | Description |
---|---|---|
text/plain |
.txt | Plain text files |
text/html |
.html, .htm | HTML documents |
text/css |
.css | Cascading Style Sheets |
text/javascript |
.js | JavaScript files |
application/json |
.json | JSON format files |
application/xml |
.xml | XML files |
application/pdf |
PDF documents | |
application/msword |
.doc | Microsoft Word documents |
application/vnd.openxmlformats-officedocument.wordprocessingml.document |
.docx | Microsoft Word (OpenXML) documents |
application/vnd.ms-excel |
.xls | Microsoft Excel spreadsheets |
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet |
.xlsx | Microsoft Excel (OpenXML) spreadsheets |
application/vnd.ms-powerpoint |
.ppt | Microsoft PowerPoint presentations |
application/vnd.openxmlformats-officedocument.presentationml.presentation |
.pptx | Microsoft PowerPoint (OpenXML) presentations |
image/jpeg |
.jpeg, .jpg | JPEG image files |
image/png |
.png | PNG image files |
image/gif |
.gif | GIF image files |
image/svg+xml |
.svg | SVG image files |
audio/mpeg |
.mp3 | MP3 audio files |
audio/wav |
.wav | WAV audio files |
audio/ogg |
.ogg | Ogg Vorbis audio files |
video/mp4 |
.mp4 | MP4 video files |
video/x-msvideo |
.avi | AVI video files |
video/quicktime |
.mov | QuickTime video files |
application/zip |
.zip | ZIP archive files |
application/x-rar-compressed |
.rar | RAR archive files |
application/x-tar |
.tar | TAR archive files |
application/x-7z-compressed |
.7z | 7z archive files |
application/octet-stream |
.bin | Binary files (unknown type) |
Overview of common MIME-Types in Cybersecurity
These MIME types are related to various types of files encountered in cybersecurity contexts, such as reports, logs, scripts, executables, and packet captures. The security relevance often depends on the context in which these files are used and the potential vulnerabilities they may contain. While this table covers many relevant MIME types for cybersecurity, it is not exhaustive, as there may be other specialized formats and extensions in use.
MIME Type | File Extension(s) | Description |
---|---|---|
application/pdf |
PDF Dokumente | |
text/plain |
.txt | Plain text files for logs, scripts, and notes |
text/x-shellscript |
.sh | Shell scripts for executing commands in Unix/Linux environments |
application/xml |
.xml | XML files, often used for configuration or data exchange |
application/json |
.json | JSON files used for data interchange in APIs |
application/octet-stream |
.bin | Binary files, often used for executables or unknown types |
application/x-pcap |
.pcap | Packet capture files used for network traffic analysis |
application/x-dosexec |
.exe | Executable files, often used for malware |
application/x-msdownload |
.dll | Dynamic Link Library files, can be exploited in malware attacks |
application/x-rar-compressed |
.rar | RAR archive files, sometimes used to bundle malicious payloads |
application/zip |
.zip | ZIP archive files, often used for malware distribution |
application/x-msdos-program |
.com | DOS executable files, may contain malicious payloads |
application/x-java-archive |
.jar | Java archive files, can contain Java bytecode and libraries |
application/x-sql |
.sql | SQL files for database queries and management |
application/x-tar |
.tar | TAR archive files, can be used to compress and distribute files |
text/x-pascal |
.pas | Pascal source code files, which could be used in exploitation |
text/x-c |
.c, .cpp | C and C++ source code files, sometimes used in security assessments |
application/x-php |
.php | PHP script files, may contain web application vulnerabilities |
text/x-php |
.php | PHP source files for web applications |
application/x-nmap |
.nmap | Nmap scripts and results, used for network mapping and vulnerability scanning |
application/vnd.microsoft.portable-executable |
.pe | Windows Portable Executable files, can be analyzed for malware |
application/vnd.microsoft.sqldatasource |
.db, .sqlite | Database files, can contain sensitive information |
Overview of common MIME-Types for Multimedia
Here’s a table listing the most common MIME types used for multimedia purposes:
MIME Type | Dateiformat(e) | Beschreibung |
---|---|---|
audio/mpeg |
.mp3 | MPEG audio files, commonly used for music |
audio/wav |
.wav | WAV audio files, uncompressed audio format |
audio/ogg |
.ogg | Ogg Vorbis audio files, often used for streaming |
audio/flac |
.flac | FLAC audio files, lossless audio compression |
video/mp4 |
.mp4 | MP4 video files, widely used for video streaming |
video/x-msvideo |
.avi | AVI video files, an older video format |
video/quicktime |
.mov | QuickTime video files, often used in professional video editing |
video/webm |
.webm | WebM video files, optimized for web use |
image/jpeg |
.jpeg, .jpg | JPEG image files, commonly used for photographs |
image/png |
.png | PNG image files, supports transparency |
image/gif |
.gif | GIF image files, supports animation |
image/svg+xml |
.svg | SVG (Scalable Vector Graphics) files, used for vector images |
image/webp |
.webp | WebP image files, providing lossy and lossless compression |
image/tiff |
.tiff, .tif | TIFF image files, used for high-quality images |
application/x-shockwave-flash |
.swf | SWF files, used for Adobe Flash animations |