Pages

Thursday, November 22, 2012

A list of Mime Types

Following is a list of mime types of most used file types. I wish I had found this earlier
ExtensionMime TypesFile Types
Audio formats
.sndaudio/basicSun/NeXT audio format
.auaudio/basicSun/NeXT audio format
.aiffaudio/x-aiffApple audio format
.aifcaudio/x-aiffApple audio format
.aifaudio/x-aiffApple audio format
.wavaudio/x-wavWindows WAV format
.midaudio/midWindows MIDI format
.rmiaudio/midWindows MIDI format
Image formats
.bmpimage/bmpWindows bitmap format
.gifimage/gifGIF
.iefimage/iefImage Exchange format
.jpgimage/jpegJPEG
.jpeimage/jpegJPEG
.jpegimage/jpegJPEG
.tifimage/tiffTIFF
.tiffimage/tiffTIFF
.rasimage/cmu-rasterCMU raster format
.pngimage/pngPNG
.pnmimage/x-portable-anymapPBM Anymap format
.pbmimage/x-portable-bitmapPBM Pixmap format
.pgmimage/x-portable-graymapPBM Graymap format
.ppmimage/x-portable-pixmapPBM Pixmap format
.rgbimage/x-rgbRGB format
.xbmimage/x-xbitmap7bit-X bitmap
.xpmimage/x-xpixmapX pixmap format
.xwdimage/x-xwindowdumpX window dump (xwd)
.cmximage/x-cmxCorel CMX format
.icoimage/x-iconX-Icon format
Video formats
.mpgvideo/mpegMPEG
.mpevideo/mpegMPEG
.mpegvideo/mpegMPEG
.qtvideo/quicktimeQuickTime
.movvideo/quicktimeQuickTime
.avivideo/aviMS Video for Windows
.movievideo/x-sgi-movieSGImovieplayer
.asfvideo/x-ms-asfMS Active streaming format
.asxvideo/x-ms-asfMS Active streaming format
.vdovideo/x-vdoliveVDOLive script
Message formats
.emlmessage/rfc822Outlook Mail Message
.mhtmessage/rfc822Mail Message
.mhtmlmessage/rfc822Mail Message
Text formats
.htmltext/html8bit-HTML
.htmtext/html8bit-HTML variant
.htmlstext/html8bit-HTML w/ Server-side includes
.shtmltext/html8bit-HTML w/ Server-side includes
.csstext/css8bit-Cascading Style Sheet
.xmltext/xml8bit-XML
.htctext/x-component8bit-HTML component
.ctext/plain7bit-C source
.htext/plain7bit-C headers
.cctext/plain7bit-C++ source
.cpptext/plain7bit-C++ source
.cxxtext/plain7bit-C++ source
.hhtext/plain7bit-C++ headers
.hxxtext/plain7bit-C++ headers
.mtext/plain7bit-Objective-C source
.f90text/plain7bit-Fortran 90 source
.txttext/plain7bit-Plain text
.rtxtext/richtext7bit-MIME Richtext format
.tsvtext/tab-separated-values7bit-Tab-separated values
.etxtext/x-setext7bit-Structure Enhanced Text
.fortext/plain7bit-Fortran
.martext/plain7bit-MACRO
.logtext/plain7bit-logfiles9
.comtext/plain7bit-scripts
.sdmltext/plain7bit-SDML
.listtext/plain7bit-listfiles
.lsttext/plain7bit-listfiles
.deftext/plain7bit-definition files
.conftext/plain7bit-definition files
.cnftext/plain7bit-definition files
.vcftext/x-vcard7bit-VCard
.manifesttext/cache-manifest7bit-manifest file
Compressed file formats
.gz application/x-gzipGNU Zip
.zipapplication/x-zipPKZIP
.tarapplication/x-tar4.3BSD tar
.ustarapplication/x-ustarPOSIX tar
Lotus application formats
.123application/vnd.lotus-1-2-3Lotus 1-2-3 97
.wk4application/vnd.lotus-1-2-3Lotus 1-2-3 97
.wk3application/vnd.lotus-1-2-3Lotus 1-2-3 97
.wk1application/vnd.lotus-1-2-3Lotus 1-2-3 97
.wksapplication/vnd.lotus-1-2-3Lotus 1-2-3 97
.scmapplication/vnd.lotus-screencamLotus ScreenCam Movie
.lwpapplication/vnd.lotus-wordproLotus Freelance 97
.samapplication/vnd.lotus-wordproLotus Freelance 97
.przapplication/vnd.lotus-freelanceLotus Freelance 97
.preapplication/vnd.lotus-freelanceLotus Freelance 97
.impapplication/vnd.lotus-improvLotus Improv
.odtapplication/vnd.oasis.opendocument.textLotus Symphony OpenDocument Text
.odpapplication/vnd.oasis.opendocument.presentationLotus Symphony OpenDocument Presentation
.odsapplication/vnd.oasis.opendocument.spreadsheetLotus Symphony Opendocument Spreadsheet
Microsoft application formats
.docapplication/mswordMicrosoft Word
.dotapplication/mswordMicrosoft Word
.docxapplication/vnd.openxmlformats-officedocument.wordprocessingml.document
.dotxapplication/vnd.openxmlformats-officedocument.wordprocessingml.template
.docmapplication/vnd.ms-word.document.macroEnabled.12
.dotmapplication/vnd.ms-word.template.macroEnabled.12
.pubapplication/x-mspublisherMicrosoft Publisher
.mppapplication/vnd.ms-projectMicrosoft Project
.potapplication/vnd.ms-powerpointMicrosoft Powerpoint
.pptapplication/vnd.ms-powerpointMicrosoft Powerpoint
.ppsapplication/vnd.ms-powerpointMicrosoft Powerpoint
.ppaapplication/vnd.ms-powerpoint
.pptxapplication/vnd.openxmlformats-officedocument.presentationml.presentation
.potxapplication/vnd.openxmlformats-officedocument.presentationml.template
.ppsxapplication/vnd.openxmlformats-officedocument.presentationml.slideshow
.ppamapplication/vnd.ms-powerpoint.addin.macroEnabled.12
.pptmapplication/vnd.ms-powerpoint.presentation.macroEnabled.12
.potmapplication/vnd.ms-powerpoint.presentation.macroEnabled.12
.ppsmapplication/vnd.ms-powerpoint.slideshow.macroEnabled.12
.scdapplication/vnd.ms-scheduleMicrosoft Schedule
.wcmapplication/vnd.ms-worksMicrosoft Works
.wdbapplication/vnd.ms-worksMicrosoft Works
.wpsapplication/vnd.ms-worksMicrosoft Works
.wriapplication/x-mswriteMicrosoft Write
.xlaapplication/vnd.ms-excelMicrosoft Excel
.xlcapplication/vnd.ms-excelMicrosoft Excel
.xlmapplication/vnd.ms-excelMicrosoft Excel
.xlsapplication/vnd.ms-excelMicrosoft Excel
.xltapplication/vnd.ms-excelMicrosoft Excel
.xlwapplication/vnd.ms-excelMicrosoft Excel
.xlsxapplication/vnd.openxmlformats-officedocument.spreadsheetml.sheet
.xltxapplication/vnd.openxmlformats-officedocument.spreadsheetml.template
.xlsmapplication/vnd.ms-excel.sheet.macroEnabled.12
.xltmapplication/vnd.ms-excel.template.macroEnabled.12
.xlamapplication/vnd.ms-excel.addin.macroEnabled.12
.xlsbapplication/vnd.ms-excel.sheet.binary.macroEnabled.12
Macromedia formats
.dcrapplication/x-directorShockwave for Director
.dirapplication/x-directorShockwave for Director
.dxrapplication/x-directorShockwave for Director
.swfapplication/x-shockwave-flashShockwave Flash
.splapplication/futuresplashFuture Splash Animator
RealAudio formats
.rmapplication/vnd.rn-realmediaRealPlayer
.rpmaudio/x-pn-realaudio-pluginRealAudio plug-in
.raaudio/x-pn-realaudioRealPlayer
.ramaudio/x-pn-realaudioRealPlayer
.rvvideo/vnd.rn-realvideoRealPlayer
VRML formats
.wrlx-world/x-vrmlVRML
.wrzx-world/x-vrmlVRML
.xafx-world/x-vrmlVRML
.xofx-world/x-vrmlVRML
Other application formats
.cdfapplication/x-cdfChannel file
.323application/h323H.323 Internet Telephony
.jsapplication/x-javascriptJavaScript
.classapplication/octet-streamJava class file
.binapplication/octet-streamUninterpreted binary
.wp5application/wordperfect5.1WordPerfect
.odaapplication/odaOpen Document Architecture
.pdfapplication/pdfAdobe Acrobat
.aiapplication/postscript8bit-Adobe Illustrator
.epsapplication/postscript8bit-Encapulated PostScript
.psapplication/postscript8bit-PostScript
.rtfapplication/x-rtf7bit-RTF
.cshapplication/x-csh7bit-C-shell script
.dviapplication/x-dviTeX DVI
.hdfapplication/x-hdfNCSA HDF data file
.latexapplication/x-latex8bit-LaTeX source
.ncapplication/x-netcdfUnidata netCDF data
.shapplication/x-sh7bit-Shell-script
.tclapplication/x-tcl7bit-TCL-script
.texapplication/x-tex8bit-TeX source
.texiapplication/x-texinfo7bit-Texinfo
.texinfoapplication/x-texinfo7bit-Texinfo
.tapplication/x-troff7bit-Troff
.roffapplication/x-troff7bit-Troff
.trapplication/x-troff7bit-Troff
.manapplication/x-troff-man7bit-Troff with man macros
.meapplication/x-troff-me7bit-Troff with me macros
.msapplication/x-troff-ms7bit-Troff with ms macros
.srcapplication/x-wais-source7bitWAIS source
.bcpioapplication/x-bcpioOld binary CPIO
.cpioapplication/x-cpioPOSIX CPIO
.gtarapplication/x-gtarGnu tar
.sharapplication/x-shar8bit-Shell archive
.sv4cpioapplication/x-sv4cpioSVR4 CPIO
.sv4crcapplication/x-sv4crcSVR4 CPIO with CRC
.icex-conference/x-cooltalkCooltalk
.rrfapplication/x-InstallFromWebInstallFromTheWeb
.wisapplication/x-InstallFromWebInstallFromTheWeb plug-in
.jnlpapplication/x-java-jnlp-fileJava Web Start
.crlapplication/pkix-crlCertificate Revocation List
Hope this helps :)


XSS - Possible measures

I understand that there are some tools like Nessus and Nikto that would help detect such attacks. I have no idea about them though. Just came across these stuffs and hence though of sharing the same.

Following is a shame less copy and paste. Again just wanted to share what I read.


How to Protect Yourself

The primary defenses against XSS are described in the OWASP XSS Prevention Cheat Sheet.
Also, it's crucial that you turn off HTTP TRACE support on all webservers. An attacker can steal cookie data via Javascript even when document.cookie is disabled or not supported on the client. This attack is mounted when a user posts a malicious script to a forum so when another user clicks the link, an asynchronous HTTP Trace call is triggered which collects the user's cookie information from the server, and then sends it over to another malicious server that collects the cookie information so the attacker can mount a session hijack attack. This is easily mitigated by removing support for HTTP TRACE on all webservers.
The OWASP ESAPI project has produced a set of reusable security components in several languages, including validation and escaping routines to prevent parameter tampering and the injection of XSS attacks. In addition, the OWASP WebGoat Project training application has lessons on Cross-Site Scripting and data encoding.

And I guess you can get more ideas on the possible ways by which you can be exploited in http://ha.ckers.org/xss.html.
Hope this helps :)

XSS Cross-site scripting makes me worry


The concept of cross site scripting rang a bell inside me a long time ago. I was kind of wary about it and I even learnt to perform it. Hey I am not a hacker, dont start getting ideas already. Its just that I am curious and feel very happy to experiment stuffs the safe way as most of us prefer to do. Recently I came across a nice post about it in https://www.owasp.org/index.php/Cross-site_Scripting_(XSS).

It was very informative and very useful. I am getting newer ideas even when I am typing this one down. All stuffs posted in the site are basic and clean, but opens up my mind to a lot of potentially harzardous methods, if employed by some one against my sites, would be a massacre.

By my thoughts some of the stuffs that bothers me about how XSS may affect us are

1.
<html>
<body>

<? php
print "Not found: " . urldecode($_SERVER["REQUEST_URI"]);
?>

</body>
</html>

2.
http://testsite.test/<script>alert("TEST");</script>

3.<%...
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("select * from emp where id="+eid);
if (rs != null) {
 rs.next();
 String name = rs.getString("name");
%>

Employee Name: <%= name %>
where name can be an XSS Hack

You can steal user session cookie etc.. and a lot more of such examples can be made

Most of the times when I am into serious mind wrecking program issues, all I would need was one loop hole, however small it may be, and I would fix the issues. I will just get what ever I want out of it.

All I did here was 10 minutes of thinking about what can I do with XSS. And I already got a lot of options.

Worst case, if I could understand a browser, which I definelty can if I spend a couple of months may be, I my self can do idiotic stuffs. So what can a full time hacker be capable of. Hope I dont get a cyber attack. This is scary

Saturday, November 17, 2012

Alert box issues in Sencha Touch 2

I believe there is an issue with the Ext.Msg.alert() dialog in chrome right from the first version of the Sencha Touch. However there were css hacks that have been posted in various forums to handle them.
My point is it only has issues with Chrome and not with safari and I believe mobile devices dont use chrome yet. So I just had this tought running in my head.


Just leave it and get on with your work unless u think, it will keep bothering you. :)

Enable/Disable USB Ports

I had a sudden thought on doing things the hard way. So I just wanted to do something that will be done other than the ordinary way. And thats how I ended up with tampering my USB ports. I really hate simple access restrictions :P
After all its is very useful. I found the following stuff which partially worked.

“HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR”

Right Click “Start” and Click modify
  • To enable USB ports: change the value from “4″ to “3″
  • To disable USB ports: change the Value for “3″ to “4″

I got to admit. I am dumb to have expected this to save me. But atleast I learnt something :)

List of all xtypes in Sencha Touch 2

List of all xtypes
# xtype Class

1 actionsheet Ext.ActionSheet
2 audio Ext.Audio
3 button Ext.Button
4 component Ext.Component
5 container Ext.Container
6 image Ext.Img
7 label Ext.Label
8 loadmask Ext.LoadMask
9 map Ext.Map
10 mask Ext.Mask
11 media Ext.Media
12 panel Ext.Panel
13 segmentedbutton Ext.SegmentedButton
14 sheet Ext.Sheet
15 spacer Ext.Spacer
16 title Ext.Title
17 titlebar Ext.TitleBar
18 toolbar Ext.Toolbar
19 video Ext.Video
20 carousel Ext.carousel.Carousel
21 carouselindicator Ext.carousel.Indicator
22 navigationview Ext.navigation.View
23 datepicker Ext.picker.Date
24 picker Ext.picker.Picker
25 pickerslot Ext.picker.Slot
26 slider Ext.slider.Slider
27 thumb Ext.slider.Thumb
28 tabbar Ext.tab.Bar
29 tabpanel Ext.tab.Panel
30 tab Ext.tab.Tab
31 viewport Ext.viewport.Default

DataView Components
---------------------------------------------
32 dataview Ext.dataview.DataView
33 list Ext.dataview.List
34 listitemheader Ext.dataview.ListItemHeader
35 nestedlist Ext.dataview.NestedList
36 dataitem Ext.dataview.component.DataItem
37
Form Components
---------------------------------------------
38 checkboxfield Ext.field.Checkbox
39 datepickerfield Ext.field.DatePicker
40 emailfield Ext.field.Email
41 field Ext.field.Field
42 hiddenfield Ext.field.Hidden
43 input Ext.field.Input
44 numberfield Ext.field.Number
45 passwordfield Ext.field.Password
46 radiofield Ext.field.Radio
47 searchfield Ext.field.Search
48 selectfield Ext.field.Select
49 sliderfield Ext.field.Slider
50 spinnerfield Ext.field.Spinner
51 textfield Ext.field.Text
52 textareafield Ext.field.TextArea
53 textareainput Ext.field.TextAreaInput
54 togglefield Ext.field.Toggle
55 urlfield Ext.field.Url
56 fieldset Ext.form.FieldSet
57 formpanel Ext.form.Panel

Problem downloading Microsoft Powerpoint 2007 document from domino server 8.5

A while ago I was presented with a seemingly trival and strange issue. The issue stated something like, a user was able to download a .pptx file from a domino website and when opened it is always blank, were as other users were able to download the .pptx file and view its contents with out issues. I thought to my self, am I an astrologer and have I sinned enough to be tested with such an issue that if I would like to get serious about it, I might laugh my self to de***.

Yes it was funny, and I did all sorts of checking like is the user trying to preview the file on lotus notes which I knew would fail or does the user's machine really have Microsoft office installed and many such tests came back negative. I knew I am approaching/at the verge of the dangerous scenario - "Laughing myself to de***", i.e. get serious.

Know what?, I did really found something serious. Once again I am humbly reminded that one can never know everything.

It is a kind of a well known bug which was well documented as well. A rare phenominan with IBM lol. :P
http://www-01.ibm.com/support/docview.wss?uid=swg21412063

It helped me find something that I was looking for a long time, a list of all the commonly used mime type. Wonderful:O..

The abstract of what I understood from the documentation is as follows
In some cases, the browser identifies the attachment as a zip file.

Symptom : The user may be prompted to download the file locally, even though the file type is associated with the correct application in their browser.

Cause : This issue occurs because the MIME types for Microsoft Office 2007 formats are not listed in the Web Server metabase on the Domino server (httpd.cnf).

Currently, when a HTTP request is made for an unknown file type, the server returns a Content-Type of "application/octet-stream" in the response, instead of the appropriate Office 2007 MIME type.

Resolving the problem
This issue is now fixed in Lotus Notes and Domino 8.5.1 FP4 and 8.5.2.

Fix details: SPR# JBEN7WRHM7

Refer to the Upgrade Central site for details on upgrading Notes/Domino.

To resolve the issue in a previous release, IBM recommends performing the following actions to add the Office 2007 MIME types to your current Web Server metabase (httpd.cnf):

1) Shutdown the HTTP process by issuing the following command on the Domino server console: tell http quit

2) Open the httpd.cnf file (located in the Domino Data directory) using a text editor, such as Notepad. In order to edit this type of file on most operating systems, it will be necessary to launch the editor first and then open using the file menu from within the editor.

3) Copy the Office 2007 MIME types below and paste them into the httpd.cnf file (Note: When inserted, each line below should begin with either the hash symbol "#" or "AddType")


#
# Microsoft Office 2007 formats
#
AddType .docx application/vnd.openxmlformats-officedocument.wordprocessingml.document
AddType .dotx application/vnd.openxmlformats-officedocument.wordprocessingml.template
AddType .xlsx application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
AddType .xltx application/vnd.openxmlformats-officedocument.spreadsheetml.template
AddType .pptx application/vnd.openxmlformats-officedocument.presentationml.presentation
AddType .potx application/vnd.openxmlformats-officedocument.presentationml.template
AddType .ppsx application/vnd.openxmlformats-officedocument.presentationml.slideshow

Note: The above list only includes the most commonly used Office 2007 MIME types. For a complete list of the document types addressed by SPR # JBEN7WRHM7 (including other extensions that may be needed in your environment), please refer to the following Microsoft documentation:
http://blogs.msdn.com/b/vsofficedeveloper/archive/2008/05/08/office-2007-open-xml-mime-types.aspx

4) Restart the HTTP task by issuing the following command on the Domino server console: load http