2/10/2010
c# mdi 에서 창 중복 생성 안되게
private void child1ToolStripMenuItem_Click(object sender, EventArgs e)
{
if (frm2.MdiParent == null)
{
frm2 = new Form2();
frm2.MdiParent = this;
frm2.Show();
}
frm2.Activate();
}
7/29/2009
hunt 사용
스니핑 툴 중에 하나인 hunt를 사용.
hunt는 동일 네트워크 상에 있는 모든 세션을 확인할수 있다. (default로 telnet과 rlogin)
구하는 건 알아서.....
# tar zxvf hunt-1.5.tgz
# cd hunt1.5
# make
# ./hunt
실행을 하게 되면 아래와 같은 화면이 나오게 된다.
메뉴를 보게 되면
l/w/r) list/watch/reset connections // 리스트를 보여주는 l , 보기모드인 w , 확인한 커넥션을 강제로 끈어 버리는 r
u) host up tests // host가 up 되어 있는 확인 test
a) arp/simple hijack (avoids ack storm if arp used) // arp spoofing
s) simple hijack /// 말그대로 하이젝킹
d) daemons rst/arp/sniff/mac
o) options
x) exit
hunt를 telnet이나 rlogin으로 접속 되어있고 통신을 하고 있다면 리스트에 뜨게 된다.
/*
* hunt 1.5
* multipurpose connection intruder / sniffer for Linux
* (c) 1998-2000 by kra
*/
starting hunt
--- Main Menu --- rcvpkt 0, free/alloc 64/64 ------
l/w/r) list/watch/reset connections
u) host up tests
a) arp/simple hijack (avoids ack storm if arp used)
s) simple hijack
d) daemons rst/arp/sniff/mac
o) options
x) exit
-> l
no connections are available
--- Main Menu --- rcvpkt 24, free/alloc 63/64 ------
l/w/r) list/watch/reset connections
u) host up tests
a) arp/simple hijack (avoids ack storm if arp used)
s) simple hijack
d) daemons rst/arp/sniff/mac
o) options
x) exit
*> l ///// 리스트를 보자.
0) 192.168.11.1 [2311] --> 192.168.11.100 [23]
1) 192.168.11.1 [2000] --> 192.168.11.131 [23]
--- Main Menu --- rcvpkt 58, free/alloc 63/64 ------
l/w/r) list/watch/reset connections
u) host up tests
a) arp/simple hijack (avoids ack storm if arp used)
s) simple hijack
d) daemons rst/arp/sniff/mac
o) options
x) exit
-> w ///////// watch 모드로 보자.
0) 192.168.11.1 [2311] --> 192.168.11.100 [23]
1) 192.168.11.1 [2000] --> 192.168.11.131 [23]
choose conn> 0
dump [s]rc/[d]st/[b]oth [b]> b
print src/dst same characters y/n [n]> y
CTRL-C to break
ffddssaa
-bash: fdsa: command not found
[youngrap@localhost youngrap]$ ddffssaa
-bash: dfsa: command not found
[youngrap@localhost youngrap]$ ffddss
-bash: fds: command not found
[youngrap@localhost youngrap]$ ssuu
Password: fdsafdsa
su: incorrect password
[youngrap@localhost youngrap]$
-펌-
sniffit
sniffit은 hunt에서 제공하는 정보보다 좀더 많은 정보를 제공한다.
작성자 : Brecht Claehout
필요조건 : C, IP 헤더, libpcap 라이버리( ftp://ftp.ee.lbl.gov/libpcap.tar.Z)
Download : http://reptile.rug.ac.be/~coder/sniffit/sniffit.html
sniffit은 상당한 설정 기능을 제공하는 비장의 카드이다. 그러나 사용할 때에 고려해야 할 점들이 많이 있으므로 주의한다.
설치
[root@linux mk]#./configure
[root@linux mk]#make
** 인터렉티브 모드로 작동시키기
[root@linux mk]# ./sniffit -i
Server : 211.234.52.20
Client : 211.234.52.10
Source Target
211.234.52.10 : 1704 - 211.234.52.20 : 23 /* ls, pwd 등 명령만 출력 */
211.234.52.20 : 23 - 211.234.52.10 : 1704 /* ls, pwd 등 명령와 결과도 출력 */
** 패킷 모니터링 (모티터 출력)
[root@linux mk]# ./sniffit -d -t 211.234.52.10
[root@linux mk]# ./sniffit -d -t 211.234.52.20 -p 23
** 패킷 모니터링 (파일출력)
[root@linux mk]# ./sniffit -t 211.234.52.20 -p 23
파일명 : 211.234.52.10.1704-211.234.52.20.23 /* ls, pwd 등 명령만 출력 */
[root@linux mk]# ./sniffit -t 211.234.52.10
파일명 : 211.234.52.20.23-211.234.52.10.1704 /* ls, pwd 등 명령와 결과도 출력 */
일반모드(Normal mode)
각 커넥션에 대한 데이터가 "출발지IP.출발지포트-도착지IP.도착지포트"와 같은 형식으로 저장된다.
Dump 모드
-d, -a 옵션 등을 주었을 경우 데이터가 stdout으로 바로 출력된다.
-c : 설정파일 명시
-p : 특별히 감시할 포트 설정
-s : 발신지 IP로부터 들어오는 패킷을 수집
-t : 목적지 IP로부터 들어오는 패킷을 수집
인터렉티브 모드(Interactive mode)
-i, -I 옵션 등을 주었을 경우 데이터가 curses를 사용하는 터미널로 출력됩니다. 각 커넥션 리스트가 나오고 브라우징이 가능합니다.
F1 : 출발지 호스트에 대한 필터링
F2 : 목적지 호스트에 대한 필터링
F3 : 출발지 포트에 대한 필터링
F4 : 도착지 포트에 대한 필터링
7/23/2009
tcpdump 사용법
tcpdump 기본 사용법
# tcpdump -i eth0 => 특정 ethernt(eth0) 으로 송수신 되는 데이터 패킷 덤프하여 확인
# tcpdump -i eth0 -w TCPDUMP => 특정 ethernet으로 송수신 되는 패킷들 파일에 저장 및 확인
# tcpdump -r TCPDUMP => TCPDUMP에 저장된 패킷헤드들을 확인
# tcpdump -i eth0 -c 10 => 특정 ethernet에서 지정한 개수만큼의 네트워크 패킷 덤프하여 확인
# tcpdump -w tcpdump.log -s 1500 tcp port 22 and host 192.168.0.1
=> 서버의 특정포트로 송수신되는 모든 데이터패킷 전체를 확인
이 명령의 의미는 현재 로컬서버와 192.168.0.00서버사이의 통신데이터패킷 중 tcp 22번포트의
모든 패킷을 1500길이로 캡쳐하여 tcpdump.log파일에 저장
# tcpdum -Xqnr tcpdump.log => 캡쳐한 tcpdump.log파일의 내용을 ASCII모드로 확인
; 목적지 주소가 1.2.3.x/24 와 1.2.4.x/25 이고 80번포트인 패킷 캡쳐
- # tcpdump host A
; A 호스트로/부터의 모든 도착/출발 패킷 출력
- # tcpdump host A and \( B or C \)
; A 호스트와 B 또는 C 사이의 모든 트래픽 출력
- # tcpdump ip host A and not B
; A호스트와 B를 제외한 호스트 간의 모든 IP 패킷 출력
- # tcpdump net ucb-ether
; 로컬호스트와 Berkeley의 호스트들 간의 모든 트래픽 출력
- # tcpdump 'gateway A and (port ftp or ftp-data)'
; 게이트웨이 A를 통한 모든 ftp 트래픽 출력
- # tcpdump ip and not net
; 로컬네트워크로/부터가 아닌 모든 트래픽 출력
- # tcpdump 'tcp[13] & 3 != 0 and not src and dst net '
; 로컬네트워크가 아닌 TCP 시작과 마지막 패킷 출력
- # tcpdump 'gateway A and ip[2:2] > 576'
; 게이트웨이 A를 통해 보내지는 576 Bytes보다 긴 IP 패킷 출력
- # tcpdump 'ether[0] & 1 = 0 and ip[16] >= 224'
; 이더넷이 아닌 IP 브로드 또는 멀티 캐스트 패킷 출력
- # tcpdump 'icmp[0] != 8 and icmp[0] != 0'
; echo 요청/응답이 아닌 모든 ICMP 패킷 출력 (ping 아닌 패킷)
- # tcpdump src net 1.2.3 or 1.2.4 and not dst net 1.2.3 or 1.2.4
; 1.2.3 과 1.2.4 IP주소 (내부) 패킷을 제외한 모든 패킷 출력
- # tcpdump -i br1
; br1 인터페이스의 모든 패킷 출력
7/21/2009
7/13/2009
clamav
7/10/2009
yum 이 안될때
yum이 안되더군요 yum을 누르면 아래와 같은 메시지가 뜹니다.
This system is not registered with RHN
CentOS는 Redhat의 쌍둥이 클론입니다. 즉 같은 rpm을 사용한다고 보시면 됩니다.
(Redhat 5 Update 2 => CentOs 5.2 와 같이 Update 버전에 따라서 서브 버전이 나뉩니다.)
게다가, 말로만 듣던 gcc버그때문에, gcc를 업데이트할 일이 있어서.
구글링을 하다가 관련 자료를 찾아서 함 시도해보았습니다.
(http://www.linuxquestions.org/questions/linux-software-2/using-centos-repos-under-rhel-644632/)
1. /etc/yum.repos.d/rhel-debuginfo.repo 을 백업하고 삭제합니다.
2. /etc/yum/pluginconf.d/rhnplugin.conf 을 수정합니다.
(사실 이건 상관없을것 같은데. 기분상 해줍니다 -_-)
enabled = 0
gpgcheck = 1
3. /etc/yum.repos.d 디렉토리에 아무 파일이나 만들어서 .repo 를 생성합니다.
현재 전 WS5 update1 버전입니다.. 빨강 부분을 주의하세요 :)
[base]
name=CentOS-5 - Base
baseurl=http://mirror.centos.org/centos/5/os/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
#released updates
[updates]
name=CentOS-5 - Updates
baseurl=http://mirror.centos.org/centos/5/updates/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
#packages used/produced in the build but not released
[addons]
name=CentOS-5 - Addons
baseurl=http://mirror.centos.org/centos/5/addons/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
#additional packages that may be useful
[extras]
name=CentOS-5 - Extras
baseurl=http://mirror.centos.org/centos/5/extras/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-5 - Plus
baseurl=http://mirror.centos.org/centos/5/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
yum update 로 확인해본다-