본업을 떠날수 없나보다. Javascript 악성코드 난독화를 수작업으로 하니 시간도 많이 걸리고 이제 좀 익숙해지고해서 이제 좋은 방법이 없나 검색중에 발견한 툴이다.


리눅스에 설치가 가능하다고 바로 사용 가능한 라즈베리파이의 Raspbian에 설치해 봤습니다.



※ JSDetox 


About JSDetox 


A Javascript malware analysis tool using static analysis / deobfuscation techniques and an execution engine featuring HTML DOM emulation


- 사이트 : http://www.relentless-coding.com/projects/jsdetox/info



※ 설치방법


- JSDetox의 안내된 공식 설치 장법이다. 

  이대로 설치하면 therubyracer 0.9.8이 없다는 에러가 발생한다.


Installation on Linux Mint 17 LTS / Ubuntu 14.04 LTS is straightforward:


sudo apt-get install git ruby ruby-dev bundler build-essential

git clone https://github.com/svent/jsdetox.git

cd jsdetox

sudo bundle install

./jsdetox


- 에러가 발생한화면


extconf.rb:15:in `<main>': undefined method `include_path' for Libv8:Module (NoMethodError)



Gem files will remain installed in /var/lib/gems/1.9.1/gems/therubyracer-0.9.8 for inspection.

Results logged to /var/lib/gems/1.9.1/gems/therubyracer-0.9.8/ext/v8/gem_make.out

An error occurred while installing therubyracer (0.9.8), and Bundler cannot continue.

Make sure that `gem install therubyracer -v '0.9.8'` succeeds before bundling.


- gem install therubyracer -v '0.9.8' 에러화면

  아래와 같은 에러가 발생하며 0.9.8 설치가 안된다.


sudo gem install therubyracer -v '0.9.8'


~~~~~~

extconf.rb:15:in `<main>': undefined method `include_path' for Libv8:Module (NoMethodError)


extconf failed, exit code 1


Gem files will remain installed in /var/lib/gems/2.1.0/gems/therubyracer-0.9.8 for inspection.

Results logged to /var/lib/gems/2.1.0/extensions/arm-linux/2.1.0/therubyracer-0.9.8/gem_make.out


- therubyracer 0.9.8 설치하는 방법

  일단 0.12.x 버전에 설치되어 있어 방법은 0.9.8버전으로 인식 시키는 방법으로 해결 가능


One solution is to run the current version as version 0.9.8. (solves not the real problem):


- Clone therubyracer's source 

  git clone https://github.com/cowboyd/therubyracer.git


- Checkout tag v0.x.x git checkout v0.9.8

  Change version number in ./lib/v8/version.rb to 0.9.8
  sudo vi ./lib/v8/version.rb


- Build the gem gem build therubyracer.gemspec

  sudo gem install therubyracer-0.9.8.gem


- 다시 설치를하면 정상적으로 완료된다


설치하기

sudo bundle install



※ 실행 및 접속화면


- 원격에서 접속이 가능하도록 실행 및 접속한 화면이다.


접속하기(원격접속 허용)

./jsdetox -l 0.0.0.0


외부에서 접속한 화면



Posted by n3015m
:

라즈베리파이 관련해서 검색하다 GPIO 간단한 테스트 프로그램 발견해서 한번 따라서 해봤습니다.




버튼을 클릭하면 LED가 점등되는 예제로 파이선으로 구현되어 있습니다. 아마도 저에게 딱 맞는 BASIC한 샘플인거 같습니다.


- 참고 사이트 : http://cupcake-user.tistory.com/14



※ 파이선 소스코드


# -*- coding:utf-8 -*-

import RPi.GPIO as GPIO

import time                       //GPIO핀을 제어하기 위해 GPIO 라이브러리 가져오기 및 타이머

 

GPIO.setmode(GPIO.BCM)     //GPIO핀이 준비되어 있는지 확인 GPIO.BCM, GPIO.BOARD 둘 중 하나 사용

GPIO.setup(18, GPIO.IN)

GPIO.setup(23, GPIO.OUT)     //GPIO18핀 인 23핀 아웃 설정

 

try:

  while True:

    input_value = GPIO.input(18)

    if input_value == False:     //버튼을 클릭 했을 때 GPIO 18과 GPIO 23에서 일어나는 이벤트

      GPIO.output(23, True)

      time.sleep(1)

    else:

      GPIO.output(23, False)

      time.sleep(1)

except KeyboardInterrupt:     //인터럽트를 위한 설정 Ctrl + C를 누르면 인터럽트 실행

  GPIO.cleanup()                  //라즈베리 파이 초기화


※ GPIO 연결 회로도




GPIO에 직접 케이블을 연결해서 테스트하려니 너무 힘들어서 그림과 같이 GPIO에 40핀 Ribbon 케이블과 T-Cobbler Plus를 구매해서 테스트 했습니다.



※ 40 Pin Ribbon Cable 연결화면


- 컴퓨터 HDD에 IDE케이블 연결한 느낌입니다.




※ 동작 테스트


프로그램 실행 후 LED 점등 테스트를 했습니다.


- 버튼을 누르기 전에 Bread보드에 케이블링한 모습니다.


- 버튼을 누르니 LED가 점등 되었습니다.


간단한거지만 하나하나 해보니 잼있네요.

Posted by n3015m
:

BLOG main image
'네오이즘'의 보안LAB 블로그입니다........... n3oism@gmail.com by n3015m

카테고리

분류 전체보기 (228)
[ HappyDevTool ] (29)
[ HappyToolRelease ] (4)
[Book] (6)
[ Security Studies ] (0)
- CII (2)
- BigData (2)
- Web Hacking (10)
- SQL Injection (25)
- Mobile Security (9)
- Network (6)
- OperatingSystem (4)
- Malware & Reversing (4)
- Phishing (5)
- Compliance (0)
- Programming (13)
- Tools (13)
- IoT (6)
- etc (21)
[Pentration Testing] (3)
[OS X] (4)
[ Security Trends ] (16)
[ Fixing Guideline ] (7)
My Way, My Life (34)
About Me (2)

최근에 올라온 글

최근에 달린 댓글

최근에 받은 트랙백

Total :
Today : Yesterday :