How Ban/Filter IP Addresses + Secure your MuToolz

Results 1 to 16 of 16
  1. #1
    Account Upgraded | Title Enabled! LifeStealer is offline
    MemberRank
    May 2006 Join Date
    int main()Location
    411Posts

    How Ban/Filter IP Addresses + Secure your MuToolz

    Ok first of all this has nothing to do with SERVER security...It is only for MuToolz security!!

    Have problems with MuToolz hacking?You did anything to prevent hackers and they are still find your password(s)?

    There's still be another way to prevent it!Yea let's get to work guys
    :)


    This works with all versions of MuToolz!

    Main Code
    *Paste the code given below in mutoolz.tpl.php right below the <?PHP
    *What it does?It checks the IP coming to view the site and check if it is going to be banned or accepted, then logged to a file log.. in the tmp folder.

    *
    Quote Originally Posted by LifeStealer

    function ip_check($accept_ip,$type) {
    $getip = $_SERVER["REMOTE_ADDR"];
    $getdate = date( "l dS of F Y" );
    $gettime = date( "h:i:sa (@B" );
    foreach($accept_ip as $accept) {
    $ip = $_SERVER['REMOTE_ADDR'];
    if($ip == $accept) {
    $accepted = true;
    **
    **
    if ($accepted == true) {
    $fp = fopen("tmp/ip_".$type.".txt", "a");
    fputs($fp, "**".$type."** Visit logged on $getdate at $gettime internet time) for IP: $getip\\n");
    fputs($fp, "");
    fclose($fp);
    return true;
    **
    **
    ALLOWING AN IP ADDRESS

    On every file in the modules folder is a modules that is used by mutoolz, u can just add this codes right below the <?PHP mark to accept an IP address...In this case we need to add it in modules/admin/index.php

    Easy... just copy $ip[] = 'xx.xx.xx.xx'; replace the xx.xx.xx.xx with a real ip address. u can have as many ip as u want.

    next.. the actual accept code:


    Quote Originally Posted by LifeStealer

    if (ip_check($ip,'accepted') != true) { exit(); **
    Final should look like this...

    Quote Originally Posted by LifeStealer

    $ip = array();
    $ip[] = '85.100.23.00';
    $ip[] = '125.112.23.64';
    if (ip_check($ip,'accepted') != true) { exit(); **
    So you can the final code and you put it in modules/admin/index.php (copy and add it in the top of the index.php file) , so you can add any IP's and you are absolutely responsible for the IP you gave as accepted...for 100% secured you can give your server's IP or some IP that you know you will be the only that will have access from there ;)
    OK YOU ARE NOW READY :)

    BANNING THE IP INSTEAD OF ACCEPTING:

    Actually it is almost the same...(You must do the first step also)
    Just replace the


    Quote Originally Posted by LifeStealer
    if (ip_check($ip,'accepted') != true) { exit(); **
    with

    Quote Originally Posted by LifeStealer
    if (ip_check($ip,'ban') == true) { exit(); **
    And...it should look like this:

    Quote Originally Posted by LifeStealer

    $ip = array();
    $ip[] = '85.100.23.00';
    $ip[] = '125.112.23.64';
    if (ip_check($ip,'accepted') != true) { exit(); **

    Pretty easy right?

    Now to customize your banning script...

    Some people don't like the exit(); due it just causes a white screen.
    so how about redirecting them to another page... something like the main page.. or google... or watever the suits ur fancy...

    here is how..


    just replace exit();

    with

    Quote Originally Posted by LifeStealer
    header("LOCATION: http://website.com/");
    WE ARE DONE! :)

    Cool Things Right?
    This Guide will help you stop that damn hackers once and for all...you just have to follow my instructions and be sure of the IP's you give as acceptable ;)

    Any questions post them here...



    Credits: LifeStealer


  2. #2
    Web developer AnHiMiLaToR is offline
    MemberRank
    May 2005 Join Date
    BulgariaLocation
    492Posts
    lol ! awesome !

  3. #3
    Honda Specialist Xurbus is offline
    MemberRank
    Jul 2004 Join Date
    Oakville ONLocation
    5,915Posts
    wow thanks i really need that

  4. #4
    Account Upgraded | Title Enabled! RedMG is offline
    MemberRank
    Feb 2006 Join Date
    Viêòt NamLocation
    749Posts
    Thx man, we need it for our private server. Wait for your next posts ! ^_^

  5. #5
    Enthusiast CALYSTO is offline
    MemberRank
    Jan 2005 Join Date
    ARGENTINALocation
    43Posts
    Mmmm i understand, all this is security for control admin panel?

  6. #6
    Account Upgraded | Title Enabled! IAmMe is offline
    MemberRank
    May 2005 Join Date
    MarsLocation
    548Posts
    Naw, that wont stop hackers. -_- this wont stop them from hacking.

  7. #7
    Apprentice clearity_stone is offline
    MemberRank
    Aug 2004 Join Date
    Beside YouLocation
    16Posts
    Hi Life Stealer

    Thank for your intesting codes.
    Firstly, I have tried to seach for mutoolz.tpl.php but could not find it.
    Secondly, when I paste your second code to modules/admin/index.php right under <?php. It give me and error eventhough I have replace my real IP in place of your sample.
    I would be grateful if you could help me to resolve the problem.

    Thanks a lot

  8. #8
    Apprentice clearity_stone is offline
    MemberRank
    Aug 2004 Join Date
    Beside YouLocation
    16Posts
    Sorry for noob question.. but where is mutoolz.tpl.php ... Plz help.. thx alot

  9. #9
    Novice vazzius is offline
    MemberRank
    Sep 2004 Join Date
    BrazilLocation
    4Posts
    Just a question, this mutoolz is a page to manage MU right?

    If it is you can use .htaccess of the apache web server to do the job of ip filter...

    But really nice work man!!

  10. #10
    Apprentice Biggspeed is offline
    MemberRank
    Mar 2006 Join Date
    7Posts

    doesn't work

    Doesn't work for me it just says unrecognized characters?

  11. #11
    Account Upgraded | Title Enabled! HELL_IN_HEAVEN is offline
    MemberRank
    Apr 2006 Join Date
    BORACAY, PHILIPPINESLocation
    530Posts
    you mean i have to manually place all the ip that i need to accept to play?hacker can use diff ip'S. pls enlighten me about this..

  12. #12
    Member masternetpro is offline
    MemberRank
    Apr 2006 Join Date
    Dia nguc tran gianLocation
    52Posts
    make how? in asp web , it action the same. you guide me.

  13. #13
    Alpha Member john_d is offline
    MemberRank
    Feb 2004 Join Date
    PhilippinesLocation
    2,868Posts
    did something similar a long time ago... date... 11-20-2005
    Quick IP BANNER!!!

    Files to Edit: 2 ( config.php and headers.php )

    config.php edit

    PHP Code:
    add above ?>
    $config['banned'] = 'IP_HERE';
    headers.php edit
    PHP Code:
    add above if (!isset($DONT_LOAD_DB)) {
    #ip ban addon
    $banlist = preg_split('/ /', $config['banned'], -1,PREG_SPLIT_NO_EMPTY);
    if (in_array($_SERVER['REMOTE_ADDR'],$banlist)) {
    Header("LOCATION: http://yahoo.com");
    **
    #end of ip ban addon

    IP_HERE = u can change it to a list of ips.. just separate each one with a SPACE ( sample $config['banned'] = '123.132.0.2 215.225.224.3'; )

  14. #14
    Apprentice CreationT is offline
    MemberRank
    Nov 2006 Join Date
    21Posts
    Oh,ok thank you for your help..

  15. #15
    Account Upgraded | Title Enabled! LifeStealer is offline
    MemberRank
    May 2006 Join Date
    int main()Location
    411Posts

    Re: [Guide] How Ban/Filter IP Addresses + Secure your MuToolz

    Quote Originally Posted by HELL_IN_HEAVEN View Post
    you mean i have to manually place all the ip that i need to accept to play?hacker can use diff ip'S. pls enlighten me about this..
    Everything is possible, you can even ban a range of IP's to get rid of it.

  16. #16
    Valued Member forgetpass is offline
    MemberRank
    Oct 2004 Join Date
    104Posts

    Re: [Guide] How Ban/Filter IP Addresses + Secure your MuToolz

    Nice work. However, if you know the fopen command sometimes may lead to a remote include attack.



Advertisement