Jump to content

Http request program


csc

Recommended Posts

hmm...

not quite, but THX any way barrytone & l0gic:)

In need prog, which will send a simply http request

like:

GET / HTTP/1.1rn

Accept: */*rn

Accept-Language: plrn

Accept-Encoding: gzip, deflatern

Host: www.google.ukrn

Connection: Keep-Alivern

rn

and gave me google page code back.

like IE or Mozilla FF but in C++ code!

Link to comment
Share on other sites

hmm...

not quite, but THX any way barrytone & l0gic:)

In need prog, which will send a simply http request

like:

GET / HTTP/1.1rn

Accept: */*rn

Accept-Language: plrn

Accept-Encoding: gzip, deflatern

Host: www.google.ukrn

Connection: Keep-Alivern

rn

and gave me google page code back.

like IE or Mozilla FF but in C++ code!

How about this one?

http://www.jlab.org/~chen/cmlog/cmlog-2-1-b/node27.html

I'm not a c++ coder, so I'm not gonna bother trying to figure out if that would suit your needs :P

Link to comment
Share on other sites

Can I ask what you are going to use this for?

I'm interested becasue this is the sort of functionality DDoS botnet zombies need. Along with a basic IRC client and interpreter (got to beable to interpret the commands it recives). You are not making a botnet zombie program are you? :P

Link to comment
Share on other sites

#include <stdio.h>

#include "CClient.hpp"



int main(int argc, char** argv)

{

    if (argc < 3)

    {

        printf("Usage:");

        printf("t%s <hostname> <port>");

        return 0;

    }

    

    CClient* pClient = new CClient();

    char* pszRecvMessage = new char[1024];



    pClient->Create();

    pClient->Connect(argv[1], atoi(argv[2]));

    

    pClient->Send("GET / HTTP/1.1rn");

    pClient->Send("Accept: */*rn");

    pClient->Send("Accept-Language: plrn");

    pClient->Send("Accept-Encoding: gzip, deflatern");

    pClient->Send("Host: www.google.comrn");

    pClient->Send("Connection: Keep-Alivern");

    pClient->Send("rn");



    while (pClient->Recv(pszRecvMessage, 1023))

    {

        printf("%s", pszRecvMessage);

    }



    delete [] pszRecvMessage;

    delete pClient;

    

    return 0;

}

This code was thrown together in a few minutes, and may contain errors (and missing class files which I don't share :))

Feel free to pay me for the actual CClient.cpp and CClient.hpp code :)

If you learn basic sockets on Windows, Linux, BSD, or whatever, what you want to do is pretty simple.

Link to comment
Share on other sites

TomB, you have just been assigned Microsoft Citrufied N00b status for using Hungarian Notation (BLEEEEEEEUUUUUUUURGH!!!) in public.

Link to comment
Share on other sites

"TomB, you have just been assigned Microsoft Citrufied N00b status for using Hungarian Notation (BLEEEEEEEUUUUUUUURGH!!!) in public."

Come on Cooper lets be accurate if your gonna take the p***. Its Systems Hungarian notation. :lol:

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...