Problem with HTTP GET Request

Hi guys, i have a problem with HTTP GET Request.
Im connected to socket so i want to get a data from 1 site, so here is how looks like my "query": send(Socket,"GET /test.php HTTP/1.1\r\nHost: anticheat.serb-craft.com\r\nConnection: close\r\n\r\n", strlen("GET /test.php HTTP/1.1\r\nHost: anticheat.serb-craft.com\r\nConnection: close\r\n\r\n"),0);

im trying to get data from: http://anticheat.serb-craft.com/test.php

here is output:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
HTTP/1.1 404 Not Found

Content-Type: text/html; charset=UTF-8

X-Content-Type-Options: nosniff

Date: Tue, 05 Jan 2016 10:42:46 GMT

Server: sffe

Content-Length: 1569

X-XSS-Protection: 1; mode=block

Connection: close



<!DOCTYPE html>
<html lang=en>
  <meta charset=utf-8>
  <meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width">
  <title>Error 404 (Not Found)!!1</title>
  <style>
    *{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/branding/googlelogo/1x/googlelogo_color_150x54dp.png) no-repeat;margin-left:-5px}@media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat 0% 0%/100% 100%;-moz-border-image:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) 0}}@media only screen and (-webkit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:54px;width:150px}
  </style>
  <a href=//www.google.com/><span id=logo aria-label=Google></span></a>
  <p><b>404.</b> <ins>That
Last edited on
The result is a 404, meaning the page could not be found on the server you connected to. To what server did you connect your Socket? I think you're connection to the wrong server, since the returned Server header differs from what I get as a result when connection to the site you are trying to access.

In the response I got connecting to the link you posted, the server header contained the value "Apache/2.4.10 (Debian)", meaning the server type differs.

Judging from the content result you posted, you connected to a server from Google. So your code is currently trying to access a page named /test.php on a Google server, with a provided Host header which doesn't exists on the server. Google's server is giving you a 404 back, and that's the result you are experiencing.

Try scanning the code where you connect to the server, maybe you entered a bad site name or IP address there. If you can't find the error, post that part of the code so we can help look for the exact error, but I think this should be enough to get you going.
Topic archived. No new replies allowed.