zeldor.biz

Linux, programming and more

Copyright © 2025
Log in

SSH aliases

December 24, 2010 by Igor Drobot Leave a Comment

I think you now this problem, you have a lot different hosts with different ssh ports.
It takes to much time to write the full ssh commands and recognize all of your ports:

Easy solution – use aliases:

1
2
3
4
5
6
vim .ssh/config
# Add this
Host piper
    HostName piper
    User root
    Port 1022

vim .ssh/config # Add this Host piper HostName piper User root Port 1022

1
ssh piper

ssh piper

Filed Under: Bash, Debian, Linux Tagged With: alias, bash, ssh

Install Grub from chroot

December 21, 2010 by Igor Drobot 16 Comments

The simple way to install grub/ grub2 from any linux live-CD or any other bootable medium.

Step 1: boot from linux live CD/DVD or even USB
Step 2: mount your hdd
Step 3: chroot in the mounted filesystem
Step 3: install grub
Step 4: reboot

1
2
3
4
5
6
7
8
9
fdisk -l
mount /dev/sda1 /mnt/
mount -t proc none /mnt/proc
mount -o bind /dev /mnt/dev
mount -t sysfs sys /mnt/sys
chroot /mnt/ /bin/bash
update-grub
/usr/sbin/grub-install --recheck --no-floppy /dev/sda
sync & reboot

fdisk -l mount /dev/sda1 /mnt/ mount -t proc none /mnt/proc mount -o bind /dev /mnt/dev mount -t sysfs sys /mnt/sys chroot /mnt/ /bin/bash update-grub /usr/sbin/grub-install --recheck --no-floppy /dev/sda sync & reboot

SUSE Syntax:
update-grub is debian and ubuntu little helper this execute the same as:

1
2
3
grub2-install --recheck --no-floppy /dev/sda
grub2-mkconfig -o /boot/grub2/grub.cfg
mkinitrd

grub2-install --recheck --no-floppy /dev/sda grub2-mkconfig -o /boot/grub2/grub.cfg mkinitrd

Filed Under: Bash, Debian, Ubuntu Tagged With: chroot, Debian, Grub, Grub2, install grub, MBR, openSUSE, Ubuntu

Unable to enumerate USB device

December 21, 2010 by Igor Drobot 1 Comment

Some hardware just don’t work with ehci_hcd on Ubuntu and other distributions. My older mobile phone refused to work no matter what I did and want. After plugging the device nothing happened, doing dmesg showed me the following error:

Output from dmesg:

1
2
3
4
5
[ 4494.828096] usb 5-1: new low speed USB device using uhci_hcd and address 41
[ 4495.244038] usb 5-1: device not accepting address 41, error -71
[ 4495.356066] usb 5-1: new low speed USB device using uhci_hcd and address 42
[ 4495.768030] usb 5-1: device not accepting address 42, error -71
[ 4495.768057] hub 5-0:1.0: unable to enumerate USB device on port 1

[ 4494.828096] usb 5-1: new low speed USB device using uhci_hcd and address 41 [ 4495.244038] usb 5-1: device not accepting address 41, error -71 [ 4495.356066] usb 5-1: new low speed USB device using uhci_hcd and address 42 [ 4495.768030] usb 5-1: device not accepting address 42, error -71 [ 4495.768057] hub 5-0:1.0: unable to enumerate USB device on port 1

After searching a lot around web, I came to a conclusion that my device (mobile phone) doesn’t work with USB 2.0. So I tried to disable the ehci_hcd to make it work.

Since Karmic doesn’t use ehci_hcd as a module, modprobe -r ehci_hcd no longer works. This module was compiled into the kernel.
There is a trick to disable it. execute the following commands in terminal:

1
2
cd /sys/bus/pci/drivers/ehci_hcd
ls

cd /sys/bus/pci/drivers/ehci_hcd ls

You will see one or two files with 0000:00:xx.x format. Execute the following command:

1
sudo sh -c 'echo -n "0000:00:xx.x" > unbind'

sudo sh -c 'echo -n "0000:00:xx.x" > unbind'

Replace the xx.x with the numbers displayed on your file/s. It should disable the ehci_hcd.

Another way:

1
2
cd /sys/bus/pci/drivers/ehci_hcd/
sudo sh -c 'find ./ -name "0000:00:*" -print| sed "s/\.\///">unbind'

cd /sys/bus/pci/drivers/ehci_hcd/ sudo sh -c 'find ./ -name "0000:00:*" -print| sed "s/\.\///">unbind'

Filed Under: Bash, Debian, Kernel, Linux Tagged With: USB

Webserver Benchmark

December 6, 2010 by Igor Drobot Leave a Comment

ab (Apache Benchmark) is a tool for benchmarking your HTTP server. It provides a quick an easy way to evaluate your http serving capabilities. ab overloads the server with http requests and measures the time it takes to serve all those requests.

How to install ab and where to get it? The real thing is that ab comes preconfigured with your apache installation. Apache by himself is just an extension command for the Apache Web Server. So if you have already installed Apache, then you should be able to run ab.

What we need in order to get ab to work is type the command and append the URL address we want to test. The command is issued as follows.

1
server ~ # ab -n10000 -c8 http://piper/

server ~ # ab -n10000 -c8 http://piper/

1
2
# Number of connections to send to the server
-n

# Number of connections to send to the server -n

1
2
# Number concurrent requests to be made
-c

# Number concurrent requests to be made -c

1
2
# Option activates the KeepAlive feature
-k

# Option activates the KeepAlive feature -k

1
2
# Is the timelimit (in seconds)
-t

# Is the timelimit (in seconds) -t

ab testing mechanism actually is a good example of a Denial of Service (DoS) attack.

Filed Under: Bash, Linux Tagged With: AB, Apache, Benchmark, DOS, Lighttpd

Nikto – vulnerabilities scanner

December 6, 2010 by Igor Drobot Leave a Comment


Nikto is an Open Source (GPL) web server scanner which scans your webserver against more than 3500 dangerous files/CGIs, outdated version checking, It has a very good plugin support
Official site

To install in ubuntu / debian

1
$ apt-get install nikto

$ apt-get install nikto

For simple test:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
firewall ~ # nikto -h debianuser.org
---------------------------------------------------------------------------
- Nikto 2.02/2.03     -     cirt.net
+ Target IP:       188.40.116.206
+ Target Hostname: debianuser.org
+ Target Port:     80
+ Start Time:      2010-12-07 10:45:55
---------------------------------------------------------------------------
+ Server: Apache
+ OSVDB-3092: GET /img/ : This may be interesting...
+ OSVDB-3268: GET /icons/ : Directory indexing is enabled: /icons
+ 4347 items checked: 2 item(s) reported on remote host
+ End Time:        2010-12-07 10:49:45 (230 seconds)
---------------------------------------------------------------------------
+ 1 host(s) tested

firewall ~ # nikto -h debianuser.org --------------------------------------------------------------------------- - Nikto 2.02/2.03 - cirt.net + Target IP: 188.40.116.206 + Target Hostname: debianuser.org + Target Port: 80 + Start Time: 2010-12-07 10:45:55 --------------------------------------------------------------------------- + Server: Apache + OSVDB-3092: GET /img/ : This may be interesting... + OSVDB-3268: GET /icons/ : Directory indexing is enabled: /icons + 4347 items checked: 2 item(s) reported on remote host + End Time: 2010-12-07 10:49:45 (230 seconds) --------------------------------------------------------------------------- + 1 host(s) tested

Filed Under: Bash, Debian, Linux, MySQL Tagged With: apache security, Nikto, Security scanner, vulnerabilities finder

  • « Previous Page
  • 1
  • …
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • Next Page »
Yeaaah Cookie! We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.Ok