Mac 패킷 캡쳐

OS/Mac OS 2016. 5. 10. 23:24

Getting Started With tcpdump

To get started with tcpdump, try the following command.

sudo tcpdump -i en0 -w trace.pcap

The elements of this command line are:

  • The sudo command causes tcpdump to run with privileges, which is necessary in order to capture network traffic.

  • The -i en0 option tells tcpdump to capture packets on the first Ethernet interface. By default, tcpdump will use the first non-loopback interface it can find (usually en0). To specify a different interface, just change en0 to the BSD name of that interface. For example, the AirPort interface is typically en1.

    To get a list of network interfaces and their user-visible names, run the networksetup tool with the -listallhardwareports argument.

  • The -w trace.pcap parameter tells tcpdump to write the packets to a file called trace.pcap.


Posted by 知彼知己百戰不殆
,

현재 디렉토리에서, exe 확장자를 가진 모든 파일 찾기

find . -name '*.exe'


루트에서부터, 즉 전체 하드에서, pl 확장자를 가진 모든 파일 찾기

find / -name '*.pl'


전체 하드 디스크에서, 파일명이 ab 로 시작하는 모든 파일 찾기

find / -name 'ab*'


전체 하드 디스크에서, 파일명이 .bash 로 시작하는 모든 파일 찾기
+ ls 명령 형식으로 출력

find / -name '.bash*' -ls


전체 하드 디스크에서, 디렉토리 이름이 et 로 시작하는 모든 디렉토리 찾기

find / -name 'et*' -type d


find 사용 시 화면에 permission denied 무시하기

마지막에 2>/dev/null 추가

'OS > Linux' 카테고리의 다른 글

CentOS 5.1 ifconfig command  (0) 2016.06.16
CentOS 5.1 gcc 설치법  (0) 2016.06.16
setpgrp() 함수  (0) 2015.12.14
execve() 함수  (0) 2015.12.13
open함수 사용법  (0) 2015.12.13
Posted by 知彼知己百戰不殆
,

gcc -S -o (목적파일 이름) (소스파일 이름)


Posted by 知彼知己百戰不殆
,

사파리 -> 환경설정 -> 고급탭 (맨 아래쪽에 메뉴 막대에서 개발자용 메뉴 보기 체크)

'OS > Mac OS' 카테고리의 다른 글

Mac 패킷 캡쳐  (0) 2016.05.10
GCC 어셈블리 사용법  (0) 2016.05.02
MAC 터미널 'ls' 명령어 디렉토리, 파일명 색 변경  (0) 2016.04.28
특수문자. 한자 사용법  (0) 2016.03.13
스크린샷 찍는 법  (0) 2016.03.13
Posted by 知彼知己百戰不殆
,

홈 디렉토리(cd ~)에서 ls -a 명령어를 치면 숨겨졌던 파일들도 나오는데 여기서 .bash_profile 파일을 열어서 

export CLICOLOR=1

export LSCOLORS=ExFxCxDxCxegedabagaced


를 추가해주면 된다. 맨 앞의 Ex는 blue를 뜻하며 디렉토리 명들의 색을 바꿔준다.

마지막 Cx는 실행 파일들의 색을 바꿔주며, green을 뜻한다. 나머지 중간의 색들은 어떤 걸 바꿔주는 지 모름.


이게 귀찮으면 alias 명령어를 사용하여 ls=ls -G(ls에 색을 입힘) 를 입력하는 방법도 있거나, ls 라고 타이핑하는 대신에 ls -G라고 타이핑을 해도 된다.




a black
b red
c green
d brown
e blue
f magenta
g cyan
h light grey
A bold black, usually shows up as dark grey
B bold red
C bold green
D bold brown, usually shows up as yellow
E bold blue
F bold magenta
G bold cyan
H bold light grey; looks like bright white
x default foreground or background

Note that the above are standard ANSI colors. The actual
display may differ depending on the color capabilities of
the terminal in use.

The order of the attributes are as follows:

1. directory
2. symbolic link
3. socket
4. pipe
5. executable
6. block special
7. character special
8. executable with setuid bit set
9. executable with setgid bit set
10. directory writable to others, with sticky bit
11. directory writable to others, without sticky
bit

The default is “exfxcxdxbxegedabagacad”, i.e. blue fore-
ground and default background for regular directories,
black foreground and red background for setuid executa-
bles, etc.

'OS > Mac OS' 카테고리의 다른 글

GCC 어셈블리 사용법  (0) 2016.05.02
Mac Safari 웹 소스코드 보는 법  (0) 2016.05.02
특수문자. 한자 사용법  (0) 2016.03.13
스크린샷 찍는 법  (0) 2016.03.13
루트계정 활성화  (0) 2016.03.13
Posted by 知彼知己百戰不殆
,

Interrupt : 현재 진행중인 process를 중단시키는 사건 반드시! process 외부로부터 옴 -> handling이 있음 인터럽트가 처리된 후 프로세스 재개 >> handling은 os가 함

ex) device로부터 오는 interrupt


trap : 사용자 모드 -> 커널 모드로 바뀌는 모든 것, CPU가 OS를 실행하는 경우(스케줄러를 불러서 cpu의 사용권을 빼앗는 경우)


exception : cpu가 현재 실행중인 process(예외를 발생시킨 process)를 스스로 중단(죽임) 시키는 것. Why? cpu가 실행할 수 없는 명령을 요청한 경우. 가장 대표적인 것은 0으로 나누는 것 >> cpu가 스스로 처리. 버퍼 오버플로우(버퍼 작게 해놓고 크게 접근, 허가받지 않은 메모리 접근) -> handling이 있음 가장 대표적인 것 >> 가상메모리 페이지 fault (페이지 테이블에 페이지가 없을 경우, 물리 메모리에 없을 때) >> OS가 처리


'OS' 카테고리의 다른 글

CPU 스케줄링  (0) 2016.01.19
컴퓨터 시스템의 구성  (0) 2015.12.26
Posted by 知彼知己百戰不殆
,


한자 사용법 : 글자 입력 후 Alt + return(Enter)

Posted by 知彼知己百戰不殆
,

스크린샷 찍는 법

OS/Mac OS 2016. 3. 13. 16:00



Posted by 知彼知己百戰不殆
,

루트계정 활성화

OS/Mac OS 2016. 3. 13. 15:59



Posted by 知彼知己百戰不殆
,

하위 디렉토리가 많은 디렉토리를 지워야 할 때

sudo rm -rf * (-r : 리커시브하게 지움)

'OS > Mac OS' 카테고리의 다른 글

Mac Safari 웹 소스코드 보는 법  (0) 2016.05.02
MAC 터미널 'ls' 명령어 디렉토리, 파일명 색 변경  (0) 2016.04.28
특수문자. 한자 사용법  (0) 2016.03.13
스크린샷 찍는 법  (0) 2016.03.13
루트계정 활성화  (0) 2016.03.13
Posted by 知彼知己百戰不殆
,