View Single Post
AntiBots
Veteran Member
Join Date: May 2008
Location: Brazil
Old 04-21-2010 , 22:38   Re: Developer Builds Available
#29

One question, That I can't test now, But Amx Mod X have bug of Path Traversa?
Looking the source code.. I think that yes.

More Info: http://en.wikipedia.org/wiki/Directory_traversal

A Solution that I add in my module:
PHP Code:
char *RB_C99_Replace(const char *str, const char *cold, const char *cnew)
{
    
char *ret, *r;
    const 
char *p, *q;
    
size_t oldlen strlen(cold);
    
size_t countretlennewlen strlen(cnew);

    if (
oldlen != newlen
    {
        for (
count 0str; (strstr(pcold)) != NULLoldlen)
            
count++;

        
retlen str strlen(p) + count * (newlen oldlen);
    } 
    else
    {
        
retlen strlen(str);
    }

    
ret = (char *)malloc(retlen 1);

    for (
retstr; (strstr(pcold)) != NULLoldlen
    {
        
ptrdiff_t l p;
        
memcpy(rpl);
        
+= l;
        
memcpy(rcnewnewlen);
        
+= newlen;
    }
    
strcpy(rp);

    return 
ret;
}

// To Prevent Path Traversa!!!
charRB_AntiPathTraversa(const char *path)
{
    return 
MF_BuildPathname"%s"RB_C99_Replace(RB_C99_Replace(path"../""" ), "..\\""" ) );

__________________
AntiBots is offline
Send a message via ICQ to AntiBots Send a message via MSN to AntiBots Send a message via Skype™ to AntiBots