2013. 8. 7. 10:07

집에 점차 인터넷 기기들이 늘어나면서  네트웍 구성이나 효율이 좋지 못하다는 판단

집에 있는 모든 피씨를 유선(각 방별 랜포트)으로 사용하면서, 서재방쪽 2대의 데스크탑 중 1대의 PC를 

외부에서도 접속 가능한 서버(DMZ 이용)로 사용하기 위해 작업 시작!!


대략적인 네트워크 구성(As-Is)



변경할 네트워크 구성(To-Be)


1. 인터넷 및 전화 단자함 찾기 (보통 출입구쪽 신발장 안쪽 벽면 또는 두꺼비집 근처)

  --> 우리집은 신발장 안쪽 벽면에 있었음


2. 집안 네트워크 구성 파악(ㅡㅡ;; 어디 물어볼 곳이 없어서 한땀 한땀 뽑아가며 실험 했음)

   처음에 공유기가 없는 상태에서 어느게 인터넷 선인지 국선인지 인터넷 단자인지 몰라 그냥 닥치는 대로 

   하나 뽑고 현상보고, 다시 꼽고, 다음것 뽑고 현상보고를 무한 반복함..(무식하면 몸이 고생임)

   

   아래 사진에서 기존 7번자리에 연결되어 있던 6번선을 뽑는 순간 IPTV 및 집안 모든 인터넷 단절

   (6번선이 인터넷 회선 이라고 판단)

   

    다음으로 각 방의 PC들 전원을 모두 끄고 한방씩만 PC를 유선으로 물려놓은 후(방 연결 포트는 아랫부분 LAN포트)

   전원을 켜서 1번의 그룹중 LED가 점등되는 라인으로 각 방별 LAN포트 라인 확인

   1번 그룹이 인터넷 회선 분배 허브이므로 2번 그룹은 전화단자 분배 포트일것임 따라서 2번 그룹에 있는 라인들이

   방별 포트 2개중 윗쪽에 위치한 포트 라인일 것이므로 위와 동일한 방법으로 각방 모든 PC들의 전원을 끄고 PC의 랜선을 방별 

   윗쪽 전화 단자에 연결하고 PC 전원을 켜고 아파트 단자함으로 와서 2번그룹의 라인들을 하나 하나 1번 그룹의 빈 포트에 

   꼽아보며 해당 포트의 LED가 점등되면 해당 라인이 전원켜진 PC가 위치한 방의 윗쪽 전화단자 라인임..


   위의 길고긴 과정을 거치면 방별 전화 포트와 LAN포트의 라인들을 각각 구별 할 수 있음(상당히 노가다)

   보통의 경우는 아래 사진(공유기에 물려있는 빨간화살표 3, 4와 같이)처럼 전화기 라인과 LAN포트 라인에는 같은 번호(사진에서 5라는 숫자)가 메겨져 있음


  전화기분배 허브쪽에 꼽혀져 있던 2번 그룹 라인들을 전부 1번그룹 또는 공유기 LAN포트에 꼽게되면 인터넷 라인으로 사용

  가능함


(우리집은 N6004 공유기에 유선 포트가 4개이므로 아파트 단자함 허브 1포트, 안방 1포트 서재방 2포트를 배정)



선정리 및 공유기 단자함에 밀어 넣기


서재방 작업용 데스크탑 PC2가 1Gbps로 연결된 모습(다만 외부 인입 인터넷 회선 자체가 100Mbps라 다운로드등 체감 성능 향상은 없는듯함)



전화포트에 연결해 놓은 우분투(백트랙) 서버쪽 정상 인터넷 동작





위와 같이 작업 끝. IPTV, 홈네트워크, 모든 방 인터넷 정상동작 확인(무선 포함)


'일상주저리' 카테고리의 다른 글

이제 내 생활도 끝이구나...  (0) 2012.05.16
천천히 가쟈..  (0) 2012.03.17
Posted by 땡보
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. 8. 4. 09:52

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

sudo netstat -tap|grep mysql 처서

tcp 0 0 localhost.localdo:mysql *:* LISTEN 4341/mysqld 

mysql 떠 있는지 확인 후

mysql 초기 비밀번호 재설정 : sudo dpkg-reconfigure mysql-server-5.1


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

[MariaDB]CentOS7, MariaDB, Mysql 한글깨짐 현상  (0) 2018.12.24
[Sybase]계정 연결 세션보기  (0) 2012.09.15
Posted by 땡보
2013. 8. 1. 11:24

신뢰할 수 있는 사이트 등록 키

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\URL\www

Posted by 땡보
2013. 7. 29. 12:31

원문출처 : http://www.autoitscript.com/forum/topic/66005-alternative-to-stringencrypt/

String.au3


This function came out of my trying to understand a supposed problem with _StringEncrypt(). Only one user reported that problem, and it was never duplicated by anyone else, so it very well may not be a bug, and this is not an attempt to "fix" _StringEncrypt().

The only thing I wanted to achieve was a version of _StringEncrypt() that would output a "standard" result for RC4 encryption, that would match RC4 implementations on web sites and in other languages. The encryption side of that was completely solved by SkinnyWhiteGuy in the topic: equal encrypt function autoit and php

What I did here was match the string-based nature of _StringEncrypt(), vice the binary nature of RC4(), with the multi-pass encryption functionality provided by the $i_EncryptLevel parameter. The result is __StringEncrypt(), with the double-underbar in the name.

Here is the function, within a basic test script:

AutoIt          
$sString = "This is a text string" ConsoleWrite("Debug: $sString = " & $sString & @LF) $sKey = "Key phrase" ConsoleWrite("Debug: $sKey = " & $sKey & @LF) For $z = 1 To 4     ConsoleWrite("Debug: Encryption level = " & $z & @LF)     $sEncrypted = __StringEncrypt(1, $sString, $sKey, $z)     ConsoleWrite("Debug: $sEncrypted = " & $sEncrypted & @LF)     $sDecrypted = __StringEncrypt(0, $sEncrypted, $sKey, $z)     ConsoleWrite("Debug: $sDecrypted = " & $sDecrypted & @LF) Next ;=============================================================================== ; ; Function Name:    __StringEncrypt() ; Description:      RC4 Based string encryption/decryption ; Parameter(s):     $i_Encrypt - 1 to encrypt, 0 to decrypt ;                   $s_EncryptText - string to encrypt ;                   $s_EncryptPassword - string to use as an encryption password ;                   $i_EncryptLevel - integer to use as number of times to encrypt string ; Requirement(s):   None ; Return Value(s):  On Success - Returns the encrypted string ;                   On Failure - Returns a blank string and sets @error = 1 ; Author(s):        (Original _StringEncrypt) Wes Wolfe-Wolvereness <Weswolf at aol dot com> ;                   (Modified __StringEncrypt) PsaltyDS at www.autoitscript.com/forum ;                   (RC4 function) SkinnyWhiteGuy at www.autoitscript.com/forum ;=============================================================================== ;  1.0.0.0  |  03/08/08  |  First version posted to Example Scripts Forum ;=============================================================================== Func __StringEncrypt($i_Encrypt, $s_EncryptText, $s_EncryptPassword, $i_EncryptLevel = 1)     Local $RET, $sRET = "", $iBinLen, $iHexWords         ; Sanity check of parameters     If $i_Encrypt <> 0 And $i_Encrypt <> 1 Then         SetError(1)         Return ''     ElseIf $s_EncryptText = '' Or $s_EncryptPassword = '' Then         SetError(1)         Return ''     EndIf     If Number($i_EncryptLevel) <= 0 Or Int($i_EncryptLevel) <> $i_EncryptLevel Then $i_EncryptLevel = 1         ; Encrypt/Decrypt     If $i_Encrypt Then         ; Encrypt selected         $RET = $s_EncryptText         For $n = 1 To $i_EncryptLevel             If $n > 1 Then $RET = Binary(Random(0, 2 ^ 31 - 1, 1)) & $RET & Binary(Random(0, 2 ^ 31 - 1, 1)) ; prepend/append random 32bits             $RET = rc4($s_EncryptPassword, $RET) ; returns binary         Next                 ; Convert to hex string         $iBinLen = BinaryLen($RET)         $iHexWords = Int($iBinLen / 4)         If Mod($iBinLen, 4) Then $iHexWords += 1         For $n = 1 To $iHexWords             $sRET &= Hex(BinaryMid($RET, 1 + (4 * ($n - 1)), 4))         Next         $RET = $sRET     Else         ; Decrypt selected         ; Convert input string to primary binary         $RET = Binary("0x" & $s_EncryptText) ; Convert string to binary                 ; Additional passes, if required         For $n = 1 To $i_EncryptLevel             If $n > 1 Then                 $iBinLen = BinaryLen($RET)                 $RET = BinaryMid($RET, 5, $iBinLen - 8) ; strip random 32bits from both ends             EndIf             $RET = rc4($s_EncryptPassword, $RET)         Next         $RET = BinaryToString($RET)     EndIf         ; Return result     Return $RET EndFunc   ;==>__StringEncrypt ; ------------------------------------------------------- ; Function:  rc4 ; Purpose:  An encryption/decryption RC4 implementation in AutoIt ; Syntax:  rc4($key, $value) ;   Where:  $key = encrypt/decrypt key ;       $value = value to be encrypted/decrypted ; On success returns encrypted/decrypted version of $value ; Author:  SkinnyWhiteGuy on the AutoIt forums at www.autoitscript.com/forum ; Notes:  The same function encrypts and decrypts $value. ; ------------------------------------------------------- Func rc4($key, $value)     Local $S[256], $i, $j, $c, $t, $x, $y, $output     Local $keyLength = BinaryLen($key), $valLength = BinaryLen($value)     For $i = 0 To 255         $S[$i] = $i     Next     For $i = 0 To 255         $j = Mod($j + $S[$i] + Dec(StringTrimLeft(BinaryMid($key, Mod($i, $keyLength) + 1, 1), 2)), 256)         $t = $S[$i]         $S[$i] = $S[$j]         $S[$j] = $t     Next     For $i = 1 To $valLength         $x = Mod($x + 1, 256)         $y = Mod($S[$x] + $y, 256)         $t = $S[$x]         $S[$x] = $S[$y]         $S[$y] = $t         $j = Mod($S[$x] + $S[$y], 256)         $c = BitXOR(Dec(StringTrimLeft(BinaryMid($value, $i, 1), 2)), $S[$j])         $output = Binary($output) & Binary('0x' & Hex($c, 2))     Next     Return $output EndFunc   ;==>rc4



These are the results of two consecutive runs in SciTE:

>Running:(3.2.10.0):C:\Program Files\AutoIt3\autoit3.exe "C:\Program Files\AutoIt3\Scripts\Test_1.au3"  Debug: $sString = This is a text string Debug: $sKey = Key phrase Debug: Encryption level = 1 Debug: $sEncrypted = 13BFA0643B2D2B75A2FA41A98B0B363748DB0EC8C5 Debug: $sDecrypted = This is a text string Debug: Encryption level = 2 Debug: $sEncrypted = FC92DD7408FBF831F8F71EB9518557EDB7A25191EAB226AEB9CF3776E3 Debug: $sDecrypted = This is a text string Debug: Encryption level = 3 Debug: $sEncrypted = 553996021B3DCE57CB21CDFD0B8808FD6D2C304B15CB79F796C76BA4680B031A03B2175035 Debug: $sDecrypted = This is a text string Debug: Encryption level = 4 Debug: $sEncrypted = BCB5DD4D8F19ED1D98BF8285385EDBB937216F5BCF45182D69BE34FD472FE0D6CE404C747C269F35C8F27D790C Debug: $sDecrypted = This is a text string +>13:06:59 AutoIT3.exe ended.rc:0



>Running:(3.2.10.0):C:\Program Files\AutoIt3\autoit3.exe "C:\Program Files\AutoIt3\Scripts\Test_1.au3"  Debug: $sString = This is a text string Debug: $sKey = Key phrase Debug: Encryption level = 1 Debug: $sEncrypted = 13BFA0643B2D2B75A2FA41A98B0B363748DB0EC8C5 Debug: $sDecrypted = This is a text string Debug: Encryption level = 2 Debug: $sEncrypted = 3F83796908FBF831F8F71EB9518557EDB7A25191EAB226AEB9261552D2 Debug: $sDecrypted = This is a text string Debug: Encryption level = 3 Debug: $sEncrypted = 4FEEF71FB98E811CCB21CDFD0B8808FD6D2C304B15CB79F796C76BA468D39E1676FC9FAA1A Debug: $sDecrypted = This is a text string Debug: Encryption level = 4 Debug: $sEncrypted = 600821594D0853343717D6DA385EDBB937216F5BCF45182D69BE34FD472FE0D6CE1CC2B3258B0833861A82BA52 Debug: $sDecrypted = This is a text string +>13:08:34 AutoIT3.exe ended.rc:0



Note that the encrypted string is the same between the two runs where $i_EncryptLevel = 1, but is different where $i_EncryptLevel > 1. It is useful in some contexts to get different results that can still be decrypted with same key to the same value.

As long as $i_EncryptLevel = 1, this function should be directly compatible with string-based RC4 implementations elsewhere (on web sites or in applications). For example, you'll get the same result if you put the string "This is a text string" and the key "Key phrase" into this web site: http://www.4guysfromrolla.com/

:) 

Posted by 땡보
2013. 7. 27. 20:51

A321FFCB92EEC82123FF289605E665A1651E817029847551E222F12F7781B06F684C5321A48C7BD238FC6883C7B8D56C03A830370A6B5CA668196D92112D50904BAE22913920941B330311DC5FEC91ADE8F3359B4D22BFE3B758BF957F9708F14D1A24B3A3C4C900E8498F5290DCDACCD92A51586E079947669D5F092366D6F409BB682B17197611CC116460F841747D3E1B2BDFDF911913C4EE386D2602534398DD2B2D60D3129A4EC921C465CC613462835E3E326D02AFFACE6CE5EA1A7EDE517559462E9E16AF78C6A2E866C2ABA61AFFBECC541ACE647A189C9B86A131164DDC795B8F3DFF2C4FAD94ABB347DF72465C25EF24A084A1D13459D6D383D7CC3966DD5D8867495AC9202C2B18B0FFFC2CF59559A1E0959DE15A7556C5B47AC99FFAD1393E4655A051F9AC741EC28B4482A7602BB19D4FBEA3D1B4DF415EA1635974B4EA5B0922283C879B1B5295EBFCA851BB944C7D1EEB1F3824E2DE62EFD70FB3BC2728F3239E1B260D85EFE5C748B42DECC8E736312E88464FC5CC3960EFB75BB72E6616DFB597434EE2EF65BE7AD85EC57279E049881C806A78C56BF87AC637A886D67F703094A096CC4DD2DF7906C6C9A3925194F262F57C024C5BC1E86159BA4342475A5A1FF91CF88F1F9770E9855D788B1DB585F90F6E2F37DDF8DA61EF7A38D9FC8F9028C6BCD03DEFF3E613A24D83F8EC200992E1332AF549FD60853377A9847CA9C1A20CB03812A89A2E8F01FD65F462F1810A7971C4FFD90B0FEF2ACEEB5D2DED87AFD1E7D9418EA7F3F1A09CDCDD8E41E8310673B1E9A95C3862B51971F37307261B0FFB87F4732E464FB06FEC9445F0DA0844E97D3FDB03F7DB581C72590DE26CE69DEE0A2F7BD38E15C3ACE66FC672DDFDB2C085A074100078DF12CB5930D8E541B048CA995078C14BAEBD1A4AB16EFA586342CA779D41901774A98623C4C006A9B68DA014D9BC25CD5B909C4751C934C23FD88CD0520A2093FE23F8AAF8C1B9E455906328BE0D370E00B73E3430B19E30919919CBB3EAACAD776F7364C1EAAE25AD4F1EE37C47DC55F771BE4DBFF5009AC00AF3294EE1BF794A4C10E38C06A2E80CC3F3ADE7A6FCC5D489B080CCD49588396F6E17CAFEA4DA8B4AC27C936F2F7C9B55035DD21B6E79009494BCF8292D72C730298D365C936E2882D421A86B670A32D8EE0B99C7DBA0FE89C1A087A5C16A726DA299A7760DBB5658F1A2873EDA65E8E11BCBA381E144FC22A43F0A22943C66A7A7039BD5314AB3606B2B1E4AA3F9A5E030E7D77CCC2C32EE65257A4629EDDE93D052B68869ADE9F78CE56AB347B6664E4E13F8B7A879386671A3BE5C13651CC1CC5B17F643DA675ADFE56F99BB819CD32C5196C69AEA8C3DEADB4D7A5DF07503E3070069BA37B1BDE61FE863A4FD55AA5587A1899D8ADB768D6958953DC98F0DE12926FE1DB423386E0876735D390A0782250CD8DF9C6698E0A89DEE14DCA7D9FEE7E114958D54A24A5562810DF767F9B1F266468879B71AB22EE7DAA1A948B090376372431F79B5AEC809F3C2DD3946C881B24118235FFEC0CF128A9FE753A645D41B8D8094DA4ADA023F33032AB675188470EE4A20AEE6D0ED8D1FBC02EAEAE368B4C6E948A9FABE2A40C06698A7B19D5D42EDEB174355CC0C8E278F4A22421A82F4B8A9194F40960E336A5BFB5D2C9979313DF240C3939117D2D80A042F3971B4F8E07ED341C2BABFBEDF8A57FC8D4DDDDC2CBEB5DE4DB4E89BAB14A4212967DDB540248D25429BF80AB70B9F275263C8EB46BD2FF2025CDCFC126CC750E057CE56F7E0FF05EDAB300606F5F4A4C456419833C045F773AC2FEE035FA2F388E89579D2A70D32BBC4AB3DB07458AB5F57BDB0C1C695717BA4643625AE958B7C33E1E7D776A675B235D91624D4AA74DA609E826DDE1FD87537B8AB005ABCF5D69B64A653FDC49CC6AF49E8669DFB9B39E06BDCD59F42D5EE3BEFFACA5CC3E46F8E645D304CEB3A449CBC306E6F52439B783644663B32806DA549BD832F696397958F76F13943D8F4A408E0F13B29C4AF69124B8AE9EAFE4BF00C5545A31157699778EFC090725AFAAB64FBCE3B794C0D13718D74616F9999AA00566876EE6410E71A1C205062D9C0DB5CC92F676811756EA08303590607A9C60F160355C9CAD2D053AA04B5CC010BD8BDB52E57D7699D4BB12C3E15B6322467A64D15C61E9449AB4D795786A53B936D9B81D2BEE0FCC12BA8B2DF29A7B0B5B05EA6FBA91565A07995D78B999C75BBD1489A04FEDAFE57978808A1113944B403E6F76717B81F54697F066E479ACAA18079DC371E1204944A3DEAE7A17A3BA114AB69FB467A76708751B0A2B0FE817F3449D3011D4F7BC715E26A34F6BFA5BB3EDA312DC2F737F3D6818571FE1D09AEEB09781324BD94F545C6FBBD488F823C0FE359459454B821C5A888E63759AB8825FF301F355E43A57E0DD9B710FFFC789BAB07C1B69D5DB237D3DD4A17C0FA4EB7DB03BD6237B3C4801B60A4280C0D8149AA0DF9AD776237F9804AB9802657C13DC30F246FFF51E6A48B5FCF5497776BADD883359B7C25DABAC51F9D7962222885889D639EC876BC4CCF1CF3ED06F5275330F15E570BC66F26722A247AEF922853D1A0E8CF64C9FB278D9C9738D56F579D10990FA10674B77FE11D3CC5DD1CC8276F82A21DF987A1A6A0F80DA7A767B89F6C96D628ECF12F5170BDCF139C96E51ED10B21257A5BD03495AAA5E37020BA30EBC712DDB4B9761AEC2E25E2B704A276CF4FA8DC1FBDE0060B5ECB605D18C727971289B66FC7401EFDF9D0969B7EB2B336ADFA56285D777FC932200F1B101D9F6A6FF1C530E1C684704BD16E4B2C41E4B8FBDAFC17AE14580C0C65D79DE0A2997B1A706DAC1B149342B435428CE6DDACC4CD16BB2CEA7E569447EA658637DECA567C6ACB770DF2B9E12C2FB8F4C814DC1E1AE223005C44211C65B7B4A1C293EBBCFFC66559B5552E6F9F88E6E1ECBD91E045A2CB5C0187462D6EE000FBC261DF89A3AC3202499FE839D3B6D09C3D00254ED94967D4890EE3C2DF01A7DE0B54072F85822133442B146984315B5253F260D12CE4EDB82FEA442760AA36A377EBB99479BC195841B8378E4CA137D8CB7E2FAB3CC5333C18C2ECFA1C43976E0325112C7EF090E403FA23F224C2B0B7C2D47658EAAD85B7849CE01621373B2212B6BE45AD23B928A4852562B4EE8A5F0C3A8AC232FEC39811703E283CA7272D66CFF34F46380FF6B5B1BE882E3B488494E7B9B1270F0EF89CF3BBC44951481ACB65F8AB555E8A1041AEEE45C21DE74C725C3AECF82519E99CBC9242FDCF44A99617937F909A3FDD1CE56937FBF07AAA0414EA05C5FE50C60774F1E1D52B7A3981D5969EDD0F61B9997E2CDFD752F304F130989624A9C8BFE524351C03993F2A76C463E2A0C13EDA47FACC720696E9603F75DF7EF73B811490418FB58492CD91F5D4CD51F7B549681BB6312F07A05FADAE3A0AB5ABEBA25D03A338806D86CF30871C732C969E967FED2906C765B53BE2564B67B128B7202C3D4514B4B681008625343B078D1E297B7957ADBA18C44D75F92918ADB3A6A1EB2B31A335CAC780C04A8DDF60C35DD7B301D29857F41382CBA55A1FA25890D890E75DF8371C5931821F931A4DDB847D1DF4F0B380E19F0C30E1B609E6FE240706FE8E58F6C90AC55720482BE48C8BF9EE571971C48FAB4A93C54821A41C82FE6285AE99C3B2601C8532F863EEF37E452393DDFA4A24310EC44E5B1630B60CAC5922C02A212B341C64A29039DDEE9EB8E25A9405D2830ACA68FACE13142694A2F668907117DCE6B3E9502AA33AE35D0A177912899F8DD9EA1CE8605EB5748127176B7821E3195A760F9AFBDB0149CC99B28E73BDB0CE804A4C2D8D8D8B9875803EA0465D27C6C23BBE4CA5F9AB3A6D2E7FC04D95B2890E077AD14BB08063EB79ED402B6CFCC523D2BBFE27A6E9C1698B1B6B60D800541F7B5B2B16A02E8A096FD2DFD96622F0F8AA836D8B4955B6609B82CA7E949895B5EC74902DC899A236209FA419882762CDFF20E7239B97E6F44442396B957AD9D60B1BDB56436C6F6E49CD8E68B7C8579790C48FE41F0E015183F8E6F9A6FD3F8E425DB75BFDDB0A08567073079957A8B2683BCC0E43405DAE9ACC6A965E20C580ADF8FA6F0590B5D254D381B0B173461A09303E995B0DAAFEE8FC799D02334053EA351F38946A6522ABD39FF1322527C9C6D870CE3E3BE9621DB1F590129D1D7D0D26961F42D4486BE719C8AEA0C9E606E47E12D8EC0664BDFE4932A9E36ADD8ADC3A048EA385C95DD8D3E5311601DC12418337FB674D42B3DD9C27B304736708B2ABAE86277C8C20C08008BC9E4CAAF15BB616377A12F7611490614A79F4009F139C492BF7CF4A5E290BB23464EADF0960BB2E2B71AB262C0F4C46BFFA007BC6753A9FE21BF508FE7081BB671A3B227218DB3734AEA3A2CC1AE361B9ECFF50F58C200DCA02259468D7B7B617B7D98F0D8CB23D991C03E342DA7C70B58559FB008C1C367FE9DEA3320FE0240D1AF068AAC6477C52F36F1F25CE4B908A37EAB72C6C8E4B8F333FE64A1D2AD4FF526980BF5A67D7D295DE74CD253280ED2CBF5A7CA4D2B6687D3EBD1DAE814A8DF1300553D94D7454FE9B3512FB2DFBA30CDE7776671E404EA0A350A7624B7FCF3FABAB1242CBC6F3241138204252B93784859DE4DBA52A1DC98F919F026488FE2957F7E49EC8261189B48338CD3D240D8F366B44586E7DE95131706FE975D667CFA6F0ED88E6244E648CFC56D2620D94FDA9F0C6EF511D32A0CD8E92F5A12DED1815EF20932504D764EA58D1B1ED65C9ADA61D3EA6CE5A09B8DC1CCD1348C7E2D57F67C991455EA3B8EF12884F1D5AF1B46C71B426F6594536B16D847A21D085C0872322EB0B669945FA8B1519D090688C55EAC50CECB41B4727CDDC2806CE08F983125C12AE8E0ACB9965E8D3752600A54CFA934BBFBA5CB4D8088DAE7108C74B8819087FA0C0AF381CF04B3A10EEB0C0F68CE6DA6610549B423E0692F7320CBF05AE566E769079D84AA055C17534F8A933B42CE2BE61DF1118BCB5A221836C44E1FF27241DB37DE1AB5771D7BE2B921CBB5B300E32D09C18216567E8EF8A26E8E58902BA43E4BE6E77731D362B0EF95909EC500D6E0A81004C0483023F6A14B0CCEB5045903C555A2BA5ED285FCD4FF614D2B620103A5F5D6C5FC73EB94EDF6301B761C8529979AAAE5C7948750C5E5E33FC3E50EC9517D66E092A26DC9268CDFF58D3F1FDA2DD3D1430105086F710328B1A61F52066640B8F2BDB05020995D578145FEBCF051333340C13D7CD7581A207175A1A50B61FDA932B200B44BC8B2A5AEB68387E34DB0C9B1D82D43404B4A72376A4478E9C1498FA71FB2A2399573975C1C238BC728E9DA6DD564D4AB110E5081575BE345725D5ACD0BE2A02B4779E5CA4C5262BE8EF83503648EF1CE902F8E4E19ED41028CE31A213CF23B71E9EB88AADDD46F5EE79226E666F25535823436FD0E5CA479EF70D3B7070DB569F7E96D44BC14C56FF2B51A1D8462941DAF00D440D85F5A7EA67C497B7A70CE9D367A69DA12B27E116966DDE132DA1CE45D2F4546FD0DDF5E42D18387F476DAA3280D8EE4C56F0253752B8FFCCDD100EF72E6A9F13A6DBEF0143464D78560419EC65B46283B2978B25ADFEE3F674EBA8950F3CB6F1DE9F6CD7C0F869C492591B3C34A681AA14690CE602BC517E498CB7696B91C35F925117861A15AEAF6633BCBDDC471A28C9129D9AA193F8F5F0E59B579EB0B6ABD66EFB611E660CE2819DD735422FA0416A98155300EC7E02D0F7165C160F086AAAA4698D4BA23EB81A467923A27D4817A97CECC90F7B28ED3482C5C92400B1598775FE00CF8B7E0518B8906D3D971994B602ED46563E4273A64113C3FC656B61D023AE38B322DB8496126E6D0D8A1B2704AF358E456DB1A321DF4E12C80CE1E9DA3B5462A42AB233E19AC979B0C364F27476C84EBBFA896FCF51991DDEA6834FD488CA140ED10B135F3E66A9F8819E073E565C4BCBD9AC8C5322D3ED974642758B0F5F4CA8C91A9D3CB5F5724FEF2F19BEE826F55B5030EE581C5D58669B6F580621F0C614950F615A9D181DDC6DF9AC62D37D7F9E4AA3BA1D6FAFEC17DCFB26BEC718D8EDDF16264E995BB92902BCF522654801079ED0C85D2F4B94DC4EA07522684879617798A0D4AB7BBE8AEE8EAFF7D1261D7C61EDCE091E519134FCC9A6FF4D5F445FCA84D84C3C06F45865022C4E44D5212765B9625096F7D2F10517411F2FA3082C2F70E1B50F67940CD8B39216D950AE64E91CE8E4085DB746576A882FFCF6FF211A73F65472F76220743633128BBB31BC02CDE0FF07E177039954D2AB8B3FB410C36582FD7A28BB277E6DE14643E469686851AD2A07332A4C659932524332EB1B18C98410E5F2EC219B0CBE5E85EECCB890A3096C86A82CDD5A97C288156FC88D23C4CCB941A521AACCC15AE8BDE1CC01137784650EB28ACA23BDF92CD6EFDBF78F564A424EE762963E51EE0BEB76521CE5A808A3104B619EAE699EC8E0811CFB5055F54B18B5E1FD0A5E310DE0BFFBF98586C0D7D8895473018187F064CB3640F7D27E97C32E1735462703C8CB34F7CBB07232E8FE532C87E527F23E1294902A7A23F18F0A45977F3B47F13F9B9B165BFC94E0D9F92DA44534198F81570EB5BB7CDA59FBBFBD3EF40C7634B6869027C3D9D2FA49122016081D5905A1108B4F1D199C71841992A99B4FFBD72F6700DA32560A4CA9F4B302C73DC1C5551B54049B271E9E24C9F64C410A8B8AAB273730CCC8F452AF361FDE1ECB0BDF3CBD9E731B9D95B6039209D097078622D8D21511E748E2C0C3E52F55A1F1FA04A9ACE88FD337977C4F76BC7F90CA04C0FE70DE28247BE8EFB92DDD8D6B6AF48DA6C132237CA9A1F4B1C4D405FBA0EC1E7C2574E890BF59313FB41DF2A9F010EFEFB6ED7354DEA77382A7FEAEF972DBA38178E71B086E48A04CCA2C6278249149DBB4DD49370AD01A254758BC522901EAE52BB9CF7075C3744CDC484B6A32874275E035B320DB3EFFA8570473DB3C27ECD530781A938BA4797855925B779C7A74F470A7ED617CF6F6229E91FE054AFB91DDC888DFDA1A9F4E104EA72D3AD7EFCDBDAE6148B5BD77D4B573B8717926566054DD81507AF52FEFA88CAA63E775695988067BB000E665E3E068AE91087F88383570321B26E6996452AF6DE8C85ECCF00CF47583C495A1C6654137D5B8BC82C1B0200FADE2AD33F480807C5637368B9CE104C0B010E3BC4CF9F359F4C520302C16F8CF52C7A0D7B4876F3059880CCF17C713821FC4539080A8E083066BF05CFA8CE7C6A044A3E559DD6A102B10942AAA1BE18047F49C5E980774DB90725F8335C9AEDD85DFCAD9358F908ECDC514E9F9500CB2F165711F21D566DC9629E0C477FAA0FB4D1DE00641CF1B14BAF8109FCB9A41F06A627818E6B05FDF62498438B6D6C97E98211CE5910C6F40DC037BF1F0A46AE72CB4095BC6C4C49949FAA95E705D2B251A7F4E7B86F427C073234E6C22844F0DF883014F2C3F61A889A32977467486EF0095875286C729AA319BCB7DC280A56BD7570C955D082D22A1F55D6EFFA6EB9008E232F3E8118FF671842D5201896E9BC08D2A27744BE97F62215F4857FF705C1F1806286538F8A7645AA0BE69A111A949A31EA739E058701F7E727DEE6842A5C894008A151120E1E88BFA799B517DDAD706532C89E6C3484F46E151C82A49AD4A5A793C2DC71431875384E351E6BDE1C1B65A1B51C79DDDBD10B80C0F33877CD4104DB902AE1A2DFFBC368EB3510B6C25D4A6A5A6EABA9D213DDD034D6F2F7AABF32C02B701F93D7A91106CBE2BA3011883E728C6D323171B77F040AFD2972093265E80F6636977418D82BC868231B6041B3814997C4DB4C556C4ECBC0DFC25C000319CF0F50E4AC4F69607B0DA9765941D3F60CA485E33428A2C33D414820B4CB1790D8220E72181588D338730DF9809D1CBD62EBE2686FD8F6E61A5E7DAF88C4A967B90884B90CBD9E79AE9C68124EADA127C1AA0ED6D4E09EAC13A7BC50763F6ADA8C198D196F61B0BCEE4B53AC8F629D94FD5984ECE0FD1AF8FE0252B2297FAF2E09283C452F457D039198E32DBB6F4230C8DA9ACF5D85AC1294431B47D7D494A9E0B8299C1C46C32981DB9BD689FCFEDA20047FE41F6A91F005F2D853767D1782067CC483A5D90E8CFC3E584C59449224AC036267D6528B2C9E1F9E6168147640883AA4CF37C9065E2C3AF4D4614C77A59C543E76D0B5031367651042DAF3881FB4C4E4C9F5F4168866718B206C28727CF5C725209201A41D1707A6F005C0A20FA38EB23F27F62DD34A3CC32183265DC6A84CB3EBA581F636E42592269CB3AE803BC39AC7543E60EA80FD1222991A14173A14A11523D2D115253626FBAFD9C3EDE2A798DD673631B69EB7239AC28C14BACA4531F5EB76ED2640B8168EB786EA12CD99C75505B4EF2CE5286B9FFB0951FC20B567478291F7A01F7E3CCDB1EB18CC24D422759F1BC43BC45731D9C5DAE759514F740FFA9675054FF008EC97BC2D5D748C7A114F27D198C305BB6FD0386E7A538B27F6F34FA3D41254EA1DAF2F3038ABF8E8AB2563430039FC2811EAD50B674C74161364666FBED78ABEA50D211DC3F1CEF42C35D9E7F10983173E3959264F46FA043E01CDA85FE0568AD305A1EF417881402E5D978ED431CF3870EA1C07B38C193D9DA8199EFB09E03753051F2C9FD207850A9F83AB02B0BFDBF240DE8A977E88C3F83FDC1108674E4ECBBAEEC620702F73B8551D74D37A95EC36C671AC372A7EE47386A97394CD4F08BF465915B98CD6839212ECD287BD30B2C3B0030CAC27718278AB5C37CF9AEC05276B9355E40995424B479EEA7151B1190ECC8A1CED3060594CF88B179768D3F645F86DC25748B6FBC16A28CD1679278D6325A983F06FF32128CEE29BCFF123A

'주옥같은사이트주저리' 카테고리의 다른 글

[링크]게임알고리즘 길찾기 등등  (0) 2013.11.04
프로그래밍 종합 강좌 사이트  (0) 2013.09.28
[Link]ETRI 전자저널  (0) 2012.04.26
[LINK]IOS_Stuff  (0) 2012.04.25
[Link]Reverse Engineering Max OS X  (0) 2012.04.25
Posted by 땡보
2013. 7. 8. 20:42

아두이노 LED 제어 실습01~~



LED 제어 실습 02~~


허허... 그놈 참 재미지구려~~

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 땡보