推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
sbmzhcn
V2EX  ›  Python

日志中出现未知 url 请求,服务器被黑?

  •  
  •   sbmzhcn · Apr 21, 2016 · 3475 views
    This topic created in 3820 days ago, the information mentioned may be changed or developed.

    我的一个 python 程序中,日志文件中出现

    2016-04-21 09:05:23 - WARNING - 404 GET http://testp5.mielno.lubin.pl/testproxy.php (91.196.50.33) 0.48ms 
    

    但我的程序肯定没有这个请求,之前也出现过这样的日志

    2016-04-20 04:17:10 - WARNING - 404 GET http://www.baidu.com (180.109.139.112) 0.66ms
    2016-04-20 05:39:15 - WARNING - 404 GET http://www.bydesign.com (173.65.154.27) 0.58ms
    2016-04-20 05:46:04 - WARNING - 404 GET http://www.baidu.com (180.109.139.112) 0.53ms
    2016-04-20 05:46:05 - WARNING - 404 GET http://www.baidu.com (180.109.139.112) 0.54ms
    2016-04-20 07:14:59 - WARNING - 404 GET http://www.baidu.com (180.109.139.112) 0.52ms
    2016-04-20 07:15:01 - WARNING - 404 GET http://www.baidu.com (180.109.139.112) 0.51ms
    

    这上面的 IP 都不怎么对,有谁遇到过这样的问题,怎么解决?

    (怎么设置日志,让它显示是程序哪个文件请求的,我使用的是 requests)

    6 replies  •  2016-04-21 16:56:42 +08:00
    ksupertu
        1
    ksupertu  
       Apr 21, 2016 via Android
    有人用盗来的服务器挂扫描器扫描你的主机而已,不必大惊小怪
    ryd994
        2
    ryd994  
       Apr 21, 2016 via Android
    人家扫开放代理而已……
    你配置一下,对不匹配的域名全部 404 就好了啊
    sbmzhcn
        3
    sbmzhcn  
    OP
       Apr 21, 2016
    @ksupertu 扫描我的主机,为什么在我的日志中会出现这个,这个不太明白。
    BOYPT
        4
    BOYPT  
       Apr 21, 2016
    你都既然开放端口了,想让你你的日志记录什么就是什么啊,
    sbmzhcn
        5
    sbmzhcn  
    OP
       Apr 21, 2016
    还有就是奇怪的是,每次日志中出现这个,我的程序就会停掉。
    aivier
        6
    aivier  
       Apr 21, 2016
    正常 HTTP 请求:
    GET /index.foo HTTP/1.1
    ...
    Host: www.example.org

    你看到的日志:
    GET http://ahother-example-url.org/foobar HTTP/1.1


    用来测试代理的,如果结果不是 404 而是 200 可能就会被公布在某些网站上,然后...没有然后了, GFWed...
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1297 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 94ms · UTC 16:36 · PVG 00:36 · LAX 09:36 · JFK 12:36
    ♥ Do have faith in what you're doing.