블로그 이미지
:: OTL ≠ 좌절 :: OTL = 운(運) ::
coriahn

Notice

Archive

  • 19,286total
  • 12today
  • 58yesterday
2011/08/08 09:55 3-5. Networks
가끔 랜카드가 IP를 169.254.23.3 이렇게 잡는 경우가 생긴다. 
어이 없는 네트워크 대역이라 생각 되지만.. IP프로토콜에 정의된 대역이였다.. 

http://en.wikipedia.org/wiki/Link-local_address

번역해서 요약해보자면.. 내부내트워크의 연결 혹은 P-to-P 간의 연결을 위해 만들어진 IP대역이고 라우터에서 처리해주지 않는다. DHCP나 다른 ip 설정메소드에 실해 했을 설정이 된다는것 같네요.. 발번역 죄송.
저작자 표시
posted by coriahn
2011/07/12 15:20 3-5. Networks
내용 : 전송속도가 T1(1.544 Mbps)으로 연결된 라우터에 대해서 60초 동안 traffic을 체크하여, 트래픽 양과 전송속도의 관계를 확인하고자 함.

라우터IP(가상) : 10.1.1.1
community : public
포트번호 : 2번
사용한 프로그램 : snmpget

[트래픽추출]
#snmpget 10.1.1.1 public ifInOctets.2 ifOutOctets.2
interfaces.ifTable.ifEntry.ifInOctets.2 = 2870061957
interfaces.ifTable.ifEntry.ifOutOctets.2 = 3914191972

60초 후에 다시 체크
# snmpget 10.1.1.1 public ifInOctets.2 ifOutOctets.2
interfaces.ifTable.ifEntry.ifInOctets.2 = 2870917187
interfaces.ifTable.ifEntry.ifOutOctets.2 = 3915984744

위의 interfaces.ifTable.ifEntry.ifInOctets.2 가 의미하는 것은, 2번 포트에 입력된 트래픽 양을 의미합니다. 따라서 위 두 값의 차이가 60초 동안 입력된 트래픽 양이 됩니다. 출력값도 마찬가지로 계산하면 됩니다.

ifInOctets - The total number of octets received on the interface, including framing characters.
IfOutOctets – The total number of octets transmitted out of the interface, including framing characters
Octet – 8비트로 구성된 바이트와 같은 단위.

[계산]
① 60초 동안 발생한 트래픽
input: 2870917187 - 2870061957 = 855230 (bytes) = 106903.75 (bits)
output: 3915984744 - 3914191972 = 1792772 (bytes) = 224096.5 (bits)

② 60초 동안 트래픽 사용률
input: (106903.75(bits) / 1544000(bits) ) * 100 = 6.9 %
output: (224096.5(bits) / 1544000(bits) ) * 100 = 14.5 %

③ 전송속도
input: 855230 (bytes) / 60(s) = 14253.8 (bytes/s 혹은 BPS)
output: 1792772 (bytes) / 60(s) = 29879.53 (bytes/s 혹은 BPS)
전체 : 14253.8 + 29879.53 = 44136.33 (BPS)

④ 결론
T1(1.544(Mbps)) 이 낼 수 있는 최대 전송속도는 1544000 /8 = 193000 (BPS) 가 된다.
그런데 위의 input, output 전송속도를 합치면, 44136.33(BPS)가 되어 22.8% 정도의 전송속도로써 인터넷을 사용하고 있음을 알 수 있다.
만일 ftp를 이용하여 자료를 다운 받는다면, 거의 전송속도가 100%에 가깝게 됨을 알 수 있다.

즉, 앞에서 60초 동안의 트래픽 사용량을 가지고, 전송속도를 알아냈었다. 하지만, 사용자가 단지 웹서핑만을 할 경우에는 발생하는 트래픽은 그렇게 많지않기 때문에, T1속도에 해당하는 전송속도를 확인하기가 어렵다. 그러나 실제 몇 분동안 파일을 다운받는 경우, 그때 발생한 트래픽양을 추출하여, 전송속도를 계산하면 193000 (BPS) 에 가깝게 됨을 알 수 있습니다

펌'd by  nanha님 블로그(
http://www.nanha.com/index.php?p=b/view&n=776&b=dft)
저작자 표시
posted by coriahn
2011/07/12 15:09 3-5. Networks

snmpwalk -v2c -c read-community 호스트IP .

 

SNMPv2-MIB::sysDescr.0 = STRING: Linux ns.aaa.or.kr 2.6.6-8hl #1 Tue Oct 12 00:22:29 KST 2004 i686
SNMPv2-MIB::sysObjectID.0 = OID: NET-SNMP-MIB::netSnmpAgentOIDs.10
SNMPv2-MIB::sysUpTime.0 = Timeticks: (54657) 0:09:06.57
SNMPv2-MIB::sysContact.0 = STRING: Root <root@localhost> (configure /etc/snmp/snmp.local.conf)

 

snmpwalk -v2c -c read-community -O f 호스트IP .

 

.iso.org.dod.internet.mgmt.mib-2.system.sysDescr.0 = STRING: Linux ns.aaa.or.kr 2.6.6-8hl #1 Tue Oct 12 00:22:29 KST 2004 i686
.iso.org.dod.internet.mgmt.mib-2.system.sysObjectID.0 = OID: .iso.org.dod.internet.private.enterprises.netSnmp.netSnmpEnumerations.netSnmpAgentOIDs.10
.iso.org.dod.internet.mgmt.mib-2.system.sysUpTime.0 = Timeticks: (47124) 0:07:51.24
.iso.org.dod.internet.mgmt.mib-2.system.sysContact.0 = STRING: Root <root@localhost> (configure /etc/snmp/snmp.local.conf)

 


snmpwalk -v2c -c read-community -O fn 호스트IP .

 

.1.3.6.1.2.1.1.1.0 = STRING: Linux ns.aaa.or.kr 2.6.6-8hl #1 Tue Oct 12 00:22:29 KST 2004 i686
.1.3.6.1.2.1.1.2.0 = OID: .1.3.6.1.4.1.8072.3.2.10
.1.3.6.1.2.1.1.3.0 = Timeticks: (76934) 0:12:49.34
.1.3.6.1.2.1.1.4.0 = STRING: Root <root@localhost> (configure /etc/snmp/snmp.local.conf)

출처 : Tong - Gold_Sky님의 Linux 통

펌'd by McDG님 블로그(http://blog.naver.com/nneat/60045305779)


https://stomp.colorado.edu/blog/blog/2010/07/09/on-configuring-snmpv3-in-net-snmp/
 
저작자 표시
posted by coriahn
2009/05/22 11:13 3-5. Networks
1. Tcpdump의 옵션들

-a : Network & Broadcast 주소들을 이름들로 바꾼다.

-c Number : 제시된 수의 패킷을 받은 후 종료한다.

-d : comile된 packet-matching code를 사람이 읽을 수 있도록 바꾸어 표준 출력으로 출력하고, 종료한다.

-dd : packet-matching code를 C program의 일부로 출력한다.

-ddd : packet-matching code를 숫자로 출력한다.

-e : 출력되는 각각의 행에 대해서 link-level 헤더를 출력한다.

-f : 외부의 internet address를 가급적 심볼로 출력한다(Sun의 yp server와의 사용은 가급적 피하자).

-F file : filter 표현의 입력으로 파일을 받아들인다. 커맨드라인에 주어진 추가의 표현들은 모두 무시된다.

-i device : 어느 인터페이스를 경유하는 패킷들을 잡을지 지정한다.
지정되지 않으면 시스템의 인터페이스 리스트를 뒤져서 가장 낮은 번호를 가진 인터페이스를 선택한다.
(이 때 loopback은 제외된다, eth0 ...)

-l : 표준 출력으로 나가는 데이터들을 line buffering한다.
다른 프로그램에서 tcpdump로부터 데이터를 받고자 할 때, 유용하다.

-n : 모든 주소들을 번역하지 않는다(port,host address 등등)

-N : 호스트 이름을 출력할 때, 도메인을 찍지 않는다.

-O : packet-matching code optimizer를 실행하지 않는다. 이 옵션은 optimizer에 있는 버그를 찾을 때나 쓰인다.

-p : 인터페이스를 promiscuous mode로 두지 않는다.

-q : 프로토콜에 대한 정보를 덜 출력한다. 따라서 출력되는 라인이 좀 더 짧아진다.

-r file : 패킷들을 '-w'옵션으로 만들어진 파일로 부터 읽어 들인다.
파일에 "-" 가 사용되면 표준 입력을 통해서 받아들인다.

-s length: 패킷들로부터 추출하는 샘플을 default값인 68Byte외의 값으로 설정할 때 사용한다.
(SunOS의 NIT에서는 최소가 96Byte이다).
68Byte는 IP,ICMP, TCP, UDP등에 적절한 값이지만 Name Server나 NFS 패킷들의 경우에는 프로토콜의 정보들을 Truncation할 우려가 있다.
이 옵션을 수정할 때는 신중해야만 한다.
이유는 샘플 사이즈를 크게 잡으면 곧 패킷 하나하나를 처리하는데 시간이 더 걸릴 뿐만아니라
패킷 버퍼의 사이즈도 자연히 작아지게 되어 손실되는 패킷들이 발생할 수 있기 때문이다.
또, 작게 잡으면 그만큼의 정보를 잃게되는 것이다.
따라서 가급적 캡춰하고자 하는 프로토콜의 헤더 사이즈에 가깝게 잡아주어야 한다.

-T type : 조건식에 의해 선택된 패킷들을 명시된 형식으로 표시한다.
type에는 다음과 같은 것들이 올 수 있다.
rpc(Remote Procedure Call), rtp(Real-Time Applications protocol), rtcp(Real-Time Application
control protocal), vat(Visual Audio Tool), wb(distributed White Board)

-S : TCP sequence번호를 상대적인 번호가 아닌 절대적인 번호로 출력한다.

-t : 출력되는 각각의 라인에 시간을 출력하지 않는다.

-tt : 출력되는 각각의 라인에 형식이 없는 시간들을 출력한다.

-v : 좀 더 많은 정보들을 출력한다.

-vv : '-v'보다 좀 더 많은 정보들을 출력한다.

-w : 캡춰한 패킷들을 분석해서 출력하는 대신에 그대로 파일에 저장한다.

-x : 각각의 패킷을 헥사코드로 출력한다.


2. 조건식(expression)

옵션의 제일 마지막인 조건식은 어떤 패킷들을 출력할지를 선택하는데 쓰인다.
조건식이 주어지지 않는 다면 모든 패킷들이 그 대상이 될 것이다.
일단 주어지면, 아무리 패킷들이 많아도 조 건식에 부합하는 패킷만을 출력한다.

조건식들은 하나 또는 몇 개의 primitive들로 구성되어 있다.
primitive들은 보통 하나 혹은 몇개의 qualifier들 다음에 오는 하나의 값으로 이루어진다.
Qualifier들은 모두 3 종류이며 다음과 같다.


1) type : 주어진 값의 종류가 무엇인지를 나타낸다.
가능한 type들은 'host', 'net', 'port'가 있다. type이 없는 값들은 type을 host라 가정한다.

2) dir : id로 부터의 어떤 특정한 전송 방향을 나타낸다.
가능한 방향은 'src', 'dst', 'src or dst', 'src and dst'이다.
만약 방향이 정해지지 않았다면, src or dst라 가정한다.
"For `null' link layers (i.e. point to point protocols such as slip) the inb ound
and out bound qualifiers can be used to specify a desired direction."

3) proto : 매칭을 특정 프로토콜에 한해서 수행한다.
가능한 프로토콜들은 ether, fddi, ip, arp, rarp, decnet, lat, sca, moprc, mopdl, tcp, udp이다.
만약 프로토콜이 명시되지 않았다면, 해당하는 값의 type에 관련된 모든 프로토콜들이 그 대상이 된다.


4) 이 밖에도 위의 패턴을 따르지 않는 Primitive들이 존재한다. (gateway, broadcst, less, greater, 산술식).

5) 좀 더 정교한 조건식들을 사용하려면, 'and(&&)', 'or(||)', 'not(!)'들을 사용하여 여러 primitive들을 연결하면 된다. 같은 표현들은 생략될 수 있다.


3. 사용 가능한 Primitive들

1) dst host HOST
packet의 IP destination 항목이 HOST일때 참이 된다.

2) src host HOST
packet의 IP source 항목이 HOST일때 참이 된다.

3) host HOST
IP source, IP destination 항목 중 어느 하나라도 HOST이면 참이다.

4) ether dst ehost
ethernet destination 주소가 ehost일 때 참이다.

5) ether src ehost
ethernet source 주소가 ehost일 때 참이다.

6) ether host ehost
ethernet source, destination 항목들 중 어느 하나라도 ehost이면 참이다.

7) gateway host
패킷이 host를 게이트웨이로 사용하면 참이다.
이 말의 의미는 ethernet sour ce나 destination 항목은 host이지만,
IP source와 destination은 host가 아닐 때를 말한다.

8) dst net NET
패킷의 IP destination 주소가 NET의 network number를 가지고 있을 때 참이 다.

9) src net NET
패킷의 IP source 주소가 NET의 network number를 가지고 있을 때 참이다.

10) net NET
패킷의 IP source 주소 혹은 destination 주소가 NET의 network number를 가 지고 있을
때 참이다.

11) net netmask mask
IP 어드레스가 지정된 netmask를 통해서 net과 매칭되면 참이다.

12) net net/len
IP 어드레스가 netmask와 len 비트만큼 매치되면 참이다.

13) dst port PORT
패킷이 ip/tcp, ip/udp 프로토콜의 패킷이고 destination port의 값이 PORT일 때 참이다.
port는 /etc/services에 명시된 이름일 수도 있고 그냥 숫자일 수도 있다.
만약 이름이 사용됐다면 port 번호와 프로토콜이 같이 체크될 것이다.
만약 숫자나 불 확실한 이름이 사용됐을 경우에는 port 번호만이 체크될 것이다.

14) src port PORT
패킷의 source port의 값으로 PORT를 가지면 참이다.

15) port PORT
패킷의 source, destination port 중에 하나라도 PORT이면 참이다.

16) less length
패킷이 length보다 짧거나 같으면 참이다.(len <= length)

17) greater length
패킷이 length보다 짧거나 같으면 참이다.(len >= length)

18) ip proto protocol
패킷이 지정된 종류의 프로토콜의 ip패킷이면 참이다.
Protocol은 icmp, igrp, udp, nd, tcp 중의 하나 혹은 몇 개가 될 수 있다.
주의할 점은 tcp, udp, icmp들은 ''로 escape되어야 한다.

19) ehter broadcast
패킷이 ethernet broadcast 패킷이라면 참이다. ehter는 생략 가능하다.

20) ip broadcast
패킷이 IP broadcast 패킷이라면 참이다.

21) ether multicast
패킷이 IP multicast 패킷이라면 참이다.

22) ether proto protocol
패킷이 ether type의 protocol이라면 참이다.
protocol은 ip, arp, rarp 중에 하나 혹은 몇개가 될 수 있다.
ip proto protocol에서와 마찬가지로 ip, arp, rarp는 escape 되어야 한다.

23) decnet src host
만약 DECNET의 source address가 host이면 참이다.
이 어드레스는 '10.123'이 나 DECNET의 host name일 수 있다.
DECNET host name은 DECNET에서 돌아가도록 설정된 Ultrix 시스템에서만 사용 가능하다.

24) decnet dst host
DECNET destination address가 host이면 참이다.

25) decnet host HOST
DECNET source, destination address중의 하나라도 HOST이면 참이다.

26) ip, arp, rarp, decnet
ether proto [ip|arp|rarp|decnet]의 약어

27) lat, moprc, mopdl
ether proto [lat|moprc|mopdl]의 약어

28) tcp, udp, icmp
ip proto [tcp|udp|icmp]의 약어

29) expr relop expr

30) EXPR
proto [expr:size]의 형식을 띤다. proto, expr, size에 올 수 있는 것들은 다음과 같다.

31) proto : ether, fddi, ip, arp, rarp, tcp, udp, icmp
32) expr : indicate Byte offset of packet of proto
33) size : optional. indicate the size of bytes in field of interest
34) default is one, and can be two or four
35) RELOP
!=, =, <=, >=, etc.

이 조건식을 사용하기 위해서는 먼저 해당하는 Protocol(proto)의 헤더에 관련된 것들을 자세히 알아야만 한다.
proto에는 대상이 될 프로토콜을 지정한다. expr에는 프로토콜 헤더의 처음부터의 Byte Offset을 지정하는 식이 들어가게 된다.
Size는 Option이며 지정이 안 되어 있을 경우에는 자동으로 1byte를 지칭한다.
따라서 이 조건식을 사용하게 되면 헤더에 포함된 정보를 Bitmask를 사용하여 직 접 원하는 패킷인지를 가려 낼 수 있기 때문에, 보다 정밀한 사용이 가능하게 된다.

Tcpdump의 사용 예제들

security라는 호스트로부터 날아오고, 날아가는 패킷들을 출력
# tcpdump host security

security와 mazinga, getarobo 사이에 날아다니고 있는 패킷들을 출력
# tcpdump host security and ( mazinga or getarobo )

security에서 elgaim을 제외한 모든 호스트로 날아다니는 IP 패킷들을 출력
# tcpdump ip host security and not elgaim

gateway amurorei를 거치는 ftp에 관련된 패킷들을 출력
# tcpdump 'gateway amurorei and ( port ftp or ftp-data )'

local호스트가 아닌 호스트와 로컬호스트가 맺는 TCP 커넥션의 시작과 마지막 패 킷들을 출력한다(SYN, FIN 패킷), tcp 프로토콜의 13번째 옥텍(8bit) 있는 1과 2의 flag.
# tcpdump 'tcp[13] & 3 != 0 and not src and dst net non-local'

gateway amurorei를 지나는 576Byte보다 큰 패킷들을 출력한다
# tcpdump 'gateway amurorei and ip[2:2] > 576'

Ethernet boradcast 혹은 multicast를 통해서 보내진 것이 아닌, IP broadcast 혹 은 multicast 패킷들을 출력 한다.
# tcpdump 'ehter[0] & 1 = 0 and ip[16] >= 224'

Echo request/reply가 아닌 ICMP 패킷들을 모두 출력한다.
# tcpdump 'icmp[0] != 8 and icmp[0] != 0'


Tcpdump의 평가

TCPDUMP는 여러모로 좋은 툴이다. libpcap을 거의 100% 활용한 프로그램의 예이며, 실제로 많은 툴들이 TCPDUMP와 병행하여 돌아가거나, TCPDUMP를 기반으로 제작되었다. TCPDUMP의 막강한 packet filter는 현재 로컬 네트워크 상에서 날아다니고 있는 특정한 패킷들을 실시간으로 기록해 줄 수 있으며, 이를 이용하여 네트워크에서 벌어지는 일들을 네트워크 관리자가 원하는 대로 뽑아 볼 수 있게 해 준다. 또한, 시스템 관리자들에게는 로컬 유저의 외부로의 커넥션들을 감시하고, 또 특정 침입자가 침투 경로로 자주 이용하는 호스트, 혹은 원하지 않는 호스트로부터의 커넥션을 실시간으로 감시할 수 있게 해 준다. libpcap을 이용하여 비슷한 툴을 제작하고자 하는 사람들에게도 TCPDUMP는 가장 훌륭한 예제가 될 것이다.

 ############################################################################

저작권은 위 글쓴 유영창 님에게 있음

출처 : KELP(Korea Embedded Linux Project) 에서 가져 왔습니다.

posted by coriahn
TAG tcpdump
2009/04/17 13:47 3-5. Networks

Linux VPN Guide will help you to create a Linux-based VPN server which can be accessed from any Windows client (primarily Windows XP, but can be extended to work with older Windows operating systems such as Windows 2000 or 95/98/NT). I wrote this guide because of the pain I went through to get VPN up and running at my work. After a couple of days of struggling and heavy debugging I was able to set up a VPN server on Fedora Core 2 and 3 with latest updates. I decided that VPN installation should not be such a nightmare and tried to make everything as simple as possible in this guide.

Linux-Windows VPN Guide with OpenSWAN, l2tpd and pppd

1) Who should use this guide?
If you have a private network that you want to be able to access remotely in VPN (virtual private networking) environment (for example, if you have servers at your workplace that are firewalled from outside with internal IP addresses such as 192.168.x.x and you want to be able to access them from the internet), this guide is definitely for you.

2) Can this guide be used on production servers?
To be honest, I'm not sure yet. I have been using this VPN solution for a while now and haven't had any problems so far. But if you notice any performance/compatibility/stability related issues, please let me know.

3) What about security?
VPN is a secure virtual tunnel, which means security is built into it. However, just like any "bullet-proof" solution out there, it has its own security-related issues. First of all, this guide only shows you how to use PSK (pre-shared security key) method of authenticating a VPN tunnel. Your VPN tunnel is encrypted with this security key and in case the key is stolen (or broken with a brute-force attack), your security is compromised. You can use other methods of encryption based on SSL (secure socket layer), but the process of setting up a VPN server and connecting the clients to it is rather complicated. You can refer to Jacco's VPN tutorial to set up a VPN solution based on SSL. As long as your PSK is very long, unguessable and not prone to a simple brute-force, you should not worry about security.

4) On what operating systems has this guide been tested on?
Installation has been successfully tested on Redhat Linux 9.0 and Fedora Core 1/2/3/4, but it should also work on any other linux flavor. For BSD systems, you would have to obtain source files for OpenSWAN and change some configuration options on l2tpd to be able to compile everything successfully.

5) Stuff we'll be needing (sources)
Download the following sources to a src directory i.e. /usr/local/src

- OpenSWAN 2.4.0 from http://www.openswan.org | Mirror
- l2tpd 0.69 from http://www.l2tpd.org | Mirror
- l2tpd Legacy PTY patch from this site
- l2tpd SysV PTY patch from this site
- l2tpd startup file from this site

6) Assumptions
It is assumed that ppp is already installed on the system and you are running the latest version of linux kernel 2.4 or 2.6. You can check if you have ppp installed on the system by running a query in your package manager ("rpm -q -a | grep ppp" in Redhat or Fedora). You can check the kernel version by running "cat /proc/version".

7) OpenSWAN installation and configuration
I recommend downloading an RPM from openswan.org instead of the source tarball, since the RPM has the patches integrated to fit your system. In case you want to compile OpenSWAN yourself, you will have to find out which patches you need for your system. Compilation and installation from source is pretty straightforward - just read the README file and follow the instructions. If you want to install from RPM, first make sure that you don't have any previous versions of OpenSWAN in your system. Most probably you don't, but Fedora Core 3 was shipped with an old version of OpenSWAN and you need to remove it before installing OpenSWAN from source or RPM. Run the following command to see if you have the package: "rpm -q -a | grep openswan". If the query returns anything, remove it by typing "rpm -e openswan". If openswan is not installed, proceed with the installation.

# cd /usr/local/src
# rpm -i openswan-2.4.0-1.i386.rpm
# rpm -i openswan-doc-2.4.0-1.i386.rpm

The openswan-doc rpm file includes all the documentation which you might need in the future.

The OpenSWAN installation has a sample ipsec.conf file included. Let's go ahead and rename it:

# mv /etc/ipsec.conf /etc/ipsec.conf.old

Now copy-paste the following into /etc/ipsec.conf

version 2.0
config setup
        interfaces=%defaultroute
        klipsdebug=none
        plutodebug=none
        overridemtu=1410
        nat_traversal=yes
        virtual_private=%v4:10.0.0.0/8,%v4:172.16.0.0/12,%v4:192.168.0.0/16
 
conn %default
        keyingtries=3
        compress=yes
        disablearrivalcheck=no
        authby=secret
        type=tunnel
        keyexchange=ike
        ikelifetime=240m
        keylife=60m
 
conn roadwarrior-net
        leftsubnet=192.168.0.0/16
        also=roadwarrior
 
conn roadwarrior-all
        leftsubnet=0.0.0.0/0
        also=roadwarrior
 
conn roadwarrior-l2tp
        leftprotoport=17/0
        rightprotoport=17/1701
        also=roadwarrior
 
conn roadwarrior-l2tp-updatedwin
        leftprotoport=17/1701
        rightprotoport=17/1701
        also=roadwarrior
 
conn roadwarrior
        pfs=no
        left=150.150.150.150
        leftnexthop=150.150.150.1
        right=%any
        rightsubnet=vhost:%no,%priv
        auto=add
 
#Disable Opportunistic Encryption
include /etc/ipsec.d/examples/no_oe.conf

Don't forget to replace "150.150.150.150" with your external IP address and "150.150.150.1" with your default gateway. I'm not going to explain what each line above does. If you want to find out for yourself, please refer to OpenSWAN documentation. The above configuration should work for most people, though.

Now edit the file "/etc/ipsec.secrets" and put the following:

150.150.150.150 %any: PSK "a_very_long_string_up_to_256_characters"

The format of the file is: "external_network_address connecting_from: PSK password". Change "150.150.150.150" to your external IP address. If you want to be able to access the network from anywhere on the Internet, leave "%any" intact. I recommend specifying the IP address of the machine that will be used to initiate VPN connections for security reasons though. PSK stands for "Pre-Shared Key" - it's the key that will be shared by both the server and the client for authentication. Make sure that the key is long (up to 256 characters) and very random. Every client trying to establish a VPN connection will have to provide this pre-shared key.

8) l2tpd installation and configuration
First of all, let me give you some information on l2tpd. The project started out really well and a big community was involved in its development. But seems like the project has been suspended for some reason and there haven't been any new releases of l2tpd since version 0.69 which is more than a year old. Latest versions of the linux distributions such as Fedora and Mandrake are compiled with a new SysV pty system. The current version of l2tpd only supports the old pty system and therefore will not work on these distros unless its patched. Jacco de Leeuw talks about this problem in his detailed VPN guide here. An alternative is to switch to rp-l2tp, which is another l2tpd daemon. But it is not a good way out, since it does not support automatic IP allocations to new connections. Another solution is to recompile the kernel with "Legacy (BSD) PTY support", but most people simply don't know how to do that or are too scared to do it. Recompiling the kernel might be a big problem for those who don't have physical access to the machine. After many hours of googling, I was able to find some patches that fix current l2tpd issues and add some features such as binding l2tpd to a specific IP address. Now here is the interesting part - the rp-l2tp package contains pty.c code that is known to work with the new pty system. I tried to simply copy-paste the script into l2tpd pty.c file, modified l2tpd.c to call "pty_get" instead of the old "getPtyMaster", removed all other pty calls and it worked! I was able to test l2tpd setup successfully on a Fedora Core 3 machine without recompiling the kernel

I have included two patches on this page. If you have a recent version of a linux distribution with 2.6 kernel, go ahead and download the file "l2tpd-0.69.sysv.patch". If you have an older version of linux with the old pty system, go ahead and download the file "l2tpd-0.69.lpty.patch".

Now, let's install l2tpd and apply the patch:

# cd /usr/local/src
# tar zxf l2tpd-0.69.tar.gz
# mv l2tpd-0.69.sysv.patch l2tpd-0.69/
# mv l2tpd /etc/rc.d/init.d/
# cd l2tpd-0.69
# patch < l2tpd-0.69.sysv.patch
# make
# cp l2tpd /usr/sbin
# chmod 755 /usr/sbin/l2tpd

Running "make" should compile an l2tpd executable without errors. You might get a couple of warnings, but no fatal errors. If you try to compile the source without patching it first, you will most probably get compilation errors (especially on systems with a newer gcc). Now configure the startup environment:

# chmod 755 /etc/rc.d/init.d/l2tpd
# chkconfig --add l2tpd
# chkconfig l2tpd on

Let's move on to configuring l2tpd. The configuration files for l2tpd should be placed in "/etc/l2tpd" folder. Go ahead and create the folder, then copy paste the following into l2tpd.conf:

[global]
port = 1701
 
[lns default]
ip range = 192.168.1.101-192.168.1.254
local ip = 192.168.1.100
require chap = yes
refuse pap = yes
require authentication = yes
name = LinuxVPN
ppp debug = yes
pppoptfile = /etc/ppp/options.l2tpd
length bit = yes

The "ip range" line is the start and the end pool of the IP addresses the clients will be given when they establish a VPN connection (on their end). The "local ip" is server IP address - it's used only when at least one connection is established. If you have a different internal network, go ahead and change both lines. Everything else should work for most people. Again, if you want to find out what each line does, please feel free to refer to l2tpd documentation.

9) PPP configuration
L2TP tunnels through PPP, which is why we need to configure it to work with l2tpd. The l2tpd configuration above specifies the "/etc/ppp/options.l2tpd" file as "pppoptfile" (PPP options file). Go ahead and create this file and copy-paste the following:

ipcp-accept-local
ipcp-accept-remote
ms-dns  192.168.1.2
ms-wins 192.168.1.3
noccp
auth
crtscts
idle 1800
mtu 1410
mru 1410
nodefaultroute
debug
lock
proxyarp
connect-delay 5000
silent

Change the line "ms-dns" to your real DNS server and "ms-wins" to your WINS server (if you have any).

Now let's create the authentication files. We use CHAP for PPP authentication. Go ahead and edit the file "/etc/ppp/chap-secrets". The format of this file should be "client server secret IP addresses". Here is a sample file:


# Secrets for authentication using CHAP
# client        server           secret            IP addresses
username     *                 "password"      192.168.1.0/24
*                 username     "password"      192.168.1.0/24

You need two lines for each username because it's a two-sided authentication - one from client to server and one from server to client. Both the password and the IP address pool should be the same for both lines. The IP address network that we specify here (192.168.1.0/24) means "allow this username to get an IP address in the range 192.168.1.0 - 192.168.1.255". The l2tpd configuration file above specifies the range to be 192.168.1.101-192.168.1.254, so only the IPs in this range are given to the client on successful authentication. You can change the networks and subnets in both files as needed. If you need more than one account to be able to access the server, go ahead and add it in the same format.

10) Starting and testing VPN
Everything is installed and configured. Let's go ahead and start the daemons:

Starting l2tpd:

/etc/rc.d/init.d/l2tpd start
Starting l2tpd: [  OK  ]

Starting OpenSWAN:

/etc/rc.d/init.d/ipsec start
ipsec_setup: Starting Openswan IPsec 2.4.0...
ipsec_setup: insmod /lib/modules/2.6.10-1.741_FC3/kernel/net/key/af_key.ko
ipsec_setup: insmod /lib/modules/2.6.10-1.741_FC3/kernel/net/ipv4/xfrm4_tunnel.ko

Take a look at /var/log/messages and /var/log/secure and make sure there are no errors. You should see notification messages such as "l2tpd: l2tpd startup succeeded" and "ipsec_setup: Starting Openswan IPsec 2.4.0...". If there are no errors, everything is up and running - proceed to next step.

11) Firewall configuration
To be able to route packets from your external to internal interfaces, packet forwarding must be turned on. Edit /etc/sysctl.conf and change "net.ipv4.ip_forward = 0" to "net.ipv4.ip_forward = 1". If you don't have that file, just type "echo 1 > /proc/sys/net/ipv4/ip_forward" and add this line to your /etc/rc.d/rc.local file. Restart your networking by typing "/etc/rc.d/init.d/network restart" or whichever way you restart your network interfaces.

Make sure that the following ports are open: UDP 500 & 4500, TCP 4500. If any of these ports are blocked, VPN will not work. If you have Redhat/Fedora distributions with iptables, insert these lines into your /etc/sysconfig/iptables file, before REJECT line at the end of the file:

-A RH-Firewall-1-INPUT -i ppp+ -j ACCEPT
-A RH-Firewall-1-INPUT -i eth1 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m udp -p udp --dport 500 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 4500 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m udp -p udp --dport 4500 -j ACCEPT

One more thing you should keep in mind while changing your firewall configuration - your internal and VPN network should be trusted, otherwise your firewall will keep rejecting packets from 192.168.x.x network into your LAN. I solve this by simply adding the first two lines above into my iptables file. The interface eth0 is external and eth1 is physically inside my internal network, of course

출처 : 희망의 나래님 블로그 보안 해킹에서
posted by coriahn
2009/04/16 17:43 3-5. Networks

사용자 삽입 이미지


OSI Layer 7

  1. Physical Layer
      인접한 통신 단말기 간의 물리적인 교신을 정의. 가령 통신을 위한 전압은 얼마로 할 것인지, 케이블 규격은 어떤 것으로 할 지 등을 결정. 통신 장비와 전송 매체가 이 계층에 포함.
  2. Data Link Layer
      인접한 통신 단말기간 실제 데이터를 전달하고 제어. 데이터를 패킷으로 분할, 데이터 흐름 조절, 에러 검출 및 에러 발생시 재전송 요청 등의 역할을 수행.
  3. Network Layer
      논리적인 두 지점간의 데이터 전송을 담당. 즉, 인터넷 상의 두 호스트 간의 데이터 전송을 담당. 라우터에도 이 계층까지는 구현되어 있는데 데이터 전송을 위한 경로 배정과 중계 역할을 해야 하기 때문.
  4. Transport Layer
      Network Layer에 전달되는 데이터의 에러와 순서를 찾아내고 필요하다면 재전송을 요청. Data Link Layer가 인접한 두 통신장치의 신뢰성있는 데이터 송수신을 제어한다면 Transport Layer는 논리적인 두 장치 사이에서의 신뢰성 있는 데이터 송수신을 제어. 전송 계층에서 송수신된 데이터는 데이터의 무결성과 순서의 정확성을 보장받음.
  5. Session Layer
    통신 단말기 사이의 세션을 구축, 유지, 또는 종료시키는 역할.
  6. Pressentation Layer
    송수신된 데이터에 대한 규약을 정함. 통신과 별개로 데이터가 표현되는 규약에 대한 약속. 가령 압축이나 암호화 규약 등.
  7. Application Layer
    네트워크 서비스를 제공. 하위 계층들과 달리 하위 계층으로부터 송수신한 데이터를 이용해 네트워크 서비스를 수행하기 위한 프로토콜을 구현.


TCP/IP Layer
OSI Layer 7을 네 개의 layer로 단순화시켜 구현.
  1. Network Access Layer
      OSI 7 Layer의 Physical과 Data Link Layer를 구현. 하는 일은 동일.
      보통 하드웨어 제작사가 배포하는 네트워크 드라이버에 구현. 어플리케이션 단에서는 그 구현에 대해 신경쓸 필요가 없음.
      물리적 통신장비를 식별하기 위해 MAC Address를 사용. 전 세계적으로 유일한 장치 번호.
  2. Internet Layer
      상위 계층에서 보낸 데이터를 논리적인 통신 정치까지 전송하는 역할. 데이터의 전송 경로를 설정하고 라우팅 작업을 수행. 여기서 사용하는 논리적 주소를 IP 주소라고 함.
  3. Transport Layer
      하위 계층(Internet Layer)를 이용해 데이터를 송신할 때 데이터를 패킷으로 분할하고 수신시 이것을 다시 조합하는 등의 역할을 수행. 손실된 데이터는 재전송을 요청하고 흐름을 제어.
      세부 프로토콜로 TCP(Transmission Control Protocol), UDP(User Datagram Protocol)이 있음.
  4. Application Layer
      개발자가 실질적으로 구현해야 하는 계층. 사용자에게 서비스되는 다양한 네트워크 서비스와 어플리케이션.


출처 : recre8or님 블로그
posted by coriahn
2009/04/16 11:53 3-5. Networks
FTP 서비스는 두개의 포트를 열어서 운영이 됩니다. 기본 FTP 의 경우 21번포트로 접근을 해서 인증을 받은후에 20번 포트를 열어서 LIST 를 보여주고, 데이터를 전송을 합니다.
이것은 FTP 프로토콜이 가지는 서비스 특성인데요. 보안상의 문제등으로 기본 포트를 사용하지 않고 변경을 하게 됩니다.

이 런경우 방화벽 안쪽에 있는 비 정규 포트의 FTP 서버의 접근은 돼나 디렉터리 List 가 보이지 않는 경우가 발생을 하게 됩니다. 이유는 많은 방화벽은 외부 인터페이스를 통해 새 연결을 받아 들이지 않습니다. 이러한 연결은 방화벽에 예기치 않은 연결 시도로 검색되므로 연결이 끊어집니다. 이러한 환경에서는 FTP 서버가 FTP 클라이언트에 새로운 연결 요청을 해야 하므로 표준 모드 FTP 클라이언트가 작동하지 않습니다.

FTP 서버가 모든 랜덤 포트 번호를 열 수 있으므로 방화벽에서는 이러한 구성을 하기 어렵습니다. . IIS 4.0과 5.0은 1024 - 5000의 기본 임시 포트 범위를 사용하지만 IIS 6.0 을 비롯한 많은 FTP 서버가 1024 - 65535의 임시 포트 범위를 사용하도록 구성됩니다. 이러한 세컨드리 포트에 대한 연결에도 모든 임시 포트에 대한 Any 액세스 권한을 부여하는 정책은 보안상 안전하지 않습니다.

IIS 6.0 에서는 이러한 부분을 해결을 할 수 있게 해줍니다. windows 방화벽을 올린 상태 또는 일반 방화벽을 올린 상태에서 모두 동일하게 적용이 됩니다.

먼저 IIS 6.0 이 랜덤하게 포트를 열수 있는 포트 범위를 준비합니다.
여기서는 5001-5005 번까지 5개의 포트를 준비 하였으며, 추가로 사용하지 않는 포트 구성이 가능합니다.

여기서는 Windows 방화벽을 가지고 설명을 드리겠습니다. 다른 박스 장비들도 방법만 다를뿐 같습니다.
사용자 삽입 이미지
위와 같이 windows 방화벽에서 추가합니다.
물론 일반 방화벽인경우에도 포트를 추가로 등록을 해주셔야 합니다.
사용자 삽입 이미지
위와 같이 5개가 등록이 된것을 확인합니다.
그다음에는 IIS 관리자를 엽니다.
사용자 삽입 이미지
서버를 선택하고 속성을 누르면 다음과 같은 화면이 나옵니다.
아래 네모칸의 내용과 같이 체크되어 있어야 합니다.
사용자 삽입 이미지
다음은 다음 경로로 이동합니다.
C:\windows\system32\inetsrv\
그런다음 Metabase.xml 을 엽니다. 메모자응로 여시면 됩니다.

사용자 삽입 이미지
찾기로 LM/MSFTPSVC 를 입력하고 찾기를 누릅니다.
사용자 삽입 이미지
그런다음 MaxConnectiions="100000" 아래에
다음과같이
PassivePortRange="5001-5005"
와 같이 입력을 합니다. " 표나 ' 나 상관없이 동작하는 거 같습니다.

그런다음 FTP 서비스를 재시작을 누릅니다.
사용자 삽입 이미지

그런다음 FTP 클라이언트로 접근해보시면 액티브 모드 와 패시브 모두 두개다 접근이 잘 될겁니다.
그럼..건강한 서버 운영하시길 바랍니다.

IIS에서는 보두 모두 1024 - 65535의 임시 포트 범위를 허용하도록 구성할 수 있습니다.
5000 이상의 TCP 포트에 연결하려는 경우 발생할 수 있는 문제에 대한 자세한 내용은 Microsoft 기술 자료의 다음 문서를 참조하시길 바랍니다.

http://support.microsoft.com/kb/323446/ko

http://support.microsoft.com/kb/309816/ko

출처 : NTFAQ의 윈도우 서버군 기술 강좌에서 가져 왔습니다.
posted by coriahn
2009/04/16 11:46 3-5. Networks

FTP는 다른 서비스와는 달리 Active 모드와 Passive 모드 2개의 모드가 존재하며 또한 각각의 모드에서는 2개 또는 2개 이상의 포트가 작동합니다. 20번 또는 1024 이후의 포트는 DATA 전송용이며 21번은 접속 시 사용되는 포트입니다. 인터넷 사용자들이 가장 흔하게 접하는 웹 브라우저들은 일반적으로 Passive Mode 로 설정되어 있는데 반하여, 알FTP 나 WS-FTP, CuteFTP 같은 FTP 클라이언트 프로그램들은 일반적으로 Active Mode 가 기본값으로 설정되어 있다.
 
(1) FTP Active 모드와 Passive 모드의 차이점
 
① Active FTP 모드의 이해
 

 
Active 모드에서의 작동 방식은 위의 그림에서와 같이 먼저
① 클라이언트에서 서버의 21번 포트로 접속 후 클라이언트가 사용할 두 번째 포트를 서버에 알려줍니다.
② 서버는 이에 대해 ack로 응답하고
③ 서버의 20번 포트는 클라이언트가 알려준 두 번째 포트로 접속을 시도합니다.
④ 마지막으로 클라이언트가 ack로 응답합니다. Active 모드의 문제점은 바로 3번째 단계 즉, 일반적인 TCP/IP의 특징인 ‘클라이언트가 서버에 접속을 시도하는 것’이 아니라 ‘서버가 클라이언에 접속을 시도한다’는 것입니다. 이 때문에 만약 클라이언트 PC등에 방화벽이 설치되어 있거나 FTP를 잘 이해하지 못하는 공유기 등을 사용하여 외부에서의 접속을 허용하지 않는다면 세 번째 프로세스가 작동하지 않게 되어 FTP 접속이 제대로 되지 않는 문제점이 있습니다. 이러한 경우 FTP 접속은 되지만 이후 데이터 목록을 받아오지 못하여 에러가 발생하게 됩니다.
 
즉, active 모드는 클라이언트에서 서버측 21번 포트로 접속시도 하고 데이터 포트는 서버에서 클라이언트로 접속 하여 데이터를 보내는 방식입니다.
 
② Passive FTP 모드의 이해
 

 

서버가 클라이언트에 접속시도를 하는 비정상적인 active 모드와 관련된 문제를 해결하기 위한 대안으로 passive 모드가 디자인되었습니다.
Passive 모드에서는
① 먼저 클라이언트가 command 포트로 접속을 시도하면
② 서버에서는 서버가 사용할 두 번째 포트를 알려줍니다.
③ 클라이언트는 다른 포트를 열어 서버가 알려준 이 포트로 접속을 시도하고,
④ 서버는 ack로 응답합니다. Passive 모드에서는 두 번째 data포트로서 active 모드가 사용했던 20번을 사용하지 않고 대신 1024 이후의 임의의 비 특권 포트를 사용하게 됩니다. 따라서 passive 모드는 서버에서 클라이언트로 연결을 시도하는 active 모드의 문제점을 해결하기는 했지만, 서버의 비 특권포트(1024 ~ 65535)를 방화벽에서 모두 열어 두어야 한다는 또 다른 문제점을 낳았습니다.
그러나 wu-ftp나 proftpd등 대부분의 ftp 데몬에서는 클라이언트가 passive 모드로 접속 시 사용할 수 있는 포트를 제한설정 할 수 있는 기능을 지원하므로 이의 문제점을 미봉책이나마 어느 정도는 해결할 수 있습니다.
 
위와 같이 passive 모드는 클라이언트에서 서버쪽 21번 포트로 접속 시도 하고 데이터 포트도 클라이언트에서 서버의 20번 포트로 접속하여 데이터를 받아오는 방식입니다.
 
(2) FTP 접속 장애요인

FTP 접속 모드에 따라 접속이 이루어지지 않거나 접속이 되어도 데이터 목록을 가져오지 못하는 현상이 발생하는 경우가 있는데 이는 이는 [서버] – [방화벽 또는 공유기] – [클라이언트] 로 연결되어 있는 방식으로 클라이언트 앞에 방화벽이나 공유기가 있다면 active 모드(서버에서 클라이언트로 접속)로는 방화벽 및 공유기로 인한 접속이 이루어지지 않는 현상이 발생하며 passive 모드(클라이언트에서 서버로 접속)로 접속해야 정상적인 접속이 이루어지기 때문에 서버와 클라이언트 사이의 방화벽 및 공유기 유무를 확인하여 적절한 모드로 접속을 하셔야 합니다.
 
서버단에 방화벽이 구축되어있는 경우 FTP 접속(Active 모드 접속이용)
서 버단에 방화벽이 구축되어있을 경우는 active모드(서버에서 클라이언트로 접속)로 접속을 하셔야 하며 passive모드(클라이언트에서 서버로 접속)로 접속하실 경우 아래 화면 처럼 접속은 정상적으로 이루어지나 디렉토리 목록을 받아오지 못하는 현상이 발생합니다.
 
클라이언트측에 방화벽 및 공유기가 구축되어있는 경우 FTP 접속(Passive 모드 접속이용)
서 버단에 방화벽이 구축되어있을 경우는 passive모드(클라이언트에서 서버로 접속)로 접속을 하셔야 하며 active모드(서버에서 클라이언트로 접속)로 접속하실 경우 아래 화면 처럼 접속은 정상적으로 이루어지나 디렉토리 목록을 받아오지 못하는 현상이 발생합니다.
 

출처 : 넥스트라인(작성자 : 기술지원부 김 삼 수 kiss@nextline.net)의 기술문서를 바탕으로 수정하였습니다.
 
posted by coriahn
2008/09/17 15:53 3-5. Networks
맥 어드레스는 00-00-00-00-00-00 이런식으로 구성되어있죠. ( 00:00:00:00:00:00 이렇게도 표기하고 구분없이 죽쓰기도 하죠)

오늘 처음 알았는데 앞의 6자리 숫자 가 제조자 를 의미하고 뒤에 6자리 숫자는 제조자가 그 기기에 부여한 고유번호 라고 하네요.

다 맞게 나오는가 궁금해서 집에 있는 맥주소를 다 집어넣고 검색해 보았습니다.

링크는 제가 가지고 있는 버팔로 공유기(WHR-G54S)의 맥 어드레스 앞 6자리였구요.

http://standards.ieee.org/cgi-bin/ouisearch? 에서 ? 다음에다가 검색할 MAC 주소 앞부분 6자리를 넣으면 됩니다.

- 나 : 로 구분안하고 6자리 숫자만 죽 쓰면 되네요.

라포네라(FON2100D/F) 도 스페인에 있는 FON 이라고 나오고

PSP 도.. 일본 소니... 로 나오고(SCE 로 나오나 했는데 그냥 소니 상사네요.)

하나로 통신 케이블 모뎀도.. 조금 이름이 틀리지만 구로에 있는 중소기업으로 나오네요.

다 맞는건 아니구요 제가 가진 유니콘 TW-54G 같은 경우 중국에 모 업체로 나오는데 유니콘에서 OEM 받은건지.

검색이 잘못된건진 모르겟네요 ㅎㅎ

별 유용성은 없겠지만. 재밌는 정보여서 올려봅니다 ^^

펌..
http://www.ppomppu.co.kr/zboard/view.php?id=etc_info&page=11&sn1=&divpage=1&category=5&sn=off&ss=on&sc=on&select_arrange=headnum&desc=asc&no=3056
posted by coriahn
2008/09/09 22:52 3-5. Networks

TCP/IP 프로토콜이 설계 될때 datagram 자체가 전혀 암호화 하지 않고 전송되게 되어 있었습니다. 따라서, 네트웍 상을 이동하는 패킷들을 모아서 순서에 맞게 재조합을 하면 원래의 데이타를 얻을 수가 있죠.. 이러한 방법을 sniffing이라고 합니다. 킁킁거리다.. 라는 뜻을 가지구요..

이렇게 되면, 원격 호스트에서 접속시 아이디랑, 비번을 가로챌 수가 있겠죠? 이것은 이더넷 상에서 데이타를 여러호스트를 대상으로 소스 호스트에서 뿌려버립니다. 그럼.. 각 호스트들은 자신의 데이타가 아니면 그냥 흘려보내고, 자신의 데이타면 그것을 받아서 어떤 일을 하게 됩니다.

원래 시스템은 기본으로 자기것만 받도록 설정되어 있습니다. 그런데, 이 스니퍼를 돌리게 되면 자신의 시스템의 인터페이스가 열리고, 아무거나 받아들이게 되죠.. 이러한 모드를 promiscuous mode 라고 합니다. 만약 자신의 시스템이 promiscuous mode로 돌아간다면 스니퍼가 돌아가고 있다고 의심하심이....

보통 인터넷에서 많이 볼수 있는 스니퍼의 경우 telnet, ftp, rlogin, email 등의 처음 128byte를 잡아서 log 파일로 남김니다.

이런 스니퍼를 사용한 해킹의 경우 치사하지만 이것만큼 편하고 좋은 해킹툴 또한 구하기 힘들죠. 스니퍼를 해킹에 이용하지 말고 시스템 보안에 이용한다면 더 큰 행복이~

실제로 시스템에 스니터를 설치해 두었다가 제 홈디렉토리를 해킹한 사람을 잡은 적이 있습니다.

<방어는...> promiscuous mode인지 아닌지 검사하는 유틸이 있습니다. cpm(check promiscuous mode) 이라는 건데.. ftp://cert.org/pub/tools 에 가시면 구하실수 있습니다.

또한 rlogin이나, rsh 대신에 사용할 수 있는 ssh, slogin 이 있습니다. 이것은 패킷을 암호화 해서 전송하므로 sniffer에 잡혔다 하더라도 안전하겠죠.. 100% 안전하다고 할 수는 없습니다... 똑똑한 사람들 한테는...

그리고, S/Key라는 것이 있습니다. 이것은 원격 호스트로의 접속에 있어서 one time password를 생성해 줍니다. 때문에, sniffing에도 어느정도 대응할 수 있습니다. 로긴할 때마다 패스워드가 변경되고, 새로운 패스워드를 보여줍니다. 따라서 자신의 비번을 sniffing당했다 하더라고 바뀐 비번이니깐.. 상관없죠.. 문제는 매번 비번이 바뀜으로 자신의 비번을 잊어버릴 위험이...

마지막으로 sniffing 한 결과를 조금 보여드리죠.. 호스트명은 보여드릴수가 없네요..

 
-- TCP/IP LOG -- TM: Thu Feb 15 11:21:16 --
PATH: xxxxx.xxxxx.ac.kr(1023) => xxxxx.xxxxx.ac.kr(rlogin)
STAT: Thu Feb 15 11:22:41, 163 pkts, 128 bytes [DATA LIMIT]
DATA: guest
: duck
: xterm/9600/7
: (255)(255)ss
: ^X
: P
: dhlfldkssud
: duck
: dhfldkssud
:
: tlen^H^H^H^H^Hsetenv d^H^Id^H^HDISPLAY ^[[D143.248.x.x:.^H0.0
:
:
: han&
: han&
--
-- TCP/IP LOG -- TM: Tue Feb 15 12:20:58 --
PATH: xxxxx.xxxxx.ac.kr(2857) => xxxx(telnet)
STAT: Tue Mar 5 10:21:13, 52 pkts, 65 bytes [TH_FIN]
DATA: (255)(253)^C(255)(251)^X(255)(250)^X
: VT100(255)(240)(255)(253)^A(255)(252)^Asljdflsdkjfl
: wlfjddl>
: exit(127)(127)(127)(127)(127)(127)(127)(127)exit
:
--
-- TCP/IP LOG -- TM: Tue Feb 15 13:01:36 --
PATH: xxxx.xxxxx.ac.kr(1953) => 143.248.x.x(ftp)
STAT: Sun Apr 14 17:02:13, 14 pkts, 49 bytes [TH_FIN]
DATA: USER mile
:
: PASS ladysun
:
: CWD backup
:
: NLST
:
: QUIT
:
--
참고로 이 제어는 오직 root 만이 할 수 있으며 promisc 설정은 ifconfig eth0 promisc 를 하면 되고 이 설정을 해제하는 방법은 ifconfig eth0 -promisc 입니다. 따라서 스니핑이 돌고 있다면 이미 관리자 권한을 빼앗긴 것이라 생각하셔도 무방합니다..

이것이 바로 스니핑이 가능한 이유이지요...

결론적으로 가장 중요한 핵심 포인트는 "ARP" 와 "Broadcasting" 입니다. 이외 더 많은 내용들은 관련 서적이나 관련 사이트를 참고하시기 바랍니다..


펌d. From.

http://superuser.co.kr/superuserboard/view.html?id=547&code=security&start=210&position=

관련사이트에서 퍼옴

http://infoncom.dongguk.ac.kr/%7Eswhong/cgi-bin/MoinMoin/wiki-moinmoin/moin.cgi/Promiscuous_20Mode_b6_f5_20_b9_ab_be_f9_c0_ce_b0_a1_3f?action=SpellCheck

posted by coriahn