Nc server needed for Pwnable problem.
Pwnable 문제를 푸는 과정에 있어서 nc를 이용해서 문제에 접속하는 경우가 대다수.
그래서 이 글을 통해 알아본다.
xinetd를 이용해 nc port를 열어서 nc로 문제를 공개.
1.Install the xinetd package.
Ubuntu에서 터미널에 $apt-get install xinetd를 입력하면 설치 가능.
2.Create a file with /etc/xinetd.d/service name.
$vi /etc/xinetd.d/ 서비스 이름.
3.Set the following in the file.
service 서비스이름 { disable = no flags = REUSE socket_type = stream # 사용하는 소켓의 종료를 입력. protocol = tcp wait = no user = Allblack # 계정 server = /sbin/shutdown # 서비스할 파일명. }
해당 파일의 맨 아래에 #Local services라는 스트링이 있는데 이 아래 포트 내용을 추가.
#Local services
서비스 이름 1234/tcp.
5.If you access nc, you can see if the service is running properly.
$nc localhost 1234
'#Tip' 카테고리의 다른 글
Syntax Highlight. (0) | 2018.05.15 |
---|---|
Double Free Bug. (0) | 2018.05.15 |
Pwnable Objdump. (0) | 2018.05.14 |
Simple Chrome Developer Tools Shortcut. (0) | 2018.05.12 |
Filter Bypass. (0) | 2018.05.09 |