2013. 8. 6. 00:27

1. apt-get install ssh

2. sshd-generate

3. /etc/init.d/ssh restart

Posted by 땡보
2013. 8. 4. 10:09

원문출처 : http://ubuntu.or.kr/viewtopic.php?t=8569


우분투에서 웹서버 환경 LAMP or APM (Apache, PHP, MySQL) 를 구축하는 법입니다.
다음 방법대로 따라하시면 쉽게 구축하실수 있을겁니다.

출처: Installing LAMP On Ubuntu For Newbies
추신: 웹서버 구축후 XE (제로보드) 설치법...

우선 apache를 설치합니다.

$ sudo apt-get install apache2


설치후 잘 작동하나 확인해 봅시다.
브라우저 주소창에 http://localhost/ 입력해 다음 메세지가 나오면 정상적으로 작동하는겁니다.
Code:
It works!

This is the default web page for this server.

The web server software is running but no content has been added, yet.


이제 PHP를 설치합니다.

$ sudo apt-get install php5 libapache2-mod-php5


설치가 끝나면 재시작 합니다.

$ sudo /etc/init.d/apache2 restart


재시작후 PHP가 잘 작동하는지 확인합니다. (다음 코드를 입력후 저장)

$ sudo gedit /var/www/testphp.php

<?php phpinfo(); ?>


브라우저 주소창에 http://localhost/testphp.php 입력해 다음 메세지가 나오면 정상적으로 작동하는겁니다.
Attachment:
-phpinfo.png
-phpinfo.png [ 8.84 KiB | 19643 번 봄 ] 


마지막으로 MySQL 을 설치합시다.

$ sudo apt-get install mysql-server


설치 중간에 암호를 설정하는 화면이 나옵니다.
New password for the MySQL "root" user: 비밀번호 입력
Repeat password for the MySQL "root" user: 비밀번호 확인
Attachment:
-mysql.png
-mysql.png [ 17.27 KiB | 19644 번 봄 ] 


* 참고로 비밀번호를 바꾸려면 다음처럼 입력합니다.

$ mysql -u root
mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('yourpassword');


* 참고로 서버 주소를 바꾸려면 다음처럼 입력후 bind-address 라인의 IP주소를 바꿔주시면 됩니다.

$ sudo gedit /etc/mysql/my.cnf

bind-address = 127.0.0.1 # 기본설정은 localhost



설치가 끝나면 MySQL 관리자 (phpMyAdmin) 를 설치합니다.

$ sudo apt-get install libapache2-mod-auth-mysql php5-mysql phpmyadmin


설치 중간에 다음 메세지가 나오면 apache2를 선택합니다. (space bar로 선택)
Web server to reconfigure automatically: apache2
Attachment:
-phpmyadmin-autoconf.png
-phpmyadmin-autoconf.png [ 14.44 KiB | 19653 번 봄 ] 


그후 phpMyAdmin의 데이터베이스를 dbconfig-common으로 설정합니다.

"예"를 눌러 넘어가면 phpMyAdmin에서 사용할 암호를 묻습니다.

이제 끝으로 phpMyAdmin에서 디비 서버와 연결할 비밀번호를 설정하면 설치가 끝납니다.
(임의의 암호 생성이 있는거보니 직접 제어 할일이 적은 설정 같은데 혹시 모르니 적어둡시다.)

역시 phpMyAdmin가 잘 설치되었나 확인해 봅시다.
브라우저 주소창에 http://localhost/phpmyadmin/ 입력해 다음 메세지가 나오면 정상적으로 작동하는겁니다.
Attachment:
-phpmyadmin-login.png
-phpmyadmin-login.png [ 15.28 KiB | 19676 번 봄 ] 

Posted by 땡보
2013. 8. 4. 10:01

아파치서버 : sudo /etc/init.d/apache2 restart


'Study > linux' 카테고리의 다른 글

[Backtrack]ssh 설정  (0) 2013.08.06
[펌]우분투 APM 셋팅법  (0) 2013.08.04
[펌]Reverse Engineering Firmware: Linksys WAG120N  (1) 2013.05.17
[Ubuntu]BackTrack5 터미널 글꼴 겹침 현상 제거  (0) 2012.08.19
Posted by 땡보
2013. 5. 17. 07:27

Reverse Engineering Firmware: Linksys WAG120N

The ability to analyze a firmware image and extract data from it is extremely useful. It can allow you to analyze an embedded device for bugs, vulnerabilities, or GPL violations without ever having access to the device.

In this tutorial, we’ll be examining the firmware update file for the Linksys WAG120N with the intent of finding and extracting the kernel and file system from the firmware image. The firmware image used is for the WAG120N hardware version 1.0, firmware version 1.00.16 (ETSI) Annex B, released on 08/16/2010 and is currently available for download from the Linksys Web site.

The first thing to do with a firmware image is to run the Linux file utility against it to make sure it isn’t a standard archive or compressed file. You don’t want to sit down and start analyzing a firmware image only to realize later that it’s just a ZIP file:

OK, it’s nothing known to the file utility. Next, let’s do a hex dump and run strings on it:

Taking a look at the strings output, we see references to the U-Boot boot loader and the Linux kernel. This is encouraging, as it suggests that this device does in fact run Linux, and U-Boot is a very common and well documented boot loader:

However, taking a quick look at the hexdump doesn’t immediately reveal anything interesting:

So let’s run binwalk against the firmware image to see what it can identify for us. There are a lot of false positive matches (these will be addressed in the up-coming 0.3.0 release!), but there are a few results that stand out:

Binwalk has found two uImage headers (which is the header format used by U-Boot), each of which is immediately followed by an LZMA compressed file.

Binwalk breaks out most of the information contained in these uImage headers, including their descriptions: ‘u-boot image’ and ‘MIPS Linux-2.4.31′. It also shows the reported compression type of ‘lzma’. Since each uImage header is followed by LZMA compressed data, this information appears to be legitimate.

The LZMA files can be extracted with dd and then decompressed with the lzma utility. Don’t worry about specifying a size limit when running dd; any trailing garbage will be ignored by lzma during decompression:

We are now left with the decompressed files ‘uboot’ and ‘kernel’. Running strings against them confirms that they are in fact the U-Boot and Linux kernel images:

We’ve got the kernel and the boot loader images, now all that’s left is finding and extracting the file system. Since binwalk didn’t find any file systems that looked legitimate, we’re going to have to do some digging of our own.

Let’s run strings against the extracted Linux kernel and grep the output for any file system references; this might give us a hint as to what file system(s) we should be looking for:

Ah! SquashFS is a very common embedded file system. Although binwalk has several SquashFS signatures, it is not uncommon to find variations of the ‘sqsh’ magic string (which indicates the beginning of a SquashFS image), so what we may be looking for here is a non-standard SquashFS signature inside the firmware file.

So how do we find an unknown signature inside a 4MB binary file?

Different sections inside of firmware images are often aligned to a certain size. This often means that there will have to be some padding between sections, as the size of each section will almost certainly not fall exactly on this alignment boundary.

An easy way to find these padded sections is to search for lines in our hexdump output that start with an asterisk (‘*’). When hexdump sees the same bytes repeated many times, it simply replaces those bytes with an asterisk to indicate that the last line was repeated many times. A good place to start looking for a file system inside a firmware image is immediately after these padded sections of data, as the start of the file system will likely need to fall on one of these aligned boundaries.

There are a couple interesting sections that contain the string ‘sErCoMm’. This could be something, but given the small size of some of these sections and the fact that they don’t appear to have anything to do with SquashFS, it is unlikely:

There are some other sections as well, but again, these are very small, much too small to be a file system:

Then we come across this section, which has the string ‘sqlz’ :

The standard SquashFS image starts with ‘sqsh’, but we’ve already seen that the firmware developers have used LZMA compression elsewhere in this image. Also, most firmware that uses SquashFS tends to use LZMA compression instead of the standard zlib compression. So this signature could be a modified SquashFS signature that is a concatination of ‘sq’ (SQuashfs) and ‘lz’ (LZma). Let’s extract it with dd and take a look:

Of course, ‘sqlz’ is not a standard signature, so the file utility still doesn’t recognize our extracted data. Let’s try editing the ‘sqlz’ string to read ‘sqsh’:

Running file against our modified SquashFS image gives us much better results:

This definitely looks like a valid SquashFS image! But due to the LZMA compression and the older SquashFS version (2.1),  you won’t be able to extract any files from it using the standard SquashFS tools. However, using the unsquashfs-2.1 utility included in Jeremy Collake’s firmware mod kitworks perfectly:

Now that we know this works, we should go ahead and add this new signature to binwalk so that it will identify the ‘sqlz’ magic string in the future. Adding this new signature is as easy as opening binwalk’s magic file (/etc/binwalk/magic), copy/pasting the ‘sqsh’ signature and changing the ‘sqsh’ to ‘sqlz’:

Re-running binwalk against the original firmware image, we see that it now correctly identifies the SquashFS entry:

And there you have it. We successfully identified and extracted the boot loader, kernel and file system from this firmware image, plus we have a new SquashFS signature to boot!

'Study > linux' 카테고리의 다른 글

[Backtrack]ssh 설정  (0) 2013.08.06
[펌]우분투 APM 셋팅법  (0) 2013.08.04
[명령어]서비스 재시작  (0) 2013.08.04
[Ubuntu]BackTrack5 터미널 글꼴 겹침 현상 제거  (0) 2012.08.19
Posted by 땡보
2012. 8. 19. 17:58

원문 출처 : http://blog.simplism.kr/?p=1070


프로그래밍용 폰트 : http://www.lowing.org/fonts/


ttf-bitstream-vera-1.10.tar.bz2


압축풀고 나온 파일들을

$ sudo mv *.ttf /usr/share/fonts/truetype/
$ fc-cache -v

로 옮기고 터미널 재실행


또한 동일 출처에서 아래도 유용함~

$ sudo apt-get install nautilus-open-terminal
$ killall nautilus

'Study > linux' 카테고리의 다른 글

[Backtrack]ssh 설정  (0) 2013.08.06
[펌]우분투 APM 셋팅법  (0) 2013.08.04
[명령어]서비스 재시작  (0) 2013.08.04
[펌]Reverse Engineering Firmware: Linksys WAG120N  (1) 2013.05.17
Posted by 땡보