mitmproxyÅÀÈ¡½Ì³Ì
mitmproxyÊÇÒ»¿îÊðÀí¹¤¾ß£¬¿É×èµ²ºÍÐÞ¸Ähttp/sÁ÷Á¿£¬ÓÃÓÚץȡºÍÆÊÎöwebÊý¾Ý¡£Ê¹Óð취ÈçÏ£º×°ÖÃmitmproxy£»Æô¶¯mitmproxy²¢ÉèÖÃä¯ÀÀÆ÷ÊðÀí£»×èµ²ÇëÇó£»Ê¹ÓÿØÖÆ̨¹ýÂ˺ÍÐÞ¸ÄÇëÇó£»³¤ÆÚ´æ´¢×èµ²µÄÇëÇó¡£
mitmproxy ÅÀÈ¡½Ì³Ì
¼ò½é
mitmproxy ÊÇÒ»¿î¹¦Ð§Ç¿Ê¢µÄÊðÀí¹¤¾ß£¬¿ÉÒÔ×èµ²ºÍÐÞ¸Ä HTTP/S Á÷Á¿£¬Ê¹¿ª·¢Ö°Ô±ºÍÑо¿Ö°Ô±Äܹ»ÇáËÉץȡºÍÆÊÎö Web Êý¾Ý¡£
×°ÖÃ
ÔÚ´ó´ó¶¼Æ½Ì¨ÉÏ£¬¿ÉÒÔͨ¹ý pip ×°Öà mitmproxy£º
python -m pip install mitmproxy
µÇ¼ºó¸´ÖÆ
ʹÓÃ
1. Æô¶¯ mitmproxy
ÔÚÖÕ¶ËÖÐÔËÐÐÒÔÏÂÏÂÁîÆô¶¯ mitmproxy£º
mitmproxy --listen-host "localhost" --listen-port "8080"
µÇ¼ºó¸´ÖÆ
Õ⽫ÔÚ localhost É쵀 8080 ¶Ë¿ÚÆô¶¯ mitmproxy¡£
2. ÉèÖÃä¯ÀÀÆ÷ÊðÀí
½«ä¯ÀÀÆ÷µÄÊðÀíÉèÖÃÉèÖÃΪ£º
- Ö÷»ú£ºlocalhost
- ¶Ë¿Ú£º8080
3. ×èµ²ÇëÇó
µ±ÄúÔÚä¯ÀÀÆ÷Öе¼º½µ½Íøվʱ£¬mitmproxy ½«×èµ²ËùÓÐ HTTP/S ÇëÇó¡£Äú¿ÉÒÔʹÓà mitmproxy µÄ GUI »ò¿ØÖÆ̨Éó²éºÍÐÞ¸ÄÕâЩÇëÇó¡£
4. ʹÓÿØÖÆ̨
mitmproxy ÌṩÁËÒ»¸ö½»»¥Ê½¿ØÖÆ̨£¬¿ÉÒÔÓÃÓÚ£º
- ¹ýÂËÇëÇó
- ÐÞ¸ÄÇëÇóÍ·ºÍÕýÎÄ
- ÉèÖöϵã
- ÖØ·ÅÇëÇó
5. ³¤ÆÚ´æ´¢
mitmproxy ¿ÉÒÔ½«×èµ²µÄÇëÇóÉúÑĵ½ÎļþÖС£Ê¹Óà –save-filepath Ñ¡ÏîÖ¸¶¨Êä³öÎļþ·¾¶£¬ÀýÈ磺
mitmproxy --save-filepath "output.mitm"
µÇ¼ºó¸´ÖÆ
¸ß¼¶¼¼ÇÉ
- ʹÓùýÂËÆ÷£ºmitmproxy ÌṩÁËÇ¿Ê¢µÄ¹ýÂËÓïÑÔ£¬¿ÉÓÃÓÚ°´ÖÖÖÖÌõ¼þ¹ýÂËÇëÇó¡£Éó²é [Îĵµ](https://docs.mitmproxy.org/stable/concepts-filters/)Ïàʶ¸ü¶àÐÅÏ¢¡£
- ½¨Éè¾ç±¾£ºÄú¿ÉÒÔʹÓà mitmproxy µÄ Python API ½¨Éè×Ô½ç˵¾ç±¾£¬ÒÔ×Ô¶¯Ö´ÐÐʹÃü»òÆÊÎöÊý¾Ý¡£
- ʹÓà addons£ºaddons ÊÇ¿ÉÒÔÀ©Õ¹ mitmproxy ¹¦Ð§µÄµÚÈý·½Ä£¿é¡£Éó²é [addons Ŀ¼](https://addons.mitmproxy.org/)ÒÔ²éÕÒÖª×ãÄúÐèÇóµÄ addons¡£
ÒÔÉϾÍÊÇmitmproxyÅÀÈ¡½Ì³ÌµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡