CreateMutex
까보면 다나와~
분류 전체보기 (216)

vim 기본 설정하기

블로깅 했던 거 같은데 안나와서 다시하는 중..;

 

# .vimrc 파일을 '/home/계정'에 만든다.

 

" 줄번호 나오게

set nu

 

" 자동 들여쓰기

# set smartindent

 

" 검색시 대소문자 구별 x

# set ic

 

" 검색시 대소문자 구별

# set scs

 

" 자동 줄바꿈

# set wrap

 

" 줄 간격

#set lsp=1

  Comments,     Trackbacks

하드디스크, MBR 구조 등 정리.

간만에 좋은 분석 거리를 남긴 320 악성코드. 남들다하는 분석이라고 대충봤는데, 분석하다보니 하드디스크, MBR, VBR 용어에서 부터 구조까지 디테일한 내용 정리가 필요함을 느꼈다.

 

추가 #1. 먼저 MBR의 섹터 주소는 0, 섹터는 1번이다. 물리적으로 Cyl 0, Side 0, Sector 1인 것이다. 따라서 부를때 약간의 모호함이 있는데, 내용은 다음 링크를 참고하자. 대부분 주소를 따라 0번 섹터가 MBR이라고 하는 것 같다.

http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q97819

 

추가 #2. 실린더, 헤더, 섹터는 -> "conversion of physical disk geometry"적인 용어로 "the number of cylinders on the disk, number of heads per cylinder, and number of sectors per track" 이런식으로 불린다.

 

MBR은 파티션을 만들면 쓰여지게 되며, 부트섹터(Boot Sector)는 포멧할때 쓰여진다.(아마 포멧할때 NTFS, FAT과 같은 파일시스템을 정의할 것이다.)

 

MBR은 Bios에 의해 메모리(0000:7c00)에 로드된다. MBR코드는 파티션 테이블을 참고하여 ACTIVE 파티션을 찾아서 해당 파티션의 부트섹터를 로드한다.

 

다음은 MBR 섹터이다.

 

 

MBR은 446byte의 Boot code + 각 16byte 4개의 Partiton table entry(상기 그림의 파란 박스), 총 64byte로 이루어진 Partition Table + 2byte Magic Number로 구성된다. 총 512 bytes, 정확히 1개 섹터 크기이다.

 

상기 그림의 빨간 박스, 정확히 0x1B8 Offset은 Disk signature이다. (4byte 고정인건지 00 값은 끊는 건지 모르겠다.)

 

추가 #3.윈도우에서는 해당 시그니처를 레지스트리 키를 통해 확인 할 수 있다. 다음은 XP에 대한 레지스트리 키이다. 레지스트리를 확인하면 상기 그림의 Disk signature와 같은 unique한 값과 동시에 "00 7e"(63 sector)라는 값을 볼 수 있는데 이는 C 드라이브 시작지점에 대한 디스크 오프셋 값이다.

"HKEY_LOCAL_MACHINE\SYSTEM\MountedDevices" 

 

 

이제부터는 Partition Table에 대한 설명이다. (사실 이것 때문에 글을 작성 중이다.)

Partition Table은 4개의 entry가 존재한다. 각 entry는 Partition에 대한 정보가 Structure로 되어 있다.

 

상기 MBR 그림의 파란 박스가 첫번째 Partition entry로 Offset 0x1BE로 고정이다.

 

다음은 Partition Table Fileds이다.

 

 

http://blogs.msdn.com/b/ntdebugging/archive/2007/06/19/how-windows-starts-up-part-1-of-4.aspx

 

위의 그림이 설명이 잘 나와 있다. 그중에 눈여겨 볼 것은 바로 Relative Sectors!

그림에 "3F 00 00 00" 4byte 크기로 3F번째 섹터가 디스크의 시작 지점이라는 것을 보여주고 있다.

 

어셈으로

shl "3F", 9 -> 7E00 -> 32256(512*63)

 

이번 320 악성코드는 Relative Sectors 필드를 참고해서 Active된 파티션의 물리주소를 찾아냈다. 즉, Boot partition의 디스크 Offset으로 접근해서 데이터를 먼저 날린것이다.(물론 MBR을 먼저 지우면 VBR을 지울수 없다;;)

 

여기서 Boot Sector가 Volume Boot Recode(VBR)이다.

 

'유용한 지식 자료들 > 하드웨어, MBR 등' 카테고리의 다른 글

_DOS_PARTITION_STRUCT  (0) 2013.03.11
  Comments,     Trackbacks

_DOS_PARTITION_STRUCT

IDA로!!!!!


typedef struct _DOS_PARTITION_STRUCT {
unsigned char IsBootable; // 부트 가능하면 0x80, 부트 불가능하면 0x00
unsigned char CHSOffset[3]; // CHS(Cylinder-Head-Sector)로 표현되는 실제 파티션 주소
unsigned char PartitionType; // 파티션 유형 (ex: FAT32=0x0C, NTFS=0x07, ...)
unsigned char EndCHSOffset[3]; // CHS 주소로 표현되는 파티션의 끝 지점
unsigned long LBAOffset; // LBA(Logical Block Addressing)로 표현되는 파티션 주소
unsigned long SizeInSector; // 파티션이 사용하는 섹터(LBA)의 총 개수
} DOS_PARTITION_STRUCT, *PDOS_PARTITION_STRUCT;


http://vbdream.tistory.com/95


  Comments,     Trackbacks

중국에서 사용하는 메신저 프로그램

qq.EXE
yy.exe
9158.EXE
Camfrog Video Chat.exe


중국에서 사용하는 메신저 프로그램이라고 한다. 이런 자료 공유~ㅎㅎ

'유용한 지식 자료들 > 기타' 카테고리의 다른 글

comprehensive list of most interesting malware topics  (0) 2013.05.23
Windows7 update 관련 프로세스  (0) 2013.05.15
윈도우 버전 정보 (GetVersion)  (0) 2012.12.07
PEB structure  (0) 2012.08.09
TEB structure  (0) 2012.08.09
  Comments,     Trackbacks

Targeted ‘phone ring flooding’

http://blog.webroot.com/2013/02/13/targeted-phone-ring-flooding-attacks-as-a-service-going-mainstream/


Targeted ‘phone ring flooding’


흥미롭네요.

 

119나 이런 기간망에도… 공격한다면 충격이 있을 거 같네요.


흠..

'악성코드 소식' 카테고리의 다른 글

Shedding New Light on Tor-Based Malware  (0) 2014.03.12
ghost, gh0st 관련 정보  (1) 2013.09.17
Red October  (0) 2013.01.16
Ole Trade Tool 악성코드  (0) 2010.12.13
Koobface 새로운 버젼입니다~  (0) 2010.10.28
  Comments,     Trackbacks

vSphere 프로비저닝 개념

다른건 모르겠고 프로비저닝이 뭔지 참 헷갈렸는데


VM설치 후 스냅샷을 해보니 알겠다.


스냅샷을 찍을 경우 원래 VM설치시 할당한 용량만큼 스냅샷 파일이 생성되지 않는다.

하지만 나중에 VM을 더 쓰다보면 스냅샷이 (용량이) 점점 커진다. 


이게 프로비저닝,


스냅샷 공간을 미리 확보하지 않고 쓰는만큼 커지는 것, 여기 까지는 경험으로 얻은 사실..


그래서 스냅샷 찍을 때는 조심해야함


  Comments,     Trackbacks

Cuckoo 0.5 Debian Squeeze installation

http://erewhon-network.net/wordpress/?p=592




  • Preparing the host:
  • Get Debian here: http://www.debian.org/distrib/netinst. I used the small CD version. Burn the iso and boot the CD.
    Choose the default options (or as appropriate for your site).
    When you get to the “Software Selection” screen, unselect all options to get a bare minimum install.
    After the install finishes, the CD ejects and the system will reboot. Log back in as root.

  • Requirements:
  • Installing python 2.7
    To install python 2.7, we will need to fix some dependencies first:

    apt-get install libssl-dev libncurses5-dev libsqlite3-dev libbz2-dev libreadline5-dev libgdbm-dev make

    Once the packages have been downloaded an installed, lets download and install python 2.7.

    wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz
    tar -xvzf Python-2.7.3.tgz
    cd Python-2.7.3
    ./configure –prefix=/opt/python2.7
    make
    make install

    Ok, python 2.7 installed, lets link it to our /usr/bin

    cd /usr/bin
    ln -s /opt/python2.7/bin/python2.7 python2.7
    ln -s python2.7 python

    Installing Cuckoo requirements:
    In order to properly function, Cuckoo requires SQLAlchemy to be installed but the version that apt downloads does not work properly so we are going to install setuptools first to install the latest version of SQLAlchemy and other cuckoo requirements.

    Download and installation of setuptools:

    wget http://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-py2.7.egg
    sh setuptools-0.6c11-py2.7.egg
    cd /opt/bin
    ln -s /opt/python2.7/bin/easy_install easy_install

    Installation of SQLAlchemy and other Cuckoo requirements (python-magic, bottle, pefile, pymongo, argparse and jinja2):

    easy_install -U pymongo python-magic bottle pefile jinja2 sqlalchemy argparse

    Download and installation of dpkt:

    wget http://dpkt.googlecode.com/files/dpkt-1.7.tar.gz
    tar -xvzf dpkt-1.7.tar.gz
    cd dpkt-1.7
    python setup.py install

    Installing tcpdump

    apt-get install tcpdump libcap2-bin

    Tcpdump requires root privileges, but since you don’t want Cuckoo to run as root you’ll have to set specific Linux capabilities to the binary:

    setcap cap_net_raw,cap_net_admin=eip /usr/sbin/tcpdump

  • Installing virtualbox 4.2
  • First step, add virtualbox to our source.list file

    nano /etc/apt/sources.list

    And add the following line

    #virtualbox
    deb http://download.virtualbox.org/virtualbox/debian squeeze contrib

    Download and add virtualbox gpg key

    wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | apt-key add -

    Update our debian source and install virtualbox

    apt-get update
    apt-get install virtualbox-4.2

    Virtual will install python 2.6 so we need to reconfigure our python

    cd /usr/bin
    rm python
    ln -s python2.7 python

  • Installing cuckoo:
  • Lets create a user for cuckoo (dont really needed but recomended) and add it to virtualbox user group

    adduser cuckoo
    usermod -a -G vboxusers cuckoo

    Next step, git installation to get the latest cuckoo version

    apt-get install git

    And finally, lets install cuckoo

    su cuckoo
    cd
    git clone git://github.com/cuckoobox/cuckoo.git

  Comments,     Trackbacks

진실 혹은 거짓~

보안쪽에서 일을 하다보니(그래서 보안쪽에서 일을 하는 건지?)

보이는게 진실(조작)인지 확인을 자주한다.


그래서 그런데 인류가 앞으로 한 몇 천년이 흐른다고 치면

온라인에서 아무렇지 않게 찍어올린 주변 사진도...

트윗도...코드도.. 역사적 사실로 가치가 생길 수 가 있을 것 같다.


하지만 점점 조작이 쉽고 정밀해지기 때문에 사실이 정말 사실인지

판단하기가 어려워 질 것이다. 내가 혹시(-_-) 유명한 사람이 된다고 하면,

이 글 조차 정말 본인이 쓴건지 아닌지 논란이 될 수 도...;;


결론적으로.. 앞으로 멀지 않은 미래에는 

온라인 멀티미디어 자료들도 단순 공유 차원을 떠나 그것이 진짜인지

아닌지 판단하거나 진짜라는 것을 증명하고 저장해주는

기관이나 기업이 나타날 것 같다. 예를 들어 사진을 해쉬값도 같이

보관해주는 기업??.. 


오늘의 공상 끝.


  Comments,     Trackbacks

아파치에서 파이썬 돌리기(Configuring the Apache Web Server to Run Python)


1. %SomePath%\apache\conf\httpd.conf


2. "AddHandler cgi-script"를 검색한다.


3. 주석처리가 되어 있다면 풀고 마지막에 .py를 붙힌다.

ex) 

#AddHandler cgi-script .cgi

AddHandler cgi-script .cgi .py


4. 아파치 재시작


5. Py 파일을 만들어서 확인

ex)

#!/usr/bin/python (윈도우 C:\Python27에 파이썬을 설치했다면 #!/Python26/python)

print "Content-type: text/html"

print

print "<html><head>"

print ""

print "</head><body>"

print "Hello."

print "</body></html>"


주소창에서 http://localhost/test.py

  Comments,     Trackbacks

Red October

http://www.f-secure.com/weblog/archives/00002486.html


http://www.securelist.com/en/analysis/204792262/Red_October_Diplomatic_Cyber_Attacks_Investigation


http://www.securelist.com/en/blog/785/The_Red_October_Campaign_An_Advanced_Cyber_Espionage_Network_Targeting_Diplomatic_and_Government_Agencies



'악성코드 소식' 카테고리의 다른 글

Shedding New Light on Tor-Based Malware  (0) 2014.03.12
ghost, gh0st 관련 정보  (1) 2013.09.17
Targeted ‘phone ring flooding’  (0) 2013.02.14
Ole Trade Tool 악성코드  (0) 2010.12.13
Koobface 새로운 버젼입니다~  (0) 2010.10.28
  Comments,     Trackbacks