But, from a security standpoint there are many things to consider when implementing WebSockets in your next project. I don't call them vulnerabilities - but they will most likely create a vulnerability when not dealt with correctly. In this post I describe all these aspects and release socket_io_client - tool for testing & exploiting WebSockets servers.
Showing posts with label server. Show all posts
Showing posts with label server. Show all posts
Friday, March 4, 2011
HTML5 WebSockets - security & new tool for attacking
WebSockets is definately one of the brighter features of HTML5. It allows for easy and efficient real-time commucation with the server, and with the introduction of Socket.IO, node.js and similar libraries, it is sure to gain popularity. It's a must when you're developing an interactive application like chat, game, realtime reporting system etc.
Thursday, September 17, 2009
HTTP File server released
Problem
Imagine a situation where your application has to store and retrieve files on the web (i.e. not on a local filesystem). You have many options - you may upload them to FTP server, e-mail them, use some file hosting services like Dropbox, upload files using a HTML form, use WebDAV server. Finally you may mount some remote filesystem like NFS.All of these options are valid, but they all carry certain amount of requirements that may not always be met:
- To use FTP, you need to set up a remote FTP server, have an implemented FTP client in your language of choice and the ability to open FTP connections on the system you're using.
- To use e-mail you need to be able to handle POP3 and SMTP protocols and have a mail server set up.
- WebDAV, although convenient, is hard to set up in the first place. The protocol itself takes some time to implement.
- Using any other web application like Dropbox requires you to have a client for their services and you need to accept the licence restrictions.
- HTML form - an excelent choice. If you're doing the uploads manually, you may write a simple script in minutes - but what if you want to upload files automatically (e.g. in a batch script)? You need to make a HTTP request with form and the file within encoded, you have to deal with mime-types, encoding file contents etc. Not really fast to implement.
- Mounting remote filesystem is impossible on a shared Linux server, or Windows server.
Solution
HTTP File server to the rescue. This small little fellow, written in PHP5 is a simple REST-oriented file server with minimal requirements:- PHP 5 (5.2 I suppose)
- web server (Apache will do)
- writable directory (this is where your files will be stored)
Example
Example usage:# store file on server - use HTTP POST wget --post-file=file_to_send.txt http://server/index.php/path/to/store/file.txt -O - # retrieve file - use HTTP GET wget http://server/index.php/path/to/store/file.txtThat's pretty much it. The server is so simple, it doesn't (yet?) offer even the ability to list directory contents. All it does is store files and retrieve them.
Download
Download HTTPFileServer and take a look for yourself. Your comments are welcome. The project is BSD licensed.
Subscribe to:
Posts (Atom)