반응형
c complier 및 c++ 라이브러리를 설치하려면..

의존성 때문에 이 libgcc이 먼저 설치되어있어야되는데

cydia에는 없다.. 이는 어떻게 구하느냐!! 고민을 하던 차에.. 구글신께 기도를 드려

얻었도다!!! 우워!!!!!!!!!

dpkg -i 패키지명

Call~


반응형

'작업공간 > Security' 카테고리의 다른 글

iPhone Unpack  (0) 2010.03.29
How to Get Started with iPhone Dev  (0) 2010.03.28
Android apk file decompiler  (0) 2010.03.24
iPhone perl Framework  (0) 2010.03.23
WaledPak-D  (0) 2009.08.03
반응형
아이폰뿐만 아니라 전체적인 스마트폰에 대한 언급을 이 카테고리에서 해야 될 듯 싶습니다..

오늘은 A3 팀블로그에 Android 실행파일 분석 (Decompile)라는 글이 올라왔더군요.
(정말.. 감탄하고 있습니다.. 회사내에서 이러한 연구를 하시는 분이 몇분이나 되시는지는 모르겠지만.. 이정도로 다양한 연구를 진행할 수 있다니.. 부럽고 부끄럽네요.. ㅠㅠ)

안드로이드에 대해서는 세미나에서 들은 것 뿐.. 실제로 제가 안드로이드 환경에서 작업을 해본적이 없어서 뭐라 할 말이 없습니다..

제가 안드로이드폰을 사지 않는 이상.. 하지 않을 것 같고요.. 물론.. 엄청난 사건이 발생한다면.. 에뮬레이터를 설치하고 있겠죠 =_=;;

블로그상에 보면 보안상 디테일한 정보는 생략한다고 나와있지만..
구글링을 좀만 하면 그와 관련된 다양한 정보를 얻을 수 있습니다.. 그래서.. 정보를 바로 Search 하기 시작했죠.. +_ +;;
(표정들이 왜 그래요?? 마치 검색 안해본 사람 처럼..
 보안상 안알려준다고 모르고 있으면 정보보안쪽 공부하는 사람 아니자나요~
 그건 그냥 일반인이지)
그리고 찾아냈습니다.

내용은 아래와 같습니다. 일본어 입니다..
저도 일본어는 못하기 때문에 일본어를 제외한 부분만 일단 봤는데.. 맞는 내용인 듯 합니다..
그래서 자료 보관차.. 이렇게 글을 남깁니다.

http://android.jpn.org/2009/11/decompile-classesdex-in-apk.html



============================================================================================================
============================================================================================================
============================================================================================================
 Androidアプリケーション(apk)の中には Dalvik VMの実行形式である
classes.dexファイルが含まれています。今回、このdexファイルのヘッダ情報を取 得したり、
コードセクションを逆コンパイルできるdexdumpを使って、dexファイルを逆アセンブルしてみます。

1.apkファイル の展開
  $ mkdir HelloAndroid
  $ cd HelloAndroid
  $ unzip ../HelloAndroid.apk

2.dexdumpの実行
  $ ~/android-sdk-linux_x86-1.5_r3/platforms/android-1.5/tools/dexdump \
   -d ./classes.dex
Processing './classes.dex'...
Opened './classes.dex', DEX version '035'
Class #0            -
  Class descriptor  : 'Lcom/example/helloandroid/HelloAndroid;'
  Access flags      : 0x0001 (PUBLIC)
  Superclass        : 'Landroid/app/Activity;'
  Interfaces        -
  Static fields     -
  Instance fields   -
  Direct methods    -
    #0              : (in Lcom/example/helloandroid/HelloAndroid;)
      name          : '<init>'
      type          : '()V'
      access        : 0x10001 (PUBLIC CONSTRUCTOR)
      code          -
      registers     : 1
      ins           : 1
      outs          : 1
      insns size    : 4 16-bit code units
0002c4:                                        |[0002c4] com.example.helloandroid.HelloAndroid.<init>:()V
0002d4: 7010 0000 0000                         |0000: invoke-direct {v0}, Landroid/app/Activity;.<init>:()V // method@0000
0002da: 0e00                                   |0003: return-void
      catches       : (none)
      positions     : 
        0x0000 line=6
      locals        : 
        0x0000 - 0x0004 reg=0 this Lcom/example/helloandroid/HelloAndroid; 

  Virtual methods   -
    #0              : (in Lcom/example/helloandroid/HelloAndroid;)
      name          : 'onCreate'
      type          : '(Landroid/os/Bundle;)V'
      access        : 0x0001 (PUBLIC)
      code          -
      registers     : 3
      ins           : 2
      outs          : 2
      insns size    : 9 16-bit code units
0002dc:                                        |[0002dc] com.example.helloandroid.HelloAndroid.onCreate:(Landroid/os/Bundle;)V
0002ec: 6f20 0100 2100                         |0000: invoke-super {v1, v2}, Landroid/app/Activity;.onCreate:(Landroid/os/Bundle;)V // method@0001
0002f2: 1500 037f                              |0003: const/high16 v0, #int 2130903040 // #7f03
0002f6: 6e20 0400 0100                         |0005: invoke-virtual {v1, v0}, Lcom/example/helloandroid/HelloAndroid;.setContentView:(I)V // method@0004
0002fc: 0e00                                   |0008: return-void
      catches       : (none)
      positions     : 
        0x0000 line=10
        0x0003 line=11
        0x0008 line=12
      locals        : 
        0x0000 - 0x0009 reg=1 this Lcom/example/helloandroid/HelloAndroid; 
        0x0000 - 0x0009 reg=2 savedInstanceState Landroid/os/Bundle; 

  source_file_idx   : 1 (HelloAndroid.java)

Class #1            -
  Class descriptor  : 'Lcom/example/helloandroid/R$attr;'
  Access flags      : 0x0011 (PUBLIC FINAL)
  Superclass        : 'Ljava/lang/Object;'
  Interfaces        -
  Static fields     -
  Instance fields   -
  Direct methods    -
    #0              : (in Lcom/example/helloandroid/R$attr;)
      name          : '<init>'
      type          : '()V'
      access        : 0x10001 (PUBLIC CONSTRUCTOR)
      code          -
      registers     : 1
      ins           : 1
      outs          : 1
      insns size    : 4 16-bit code units
000300:                                        |[000300] com.example.helloandroid.R$attr.<init>:()V
000310: 7010 0a00 0000                         |0000: invoke-direct {v0}, Ljava/lang/Object;.<init>:()V // method@000a
000316: 0e00                                   |0003: return-void
      catches       : (none)
      positions     : 
        0x0000 line=11
      locals        : 
        0x0000 - 0x0004 reg=0 this Lcom/example/helloandroid/R$attr; 

  Virtual methods   -
  source_file_idx   : 15 (R.java)

Class #2            -
  Class descriptor  : 'Lcom/example/helloandroid/R$drawable;'
  Access flags      : 0x0011 (PUBLIC FINAL)
  Superclass        : 'Ljava/lang/Object;'
  Interfaces        -
  Static fields     -
    #0              : (in Lcom/example/helloandroid/R$drawable;)
      name          : 'icon'
      type          : 'I'
      access        : 0x0019 (PUBLIC STATIC FINAL)
  Instance fields   -
  Direct methods    -
    #0              : (in Lcom/example/helloandroid/R$drawable;)
      name          : '<init>'
      type          : '()V'
      access        : 0x10001 (PUBLIC CONSTRUCTOR)
      code          -
      registers     : 1
      ins           : 1
      outs          : 1
      insns size    : 4 16-bit code units
000318:                                        |[000318] com.example.helloandroid.R$drawable.<init>:()V
000328: 7010 0a00 0000                         |0000: invoke-direct {v0}, Ljava/lang/Object;.<init>:()V // method@000a
00032e: 0e00                                   |0003: return-void
      catches       : (none)
      positions     : 
        0x0000 line=13
      locals        : 
        0x0000 - 0x0004 reg=0 this Lcom/example/helloandroid/R$drawable; 

  Virtual methods   -
  source_file_idx   : 15 (R.java)

Class #3            -
  Class descriptor  : 'Lcom/example/helloandroid/R$layout;'
  Access flags      : 0x0011 (PUBLIC FINAL)
  Superclass        : 'Ljava/lang/Object;'
  Interfaces        -
  Static fields     -
    #0              : (in Lcom/example/helloandroid/R$layout;)
      name          : 'main'
      type          : 'I'
      access        : 0x0019 (PUBLIC STATIC FINAL)
  Instance fields   -
  Direct methods    -
    #0              : (in Lcom/example/helloandroid/R$layout;)
      name          : '<init>'
      type          : '()V'
      access        : 0x10001 (PUBLIC CONSTRUCTOR)
      code          -
      registers     : 1
      ins           : 1
      outs          : 1
      insns size    : 4 16-bit code units
000330:                                        |[000330] com.example.helloandroid.R$layout.<init>:()V
000340: 7010 0a00 0000                         |0000: invoke-direct {v0}, Ljava/lang/Object;.<init>:()V // method@000a
000346: 0e00                                   |0003: return-void
      catches       : (none)
      positions     : 
        0x0000 line=16
      locals        : 
        0x0000 - 0x0004 reg=0 this Lcom/example/helloandroid/R$layout; 

  Virtual methods   -
  source_file_idx   : 15 (R.java)

Class #4            -
  Class descriptor  : 'Lcom/example/helloandroid/R$string;'
  Access flags      : 0x0011 (PUBLIC FINAL)
  Superclass        : 'Ljava/lang/Object;'
  Interfaces        -
  Static fields     -
    #0              : (in Lcom/example/helloandroid/R$string;)
      name          : 'app_name'
      type          : 'I'
      access        : 0x0019 (PUBLIC STATIC FINAL)
    #1              : (in Lcom/example/helloandroid/R$string;)
      name          : 'hello'
      type          : 'I'
      access        : 0x0019 (PUBLIC STATIC FINAL)
  Instance fields   -
  Direct methods    -
    #0              : (in Lcom/example/helloandroid/R$string;)
      name          : '<init>'
      type          : '()V'
      access        : 0x10001 (PUBLIC CONSTRUCTOR)
      code          -
      registers     : 1
      ins           : 1
      outs          : 1
      insns size    : 4 16-bit code units
000348:                                        |[000348] com.example.helloandroid.R$string.<init>:()V
000358: 7010 0a00 0000                         |0000: invoke-direct {v0}, Ljava/lang/Object;.<init>:()V // method@000a
00035e: 0e00                                   |0003: return-void
      catches       : (none)
      positions     : 
        0x0000 line=19
      locals        : 
        0x0000 - 0x0004 reg=0 this Lcom/example/helloandroid/R$string; 

  Virtual methods   -
  source_file_idx   : 15 (R.java)

Class #5            -
  Class descriptor  : 'Lcom/example/helloandroid/R;'
  Access flags      : 0x0011 (PUBLIC FINAL)
  Superclass        : 'Ljava/lang/Object;'
  Interfaces        -
  Static fields     -
  Instance fields   -
  Direct methods    -
    #0              : (in Lcom/example/helloandroid/R;)
      name          : '<init>'
      type          : '()V'
      access        : 0x10001 (PUBLIC CONSTRUCTOR)
      code          -
      registers     : 1
      ins           : 1
      outs          : 1
      insns size    : 4 16-bit code units
000360:                                        |[000360] com.example.helloandroid.R.<init>:()V
000370: 7010 0a00 0000                         |0000: invoke-direct {v0}, Ljava/lang/Object;.<init>:()V // method@000a
000376: 0e00                                   |0003: return-void
      catches       : (none)
      positions     : 
        0x0000 line=10
      locals        : 
        0x0000 - 0x0004 reg=0 this Lcom/example/helloandroid/R; 

  Virtual methods   -
  source_file_idx   : 15 (R.java)

結果、HelloAndroid.apkで使用さ れているクラスは#0~#5の6つ。
Class #0のVirtual methodsは1つで、名前はonCreate。
メ ソッド内で、super.onCreate()とsetContentView()をコールしていることがわかります。
これだけ逆 アセンブルできれば十分ですね。


반응형

'작업공간 > Security' 카테고리의 다른 글

How to Get Started with iPhone Dev  (0) 2010.03.28
[iPhone] libgcc  (4) 2010.03.25
iPhone perl Framework  (0) 2010.03.23
WaledPak-D  (0) 2009.08.03
Panda Challenge 1 풀이  (2) 2009.07.27
반응형
아이폰에서 꼭 perl을 돌릴 필요가 생겼고..
(사실 python이나 ruby도 상관없지만.. 일단 그래도 perl이 좀 편할 것 같아서)

perl을 설치하기 위해 몇일동안 웹서핑한 결과.. 드디어 찾아냈습니다..



iPhone perl Framework 라는 곳에서 긁어왔습니다.
http://thireus.dareyourmind.net/index.php/thireus-home-news/8-general-announcement/111-iphone-perl-framework

How to install Perl on the Iphone:

- install aptitude via Cydia
- copy this file to your Ipod/Iphone filesystem: http://coredev.nl/cydia/coredev.pub


- execute "apt-key add coredev.pub" at the same directory
- execute "echo 'deb http://coredev.nl/cydia iphone main' > /etc/apt/sources.list.d/coredev.nl.list" to add the new source
- do a "apt-get update" for getting the new filelist
- easily execute "apt-get install perl"

Thanks Br4in!

Source: http://marcoramilli.blogspot.com/2008/01/iphone-perl-framework.html


반응형

'작업공간 > Security' 카테고리의 다른 글

How to Get Started with iPhone Dev  (0) 2010.03.28
[iPhone] libgcc  (4) 2010.03.25
Android apk file decompiler  (0) 2010.03.24
WaledPak-D  (0) 2009.08.03
Panda Challenge 1 풀이  (2) 2009.07.27
반응형

UnPacking Malicious Executables

요즘 Pentestit.com이 리뉴얼중인듯 싶네요

볼만한 자료가 상당히 많이 올라오고 있습니다... 이번에는 언팩 과정을 설정하고 있는 글이 올라와있어요..

처음엔 UPX.. 누구나 다 아는 내용이죠.. 이젠 국민패커라고 불러도 무방할 듯 싶어요...

하지만 중반 이후 나오는 패커는

언패킹을 UPX만 해본 사람이라면 생소할 것 같네요..

하지만 따라하기 쉽게 자세한 설명이 적혀 있으니 따라해보시는 것도 좋을 듯 합니다 ㅇ_ㅇ;;






반응형

'작업공간 > 기본적인 삽질 & 기록' 카테고리의 다른 글

3.1.3 탈옥  (0) 2010.05.03
Backtrack4 Metasploit framework3 Update  (0) 2010.03.29
Disassemble the MBR  (0) 2010.03.08
Shellcode to Execute a Ping!  (0) 2010.03.08
CentOS 서비스 데몬 확인 방법  (0) 2010.03.04
반응형
http://blogs.msdn.com/ntdebugging/archive/2008/03/06/disassemble-the-mbr.aspx

공부용 링크 입니다..

질문은 역시 해당 링크에 해주시기 바랍니다.
반응형
반응형
http://blog.didierstevens.com/programs/shellcode/

공부용으로 걸어놓은 링크 입니다..
질문은 No~
해당 사이트 가셔서 하시기 바랍니다.

반응형

'작업공간 > 기본적인 삽질 & 기록' 카테고리의 다른 글

UnPacking Malicious Executables  (2) 2010.03.09
Disassemble the MBR  (0) 2010.03.08
CentOS 서비스 데몬 확인 방법  (0) 2010.03.04
Backtrack Network Setting  (0) 2010.03.04
Sad iPhone  (2) 2010.02.28
반응형
http://blog.madpowah.org/archives/2010/03/index.html#e2010-03-07T23_51_25.txt

아래 코드는 위 링크를 긁어온 것입니다.
공부하는데 이러한 생각을 길러야되는데.. 미처 이런 부분은 생각도 못하고 있었네요..

#!/usr/local/bin/bash
echo ">> ARP Poisoning Guardian by cloud"
echo ">> website : http://blog.madpowah.org"
echo "-----"
help() {
echo "Usage: ./arprotec.sh -ip <ip_gateway>"
exit
}
if [ $# -lt 2 ]
then
help
exit
fi

if [ "-ip" = $1 ]
then
ip_gw=$2
else
help
exit
fi
arp -a > arpfile
while read line_arp
do
ip=`echo $line_arp | cut -d ' ' -f2 | cut -d '(' -f2 | cut -d ')' -f1`

if [ $ip = $ip_gw ]
then
mac_gw=`echo $line_arp | cut -d ' ' -f4`
fi
done < arpfile
echo ">> IP :" $ip_gw "MAC :" $mac_gw
echo ">> Now starting..."
echo ">>"
attack=0
while [ 42 -eq 42 ]
do
arp -a > arpfile
while read line_arp
do
ip=`echo $line_arp | cut -d ' ' -f2 | cut -d '(' -f2 | cut -d ')' -f1`

if [ $ip = $ip_gw ]
then
mac_gw_new=`echo $line_arp | cut -d ' ' -f4`
if [ $mac_gw_new != $mac_gw ]
then
if [ $attack -ne 1 ]
then
heure=`date | cut -d ' ' -f5`
echo ">>" $heure "/!\ ARP Poisoning detected !!!"
echo ">>" $heure "MAC Attacker: " $mac_gw_new
echo ">>" $heure "You should add a static arp entry typing: arp -s" $ip_gw $mac_gw
echo ">>"
attack=1
fi
else
if [ $attack -ne 0 ]
then
heure=`date | cut -d ' ' -f5`
echo ">>" $heure "Attack seems stopped ..."
echo ">>"
attack=0
fi
fi
fi
done < arpfile
rm arpfile
sleep 5
done

[cloud@r00t ~]$ ./arprotec.sh -ip 192.168.0.254
>> ARP Poisoning Guardian by cloud
>> website : http://blog.madpowah.org
-----
>> IP : 192.168.0.254 MAC : 00:07:ca:3c:8e:d8
>> Now starting...
>>
>> 23:23:15 /!\ ARP Poisoning detected !!!
>> 23:23:15 MAC Attacker: 00:1c:f0:9e:3f:4a
>> 23:23:15 You should add a static arp entry typing: arp -s 192.168.0.254 00:07:ca:3c:8e:d8
>>
>> 23:25:09 Attack seems stopped ...




반응형

'작업공간 > Tool' 카테고리의 다른 글

MDecoder  (0) 2010.10.13
OllyDBG 2.0 Release  (0) 2010.06.07
Malware - ZEUS BotNet  (0) 2010.03.07
Super Phisher  (0) 2010.03.02
FileInsight  (0) 2010.03.01
반응형

Zeus란??

제우스 웹 서버(Zeus Web Server)는 유닉스유닉스 계열 플랫폼을 위한 높은 성능의 웹 서버이다.

영국 케임브리지의 소프트웨어 회사 제우스 테크놀로지가 개발하였다. 초기 제작자와 회사를 세운 사람들은 케임브리지 대학교의 졸업생 Damian Reeves와 Adam Twiss였다.


몇일 전.. 국내 보안 사이트에서 ZEUS BotNet에 관련된 기사가 떴습니다.


ZEUS BotNet에 감염된 PC를 이용하여 인터넷 뱅킹을 이용했고 그때 유출된 개인 정보를 통해 해커가 회사 돈
약 2억원을 빼냈다는 내용입니다.

그러던 중 오늘 해외 보안 사이트에서도 ZEUS BotNet에 대해서 언급하는 글이 있어서 정리도 할 겸 글을 남기고
있습니다..


(혹시 이 문서 내용 번역 좀 해주실분.. -_-ㅋ;;
앞부분은 대충 아는 내용이라 휙휙 넘어가는데.. 뒷부분은... oTL..)


아래는 간단한 ZEUS 소개에 대한 내용입니다.

WHAT IS ZEUS?
ZeuS is primarily a crimeware kit designed to steal users’ online banking login credentials, among other things. It is the handiwork of Eastern European organized criminals that has now entered the underground cybercriminal  market as a commodity.
ZeuS is known by many names—ZBOT due to its botnet capabilities, WSNPoem, PRG, and others—but its use  has been particularly criminal. In short, ZeuS is two things:
• From a technical perspective, it is a crimeware tool primarily used to steal money.
• From another perspective, it signals a new wave in online criminal business
enterprise wherein many different organizations cooperate with one another to perpetrate outright online theft and fraud.
The principal perpetrators behind the ZeuS botnet are in Eastern Europe, particularly in the Ukraine and Russia. However, the recent availability of the ZeuS Builder toolkit in the open market has muddied the waters on attributing crimes to any one individual or group. That said, there is definitively a difference between “professional” criminals and “amateurs.” The professional, organized crime syndicates also have other business
connections, which they leverage to perpetrate their crimes and move their money.




Zeus BotNet 중 특정 버전의 Zeus Builder를 구할 수 있었습니다.
해당 Builder를 가지고 이것저것 살펴보니 글로만 보던 ZPACK을 좀 더 확실히 이해 할 수 있었습니다.
그래서 특정 패턴을 뽑아보려고 하니 역시 Builder보다는 그로 인한 product를 잡는게 나을 것 같더군요...
실질적으로 Builder가 돌아다니는 것 보단 product가 훨씬 많이 돌아다닐 것이며 product를 검출하는 패턴이 훨씬 효율적이란 생각이 들더군요;;
무언가 좀 특정한 부분이 없을까.. 고민을 해보았는데..

마땅히 특정 패턴을 추출하기 힘들었습니다..
고민을 하던 도중.. 내용이 바뀌더라도 언팩과정은 변하지 않을 것이라는 생각이 들더군요..
예상대로 언팩과정은 OPCODE는 같았고 다른 점은 참조되는 메모리의 Address만이 틀린거 같았습니다..
이는 충분히 Snort에서 검증을 할 수 있을 것 같았고 실제로 몇몇 Snort에 적용을 해 놓은 상태 입니다..

비록 해당 버전의 Builder에서만 발견되는 내용이겠지만..
그래고 오탐의 가능성이 있겠지만.. 일단 뽑아서 적용시켜놨습니다....

벌써 한달 가량 되었지만..
아직까지는 단한번도 탐지가 되지 않았습니다;;
너무 오래된 버전이라 그런건지............................ -_-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

최근 퍼지고 있는 ZPACK들도 모아서 살펴봐야겠네요.. 근데 딱히 버전 정보를 확인할 길이 없어서........

혹시 ZPACK을 백신 업체에서는 어떻게 탐지를 하고 있는지 아시는 분이거나..
이런 부분을 탐지하는 룰을 본적있다던가..
하는 분은 알려주세요.









반응형

'작업공간 > Tool' 카테고리의 다른 글

MDecoder  (0) 2010.10.13
OllyDBG 2.0 Release  (0) 2010.06.07
[Tool] Detectez les attaques Man in the Middle !  (0) 2010.03.08
Super Phisher  (0) 2010.03.02
FileInsight  (0) 2010.03.01
반응형
CentOS에서는 되는데 Backtrack에는 해당 명령이 없다..
Backtrack에서 이와 같은 명령어를 아시는 분은.. 댓글로 살포시 알려주시면 감사하겠습니다.

[sun2day@localhost ~]# ntsysv

반응형

'작업공간 > 기본적인 삽질 & 기록' 카테고리의 다른 글

UnPacking Malicious Executables  (2) 2010.03.09
Disassemble the MBR  (0) 2010.03.08
Shellcode to Execute a Ping!  (0) 2010.03.08
Backtrack Network Setting  (0) 2010.03.04
Sad iPhone  (2) 2010.02.28
반응형

여태까지 어디서 세팅을 하는지 몰라서..

ifconfig eth0 xxx.xxx.xxx.x
route add default gw xxx.xxx.xxx.x

했었는데..
알고보니 너무나도 쉬운 곳에 있었다..


sun2day@bt:~# vi /etc/network/interfaces

      1 auto lo
      2 iface lo inet loopback
      3
      4 auto eth0
      5 iface eth0 inet static
      6 address 172.16.8.100
      7 gateway 172.16.8.2
      8 netmask 255.255.255.0

sun2day@bt:~# /etc/init.d/networking restart


반응형

'작업공간 > 기본적인 삽질 & 기록' 카테고리의 다른 글

UnPacking Malicious Executables  (2) 2010.03.09
Disassemble the MBR  (0) 2010.03.08
Shellcode to Execute a Ping!  (0) 2010.03.08
CentOS 서비스 데몬 확인 방법  (0) 2010.03.04
Sad iPhone  (2) 2010.02.28

+ Recent posts