jailshell virtfs

No Comments

NEVER DELETE ANY FILES FROM /home/virtfs/

/home/virtfs is used to chroot the user into jailed shell. Cpanel will hard link files into this directory so deleting files in /home/virtfs will also delete the files on the server in the actual location. (example: rm /home/virtfs/user/etc/exim.pl will delete /etc/exim.pl)

If a user is reporting double the quota and it is from /home/virtfs then we need to umount or kill and hanging jailshell process. To do this run

ps aufx |grep user |grep jailshell

If there are no jailshell processes then run

cat /proc/mounts

It will show,
/dev/root /home/virtfs/user/lib ext3 rw,data=ordered,usrquota 0 0
/dev/sda2 /home/virtfs/user/usr/lib ext3 rw,data=ordered,usrquota 0 0
/dev/sda2 /home/virtfs/user/usr/sbin ext3 rw,data=ordered,usrquota 0 0
/dev/sda2 /home/virtfs/user/usr/share ext3 rw,data=ordered,usrquota 0 0
/dev/sda2 /home/virtfs/user/usr/bin ext3 rw,data=ordered,usrquota 0 0
/dev/sda2 /home/virtfs/user/usr/man ext3 rw,data=ordered,usrquota 0 0
/dev/sda2 /home/virtfs/user/usr/X11R6 ext3 rw,data=ordered,usrquota 0 0
/dev/sda2 /home/virtfs/user/usr/kerberos ext3 rw,data=ordered,usrquota 0 0
/dev/sda2 /home/virtfs/user/usr/libexec ext3 rw,data=ordered,usrquota 0 0
/dev/sda2 /home/virtfs/user/usr/local/bin ext3 rw,data=ordered,usrquota 0 0
/dev/sda2 /home/virtfs/user/usr/local/share ext3 rw,data=ordered,usrquota 0 0
/dev/sda2 /home/virtfs/user/usr/local/Zend ext3 rw,data=ordered,usrquota 0 0
/dev/sda2 /home/virtfs/user/usr/include ext3 rw,data=ordered,usrquota 0 0
/dev/sda2 /home/virtfs/user/usr/local/lib ext3 rw,data=ordered,usrquota 0 0
/dev/sda3 /home/virtfs/user/var/spool ext3 rw,noatime,nodiratime,data=ordered,usrquota 0 0
/dev/sda3 /home/virtfs/user/var/lib ext3 rw,noatime,nodiratime,data=ordered,usrquota 0 0
/dev/sda3 /home/virtfs/user/var/run ext3 rw,noatime,nodiratime,data=ordered,usrquota 0 0
/dev/sda3 /home/virtfs/user/var/log ext3 rw,noatime,nodiratime,data=ordered,usrquota 0 0
/dev/sda6 /home/virtfs/user/tmp ext3 rw,nosuid,nodev,noexec,data=ordered 0 0
/dev/root /home/virtfs/userbin ext3 rw,data=ordered,usrquota 0 0

You will need to unmount each of these by running
umount /home/virtfs/user/tmp and so on

You can also run

for i in `cat /proc/mounts |grep virtfs |grep user |awk ‘{print$2}’`; do umount $i; done

Make sure to replace user with the cpanel username in the above command. This will then clear up the files in /home/virtfs and the quota should return to normal.

Remote Shutdown Via SMS

1 Comment

I recently read an article on lifehacker that explained how to shut down windows with a text message.
(http://lifehacker.com/software/remote-computing/shutdown-windows-with-a-text-message-172873.php)
Although I think this is a really cool idea, I don’t own microsoft outlook and I wanted to figure out a more portable way to go about setting up this project on my computer.

With an add-on and a few tweaks, it is possible configure this, with a portable copy of Mozilla Thunderbird. 
This should take < 10 minutes to set up and configure.

Step 1 – Get thunderbird portable

Download a copy of portable thunderbird:
http://portableapps.com/apps/internet/thunderbird_portable
and extract it by running the exe.

Step 2 – Setup thunderbird & install add-on

First of all, set up an email account.  I created a gmail account just for this project.  Go through thunderbird’s setup process and make sure your email account is configured properly.  You’ll probably need to login to your account and enable POP/IMAP settings.

Now that you have a portable, working copy of mozilla thunderbird, download this add-on:
https://addons.mozilla.org/en-US/thunderbird/addon/2610
This is what makes it all work.

To install this into the thunderbird portable folder, open ThunderbirdPortable, and go to Tools -> Add-ons and click install.  Direct thunderbird to the .xpi file you downloaded and it will install the add-on.

Restart thunderbird to proceed.

Step 3 – Configure inbox

Before you can configure the options for the add-on, you’ll need to create a folder that will hold the text messages.  Right click on “Inbox” and click new folder.  Name this something memorable.  I named mine “SMS”

Next, click Tools -> Message Filters.  Here you will pick the requirements your text message must meet in order to shut down your computer.  Click “New” and create a filter.  Configure your filter to meet some requirements in the top box, and configure the second box to move the message into the folder you created earlier.

Step 4 – Configure add-on

Before the add-on can run, it needs a command to run.  Create a batch file in the portable thunderbird program directory that contains something like this:

Code:
shutdown.exe -s

In my example, I’m naming it shutdown.bat

Next, open up your portable thunderbird and click on the folder you created earlier (“SMS” in my case).  Then, go to Tools -> Mailbox Alert Preferences

IMPORTANT : Make sure that you have selected your folder BEFORE editing the mailbox alert preferences.  Otherwise, you will end up shutting down your computer every time you receive an email.

Check the Execute a command: checkbox as I have above, and point it to the shutdown batch file.  Hit OK.

To decrease the delay between the sending of the text message to the shutting down of the computer, go to Tools -> Account Settings…
click “Server Settings” on the left side under the account you will be receiving text messages on.  Under the server settings part of the box, change Check for new messages every _30_ minutes to every _1_ minute.

Well done.  Running this portable program will enable you to shutdown your computer from anywhere, as long as your computer is connected to the internet and you have a phone.  Try it out – send a message to your email address that meets the criteria you set up in the filter.  If everything works out, next time thunderbird checks for messages, it should get your SMS and shutdown.

This concludes the practical part of the guide, but, as I’m sure you’ve processed, this could potentially be used from ANY computer connected to the internet to run ANY program.  This has quite a lot of potential, so I decided to see what I could whip up in a couple of minutes.

idea – run the program invisibly, in the background

This is fairly easy to set up.  Download nircmd (http://www.nirsoft.net/utils/nircmd.html) and place it in your thunderbird folder.  Nircmd is a really cool tool that can be configured to do quite a lot of things.  Read the .chm in the zip to see all of the options.  After you have placed the executable in the folder (nircmdc.exe), create another batch file.

put this in the file:

Code:
@echo off
start ThunderbirdPortable.exe
nircmdc cmdwait 5000 win hide ititle “Thunderbird”

This is a fairly simple batch file, which will open thunderbird in a new process, wait 5 seconds (for thunderbird to initialize and start up) and then hide the window.  The program is still viewable in the your processes, but it isn’t viewable in the taskbar.

Now all you need to do is double click the batch file you have just created, wait a few seconds, and you will have a portable thunderbird running in the background, ready to shutdown your computer when it receives the right message.

I’m sure you can think of many more ideas to add to this, so contribute whatever you’re thinking.  My apologies if I left out anything important in this guide.  Please let me know if I did.  If you get it working, let me know how it goes.

daedalus [ http://forums.hak5.org/index.php/topic,9019.0.html ]

Wanokoto Webapp Turns Photos Old-Timey

No Comments

The Red Ferret Journal points out a slick Japanese language upload-and-convert tool for giving photos that browned-out, decades-old look. Select a photo or paste in a URL (both words are written in English, as luck would have it), and hit the bottom blue button. The photo results aren’t returned at full resolution, but, depending on lighting, quality, and, of course, modernity of subject, you can get pretty authentic-looking results without any image editor filters or plug-ins. The site is free to use, and (it appears) doesn’t restrict upload file sizes.