简体   繁体   English

尝试在端口 80 上侦听 GET

[英]Trying to Listen for GET on Port 80

I want to be able to read the URL GET requests coming to my server, ex: "www.JohnAlexINL.com/ping" or " http://johnalexinl.com/ ", et cetera.我希望能够读取到达我的服务器的 URL GET 请求,例如:“www.JohnAlexINL.com/ping”或“ http://johnalexinl.com/ ”等。

I've tried using TCPDump, but it gives me a bunch of garbled nonsense that I can't figure out how to translate back into the original request (I can track the sources and read the packets, but I can't get them back into a URL).我试过使用 TCPDump,但它给了我一堆乱码,我无法弄清楚如何将其转换回原始请求(我可以跟踪源并读取数据包,但我无法将它们取回到一个 URL)。 I've also tried just listening on my TCP/UDP/HTTP ports, but that causes compatibility issues with Apache, effectively shutting my website down我也试过只监听我的 TCP/UDP/HTTP 端口,但这会导致与 Apache 的兼容性问题,从而有效地关闭了我的网站

I tried this first我先试过这个
sudo tcpdump -vv -x -i lo 'port 80'
and without 'port 80' later并且以后没有“端口 80”
sudo tcpdump -vv -x -i lo

I tried a few other configurations and having it save to a file and sifting through it, but I was doing that in IDLE, so I don't remember anymore exactly how I typed it all out.我尝试了其他一些配置并将其保存到文件中并对其进行筛选,但我是在 IDLE 中这样做的,所以我不再记得我是如何完全输入的。 Sorry for that对不起

I was hoping I would see the TCP "Handshake", a GET request, and some packets in response that have the actual data in them.我希望我能看到 TCP“握手”、一个 GET 请求和一些包含实际数据的响应数据包。

I got something somewhat similar, but not that I can actually use, since it only says what data has been moved -- not the request that warranted the response.我得到了一些类似的东西,但不是我可以实际使用的,因为它只说明了哪些数据已被移动——而不是保证响应的请求。

An excerpt:摘录:

19:45:25.293910 IP (tos 0x0, ttl 64, id 4474, offset 0, flags [DF], proto UDP (17), length 103)
    localhost.domain > localhost.36156: [bad udp cksum 0xfe9a -> 0xee1b!] 30218 q: PTR? 53.0.0.127.in-addr.arpa. 1/0/1 53.0.0.127.in-addr.arpa. PTR localhost. ar: . OPT UDPsize=65494 (75)
    0x0000:  4500 0067 117a 4000 4011 2ad6 7f00 0035
    0x0010:  7f00 0001 0035 8d3c 0053 fe9a 760a 8180
    0x0020:  0001 0001 0000 0001 0235 3301 3001 3003
    0x0030:  3132 3707 696e 2d61 6464 7204 6172 7061
    0x0040:  0000 0c00 01c0 0c00 0c00 0100 0000 0000
    0x0050:  0b09 6c6f 6361 6c68 6f73 7400 0000 29ff
    0x0060:  d600 0000 0000 00

You're using entirely the wrong toolset.您正在使用完全错误的工具集。 Choose a simple web framework like web.py and follow the examples.选择一个简单的 web 框架,比如 web.py 并按照示例进行操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM