• Blog All
  • kost
  • test

Kost dungeon

Some thoughts from vegetarian linux and security aware aikidoka :)

  • Home
  • Contact
  • Log in

Installing IO::Socket::SSL using Strawberry Perl

April 1st, 2009

When you try to install Net::SSLeay as dependency of IO::Socket::SSL using Strawberry Perl and you get something like this:

Running install for module 'Net::SSLeay' Running make for F/FL/FLORA/Net-SSLeay-1.35.tar.gz Has already been unwrapped into directory C:\strawberry\cpan\build\Net-SSLeay-1.35-zncySb 'C:\strawberry\perl\bin\perl.exe Makefile.PL' returned status 512, won't make Running make test Make had some problems, won't test Running make install Make had some problems, won't install

or this:

dmake.EXE Error code 129, while making SSLeay.o
or error code 512.

You should download OpenSSL library from Shining Light Productions - Win32 OpenSSL and NOT from gnuwin32 sourceforge page. After that, you just need to copy the files from C:\OpenSSL\lib\MinGW to C:\OpenSSL\lib. Installation will succeed. At least it did for me ;)

Technorati tags: perl windows ssl strawberry openssl debian

Posted in FLOSS | Send feedback »

Debian 5.0 lenny - 1st experience

February 15th, 2009

Debian released 5.0 version (aka lenny). You can read announcement here. First upgrade to lenny on testing server went good. No problems at all. Few notes regarding the packages I use: mod-security is not in default repositories due to late fix. Also, they have only client for OpenVAS available on repositories. Hope they will fix it in later revisions...

Any way, more about mod-security legal saga in Lenny you can read here. Unofficial apt repository for mod-security you can reach here.

Technorati tags: lenny security apache linux xandros debian

Posted in FLOSS, Security | Send feedback »

ASUS EEE - new Xandros repository

January 29th, 2008

As you can notice, I built new repository for Xandros ASUS EEE distribution. It has some Croatian specific packages as well as some interesting packages which you cannot find elsewhere. So, for example you can install Keepassx which is Password Manager I use. Also, you can install Truecrypt which is multiplatform file system encryption I use. Note that you'll need dm-mod module installed and insmoded before mounting truecrypt volumes and you can download it here (it's not available in Xandros default distro!). Probably, you'll find kernel modules as packages in future as well.

In order to add new repository, you need to edit /etc/apt/sources.list and add following lines (as administrator/root):
deb http://ftp.linux.hr/asuseee/xandros/ binary/
deb-src http://ftp.linux.hr/asuseee/xandros/ source/

...or you can download packages directly.

Do note that you need to install additional repositories as prerequisites. Follow instructions here:
http://wiki.eeeuser.com/addingxandrosrepos

Full instructions you can find on forum:
http://forum.eeeuser.com/viewtopic.php?id=13623

Technorati tags: asus eee hacking linux xandros debian

Posted in FLOSS, Gadgets | 1 feedback »

ASUS EEE - few tricks for beginners ;)

January 29th, 2008

As ASUS EEE is available in Croatia stores now, I'll give few tips (and no tricks) for beginners with ASUS EEE in Croatia.

Probably you noticed that you cannot select Croatian keyboard layout. What you need to do is edit /etc/X11/xorg.conf and find following line:
Option "XkbLayout" "us"
And change it to (for Croatian keyboard):
Option "XkbLayout" "hr"
Optionally, you can change it to (if you want Croatian letters on AltGr):
Option "XkbLayout" "hr(us)"

If you want to change keyboard layout on the fly, open terminal (ctrl+alt+t) and type following (if you need to change to Croatian layout):
setxkbmap hr
Also, if you want Croatian letters on AltGr, you need to type:
setxkbmap hr us
If you want to switch back to US keyboard layout, type following:
setxkbmap us

If you need Croatian spelling checker for OpenOffice.Org, you need to edit /etc/apt/sources.list and add following lines (as administrator/root):
deb http://ftp.linux.hr/asuseee/xandros/ binary/
deb-src http://ftp.linux.hr/asuseee/xandros/ source/

After that, type this in terminal (in order to install packages):
sudo apt-get update
sudo apt-get install myspell-hr

And if you need hyphenation support in OpenOffice.Org, type following:
sudo apt-get install openoffice.org-hyphenation-hr

Now, launch OpenOffice.Org, choose Tools->Options, then Language Settings, and in Languages in section Default language for documents choose Croatian in drop down menu.

You can restart OpenOffice.Org and Spelling checker (as you type) will be enabled by default.

If you want to tweak default ASUS Icewm preferences, copy preferences file from /etc/X11/icewm/ (not /usr/share/icewm!) to .icewm and modify it.

Regarding overclocking and fan control, you can download precompiled module (Note to everyone: this is new version/release - with new and better patch!)

Technorati tags: asus eee hacking linux xandros debian

Posted in FLOSS, Gadgets | 9 feedbacks »

Debugging SquashFS and tools

January 29th, 2008

Recently, I was playing with squashfs and with its SquashFS LZMA companion. I hit the segmentatin fault while I was building squashfs from ASUS EEE read only image. I'll try to explain my debug process, so people who are not familiar can follow (and learn something). I run gdb on core dump and discovered that problematic function is write_file_blocks_dup (output of gdb):


Program terminated with signal 11, Segmentation fault.
#0 0x08050b84 in write_file_blocks_dup ()
(gdb) bt
#0 0x08050b84 in write_file_blocks_dup ()
#1 0x080519e9 in write_file ()
#2 0x0805257c in dir_scan2 ()
#3 0x08052502 in dir_scan2 ()
#4 0x08052502 in dir_scan2 ()
#5 0x08052502 in dir_scan2 ()
#6 0x08052502 in dir_scan2 ()
#7 0x08052c60 in dir_scan ()
#8 0x0805506e in main ()
(gdb) print reader_buffer
$1 = 139977672

Seg fault often happens when you try to read/write memory which you don't own (or you freed already). By looking at that function (write_file_blocks_dup), I found interesting piece of code:

Code:

if(read_buffer->c_byte) {
  read_buffer->block = bytes;
  bytes += read_buffer->size;
  file_bytes += read_buffer->size;
  if(block < thresh) {
    buffer_list[block].read_buffer = NULL;
    queue_put(to_writer, read_buffer);
  } else
     buffer_list[block].read_buffer = read_buffer;
  } else {
    buffer_list[block].read_buffer = NULL;
    alloc_free(read_buffer);
}
buffer_list[block].start = read_buffer->block;
buffer_list[block].size = read_buffer->size;
progress_bar(++cur_uncompressed, estimated_uncompressed,columns);

If you notice, there is alloc_free function which try to free read_buffer, but immediately after that - there's statements which try to access that memory (which doesn't exist any more). So, I changed it to:

Code:

if(read_buffer->c_byte) {
  read_buffer->block = bytes;
  bytes += read_buffer->size;
  file_bytes += read_buffer->size;
  if(block < thresh) {
    buffer_list[block].read_buffer = NULL;
    queue_put(to_writer, read_buffer);
  } else
     buffer_list[block].read_buffer = read_buffer;
  } else {
    buffer_list[block].read_buffer = NULL;
}
buffer_list[block].start = read_buffer->block;
buffer_list[block].size = read_buffer->size;
progress_bar(++cur_uncompressed, estimated_uncompressed,columns);
alloc_free(read_buffer);

I made patch for it and sent to author via squashfs sourceforge page. That's one bug less...

But! Here it comes again. I hit another problem. My mksquashfs process was stuck at around 60% and progress bar is not moving. So, I connected to PID of mksquashfs process using gdb and discovered that it's waiting in get_fragment function on pthread as illustrated below:


xb7f32c01 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/tls/libpthread.so.0
(gdb) bt
#0 0xb7f32c01 in pthread_cond_wait@@GLIBC_2.3.2 ()
from /lib/tls/libpthread.so.0
#1 0x0804dcad in get_fragment ()
#2 0x0804e104 in duplicate ()
#3 0x0805155f in write_file_frag_dup ()
#4 0x080516f8 in write_file_frag ()
#5 0x08051a36 in write_file ()
#6 0x0805257c in dir_scan2 ()
#7 0x08052502 in dir_scan2 ()
#8 0x08052502 in dir_scan2 ()
#9 0x08052502 in dir_scan2 ()
#10 0x08052502 in dir_scan2 ()
#11 0x08052502 in dir_scan2 ()
#12 0x08052502 in dir_scan2 ()
#13 0x08052502 in dir_scan2 ()
#14 0x08052c60 in dir_scan ()
#15 0x0805506e in main ()

I tried to see on what file it hangs while building filesystem and it hangs at the following:


mksquashf 32709 root 3u REG 8,3 607996129 1484897 /asus-eee/asus-eee.lza
mksquashf 32709 root 4r REG 8,3 395 277747 /asus-eee/usr/share/games/frozen-bubble/gfx/menu/backgrnd-closedeye-right-green.png

I tried to start it again, and it again hang at the following file:


mksquashf 6544 root 3u REG 8,3 607996129 1101584 /asus-eee/asus-eee.lza
mksquashf 6544 root 4r REG 8,3 395 277747 /asus-eee/usr/share/games/frozen-bubble/gfx/menu/backgrnd-closedeye-right-green.png

It seems that pthread implementation is broken somehow. I tried to look at get_fragment function, and discovered that mksquashfs is waiting at the following piece of code:

Code:

pthread_mutex_lock(&fragment_mutex);
while(fragment_table[fragment->index].pending)
  pthread_cond_wait(&fragment_waiting, &fragment_mutex);
pthread_mutex_unlock(&fragment_mutex);
disk_fragment = &fragment_table[fragment->index];
size = SQUASHFS_COMPRESSED_SIZE_BLOCK(disk_fragment->size);

Notice that there's no error checking on pthread functions at all (like in pthread_mutex_lock), so I have to implement error checking in order to see what's wrong around pthread implementation (because it seems like some pthread runaway). But, It's too late and this would take long as I have to put lot of error checkings around every pthread call, so I'm leaving this as exercise for the reader of this blog!

Good luck! :)

Technorati tags: asus eee hacking linux xandros debian squashfs gdb debug

Posted in FLOSS, Gadgets | 1 feedback »

Compiling kernel modules for Xandros ASUS EEE

January 28th, 2008

As lot of people asked me how I managed to compile kernel modules for Xandros default distribution on ASUS EEE, here's explanation.

First, I copied all files (except /proc, /sys, ...) from ASUS EEE to my laptop. I used tar and netcat for that. After that, I chrooted that ASUS EEE file structure (chroot . bash).

Now, i've done lot of apt-gets to have development enviroment ready (gcc, libc-dev, etc...). For kernel part, I downloaded vanilla kernel source (same version as ASUS EEE) from kernel.org (direct link). In order to make kernel as match as close to original one, I downloaded unionfs (direct link) and applied patch to vanilla tree.

It's good feature that ASUS engineers left the kernel .config file in /boot, so I could use original .config file (it's full pathname is /boot/config-2.6.21.4-eeepc). Just copied that config file to source tree as .config and made:
make oldconfig && make prepare

So, now I have full enviroment ready and I just compile any additional extra module I need. This way you can compile the kernel (not just modules). But it would lack full ASUS EEE hardware support. I used this method to compile kernel modules (like eee.ko).

In the meantime, ASUS released their kernel source (or I just realized that) and you can download it here (choose EEEPC and find it under Source code category).
You need to unrar the downloaded file and install it using dpkg (dpkg -i linux-source-2.6.21.4-eeepc.deb). The linux source is installed in /usr/src/linux-source-2.6.21.4-eeepc.tar.bz2. Untar it, compile it and have fun! :)

It's good, now you have two options: vanilla kernel or original EEE kernel.

Technorati tags: asus eee hacking linux xandros debian squashfs

Posted in FLOSS, Gadgets | Send feedback »

Making ASUS EEE more useful

January 23rd, 2008

ASUS EEE is becoming more and more popular. As such, there's more and more modifications and support for it. eee.ko module is one of them. eee.ko consists of a kernel module to change the eee's FSB speed, allowing the CPU to run at its full 900Mhz. eee.ko provides nice /proc interface for fan control too.

Because, there's no eee.ko precompiled module for Xandros default distribution, I compiled one and you can download it (together with source patch to work on Xandros if you want to compile it yourself because the module is written for Ubuntu newer kernel originally). There's also nice script for FAN control which you can download (if you don't like /proc interface).

If you are interested only in controlling the fan of your ASUS EEE, then you can download this eee.ko fan module only..

I would recommend reading this topic and this topic to people interested in booting puppy linux on ASUS EEE (as they contain link to kernel modules/drivers for ASUS EEE hardware compiled for puppyLinux). If you're just interested in PET packages for puppylinux having these modules/drivers, you can download them here.

I have also compiled squashfs (3.3) for Xandros default distribution. I made it available on my site so, you can download squashfs kernel module and squashfs tools (in case you want to make squashfs directly on ASUS EEE). Why squashfs? Well, you can compress read only part of 4gb disk with squashfs and save some space on your ASUS EEE.

If you are from Croatia and interested in ASUS EEE tweaking, I would also recommend joining eeepc-zagreb group.

Technorati tags: asus eee hacking linux xandros debian squashfs

Posted in FLOSS, Gadgets | Send feedback »

First 24 hours with ASUS EEE

January 13th, 2008

ASUS EEE doesn't have Bluetooth by default, but it has bluetooth packages lying around in default installation. So, I plugged in my Bluetooth USB dongle and changed few parameters. After few minutes, I got my bluetooth connection working with my phone, NXT and Thinkpad.

Because ASUS EEE doesn't have PCMCIA slot, I couldn't use my VIP 3G PCMCICA card to access Internet everywhere. I need that in order to be fully mobile with my ASUS EEE. So, I managed to set up Internet connection using my mobile phone via bluetooth. I just copied the scripts I use with my Thinkpad to reach Internet via mobile phone and it worked! Now, my ASUS EEE become even more mobile :)
If you want to connect your ASUS EEE to Internet via mobile phone, I found nice instructions here. It's typical instructions for connecting to internet via your mobile phone with chat scripts and pppd.

ASUS EEE
Happy ASUS EEE users ;)

If you didn't know - ASUS EEE has web camera (with Skype software and Skype video working out of the box). With my knowledge of audio/video streaming I gained from streaming HULK events like this one, I tried to set up basic audio/video streaming using ASUS EEE device, just for fun.

First, I had to enable camera (it's enabled only if you use Skype or webcam software) using this command:
echo 1 > /proc/acpi/asus/camera

After turning on the camera, typical V4L device appears at /dev/video0. Basically, I used gstreamer to grab and recode audio/video and shout2send gstreamer plugin to forward OGG stream to icecast server (I could use oggfwd too, but gstreamer seemed faster solution). With combination of mobile internet, I got extremely mobile streaming solution using open OGG (Theora/Vorbis) format. It's stil not perfect streaming, because it's only 900 Mhz procesor, but it's usable. I guess I have to tune it more. Probably, I'll write step by step guide for EEE user Wiki about that.

After playing with camera, don't forget to turn off your camera in order to save battery :) :
echo 0 > /proc/acpi/asus/camera

Actually, /proc/acpi/asus is just interface for asus_acpi module. Using it, you can turn off (or turn on) some devices in order to save battery life of your ASUS EEE. Here is quick oneliner how you can turn off wireless, camera and card reader:

for i in camera cardr wlan; do (echo 0 > /proc/acpi/asus/$i); done

and to turn it on all again:

for i in camera cardr wlan; do (echo 1 > /proc/acpi/asus/$i); done

If you don't like my quick solutions :), you can see this solution from Avian.

Dobrica told me he has problems with apt-get upgrading his ASUS EEE (Firefox segfaults after upgrade). Anyway, I found the fix on the internet. Solution is actually to remove scim support (it's for Asian languages anyway and we don't use it here). Dobrica said he used another fix: apt-get install eeepc-updatepack-20071126. It seems it's the better one. Anyway, I guess I'm lucky because I didn't had that problem he had.

Technorati tags: asus eee hacking linux xandros debian

Posted in FLOSS, Gadgets | 1 feedback »

ASUS EEE - first impressions

January 13th, 2008

Yesterday, we bought ASUS EEE. It's cheap and light subnotebook running Linux (specifically, Xandros distribution). It has Firefox, Thunderbird, OpenOffice.Org, Skype, Pidgin/Gaim, Amarok, Smplayer already on his solid state drive.

When we bought it, we spent some time searching for terminal (it's ctrl+alt+t BTW), but after successful search - everything was open for happy afternoon :)

After digging for some time inside ASUS EEE software solution, here's few of my findings:

To get BIOS boot menu of ASUS EEE press Escape. I tried PuppyLinux and different versions of Slax (Slax is my USB distro of choice after Puppy debacle) just after going out of the ASUS EEE Shop. Both distros worked flawlessly.

ASUS EEE version of Xandros uses ASUS Launcher and icewm. I'm old user of icewm, so I tweaked it in a few seconds to suit my need :)

ASUS EEE uses unionfs. Just notice for beginners: that means if you delete some preinstalled software doesn't mean you actually deleted the software and saved some space. You just marked these files as deleted. On the other hand, it easies restoration of ASUS EEE original state if you do something wrong.

Xandros is based on Debian, so apt-get stuff works which makes upgrading and installing additional software easy. I would suggest you to add repositories for ASUS EEE as described here. Openssh-server, nmap, kismet and sshfs is already happily working on my ASUS EEE.

There's no runlevels on ASUS EEE version of Xandros. There's fastinit in /sbin/fastinit which handles the init process. That also means that your scripts in /etc/init.d will not be started by default. More about the boot process, you can read here.

Changing login name(by default it is user) is bit harder because /sbin/fastinit has hard coded value of user when launching startx (su -l user commands hard coded). So, what I come up with is having two different login names with same uid/gid (of course, with my preffered login name first) in authentication files (passwd/shadow). If you are doing that for yourself, you should be aware of implications of that solution.

I would definitevly suggest to read Wiki at www.eeeuser.com because it has lot of tips&tricks regarding tweaking your ASUS EEE.

Technorati tags: asus eee hacking linux xandros debian

Posted in FLOSS, Gadgets | Send feedback »

Defcon 15: 1st day of the convention

August 4th, 2007

So, let's start with the talks actually :) Conference day starts usually from 10am and it ends up at 8-9pm. There are 5 parallel tracks each day. Usually there is 10 minutes break between the lectures, so people can change the track if they want to. But there are no breaks for lunch.

Defcon 15: Everything is ready
Defcon 15: Everything is ready

I decided to join Joe Grand's (aka Kingpin) presentation about making the defcon 15 badge. He started his lecture with the poem about the badge and later he described the process of making the defcon 15 badge as it is now. Complete source code and schematics can be found on his website. He said he used Freescale. The software development enviroment for the Badge is available for free (max. 16 kb) here (It's frescale's Codewarrior). Also, hardware debugging can be done with Freescale's USB spydero 8 module or p&e micro heso8 multilink usb-ml-12. He officially announced hacking the badge contest and said tools and extension will be provided for free in the vendor area. On the end of the lecture, he was asked about that "GO VOICE" message and geocoordinates. Kingpin explained that "GO VOICE" message is there just for fun. The message is from the old BBS days (when you talked with SysOp and wanted to chat with him over the phone). He commented GPS coordinates as a part of hacking history.

Bruce Schneier was the next lecturer. He's known as Chuck Norris of information security (link) and author of popular security blog called Schneier on Security. He held Q&A session and topics were as expected: recent TSA issues and how he got to the Defcon :) , Hash algorithm contest, privacy and data pollution, aggregate data benefits vs personal data privacy, encryption, ...

Defcon 15: Bruce Schneier
Defcon 15: Bruce Schneier

After Bruce, I switched the track to hear about breaking forensics software. Talk was mostly about Encase potential vulnerabilities and how you can hide data from forensic team who uses Encase. Interesting example is that you can use 26th partition to hide data (Encase only recognizes only first 25 partitions). But it will be fixed in next release of Encase.

There were also lot of talks and comments about static code analysis vs. fuzzing. I don't see why I should choose at all? I use happily both methods: static code analysis and (preferably intelligent) fuzzing.

For this night entertainment, Black ball was organized featuring Regenerator. It was advised to dress your best blacks and that bondage rubber and fetish is encouraged on black ball, so it was interesting how people were dressed up ;)

Another interesting side effect of the convention are ATMs:

Defcon 15: ATMs are out of order
Defcon 15: ATMs are out of order

And if you come closer to ATM you can see big "Out of order" message:

Defcon 15: ATM is out of order
Defcon 15: ATM is out of order

It's the first day of the Defcon and ATMs are not working. Coincidence? :)

Technorati tags: conference hacking cracking security convention las vegas defcon 15 defcon2007

Posted in Security, Travel, Network/Internet | 1 feedback »

1 2 3 4 5 6 7 8 9 10 11 ... 22 >>
  • July 2009
    Sun Mon Tue Wed Thu Fri Sat
     << <   > >>
          1 2 3 4
    5 6 7 8 9 10 11
    12 13 14 15 16 17 18
    19 20 21 22 23 24 25
    26 27 28 29 30 31  
  • Kost dungeon

  • Hi! I'm Vlatko Kosturjak. People call me Kost (It means Bone on Croatian). I'm from Zagreb, Croatia. I'm security specialist in big IT company. I'm interested in Linux and Open Source software in general. When I'm not sitting at my computer, I probably practice Aikido. Sometimes I do something with djembe and didge too...

    You can visit my homepage or you can mail me. Also, in my gallery you can see a bunch of persons mentioned on this blog.

    Vlatko Kosturjak - Kost

    Posts with inappropriate content or language will be deleted without any explanation. Never forget that this is my own site. All opinions expressed here are my own, and do not necessarily represent those of my employer, organization, or anyone else.

    • Recently
    • Archives
    • Categories
    • Latest comments
  • Search

  • Categories

    • All
    • Fun
      • Movies
      • Music
      • TV
    • ICT
      • Croatia
      • FLOSS
      • Gadgets
      • GSM
      • Network/Internet
      • Security
    • Lifestyle
      • Free Culture
      • Martial Art
        • Aikido
        • Krav Maga
      • R/C
      • Religion
      • Travel
      • Vegetarianism
    • Misc
  • XML Feeds

    • RSS 2.0: Posts, Comments
    • Atom: Posts, Comments
    What is RSS?
blog soft

©2009 by Vlatko Kosturjak | Contact | Design by Michael | Credits: blog tool | dedicated servers | authors