µ¼º½£º[Ê×Ò³]>[linuxÄÚºËѧϰ±Ê¼Ç]
Ŀ¼
[Òþ²Ø]
1 ×Ö·ûÉ豸Çý¶¯ÖªÊ¶½²½â
1.1 ÃèÊö×Ö·ûÉ豸»ù±¾½á¹¹Ìå
1.2 ×÷ÓÃ
1.3 ¸÷×Ö¶ÎÏê½â
1.4 ²Ù×÷
1.5 ʵÀý
1.5.1 ´úÂë
1.5.2 ÔËÐÐ
[±à¼]×Ö·ûÉ豸Çý¶¯ÖªÊ¶½²½â
×÷Õߣº[Å£ÌÎ]
[±à¼]ÃèÊö×Ö·ûÉ豸»ù±¾½á¹¹Ìå
/linux/include/linux/cdev.h
13struct cdev {
14 struct kobject kobj;
15 struct module *owner;
16 const struct file_operations *ops;
17 struct list_head list;
18 dev_t dev;
19 unsigned int count;
20};
[±à¼]×÷ÓÃ
ÃèÊö×Ö·ûÉ豸µÄ»ù±¾½á¹¹Ì壬ÓÃÓÚ½øÒ»²½·â×°ÔÚ¸ü´óµÄ½á¹¹ÌåÄÚ£¬ÒÔÃèÊö¾ßÌåµÄ×Ö·ûÉ豸£¬ÀýÈ磺
struct xxx_cdev {
const char *name;
struct cdev cdev;
...
}
ÕâÑù¾Í¿ÉÒÔʹÓÃxxx_cdev½á¹¹ÃèÊö¾ßÌåµÄ×Ö·ûÉ豸ÁË¡£
[±à¼]¸÷×Ö¶ÎÏê½â
1¡¢struct kobject kobj;
¾ßÌå½á¹¹²Î¼ûhttp://blog.chinaunix.net/u1/55599/showart.php?id=1086478£¬´Ë´¦ËüÊÇÒ»¸öÄÚǶµÄ½á¹¹£¬×÷ÓÃÊÇÌṩÒýÓüÆÊý¡£ÔÚµ÷ÓÃcdev_init()º¯Êý³õʼ»¯cdev½á¹¹Ìåʱ£¬»áµ÷ÓÃkobject_init()º¯Êý³õʼ»¯¸ÃÊý¾ ......
Ðá̽Æ÷(sniffer)ÔÚÍøÂ簲ȫÁìÓòÊÇÒ»°ÑË«Èн££¬Ò»·½Ãæ³£±»ºÚ¿Í×÷ΪÍøÂç¹¥»÷¹¤¾ß£¬´Ó
¶øÔì³ÉÃÜÂë±»µÁ¡¢Ãô¸ÐÊý¾Ý±»ÇԵȰ²È«Ê¼þ£»ÁíÒ»·½ÃæÓÖÔÚÐÖúÍøÂç¹ÜÀíÔ±¼à²âÍøÂç×´¿ö¡¢Õï¶ÏÍøÂç¹ÊÕÏ¡¢ÅųýÍøÂçÒþ»¼µÈ·½ÃæÓÐ×Ų»¿ÉÌæ´úµÄ×÷Óá£Ðá̽Æ÷ÊÇÆóÒµ
±Ø²»¿ÉÉÙµÄÍøÂç¹ÜÀí¹¤¾ß¡£±¾ÎÄÒÔLinuxƽ̨ÏÂÈý¸ö³£ÓõÄÍøÂçÐá̽Æ÷Tcpdump¡¢EtherealºÍEtherApeΪÀý£¬½éÉÜÈçºÎ½èÖú
snifferÀ´Õï¶ÏÍøÂç¹ÊÕÏ£¬´Ó¶ø±£ÕÏÍøÂç¸ßЧ°²È«µØÔËÐС£
¼ò½é
Ðá̽Æ÷(sniffer)ÓÖ³ÆΪ°üÐá̽Æ÷£¬ÊÇÓÃÀ´½Ø»ñ¼ÆËã»úÍøÂçͨÐÅÊý¾ÝµÄÈí¼þ»òÓ²
¼þ¡£Óëµç»°µç·²»Í¬£¬¼ÆËã»úÍøÂçÊǹ²ÏíͨÐÅͨµÀµÄ£¬´Ó¶øÒâζ×Åÿ̨¼ÆËã»ú¶¼¿ÉÄܽÓÊÕµ½·¢Ë͸øÆäËü¼ÆËã»úµÄÐÅÏ¢£¬²¶»ñÔÚÍøÂçÖд«ÊäµÄÊý¾ÝÐÅϢͨ³£±»³ÆΪ¼àÌý
(sniffing)¡£Ðá̽Æ÷³£³£×÷ΪһÖÖÊÕ¼¯ÍøÂçÖÐÌض¨Êý¾ÝµÄÓÐЧ·½·¨£¬ÊÇÀûÓüÆËã»úµÄÍøÂç½Ó¿Ú½Ø»ñÄ¿µÄµØΪÆäËü¼ÆËã»úÊý¾Ý±¨ÎĵÄÒ»ÖÖ¹¤¾ß¡£
Ðá̽Æ÷¹¤×÷ÔÚÍøÂç»·¾³Öеĵײ㣬¿ÉÒÔÀ¹½ØËùÓÐÕýÔÚÍøÂçÉÏ´«Ë͵ÄÊý¾Ý£¬´Ó¶ø³ÉΪÍøÂ簲ȫµÄÒ»¸ö¾Þ´óÍþв¡£Í¨¹ý¶ÔÍøÂç½øÐÐÐá̽£¬Ò»Ð©¶ñÒâÓû§Äܹ»ºÜÈÝÒ×µØÇÔÈ¡µ½¾øÃÜÎĵµºÍÃô¸ÐÊý¾Ý£¬Òò´ËÐá̽Æ÷¾³£±»ºÚ¿Íµ±×÷ÍøÂç¹¥»÷µÄÒ»ÖÖ»ù±¾ÊֶΡ£
Èκι¤¾ß¶¼Óб×ÓÐÀû£¬Ðá̽Æ÷¼È¿ÉÒÔ×÷ΪºÚ¿Í» ......
sudo apt-get install virtualbox
sudo apt-get install ntfs-3g ntfs-config #ntfsдÈëÖ§³Ö£¬×°ÍêºóÔËÐÐntfs-config,°ÑÁ½¸ö¹³´òÉϼ´¿É¡£Â¥Ï·½·¨×÷·Ï
sudo apt-get install googleearth googlizer gtalk#googleÏà¹Ø£¬skyxÓÑÇéÌáʾ:²»ÍƼöÂí¼× gtalk
sudo apt-get install ghex #GNOME ÉϵÄÊ®Áù½øÖÆÎļþ±à¼Æ÷
sudo apt-get install kvm #Full virtualization on x86 hardware »ªÖ÷ϯÍƼö
sudo apt-get install vmware-player #Free virtual machine player from VMware
sudo apt-get install makeself #utility to generate self-extractable archives
sudo apt-get install sun-java6-jre#°²×°JAVA6»·¾³
sudo apt-get install sun-java6-jdk #°²×°JAVA6»·¾³#
sudo update-alternatives --config java#É趨JAVA»·¾³
sudo apt-get install rox-filer#Ò»¸ö¼òµ¥µÄÎļþ¹ÜÀíÈí¼þ
sudo apt-get install socks4-server socks4-clients #Ò»¸ösocks ´úÀí·þÎñÆ÷/soks4´úÀí¿Í»§¶Ë
sudo apt-get install mc #ÀàËÆnorton commander ¹¤¾ß£¬skyx ÍÂѪÍƼö
sudo apt-get install liferea #³¬Ç¿µÄrss reader £¬Ã÷ÏÔ±ÈakregatorºÃÓ㬠ÓÉzhuqin_83ÍÂѪÍƼö
sudo apt-get in ......
ÍøÉϵÄÎÄÕ¿ÉÄܹýÓÚÉîÈ룬²»Ì«ÊʺÏÐÂÊÖ¿´£¬ÕâÀï½éÉÜ×î¼òµ¥µÄ¼¸ÌõSMTPÖ¸Á½öÐèÒªÊäÈëºÜÉÙµÄÃüÁî¼´¿É³É¹¦·¢ËÍÒ»·âÓʼþ¡£
ÆäÖдÖÌ岿·ÖΪÊäÈëµÄÃüÁÀ¶É«²¿·ÖΪ¿É±äÄÚÈÝ£¬»ÒɫΪ·þÎñÆ÷Ó¦´ðÄÚÈÝ©¤©¤
[root@localhost ~]# telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
220 localhost.localdomain ESMTP Sendmail 8.13.8/8.13.8; Sun, 27 Sep 2009 20:02:18 +0800
HELO www.coelite.cn
250 localhost.localdomain Hello localhost.localdomain [127.0.0.1], pleased to meet you
MAIL from: moky@coelite.cn
250 2.1.0 moky@coelite.cn... Sender ok
RCPT TO: moky@chinabaiya.com
250 2.1.5 moky@chinabaiya.com... Recipient ok
RCPT TO: moky@vip.qq.com
250 2.1.5 moky@vip.qq.com... Recipient ok
DATA
354 Enter mail, end with "." on a line by itself
Subject: Hello
Content-Type: text/html
<html>
<body>
<a href="http://www.coelite.cn">coelite</a>
</body>
</html>
.
250 2.0.0 n8RC2IrV003529 Message accepted for del ......
root@linux ~]# tar [-cxtzjvfpPN] ÎļþÓëĿ¼ ....
²ÎÊý£º
-c £º½¨Á¢Ò»¸öѹËõÎļþµÄ²ÎÊýÖ¸Áî(create µÄÒâ˼)£»
-x £º½â¿ªÒ»¸öѹËõÎļþµÄ²ÎÊýÖ¸Á
-t £º²é¿´ tarfile ÀïÃæµÄÎļþ£¡
Ìرð×¢Ò⣬ÔÚ²ÎÊýµÄÏ´ïÖУ¬ c/x/t ½öÄÜ´æÔÚÒ»¸ö£¡²»¿Éͬʱ´æÔÚ£¡
ÒòΪ²»¿ÉÄÜͬʱѹËõÓë½âѹËõ¡£
-z £ºÊÇ·ñͬʱ¾ßÓÐ gzip µÄÊôÐÔ£¿Ò༴ÊÇ·ñÐèÒªÓà gzip ѹËõ£¿
-j £ºÊÇ·ñͬʱ¾ßÓÐ bzip2 µÄÊôÐÔ£¿Ò༴ÊÇ·ñÐèÒªÓà bzip2 ѹËõ£¿
-v £ºÑ¹ËõµÄ¹ý³ÌÖÐÏÔʾÎļþ£¡Õâ¸ö³£Ó㬵«²»½¨ÒéÓÃÔÚ±³¾°Ö´Ðйý³Ì£¡
-f £ºÊ¹ÓõµÃû£¬ÇëÁôÒ⣬ÔÚ f Ö®ºóÒªÁ¢¼´½ÓµµÃûร¡²»ÒªÔÙ¼Ó²ÎÊý£¡
¡¡¡¡¡¡ÀýÈçʹÓẠtar -zcvfP tfile sfile¡»¾ÍÊÇ´íÎóµÄд·¨£¬ÒªÐ´³É
¡¡¡¡¡¡¡º tar -zcvPf tfile sfile¡»²Å¶Ôร¡
-p £ºÊ¹ÓÃÔÎļþµÄÔÀ´ÊôÐÔ£¨ÊôÐÔ²»»áÒÀ¾ÝʹÓÃÕ߶ø±ä£©
-P £º¿ÉÒÔʹÓþø¶Ô·¾¶À´Ñ¹Ëõ£¡
-N £º±ÈºóÃæ½ÓµÄÈÕÆÚ(yyyy/mm/dd)»¹ÒªÐµIJŻᱻ´ò°ü½øн¨µÄÎļþÖУ¡
--exclude FILE£ºÔÚѹËõµÄ¹ý³ÌÖУ¬²»Òª½« FILE ´ò°ü£¡
·¶Àý£º
·¶ÀýÒ»£º½«Õû¸ö /etc Ŀ¼ÏµÄÎļþÈ«²¿´ò°ü³ÉΪ /tmp/etc.tar
[root@linux ~]# tar -cvf /tmp/etc.tar /etc <==½ö´ò°ü£¬²»Ñ¹Ëõ£¡
[root@linux ~]# tar -zcvf /tmp/etc.tar ......
linuxÈíÖжϻúÖÆ
ÖжϷþÎñ³ÌÐòÍùÍù¶¼ÊÇÔÚCPU¹ØÖжϵÄÌõ¼þÏÂÖ´Ðеģ¬ÒÔ±ÜÃâÖжÏǶÌ׶øʹ¿ØÖƸ´ÔÓ»¯¡£µ«ÊÇCPU¹ØÖжϵÄʱ¼ä²»ÄÜÌ«³¤£¬·ñÔòÈÝÒ׶ªÊ§ÖжÏÐźš£Îª´Ë£¬ Linux½«ÖжϷþÎñ³ÌÐòÒ»·ÖΪ¶þ£¬¸÷³Æ×÷“Top Half”ºÍ“Bottom Half”¡£Ç°Õßͨ³£¶Ôʱ¼äÒªÇó½ÏΪÑϸñ£¬±ØÐëÔÚÖжÏÇëÇó·¢ÉúºóÁ¢¼´»òÖÁÉÙÔÚÒ»¶¨µÄʱ¼äÏÞÖÆÄÚÍê³É¡£Òò´ËΪÁ˱£Ö¤ÕâÖÖ´¦ÀíÄÜÔ×ÓµØÍê³É£¬Top Halfͨ³£ÊÇÔÚCPU¹ØÖжϵÄÌõ¼þÏÂÖ´Ðеġ£¾ßÌåµØ˵£¬Top HalfµÄ·¶Î§°üÀ¨£º´ÓÔÚIDTÖеǼǵÄÖжÏÈë¿Úº¯ÊýÒ»Ö±µ½Çý¶¯³ÌÐò×¢²áÔÚÖжϷþÎñ¶ÓÁÐÖеÄISR¡£¶øBottom HalfÔòÊÇTop Half¸ù¾ÝÐèÒªÀ´µ÷¶ÈÖ´Ðеģ¬ÕâЩ²Ù×÷ÔÊÐíÑÓ³Ùµ½ÉÔºóÖ´ÐУ¬ËüµÄʱ¼äÒªÇó²¢²»Ñϸñ£¬Òò´ËËüͨ³£ÊÇÔÚCPU¿ªÖжϵÄÌõ¼þÏÂÖ´Ðеġ£
µ«ÊÇ£¬ LinuxµÄÕâÖÖBottom Half£¨ÒÔϼò³ÆBH£©»úÖÆÓÐÁ½¸öȱµã£¬Ò²¼´£º£¨1£©ÔÚÈÎÒâһʱ¿Ì£¬ÏµÍ³Ö»ÄÜÓÐÒ»¸öCPU¿ÉÒÔÖ´ÐÐBottom Half´úÂ룬ÒÔ·ÀÖ¹Á½¸ö»ò¶à¸öCPUͬʱÀ´Ö´ÐÐBottom Halfº¯Êý¶øÏ໥¸ÉÈÅ¡£Òò´ËBH´úÂëµÄÖ´ÐÐÊÇÑϸñ“´®Ðл¯”µÄ¡££¨2£©BHº¯Êý²»ÔÊÐíǶÌס£
ÕâÁ½¸öȱµãÔÚµ¥CPUϵͳÖÐÊÇÎ޹ؽôÒªµÄ£¬µ«ÔÚSMPϵͳÖÐÈ´ÊǷdz£ÖÂÃüµÄ¡£ÒòΪBH»úÖƵÄÑϸ ......