ÔõôÔÚLinuxÖÐÌí¼ÓеÄϵͳµ÷ÓÃ
ϵͳµ÷ÓÃÊÇÓ¦ÓóÌʽºÍ²Ù×÷ϵͳÄÚºËÖ®¼äµÄ¹¦Äܽӿڡ£ÆäÖ÷ҪĿµÄÊÇʹµÃÓû§
ÄÜʹÓòÙ×÷ϵͳÌṩµÄÓйØÉ豸¹ÜÀí¡¢ÊäÈë/ÊäÈëϵͳ¡¢ÎļþϵͳºÍ½ø³Ì¿ØÖÆ¡¢
ͨÐż°´æ´¢¹ÜÀíµÈ·½ÃæµÄ¹¦ÄÜ£¬¶ø²»±ØÁ˽âϵͳ³ÌʽµÄÄÚ²¿½á¹¹ºÍÓйØÓ²¼þϸ
½Ú£¬´Ó¶øÆðµ½¼õÇáÓû§¸ºµ£ºÍ±£»¤ÏµÍ³¼°Ìá¸ß×ÊÔ´ÀûÓÃÂʵÄ×÷Óá£
¡¡¡¡Linux²Ù×÷ϵͳ×÷ΪÃâ·ÑÈí¼þµÄ´ú±í£¬ËûÓÅÁ¼µÄÐÔÄÜʹµÃËûµÄÓ¦ÓÃÈÕÒæ¹ã·º£¬
²»½öµÃµ½×¨ÒµÈËÊ¿µÄ¿Ï¶¨£¬¶øÇÒÉÌÒµ»¯µÄÓ¦ÓÃÒ²ÊÇÈç»ðÈçݱ¡£ÔÚLinuxÖУ¬´ó²¿·Ö
µÄϵͳµ÷Óðüº¬ÔÚLinuxµÄlibc¿âÖУ¬Í¨¹ý±ê×¼µÄCº¯Êýµ÷Ó÷½·¨Äܵ÷ÓÃÕâЩϵͳ
µ÷Óá£ÄÇô£¬¶ÔLinuxµÄ·¢ÉÕÓÑÀ´Ëµ£¬ÔõôÔÚLinuxÖÐÔö¼ÓеÄϵͳµ÷ÓÃÄØ£¿
1 Linuxϵͳµ÷ÓûúÖÆ
¡¡¡¡ÔÚLinuxϵͳÖУ¬ÏµÍ³µ÷ÓÃÊÇ×÷ΪһÖÖÒì³£ÀàÐÍʵÏֵġ£Ëû½«Ö´ÐÐÏàÓ¦µÄ»úÆ÷
´úÂëÖ¸ÁîÀ´²úÉúÒì³£Ðźš£²úÉúÖжϻòÒì³£µÄÖØҪЧ¹ûÊÇϵͳ×Ô¶¯½«Óû§Ì¬×ª»»Îª
ºËÐÄ̬À´¶ÔËû½øÐд¦Àí¡£Õâ¾ÍÊÇ˵£¬Ö´ÐÐϵͳµ÷ÓÃÒì³£Ö¸Áîʱ£¬×Ô¶¯µØ½«ÏµÍ³×ª»»
ΪºËÐÄ̬£¬²¢°²ÅÅÒì³£´¦Àí³ÌʽµÄÖ´ÐС£
¡¡¡¡LinuxÓÃÀ´ÊµÏÖϵͳµ÷ÓÃÒì³£µÄʵ¼ÊÖ¸ÁîÊÇ£º
¡¡¡¡Int  $0x80
¡¡¡¡ÕâÒ»Ö¸ÁîʹÓÃÖжÏ/Òì³£ÏòÁ¿ºÅ128£¨¼´16½øÖƵÄ80£©½«¿ØÖÆȨתÒƸøÄںˡ£Îª
´ïµ½ÔÚʹÓÃϵͳµ÷ÓÃʱ²»±ØÓûúÆ÷Ö¸Áî±à³Ì£¬ÔÚ±ê×¼µÄCÓïÑÔ¿âÖÐΪÿһϵͳµ÷ÓÃ
ÌṩÁËÒ»¶Î¶ÌµÄ×Ó³Ìʽ£¬Íê³É»úÆ÷´úÂëµÄ±à³Ì¹¤×÷¡£ÊÂʵÉÏ£¬»úÆ÷´úÂë¶Î·Ç³£¼ò
¶Ì¡£ËûËùÒª×öµÄ¹¤×÷Ö»Êǽ«Ë͸øϵͳµ÷ÓõIJÎÊý¼ÓÔص½CPU¼Ä´æÆ÷ÖУ¬½Ó×ÅÖ´ÐÐ
int  $0x80Ö¸ÁȻºóÔËÐÐϵͳµ÷Óã¬ÏµÍ³µ÷Óõķµ»ØÖµ½«ËÍÈëCPUµÄÒ»¸ö¼Ä´æÆ÷
ÖУ¬±ê×¼µÄ¿â×Ó³ÌʽȡµÃÕâÒ»·µ»ØÖµ£¬²¢½«ËûËÍ»ØÓû§³Ìʽ¡£
¡¡¡¡ÎªÊ¹ÏµÍ³µ÷ÓõÄÖ´ÐгÉΪһÏî¼òµ¥µÄÈÎÎñ£¬LinuxÌṩÁËÒ»×éÔ¤´¦ÀíºêÖ¸Áî¡£
ËûÃÇÄÜÓÃÔÚ³ÌʽÖС£ÕâЩºêÖ¸ÁîÈ¡Ò»¶¨µÄ²ÎÊý£¬È»ºóÀ©Õ¹Îªµ÷ÓÃÖ¸¶¨µÄϵͳµ÷ÓÃ
µÄº¯Êý¡£
¡¡¡¡ÕâЩºêÖ¸Áî¾ßÓÐÀàËÆÏÂÃæµÄÃû³Æ¸ñʽ£º
¡¡¡¡_syscallN£¨parameters£©
¡¡¡¡ÆäÖÐNÊÇϵͳµ÷ÓÃËùÐèµÄ²ÎÊýÊýÄ¿£¬¶øparametersÔòÓÃÒ»×é²ÎÊý´úÌæ¡£ÕâЩ²Î
ÊýʹºêÖ¸ÁîÍê³ÉÊʺÏÓÚÌض¨µÄϵͳµ÷ÓõÄÀ©Õ¹¡£ÀýÈ磬ΪÁ˽¨Á¢µ÷ÓÃsetuid£¨£©Ïµ
ͳµ÷Óõĺ¯Êý£¬Ó¦¸ÃʹÓãº
¡¡¡¡_syscall1£¨ int£¬ setuid£¬ uid_t£¬ uid £©
¡¡¡¡syscallN£¨ £©ºêÖ¸ÁîµÄµÚ1¸ö²ÎÊýint˵Ã÷²úÉúµÄº¯ÊýµÄ·µ»ØÖµµÄÀàÐÍÊÇÕû
ÐÍ£¬µÚ2¸ö²ÎÊýsetuid˵Ã÷²úÉúµÄº¯ÊýµÄÃû³Æ¡£ºóÃæÊÇϵͳµ÷ÓÃËùÐèÒªµÄÿ¸ö²Î
Êý¡£ÕâÒ»ºêÖ¸ÁîºóÃæ¸üÓÐÁ½¸ö²ÎÊýuid_tºÍuid·Ö±ðÓÃÀ´Ö¸¶¨²ÎÊýµÄÀàÐͺÍÃû³Æ¡£
¡¡¡¡Á
Ïà¹ØÎĵµ£º
ÀýÒ»£º·¢ËÍSignaling Packet£º
Signaling CommandÊÇ2¸öBluetoothʵÌåÖ®¼äµÄL2CAP²ãÃüÁî´«Êä¡£ËùÒÔµÃSignaling CommandʹÓÃCID 0x0001.
¶à¸öCommand¿ÉÒÔÔÚÒ»¸öC-frame£¨control frame£©Öз¢ËÍ¡£
Èç¹ûÒªÖ±½Ó·¢ËÍSignaling Command.ÐèÒª½¨Á¢SOCK_RAWÀàÐ͵ÄL2CAPÁ¬½ÓSocket¡£ÕâÑù²ÅÓлú»á×Ô¼ºÌî³äCommand Code£¬Identi ......
Service Discovery Protocol(SDP)ÌṩһÖÖÄÜÁ¦£¬ÈÃÓ¦ÓóÌÐòÓз½·¨·¢ÏÖÄÄÖÖ·þÎñ¿ÉÓÃÒÔ¼°ÕâÖÖ·þÎñµÄÌØÐÔ¡£
·þÎñ·¢ÏÖÐÒé(SDP»òBluetooth SDP)ÔÚÀ¶ÑÀÐÒéÕ»ÖжÔÀ¶ÑÀ»·¾³ÖеÄÓ¦ÓóÌÐòÓÐÌØÊâµÄº¬Ò⣬·¢ÏÖÄĸö·þÎñÊÇ¿ÉÓõĺÍÈ·¶¨ÕâЩ¿ÉÓ÷þÎñµÄÌØÕ÷¡£SDP¶¨ÒåÁËbluetooth client·¢ÏÖ¿ÉÓÃbluetooth server·þÎñºÍËüÃǵÄÌØÕ÷µÄ·½·¨¡£ ......
ÔÚ¿½±´Êý¾ÝµÄʱºò£¬Èç¹ûÓöµ½Ò»¶ÑСÎļþ£¬¼´Ê¹×ÜÊý¾ÝÁ¿ºÜС£¬¿½±´Ò²»áºÜ·Ñʱ£¬ÔÚwinÏ£¬ÓÐÒ»¸öÈí¼þ½Ðfastcopy£¬¿ÉÒÔʵÏÖ¿ìËÙ¿½±´£¬¾Ý˵ʹÓÃÁËÒ»ÖÖ½ÐÄÚ´æÓ³ÉäµÄ¼¼Êõ£¬ÄÇôÔÚLinuxÏÂÓÐûÓÐÄØ£¿
ÎÒÕÒÁË°ëÌ죬ÔÀ´LInuxϸù±¾²»ÐèÒªµ¥¶ÀµÄÈí¼þ£¬ÓÃÏÖÓеÄÃüÁî×éºÏ¾ÍOKÁË£¡
ÓиßÊÖÔÚÁ½¸ö·þÎñÆ÷¼ä´«Êý¾Ý£¬Ê¹ÓÃÃüÁʵÏÖÁË¿ìËÙ´«Ë ......
1£©/etc/sysconfig/network-scripts/ifcfg-interface-name
ÅäÖÃÎļþifcfg-interface-name°üº¬Á˳õʼ»¯½Ó¿ÚËùÐèµÄ´ó²¿·ÖÏêϸÐÅÏ¢¡£ÆäÖÐinterface-name½«¸ù¾ÝÍø¿¨µÄÀàÐͺÍÅÅÐò¶ø²»Í¬£¬Ò»°ãÆäÃû×ÖΪeth0¡¢eth1¡¢ppp0µÈ£¬ÆäÖÐeth±íʾÒÔÌ«£¨eth0£©ÀàÐÍÍø¿¨£¬0±íʾµÚÒ»¿éÍø¿¨£¬1±íʾµÚ¶þ¿éÍø¿¨£¬¶øppp0Ôò±íʾµÚÒ»¸öpoint-to-poir ......
Ëæ×ÅÏÖ´ú¼ÆËã»ú¼¼ÊõµÄ·ÉËÙ·¢Õ¹ºÍ»¥ÁªÍø¼¼ÊõµÄ¹ã·ºÓ¦Ó㬴Ópcʱ´ú¹ý¶Éµ½ÁËÒÔ¸öÈËÊý×ÖÖúÀí¡¢ÊÖ³Ö¸öÈ˵çÄÔºÍÐÅÏ¢¼ÒµçΪ´ú±íµÄ3c(¼ÆËã»ú¡¢Í¨ÐÅ¡¢Ïû·Ñµç
×Ó)Ò»ÌåµÄºópcʱ´ú¡£ºópcʱ´úÀǶÈëʽϵͳ°çÑÝÁËÔ½À´Ô½ÖØÒªµÄ½ÇÉ«£¬±»¹ã·ºÓ¦ÓÃÓÚÐÅÏ¢µçÆ÷¡¢Òƶ¯¼ÆËã»úÉ豸¡¢ÍøÂçÉ豸ºÍ¹¤¿Ø·ÂÕæµÈÁìÓò¡£Ç¶Èëʽ ......