Jump to content

Copying player names


nodrescue

Recommended Posts

There is a player living in Germany who is using my log nodrescue, if i try login i get a underscore end of my name.

Everyone knows i'm nodrescue and i live in the UK

Your own rules below state impersonating another player is against the rules, i have asked him to stop it but he just laughs and says CnC won't do shit about it.

 

* Welcome to the CnCNet IRC Network [email protected]

(19) [16:24] * Welcome to CnCNet! Rules: No racism, harassment or impersonation allowed! No Religions/Politics! No Cheats or any kind of automated game-play (gaming mice and keyboards/macros etc.)

 

I am using account TheOne at the moment but this idiot is taking the piss out of other players pretending to be me,

As you can see his in lobby and in a game impersonating me.

 

If you need further proof i am who i say i can gather more. Peter

Untitled.png.7c88585db3254a9fea04bfad583a0fa3.png

Link to comment
Share on other sites

We cannot use nickserv cause the lobby can run on any IRC network

Auth will be coming soon with the ladder release, it won't be perfect at the start but it is at least something :D

Anyways, I will send this guy a warning when I see him since it is against the rules. Some guys change i to l and modify the names slightly in different ways, so we will never be able to fully prevent it. You guys have to continue to report such problems in the future too

 

Link to comment
Share on other sites

We cannot use nickserv cause the lobby can run on any IRC network

Auth will be coming soon with the ladder release, it won't be perfect at the start but it is at least something :D

Anyways, I will send this guy a warning when I see him since it is against the rules. Some guys change i to l and modify the names slightly in different ways, so we will never be able to fully prevent it. You guys have to continue to report such problems in the future too

 

I sent you a private message with a small library.. maybe you will find it useful!

Link to comment
Share on other sites

We cannot use nickserv cause the lobby can run on any IRC network

Oh, sure. And just changing that requirement from "any irc network" to "any irc network with nickserv" is such a big deal  :dry:

 

I already sent this to FunkyFr3sh, so I thought I would share it here.

 

#include <stdio.h>
#include <curl/curl.h>
#include <iostream>
#include <cstring>

#include "gumbo.h"

using namespace std;

#define LOGIN_URL "http://cnc-comm.com/community/index.php?action=login"
#define POST_URL "http://cnc-comm.com/community/index.php?action=login2"
#define USER_AGENT "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36"

CURL *curl;
CURLcode res;

string data, error;

struct curl_httppost *formpost=NULL;
struct curl_httppost *lastptr=NULL;

static size_t curl_write( void *ptr, size_t size, size_t nmemb, void *stream) {
  data.append( (char*)ptr, size*nmemb );
  return size*nmemb;
};

int curl_check_cookie_response( )
{
  struct curl_slist *cookies;
  struct curl_slist *nc;
  int i;
  res = curl_easy_getinfo(curl, CURLINFO_COOKIELIST, &cookies);
  if (res == CURLE_OK) {
    nc = cookies, i = 1;
    while (nc) {
        if(strstr( nc->data, "c_user") != NULL )
            return 1;
        nc = nc->next;
        i++;
  } }
  curl_slist_free_all(cookies);
  return 0;
}

void gumbo_check_failed_login( GumboNode* node )
{
    GumboAttribute* detail;
    if (node->type != GUMBO_NODE_ELEMENT) {
        return;
    }
    if( node->v.element.tag == GUMBO_TAG_P &&
    (detail = gumbo_get_attribute(&node->v.element.attributes, "class"))){
        if( strcmp( detail->value, "error") == 0 ) {
            GumboNode* child = static_cast<GumboNode*>(node->v.element.children.data[0]);
            if( child->v.text.text != NULL ) {
                error = child->v.text.text;
            }
    } }
    GumboVector* children = &node->v.element.children;
    for (unsigned int i = 0; i < children->length; ++i) {
         gumbo_check_failed_login(static_cast<GumboNode*>(children->data[i]));
    }
}

int authenticate_details( const char* user, const char* password )
{
    curl_easy_setopt(curl, CURLOPT_URL, POST_URL );
    curl_formadd(&formpost, &lastptr, CURLFORM_COPYNAME, "user", CURLFORM_COPYCONTENTS, user, CURLFORM_END);
    curl_formadd(&formpost, &lastptr, CURLFORM_COPYNAME, "passwrd", CURLFORM_COPYCONTENTS, password, CURLFORM_END);
    curl_formadd(&formpost, &lastptr, CURLFORM_COPYNAME, "button_submit", CURLFORM_COPYCONTENTS, "Login", CURLFORM_END);
    curl_easy_setopt(curl, CURLOPT_HTTPPOST, formpost);
    if( curl_easy_perform(curl) == CURLE_OK ) {
        return 0;
    }
    return 1;
}

int initialize_curl( )
{
    curl = curl_easy_init();
    if( curl ) {
        curl_easy_setopt(curl, CURLOPT_USERAGENT, USER_AGENT);
        curl_easy_setopt( curl, CURLOPT_WRITEFUNCTION, curl_write );
        curl_easy_setopt( curl, CURLOPT_WRITEDATA, &data );
        curl_easy_setopt(curl, CURLOPT_COOKIEFILE, "cookies.txt");
        curl_easy_setopt(curl, CURLOPT_COOKIEJAR, "cookies.txt");
        return 0;
    }
    return 1;
}

int main( int argc, char *argv[] ) {

    if( initialize_curl() == 0 ) {

        curl_easy_setopt(curl, CURLOPT_URL, LOGIN_URL );

        if( curl_easy_perform(curl) == CURLE_OK ) {

            data.clear();

            if( authenticate_details("hamster", "pass12345" ) == 0 ) {

                GumboOutput* output = gumbo_parse(data.c_str());

                gumbo_check_failed_login( output->root);

                if( !error.empty() ) {
                    printf("Error: %s\r\n", error.c_str() );
                } else {
                    printf("Successfully logged in.");
                }
                gumbo_destroy_output(&kGumboDefaultOptions, output);
            }
        }
    }
    return 0;
}

Link to comment
Share on other sites

We cannot use nickserv cause the lobby can run on any IRC network

Auth will be coming soon with the ladder release, it won't be perfect at the start but it is at least something :D

Anyways, I will send this guy a warning when I see him since it is against the rules. Some guys change i to l and modify the names slightly in different ways, so we will never be able to fully prevent it. You guys have to continue to report such problems in the future too

 

Thank you

Link to comment
Share on other sites

I already sent this to FunkyFr3sh, so I thought I would share it here.

 

GumboOutput* output = gumbo_parse(data.c_str());

What is this gumbo-jumbo?  :P

 

BTW, CnCNet doesn't use C++. I commend you for using C++, though. Respect, bro! A lot of hackers on CnC - keep 'em coming!

 

Link to comment
Share on other sites

I already sent this to FunkyFr3sh, so I thought I would share it here.

 

GumboOutput* output = gumbo_parse(data.c_str());

What is this gumbo-jumbo?  :P

 

BTW, CnCNet doesn't use C++. I commend you for using C++, though. Respect, bro! A lot of hackers on CnC - keep 'em coming!

 

gumbo is an HTML parser. And the beauty of C++ is that you can make DLLs to use them with other languages. :P

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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