stone(1)

NAME
stone - Simple TCP/UDP Packet Repeater

SYNOPSYS
stone [-d] [-n] [-u max] [-f n] [-l] [-z SSL] st [-- st]...

OPTIONS

-d  ¥Ç¥Ð¥Ã¥°¥ì¥Ù¥ë¤òÁý²Ã¤µ¤»¤Þ¤¹¡£

-z  SSL °Å¹æ²½¤Î¥ª¥×¥·¥ç¥ó¤Ç¤¹¡£

-n  ¥Û¥¹¥ÈÌ¾¤ä¥µ¡¼¥Ó¥¹Ì¾¤ÎÂå¤ï¤ê¤Ë IP ¥¢¥É¥ì¥¹¤ä¥µ¡¼¥Ó¥¹ÈÖ¹æ¤òÉ½¼¨¤·¤Þ¤¹¡£

-u  Æ±»þ¤Ëµ­²±¤Ç¤­¤ë UDP ¥Ñ¥±¥Ã¥È¤ÎÈ¯¿®¸µ¤ÎºÇÂç¿ô¤ò»ØÄê¤·¤Þ¤¹¡£ ¥Ç¥Õ¥©¥ë¥È¤Ï 10 ¤Ç¤¹¡£

-f  »Ò¥×¥í¥»¥¹¤Î¿ô¤ò»ØÄê¤·¤Þ¤¹¡£¥Ç¥Õ¥©¥ë¥È¤Ï»Ò¥×¥í¥»¥¹Ìµ¤·¤Ç¤¹¡£

-l  ¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸Åù¤ò syslog ¤Ø½ÐÎÏ¤·¤Þ¤¹¡£

st  ¼¡¤Î¤¤¤º¤ì¤«¤Ç¤¹¡£st ¤Ï¡Ö--¡×¤Ç¶èÀÚ¤ë¤³¤È¤Ë¤è¤ê¡¢ Ê£¿ô¸Ä»ØÄê¤Ç¤­¤Þ¤¹¡£
    (1) host:port sport [xhost ...]
    (2) host:port shost:sport [xhost ...]
    (3) display [xhost ...]
    (4) proxy sport [xhost ...]
    (5) host:port/http request [hosts ...]
    (6) host:port/proxy header [hosts...]

stone ¤ò¼Â¹Ô¤·¤Æ¤¤¤ë¥Þ¥·¥ó¤Î¥Ý¡¼¥È sport ¤Ø¤ÎÀÜÂ³¤ò¡¢Â¾¤Î¥Þ¥· ¥ó host ¤Î¥Ý¡¼¥È port ¤ØÃæ·Ñ¤·¤Þ¤¹¡£¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤òÊ£¿ô»ý¤Ä ¥Þ¥·¥ó¤Ç¤Ï¡¢(2) ¤Î¤è¤¦¤Ë¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Î¥¢¥É¥ì¥¹ shost ¤ò»ØÄê ¤¹¤ë¤³¤È¤Ë¤è¤ê¡¢ÆÃÄê¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ø¤ÎÀÜÂ³¤Î¤ß¤òÅ¾Á÷¤¹¤ë¤³¤È¤¬ ¤Ç¤­¤Þ¤¹¡£

display [xhost ...]
    X ¥×¥í¥È¥³¥ëÃæ·Ñ¤Î¤¿¤á¤Î¾ÊÎ¬µ­Ë¡¤Ç¤¹¡£¥Ç¥£¥¹¥×¥ì¥¤ÈÖ¹æ display ¤Ø¤ÎÀÜÂ³¤ò¡¢´Ä¶­ÊÑ¿ô DISPLAY ¤Ç»ØÄê¤·¤¿ X ¥µ¡¼¥Ð¤ØÅ¾Á÷ ¤·¤Þ¤¹¡£

proxy sport [xhost ...]
    http proxy ¤Ç¤¹¡£WWW ¥Ö¥é¥¦¥¶¤Î http proxy ¤ÎÀßÄê¤Ç¡¢ stone ¤ò¼Â¹Ô¤·¤Æ¤¤¤ë¥Þ¥·¥ó¤ª¤è¤Ó¥Ý¡¼¥È sport ¤ò»ØÄê¤·¤Þ¤¹¡£

host:port/http request [hosts ...]
    http ¥ê¥¯¥¨¥¹¥È¤Ë¤Î¤»¤Æ¥Ñ¥±¥Ã¥È¤òÃæ·Ñ¤·¤Þ¤¹¡£request ¤Ï HTTP 1.0 ¤Çµ¬Äê¤µ¤ì¤ë¥ê¥¯¥¨¥¹¥È¤Ç¤¹¡£

host:port/proxy header [hosts...]
    http ¥ê¥¯¥¨¥¹¥È¥Ø¥Ã¥À¤ÎÀèÆ¬¤Ë header ¤òÄÉ²Ã¤·¤ÆÃæ·Ñ¤· ¤Þ¤¹¡£

xhost ¤òÎóµó¤¹¤ë¤³¤È¤Ë¤è¤ê¡¢stone ¤ØÀÜÂ³²ÄÇ½¤Ê¥Þ¥·¥ó¤òÀ©¸Â¤¹¤ë ¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¥Þ¥·¥óÌ¾¡¢¤¢¤ë¤¤¤Ï¤½¤Î IP ¥¢¥É¥ì¥¹¤ò¶õÇò¤Ç¶èÀÚ¤Ã ¤Æ»ØÄê¤¹¤ë¤È¡¢¤½¤Î¥Þ¥·¥ó¤«¤é¤ÎÀÜÂ³¤Î¤ß¤òÃæ·Ñ¤·¤Þ¤¹¡£

xhost ¤Ë¡Ö/mask¡×¤òÉÕ¤±¤ë¤È¡¢ÆÃÄê¤Î¥Í¥Ã¥È¥ï¡¼¥¯¤Î¥Þ¥·¥ó¤«¤é ¤ÎÀÜÂ³¤òµö²Ä¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£Îã¤¨¤Ð¡¢¥¯¥é¥¹ C ¤Î¥Í¥Ã¥È¥ï¡¼¥¯ 192.168.1.0 ¤Î¾ì¹ç¤Ï¡¢¡Ö192.168.1.0/255.255.255.0¡×¤È»ØÄê¤·¤Þ¤¹¡£

sport ¤Ë¡Ö/udp¡×¤òÉÕ¤±¤ë¤È¡¢TCP ¥Ñ¥±¥Ã¥È¤òÃæ·Ñ¤¹¤ëÂå¤ï¤ê¤Ë¡¢ UDP ¥Ñ¥±¥Ã¥È¤òÃæ·Ñ¤·¤Þ¤¹¡£

port ¤Ë¡Ö/ssl¡×¤òÉÕ¤±¤ë¤È¡¢¥Ñ¥±¥Ã¥È¤ò SSL ¤Ç°Å¹æ²½¤·¤ÆÃæ·Ñ¤·¤Þ¤¹¡£

sport ¤Ë¡Ö/ssl¡×¤òÉÕ¤±¤ë¤È¡¢SSL ¤Ç°Å¹æ²½¤µ¤ì¤¿¥Ñ¥±¥Ã¥È¤òÉü¹æ²½ ¤·¤ÆÃæ·Ñ¤·¤Þ¤¹¡£

sport ¤Ë¡Ö/http¡×¤òÉÕ¤±¤ë¤È¡¢http ¥ê¥¯¥¨¥¹¥È¾å¤Î¥Ñ¥±¥Ã¥È¤òÃæ·Ñ ¤·¤Þ¤¹¡£

DESCRIPTION
stone ¤Ï¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥ì¥Ù¥ë¤Î TCP & UDP ¥Ñ¥±¥Ã¥È¥ê¥Ô¡¼¥¿¡¼¤Ç¤¹¡£ ¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë¤ÎÆâ¤«¤é³°¤Ø¡¢¤¢¤ë¤¤¤Ï³°¤«¤éÆâ¤Ø¡¢TCP ¥Ñ¥±¥Ã¥È¤¢¤ë¤¤¤Ï UDP ¥Ñ¥±¥Ã¥È¤òÃæ·Ñ¤·¤Þ¤¹¡£

stone ¤Ë¤Ï°Ê²¼¤Î¤è¤¦¤ÊÆÃÄ§¤¬¤¢¤ê¤Þ¤¹¡£

1. Win32 ¤ËÂÐ±þ¤·¤Æ¤¤¤ë
    °ÊÁ°¤Ï UNIX ¥Þ¥·¥ó¤Ç¹½À®¤µ¤ì¤ë¤³¤È¤¬Â¿¤«¤Ã¤¿¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë¤Ç¤¹ ¤¬¡¢ºÇ¶á¤Ï WindowsNT ¤¬»È¤ï¤ì¤ë¥±¡¼¥¹¤¬Áý¤¨¤Æ¤­¤Þ¤·¤¿¡£stone ¤Ï WindowsNT ¤¢¤ë¤¤¤Ï Windows95 ¾å¤Ç¼ê·Ú¤Ë¼Â¹Ô¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ ¤â¤Á¤í¤ó¡¢Linux, FreeBSD, BSD/OS, SunOS, Solaris, HP-UX ¤Ê¤É¤Î UNIX ¥Þ¥·¥ó¤Ç¤â»È¤¦¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£

2. Ã±½ã
    ¤ï¤º¤« 2000 ¹Ô (C ¸À¸ì) ¤Ç¤¹¤Î¤Ç¡¢¥»¥­¥å¥ê¥Æ¥£¥Û¡¼¥ë¤¬À¸¤¸¤ë²ÄÇ½ À­¤òºÇ¾®¸Â¤Ë¤Ç¤­¤Þ¤¹¡£

3. SSLeay ÂÐ±þ
    Eric Young »á¤Î SSLeay ¤ò»È¤¦¤³¤È¤Ë¤è¤ê¡¢°Å¹æ²½/Éü¹æ²½¤·¤Æ¥Ñ¥±¥Ã ¥È¤òÃæ·Ñ¤Ç¤­¤Þ¤¹¡£

4. http proxy
    ´Ê°×·¿ http proxy ¤È¤·¤Æ¤â»È¤¦¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£

EXAMPLE
outer:
    ¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë¤Î³°Â¦¤Ë¤¢¤ë¥Þ¥·¥ó
inner:
    ¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë¤ÎÆâÂ¦¤Ë¤¢¤ë¥Þ¥·¥ó
fwall:
    ¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë. ¤³¤Î¥Þ¥·¥ó¾å¤Ç stone ¤ò¼Â¹Ô

stone 7 outer
    DISPLAY ¤Ç»ØÄê¤·¤¿ X server ¤Ø X ¥×¥í¥È¥³¥ë¤òÃæ·Ñ
    outer ¤Ç DISPLAY=inner:7 ¤ÈÀßÄê¤·¤Æ X ¥¯¥é¥¤¥¢¥ó¥È¤ò¼Â¹Ô

stone outer:telnet 10023
    outer ¤Ø telnet ¥×¥í¥È¥³¥ë¤òÃæ·Ñ
    inner ¤Ç telnet fwall 10023 ¤ò¼Â¹Ô

stone outer:domain/udp domain/udp
    DNS Ìä¤¤¹ç¤ï¤»¤ò outer ¤ØÃæ·Ñ
    inner ¤Ç nslookup - fwall ¤ò¼Â¹Ô

stone outer:ntp/udp ntp/udp
    outer ¤Ø NTP ¤òÃæ·Ñ
    inner ¤Ç ntpdate fwall ¤ò¼Â¹Ô

stone localhost:http 443/ssl
    WWW ¥µ¡¼¥Ð¤ò https ÂÐ±þ¤Ë¤¹¤ë
    WWW ¥Ö¥é¥¦¥¶¤Ç https://fwall/ ¤ò¥¢¥¯¥»¥¹

stone localhost:telnet 10023/ssl
    telnet ¤ò SSL ²½
    inner ¤Ç SSLtelnet -z ssl fwall 10023 ¤ò¼Â¹Ô

stone proxy 8080
    http proxy

fwall ¤¬ http proxy (port 8080) ¤Ç¤¢¤ë»þ:

stone fwall:8080/http 10023 'POST http://outer:8023 HTTP/1.0'

stone localhost:telnet 8023/http
    inner ¤È outer ¤Ç¤½¤ì¤¾¤ì stone ¤ò¼Â¹Ô
    http ¾å¤Ç¥Ñ¥±¥Ã¥È¤òÃæ·Ñ

stone fwall:8080/proxy 9080 'Proxy-Authorization: Basic c2VuZ29rdTpoaXJvYWtp'
    proxy Ç§¾Ú¤ËÂÐ±þ¤·¤Æ¤¤¤Ê¤¤¥Ö¥é¥¦¥¶ÍÑ

COPYRIGHT
¤³¤Î stone ¤Ë´Ø¤¹¤ëÁ´¤Æ¤ÎÃøºî¸¢¤Ï¡¢¸¶Ãøºî¼Ô¤Ç¤¢¤ëÀçÀÐ¹ÀÌÀ¤¬½êÍ­ ¤·¤Þ¤¹¡£¤³¤Î stone ¤Ï¡¢GNU General Public License (GPL) ¤Ë½à¤º¤ë ¥Õ¥ê¡¼¥½¥Õ¥È¥¦¥§¥¢¤Ç¤¹¡£¸Ä¿ÍÅª¤Ë»ÈÍÑ¤¹¤ë¾ì¹ç¤Ï¡¢²þÊÑ¡¦Ê£À½¤ËÀ©¸Â ¤Ï¤¢¤ê¤Þ¤»¤ó¡£ÇÛÉÛ¤¹¤ë¾ì¹ç¤Ï GPL ¤Ë½¾¤Ã¤Æ²¼¤µ¤¤¡£

DISCLAIMER
¤³¤Î stone ¤ÏÌµÊÝ¾Ú¤Ç¤¹¡£¤³¤Î stone ¤ò»È¤Ã¤ÆÀ¸¤¸¤¿¤¤¤«¤Ê¤ëÂ»³²¤Ë ÂÐ¤·¤Æ¤â¡¢¸¶Ãøºî¼Ô¤ÏÀÕÇ¤¤òÉé¤¤¤Þ¤»¤ó¡£¾Ü¤·¤¯¤Ï GPL ¤ò»²¾È¤·¤Æ²¼ ¤µ¤¤¡£

AUTHOR
ÀçÀÐ ¹ÀÌÀ
sengoku@gcd.org
http://www.gcd.org/sengoku/