admin

[Fortify]병렬분석 방법

형식) sourceanalyzer -64 -Xmx8G -Dcom.fortify.sca.RmiWorkerMaxHeap=4G -XX:-UseGCOverheadLimit -XX:MaxPermSize=256M -j 3 -logfile [로그파일]  -scan -f [FPR파일] 1) CLI 예제 및 설명  sourceanalyzer -b build_id -64 -Xmx6144M -Dcom.fortify.sca.RmiWorkerMaxHeap=3072M -XX:-UseGCOverheadLimit -XX:MaxPermSize=256M -j 6 -logfile scan.log -scan -f build_id.fpr  위 CLI 예제에 노란색으로 표시된 영역이 Parallel mode 옵션입니다. -j scan 시 사용할 CPU 코어이며, -Dcom.fortify.sca.RmiWorkerMaxHeap는 각 CPU 코어가 사용할 힙 […]

[Fortify]병렬분석 방법 더 읽기"

[Fortify]임의의 소스파일 확장자 매칭 방법

설정 파일 경로 :  Fortify SCA 설치경로\Core\config\fortify-sca.properties 설정 변경 예제 :  소스 파일 확장자가 .biz일 경우, 아래 노란색 표시 부분처럼 변경 후 소스 재분석(예제 fpr 첨부, 참조바람) com.fortify.sca.DefaultFileTypes=java,jsp,jspx,tag,tagx,tld,sql,cfm,php,phtml,ctp,pks,pkh,pkb,xml,config,settings,properties,dll,exe,inc,asp,vbscript,js,ini,bas,cls,vbs,frm,ctl,html,htm,xsd,wsdd,xmi,py,cfml,cfc,abap,xhtml,cpx,xcfg,jsff,as,mxml,cbl,cscfg,csdef,wadcfg,appxmanifest,wsdl,plist,biz # Custom Rules## This property controls what directory is searched to pick up custom rules.  If it is set, the default# (Core/config/customrules) will not be searched #com.fortify.sca.CustomRulesDir=${com.fortify.Core}/config/customrules

[Fortify]임의의 소스파일 확장자 매칭 방법 더 읽기"

파일실행 함수(execute)

static int execute(char **argv) {    pid_t p;    int status;     p = fork();    switch (p) {        case -1:            return -1;        case 0:            execvp(argv[0], argv);            exit(1);            break;        default:            waitpid(p, &status, 0);            break;    }     return WEXITSTATUS(status);}

파일실행 함수(execute) 더 읽기"

make 기본 문법

출처 : http://blog.daum.net/english_100/8 4. 규칙 작성하기 makefile 에서 규칙은 언제 어떻게 파일을 재작성할 것인지를 알려준다. 그 안에는 target이 있고 (대부분의 경우 한개의 규칙 속에는 한개의 target이 존재한다.) target에 대한 prerequisite 그리고 recipe가 있다.여러 규칙들의 순서는 default goal을 결정할 때 외에는 중요치 않다 (default goal 이란 make에 아무것도 명기하지 않고 입력했을 때 실행될 target). default goal

make 기본 문법 더 읽기"

make Writing Recipes in Rule

출처 : http://blog.daum.net/english_100/9 5. 규칙속 recipe 작성하기 recipe 는 한개 이상의 명령 행으로 구성되며 이 명령들은 쓰여진 순서대로 차례차례 실행된다. 일반적으로 이 명령들의 결과로 타깃이 갱신되어 최신상태로 변화하게 된다. 사용자가 사용하는 여러 쉘프로그램 중에 makefile 내에 특별히 언급하지 않으면 /bin/sh 을 이용하게 된다. 5.1 Recipe 문법 Makefile 은 한 파일 내에 서로 다른 두가지 문법을

make Writing Recipes in Rule 더 읽기"

make 조건 분기

출처: http://blog.daum.net/english_100/11 7. Makefile의 조건분기 7.1 조건 분기의 예 다음 예는 CC 변수가 ‘gcc’인지 안닌지에 따라 어떤 라이브러리를 링크할 것인가를 결정하는 조건문 예이다. libs_for_gcc = -lgnunormal_libs =foo : $(objects)ifeq ($(CC),gcc)        $(CC) -o $(objects) $(libs_for_gcc)else        $(CC) -o $(objects) $(normal_libs)endif 이 예에는 ifeq, else, endif 등 세가지 지시자가 쓰였다.ifeq 지시자는 조건문의 시작으로

make 조건 분기 더 읽기"

make 명령행 옵션

출처 : http://blog.daum.net/english_100/13 9. make를 실행하는 법   make의 종료 상태는 다음 3가지중 하나를 갖는다.   0 make가 성공적으로 끝났음   2 make 수행중 에러가 발생했음. 그 에러에 대한 메시지를 출력함   1 ‘-q’ 옵션이 사용되었고 어떤 타깃이 아직 최신상태로 갱신되지 않았다고 make가 결정했을 때   9.1 Makefile을 명기하기 위한 옵션   특정 makefile을 명기하기

make 명령행 옵션 더 읽기"

make 암묵적 규칙 사용

출처 : http://blog.daum.net/english_100/14 10. 암묵적 규칙 사용하기 C 소스파일을 C 컴파일러를 이용해 오브젝트 파일을 생성하는 이런 표준적인 작업은 자주 발생하는 일이다. 암묵적 규칙은 사용자가 구체적으로 명기하지 않은 사항에 대해 관례적으로 사용하는 기술을 말한다. 예를 들어 ‘.c’로 끝나는 파일을 만나면 make는 C 컴파일러를 통해 오브젝트 파일을 만드는 암묵적 규칙을 수행한다. 10.1 암묵적 규칙 사용하기 타깃 파일을

make 암묵적 규칙 사용 더 읽기"

make 텍스트 변환 함수

출처 : http://blog.daum.net/english_100/12 8. 텍스트 변환을 위한 함수   8.1 함수 호출 문법   함수 호출은 변수 참조와 비슷하다. 즉 : $(function arguments) 또는 ${function arguments}   여기서 function은 함수 이름으로 make가 제공하는 함수거나 사용자가 직접 만든 함수일 수 있다. arguments는 함수의 인자로서 함수명과는 공백문자나 탭문자 등으로 분리되고 여러개의 인자가 있을 경우는 콤마로 분리한다. 함수의

make 텍스트 변환 함수 더 읽기"

make 변수 문법

출처 : http://blog.daum.net/english_100/10 6. 변수 사용법   변수란 문자열을 함유하고 있는 makefile 내에 정의된 이름이다. 이 값은 타깃이나 prerequisite, recipe 등 makefile의 다른 부분에서 치환되어 쓰이게 된다. 변수나 함수는 recipe 에서만 제외하고 makefile을 읽어들일 때 ‘=’의 오른쪽 부분이나 define 지시자의 몸통부분의 값으로 펼쳐진다. 변수에는 파일이름, 컴파일러에게 건네줄 옵션, 실행할 프로그램, 검색할 디렉토리 등등 상상할 수 있는

make 변수 문법 더 읽기"

OpenWRT 이미지 빌드

export KERNEL_SRC_DIR=/home/hasu0707/ib/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/linux-ramips_rt305xexport ROOTFS_SRC_DIR=/home/hasu0707/ib/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/root-ramipsexport TOOLCHAIN_BIN_DIR=/home/hasu0707/ib/staging_dir/host/binexport DTS_DIR=/home/hasu0707/ib/target/linux/ramips/dtsexport OUTPUT_DIR=/home/hasu0707/ib/bin/ramips cp -fv ${KERNEL_SRC_DIR}/vmlinux.elf ${OUTPUT_DIR}/openwrt-ramips-rt305x-vmlinux.elfcp -fv ${KERNEL_SRC_DIR}/vmlinux ${OUTPUT_DIR}/openwrt-ramips-rt305x-vmlinux.bin ${TOOLCHAIN_BIN_DIR}/lzma e \${KERNEL_SRC_DIR}/vmlinux \-lc1 -lp2 -pb2 \${KERNEL_SRC_DIR}/vmlinux.bin.lzma cp -fv ${KERNEL_SRC_DIR}/uImage.lzma ${OUTPUT_DIR}/openwrt-ramips-rt305x-uImage.bin ${TOOLCHAIN_BIN_DIR}/mksquashfs4 \${ROOTFS_SRC_DIR} \${KERNEL_SRC_DIR}/root.squashfs \-nopad -noappend -root-owned -comp xz -Xpreset 9 \-Xe -Xlc 0 -Xlp 2 -Xpb 2  -b 256k -p ‘/dev d 755 0 0’ \-p ‘/dev/console c 600 0 0

OpenWRT 이미지 빌드 더 읽기"

iptables manpage

NAME iptables – IPv4 기반 패킷 필터링 및 NAT 를 위한 관리자 툴   SYNOPSIS iptables [-t table] -[AD] chain rule-specification [options] iptables [-t table] -I chain [rulenum] rule-specification [options] iptables [-t table] -R chain rulenum rule-specification [options] iptables [-t table] -D chain rulenum [options] iptables [-t table] -[LFZ] [chain] [options] iptables [-t table] -N

iptables manpage 더 읽기"

kernel compile

export LINUX_SRC_DIR=/home/hasu0707/openwrt/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/linux-ramips_rt305x/linux-3.10.36export INCLUDE_DIR=/home/hasu0707/openwrt/staging_dir/host/includeexport OUTPUT_DIR=/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/linux-ramips_rt305x make -C ${LINUX_SRC_DIR} \HOSTCFLAGS=”-O2 -I${INCLUDE_DIR} -Wall -Wmissing-prototypes -Wstrict-prototypes” \CROSS_COMPILE=”mipsel-openwrt-linux-uclibc-” \ARCH=”mips” \KBUILD_HAVE_NLS=no \CONFIG_SHELL=”/bin/bash” \V=” mipsel-openwrt-linux-uclibc-objcopy \-O binary \-R .reginfo \-R .notes \-R .note \-R .comment \-R .mdebug \-R .note.gnu.build-id \-S ${OUTPUT_DIR}/linux-3.10.36/vmlinux \${OUTPUT_DIR}/vmlinux mipsel-openwrt-linux-uclibc-objcopy \-R .reginfo \-R .notes \-R .note \-R .comment \-R .mdebug \-R .note.gnu.build-id \-S ${OUTPUT_DIR}/linux-3.10.36/vmlinux \${OUTPUT_DIR}/vmlinux.elf

kernel compile 더 읽기"

firmware-mod-kit의 펌웨어(bin) 추출과정 설명

■ firmware-mod-kit의 펌웨어(bin) 추출과정 설명 firmware-mod-kit(https://code.google.com/archive/p/firmware-mod-kit/downloads)의 extract-firmware.sh의 동작과정을 설명한다. ■ 필요한 프로그램 fmk/src/binwalk-1.0/src/bin/binwalk-script fmk/unsquashfs_all.sh ■ 추출 과정 1. 쉘스크립트 변수 정의 BINWALK="/opt/fmk/src/binwalk-1.0/src/bin/binwalk-script -v -m /opt/fmk/src/binwalk-1.0/src/binwalk/magic/binwalk" UNSQUASHFS="/opt/fmk/unsquashfs_all.sh" 2. 펌웨어 정보 추출 ${BINWALK} -f bininfo.txt test.bin test.bin의 정보를 bininfo.txt로 출력한다. 정상적으로 실행되면 아래와 같은 내용이 bininfo.txt에 들어있다. Firmware Mod Kit (extract) 0.99, (c)2011-2013 Craig Heffner, Jeremy Collake

firmware-mod-kit의 펌웨어(bin) 추출과정 설명 더 읽기"

dts 파일 컴파일

dts – device tree source textdtb – device tree blob ~/openwrt/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/linux-ramips_rt305x/linux-3.10.36/scripts/dtc/dtc \-O dtb \-o ~/openwrt/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/linux-ramips_rt305x/SR-K100.dtb \~/openwrt/target/linux/ramips/dts/SR-K100.dts

dts 파일 컴파일 더 읽기"

위로 스크롤