821 views

Loading ...
23.12.11
Posted in Blogroll, News, Product Ideas, Tech at 12:26 am by Liv 
I’m sure some of you have found the need occasionally to use the “console” input/output support provided by the JDK via System.in and System.out — if nothing else just to implement an occasional more complicated command-line “scripty” app to be run in a Linux environment and piped input in or out from/to another program.
The problem so far has been the fact that while System.out is a PrintStream instance — System.in is an InputStream implementation! So while the output deals with characters, the input deals with bytes — and you have to start wrapping it up (through a few layers!) into a BufferedReader so you can read input line by line.
Luckily, JDK 1.6 introduces a nice function on the System class : console() — which does solve these problems.
Read the rest of this entry »
Permalink
Disclaimer
375 views

Loading ...
28.10.11
Posted in Blogroll, Tech at 4:28 pm by Liv 
This is similar to the previous disk quota exploit I mentioned, except that this time an attacker can exploit the inode quota on the disk. This quota defines how many files user can use/store on a disk/partition. If there is no capping on this value, a user process can occupy all the inodes available on that partition by simply creating an empty file every iteration, thus preventing any other process that needs to create files on disk (e.g. pipes, temporary files etc) from doing so — leading to either crashes in the system processes or preventing these from working.
The code to exploit this is quite simple, as you might have guessed it: an infinite loop that simply creates an empty file on the disk this time — so at each iteration the system will lose one inode until there are no longer free inodes on the disk which will cause the system processes to crash or at least prevent them from working properly — such that the only thing you can really do is a hard reset. (Again, you won’t be able to log in either via the local console or remotely — or even kick off a reboot process — as the system will no longer be able to create any temporary files or write to the log file, or even worse, some of the daemon processes — e.g. ssh — will die.) Even worse, rebooting won’t work either as during start-up the system will not be able to create files on that partition!
Read the rest of this entry »
Permalink
Disclaimer
376 views

Loading ...
Posted in Blogroll, Tech at 4:16 pm by Liv 
This is again similar to the others above, except that this time an attacker can exploit the disk quota. This quota defines how much space a user can use/store on a disk/partition. If there is no capping on this value, a user process can try to fill up the disk space available in the system, thus preventing any other process that needs to create files on disk (e.g. pipes, temporary files etc) from doing so — leading to either crashes in the system processes or preventing these from working.
The code to exploit this is quite simple, as you might have guessed it: an infinite loop that simply writes data on the disk in a file this time — so the file size at each iteration will grow up to the point when there is no space on the disk which will cause the system processes to crash or at least prevent them from working properly — such that the only thing you can really do is a hard reset. (Again, you won’t be able to log in either via the local console or remotely — or even kick off a reboot process — as the system will no longer be able to create any temporary files or write to the log file, or even worse, some of the daemon processes — e.g. ssh — will die.) The worst part about this approach is that your reboot won’t work, as obviously files are persistent so during reboot your system will quite likely freeze as there will still be no space on the disk!
Read the rest of this entry »
Permalink
Disclaimer
363 views

Loading ...
Posted in Blogroll, Tech at 4:07 pm by Liv 
This is somehow similar to the one above, except that this time an attacker can exploit the memory quota. This quota defines how much memory a user process can allocate at a time. If there is no capping on this value, a user process can try to allocate all the memory available in the system (including the virtual memory), thus preventing any other process that needs to allocate memory from doing so — leading to either crashes in the system processes or preventing these from working.
The code to exploit this is quite simple, as you might have guessed it: an infinite loop that simply calls malloc() this time– so the memory allocated at each iteration will grow by a certain amount and pretty pretty shortly it will cause the system processes to crash or at least prevent them from working properly — such that the only thing you can really do is a hard reset. (Again, you won’t be able to log in either via the local console or remotely — or even kick off a reboot process — as the system will no longer have memory to allocate to new processes; or even worse, some of the daemon processes — e.g. ssh — will die because of lack of memory.)
Read the rest of this entry »
Permalink
Disclaimer
785 views

Loading ...
Posted in Blogroll, Tech at 4:01 pm by Liv 
One way an attacker might try to crash your machine is to exploit the process quota — more specifically to exploit the fact that a process quota is not set. The process quota defines an upper limit for the number of processes a user can run at any moment in time. If this is not, it will allow any user to run an infinite number of processes — which will ultimately bring the machine to its knees.
The code to exploit this is quite simple, as you might have guessed it: an infinite loop that simply calls fork() — so the number of processes at each iteration will multiply in geometrical progression and pretty pretty shortly it will stop the server from doing anything else than swapping in between these processes — such that the only thing you can really do is a hard reset. (You won’t be able to log in either remotely or via a console or even kick off a simple reboot as the system will not be able to fork another process anymore!)
Read the rest of this entry »
Permalink
Disclaimer
« Previous entries Next Page » Next Page »