libpcap 를 올려서 패킷 캡쳐를 해보려고 합니다.. 

 

저게 좀 초보라... 잘 모르겠어요 ㅠ_ㅜ 도와주세요

 

libpcap는 올려서 루팅된 핸드폰에서 실행하여 보니 no suitable device found 에러가 나옵니다...

 

제가 사용하는 핸드폰은 HTC desire 인데요.. 운영 체제는 2.2 입니다.

 

adb shell 로들어가 su 권한 주고 mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system  요렇게 명령어 줘서

 

폰에서 superuser 알람 뜨면 allow도 해 주었어요...

 

#define DEBUG_TAG "Sample_LIBPCAP_DEBUGGING" 

JNIEXPORT void JNICALL Java_org_umit_android_libpcaptest_libpcaptest_testLog
(JNIEnv *env, jclass clazz, jstring message) 

    char errbuf[1024]; 
    errbuf[0] = '\0'; 

   char *szLogThis; 
   char *dev = pcap_lookupdev(errbuf); 

    if (dev == NULL) { 
        szLogThis = "Couldn't find default device";      
    } 
    else szLogThis = dev; 

    __android_log_print(ANDROID_LOG_DEBUG, DEBUG_TAG, "Device status: [%s]", szLogThis); 
    __android_log_print(ANDROID_LOG_DEBUG, DEBUG_TAG, "errbuf [%s]", errbuf); 

    (*env)->ReleaseStringUTFChars(env, message, szLogThis);
}

 

저기 errbuf 로 로그 뜨면 나오는 말이 no suitable device found 입니다..

 

그런데 adb shell 로 핸드폰 들어 가보면 밑에 그림과 같이 분명 eth0 가 up 되있는 상태인데요.. .ㅠ_ㅜ

 

제목 없음.png

 

pcap이 루트 권한으로 실행 된다야 한다는 것이 핸드폰에서 root 권한을 갖어야 한다는 것 외에  다른 의미가 또 있는 건가요?

 

그리고 또 궁금한 점이

 

mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system  왜 이 권한을 주어야 해요?ㅠ_ㅜ

 

그리고 명령어 대로라면 rw 권한 을 주니 system 밑에 있는 모든 디렉토리로 adb push 명령이 먹어야 할 것 같은데

 

adb push libpcap.so /system/lib 제가 만든 libpcap.so 를 /system/lib에 넣으려고 하면 pumission denied 가 나옵니다...

 

흑흑... 도와주세요 ㅠ_ㅜ