Raised This Month: $12 Target: $400
 3% 

[iMacros Script] Ban a users steam friends for good measure


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MoggieX
Veteran Member
Join Date: Aug 2007
Location: n00bville
Old 07-20-2009 , 21:36   [iMacros Script] Ban a users steam friends for good measure
Reply With Quote #1

Howdy,

I'm perfectly aware I may get flamed to the ground for posting this. However I've found that idiots attract idiots and if we discover one, we'll not only ban them, but we'll take their steam friends and ban them as well for good measure.

The attached is a iMacros JavaScript file that will scroll through a steam friends page and convert names and community ID's to steam ID's and put them into a text file for external processing.

Requirements:
iMacros - http://www.iopus.com/download/ (which is Free, tested using FireFox version!)

Instructions
1. Place the SteamFriendsToBan.js in your iMacros folder (normally C:\Documents and Settings\USER\My Documents\iMacros\Macros)

2. Open the attached JS file, alter the following to your own liking and save
- SteamFriendsURL
- NumberOfFriends

3. Run the file, within a few moments a file at C:\\SteamFriendsToBan.txt will be created with a list of steam ID's for external use

TIP: http://wiki.imacros.net/iMacros_for_...ting_Interface

By default each Javascript step is shown during replay. This option is useful for testing and debugging, but it slows down the Javascript execution artificially. To run Javascript at its normal (very fast) speed please uncheck this option.


Code:
PHP Code:
//////////////////////////////////////////////////////////
// 
//    iMacros ban their friends for good measure script
//    
//    After the fiel has been run, check the text file at:
//    C:\\SteamFriendsToBan.txt
//
//////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////
//    Configurable Section
//////////////////////////////////////////////////////////
var SteamFriendsURL     "http://steamcommunity.com/profiles/76561197961403283/friends"
// Example: http://steamcommunity.com/profiles/76561197961403283/friends
var NumberOfFriends        20        
// Number of times to repeat, put 255 if unsure, it will take longer and most likely give errors, but thats the max steam friends a single player can have 

//////////////////////////////////////////////////////////
//    vars Leave these ones ALONE!
//////////////////////////////////////////////////////////
var i=0;                              // For cycling
var JSNewLine="\n";                   // new Line
var MyMacroCode;                     // For running the code
var MyMacroCode2;                     // For running the code2
var LoopCounter 1;                // Used to loop
var DeBug=0;                         // Added for debugging, set to 0 to turn off
var CheckExtract;                    // Var to dump extract in
var CommunityID;                    // var to dump community ID in
var CommunityXML;                    // To Hold XML

//////////////////////////////////////////////////////////
//    Main Function
//////////////////////////////////////////////////////////
for (0NumberOfFriends++ )
{
    
// Reset vars
    
MyMacroCode        "";
    
MyMacroCode2    "";
    
CheckExtract    "";
    
CommunityID        "";
    
SteamID            "";
    
CommunityXML    "";
  
    
// Build the macro
       
MyMacroCode "CODE:"
       
MyMacroCode MyMacroCode "TAB T=1" JSNewLine
    MyMacroCode 
MyMacroCode "SET !VAR1 !EXTRACT" JSNewLine
    MyMacroCode 
MyMacroCode "URL GOTO=" SteamFriendsURL JSNewLine
    MyMacroCode 
MyMacroCode "TAG POS=" LoopCounter +"  TYPE=A ATTR=CLASS:linkFriend*&&TXT:*&&HREF:http://steamcommunity.com/* EXTRACT=HREF" JSNewLine
        
    iimPlay
(MyMacroCode)
    
CheckExtract =    iimGetLastExtract()
    
    if (
DeBug == 1)
    {
        
alert("CheckExtract: " CheckExtract);
    }
    
    if (
CheckExtract == "#EANF#")
    {
        
// Now because some use iconHolder_ instead, lets run with the same tag number to make sure we get the bastards
        
MyMacroCode2 "CODE:"
           
MyMacroCode2 MyMacroCode2 "TAB T=1" JSNewLine
        MyMacroCode2 
MyMacroCode2 "SET !VAR1 !EXTRACT" JSNewLine
        MyMacroCode2 
MyMacroCode2 "URL GOTO=" SteamFriendsURL JSNewLine
        MyMacroCode2 
MyMacroCode2 "TAG POS=" LoopCounter +"  TYPE=A ATTR=CLASS:iconHolder_*&&TXT:*&&HREF:http://steamcommunity.com/* EXTRACT=HREF" JSNewLine
        
        iimPlay
(MyMacroCode2)
        
CheckExtract =    iimGetLastExtract()
        if (
DeBug == 1)
        {
            
alert("CheckExtract: " CheckExtract);
        }
    }
    
    
// If its Still #EANF# then bail
    
if (CheckExtract == "#EANF#")
    {
        
alert("EOF");
    }
    else if (
CheckExtract.substr(035) == "http://steamcommunity.com/profiles/")
    {
        
// Normal Profile with Community ID
        
CommunityID     CheckExtract.replace("http://steamcommunity.com/profiles/""");
        if (
DeBug == 1)
        {
                
alert("CommunityID = " CommunityID );
        }
        
// Make that ID into a Steam ID
        
SteamID            convertToID(CommunityID);
        if (
DeBug == 1)
        {
                
alert("The SteamID is: " SteamID);
        }
    }
    else if (
CheckExtract.substr(029) == "http://steamcommunity.com/id/"// http://steamcommunity.com/id/
    
{
        
// This is the awkward one, we need to go hunting in XML
        // Needs to be profile + ?xml=1
        
CommunityXML    =     CheckExtract "?xml=1";
        if (
DeBug == 1)
        {
            
alert(CommunityXML);
        }
        
        
xmlDoc            =    loadXMLDoc(CommunityXML);
        
// Get Community ID
        
CommunityID      =     xmlDoc.getElementsByTagName("steamID64")[0].childNodes[0].nodeValue
        if (
DeBug == 1)
        {
                
alert(CommunityID);
        }
        
// Make that ID into a Steam ID
        
SteamID            =     convertToID(CommunityID);
        if (
DeBug == 1)
        {
                
alert(SteamID);
        }
        
    }
    
    if (
LoopCounter == 1)
    {
        
// Make a pretty header
        
writeToFile("C:\\SteamFriendsToBan.txt","ID, CommunityID, SteamID\r\n");
        
writeToFile("C:\\SteamFriendsToBan.txt","" LoopCounter "," CommunityID "," SteamID "\r\n");
    }
    else
    {
        
writeToFile("C:\\SteamFriendsToBan.txt","" LoopCounter "," CommunityID "," SteamID "\r\n");
    }
    
    
// loop back up
    
LoopCounter LoopCounter 1
}


//////////////////////////////////////////////////////////
//    Convert to Steam ID from Community ID
//////////////////////////////////////////////////////////
function convertToID(CommunityID)
{
    
//CommunityID = CommunityID.replace("http://steamcommunity.com/profiles/", ""); //remove http://steamcommunity.com/profiles/
    
var strlen(CommunityID);
    var 
CommunityID.substr(10);
    var 
CommunityID.substr(11);
    var 
AuthID;
    if (
2)
    {
        
AuthID 1;
    }
    else
    {
        
AuthID 0;
    }    
    var 
UserID = (7960265728 AuthID) / 2;
    
SteamID "STEAM_0:" AuthID ":" UserID;
    return 
SteamID;
}
//////////////////////////////////////////////////////////
//    strlen function as JS does not have it
//////////////////////////////////////////////////////////
function strlen(strVar)
{
    return(
strVar.length)
}

//////////////////////////////////////////////////////////
//    XML Function
//////////////////////////////////////////////////////////
function loadXMLDoc(dname
{
    var 
xmlDoc;
    if (
window.XMLHttpRequest)
    {
    
xmlDoc=new window.XMLHttpRequest();
    
xmlDoc.open("GET",dname,false);
    
xmlDoc.send("");
    return 
xmlDoc.responseXML;
    }
    
// IE 5 and IE 6
    
else if (ActiveXObject("Microsoft.XMLDOM"))
    {
    
xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
    
xmlDoc.async=false;
    
xmlDoc.load(dname);
    return 
xmlDoc;
    }
    
    
alert("Error loading document");
    return 
null;
}
//////////////////////////////////////////////////////////
//    File Writing Function
// Code from http://www.captain.at/programming/xul/
// Filename: writeToFile.js
//////////////////////////////////////////////////////////

function writeToFile(filenamedata) {
   try {
      
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
   } catch (
e) {
      
alert("Permission to save file was denied.");
   }
   var 
file Components.classes["@mozilla.org/file/local;1"]
      .
createInstance(Components.interfaces.nsILocalFile);
   
file.initWithPathfilename );
   if ( 
file.exists() == false ) {
      
//alert( "Creating file... " );
      
file.createComponents.interfaces.nsIFile.NORMAL_FILE_TYPE420 );
   }
   var 
outputStream Components.classes["@mozilla.org/network/file-output-stream;1"]
      .
createInstanceComponents.interfaces.nsIFileOutputStream );

   
// Open flags
   
var PR_RDONLY  =     0x01
   
var PR_WRONLY  =     0x02
   
var PR_RDWR    =     0x04
   
var PR_CREATE_FILE 0x08
   
var PR_APPEND  =     0x10
   
var PR_TRUNCATE=     0x20
   
var PR_SYNC    =     0x40
   
var PR_EXCL    =     0x80

   
/*
   ** File modes ....
   **
   ** CAVEAT: 'mode' is currently only applicable on UNIX platforms.
   ** The 'mode' argument may be ignored by PR_Open on other platforms.
   **
   **   00400   Read by owner.
   **   00200   Write by owner.
   **   00100   Execute (search if a directory) by owner.
   **   00040   Read by group.
   **   00020   Write by group.
   **   00010   Execute by group.
   **   00004   Read by others.
   **   00002   Write by others
   **   00001   Execute by others.
   **
   */

   
outputStream.initfilePR_RDWR PR_CREATE_FILE PR_APPEND420);
   var 
result outputStream.writedatadata.length );
   
outputStream.close();

Attached Files
File Type: zip SteamFriendsToBan.zip (2.6 KB, 155 views)
__________________

Last edited by MoggieX; 07-22-2009 at 07:06.
MoggieX is offline
Send a message via Skype™ to MoggieX
TESLA-X4
Senior Member
Join Date: Dec 2008
Location: $Recycle.Bin
Old 07-21-2009 , 03:46   Re: [iMacros Script] Ban a users steam friends for good measure
Reply With Quote #2

Quote:
Originally Posted by MoggieX View Post
However I've found that idiots attract idiots...
Absolutely. This thing sounds epic, I'll probably try it out later when I get home lol
TESLA-X4 is offline
Greyscale
SourceMod Plugin Approver
Join Date: Dec 2007
Location: strYoMommasHouse[you];
Old 07-22-2009 , 02:23   Re: [iMacros Script] Ban a users steam friends for good measure
Reply With Quote #3

*deletes idiots from steam friends*

__________________
Greyscale is offline
Dragonshadow
BANNED
Join Date: Jun 2008
Old 07-22-2009 , 12:51   Re: [iMacros Script] Ban a users steam friends for good measure
Reply With Quote #4

Lol this is cool but at the same time now you'll have people going

"wtf I've never even played on this erver and I'm banned from it ((((((((((("
Dragonshadow is offline
Doggie52
Senior Member
Join Date: Jul 2007
Location: Sweden
Old 07-24-2009 , 05:34   Re: [iMacros Script] Ban a users steam friends for good measure
Reply With Quote #5

I see both positive and a lot of negative aspects of this. Imagine someone getting banned and pulling hundreds of others with them into the ban, causing there to be less players on a server, all because of some ridiculous thought that someone's steam friends reflects that someone's intelligence.
__________________
Quote:
Originally Posted by Iltafragit View Post
4kg ram i5 processor
Doggie52 is offline
MoggieX
Veteran Member
Join Date: Aug 2007
Location: n00bville
Old 07-24-2009 , 05:44   Re: [iMacros Script] Ban a users steam friends for good measure
Reply With Quote #6

Quote:
Originally Posted by Dragonshadow View Post
Lol this is cool but at the same time now you'll have people going

"wtf I've never even played on this erver and I'm banned from it ((((((((((("
Use MySQL Bans or Sourcebans and load them in to the db directly, then you'll know who they are if the moan. We give the same answer to all, no.

Quote:
Originally Posted by Doggie52 View Post
I see both positive and a lot of negative aspects of this. Imagine someone getting banned and pulling hundreds of others with them into the ban, causing there to be less players on a server, all because of some ridiculous thought that someone's steam friends reflects that someone's intelligence.
Yea, banning 64,000 from a public group would be plain silly, banning 97 from group(s) of greifers is not, can't really code common sense when using this ;-)

Matt
__________________
MoggieX is offline
Send a message via Skype™ to MoggieX
NouveauJoueur
SourceMod Donor
Join Date: May 2009
Old 07-24-2009 , 05:48   Re: [iMacros Script] Ban a users steam friends for good measure
Reply With Quote #7

This is a really good tools, could you make the same for steam groups ?
Look at this french group :

http://steamcommunity.com/groups/GsK_steam

They claim to be the best hackers on the earth and that they are tracked by french secret police cause of what they're doing. My servers catched many of those kid trying to use well known things like sv_soundscapeprintdebug(...), timeleft, changelevel (i'm not even running mani admin so it wont work at all anyway) .... They even bought a DoS Attack program for CS:S (they aren't real hackers, so they don't know how to code it).

All of those kid's tell their friends how to exploit server's security hole, so my servers protection catch&ban many of them too, when I convert their steam ID I can see that they have at least one of GSK kids in their friend list ...

And they steal other's account too (not by hacking), because they get VAC ban (best hackers always download free cheats for sure :p)
NouveauJoueur is offline
MoggieX
Veteran Member
Join Date: Aug 2007
Location: n00bville
Old 07-24-2009 , 07:00   Re: [iMacros Script] Ban a users steam friends for good measure
Reply With Quote #8

The aim of this is not to name specific groups, rather just provide a server administrator with a tool that they can use to get this kind of data, primialry for small groups of users, as they tend to be in small groups of "friends".

Now with that group because they only have 22 members, it will work.If you do come across a large-ish group, then change the urls manually.
__________________
MoggieX is offline
Send a message via Skype™ to MoggieX
Doggie52
Senior Member
Join Date: Jul 2007
Location: Sweden
Old 07-24-2009 , 12:29   Re: [iMacros Script] Ban a users steam friends for good measure
Reply With Quote #9

Quote:
Originally Posted by MoggieX View Post
Yea, banning 64,000 from a public group would be plain silly, banning 97 from group(s) of greifers is not, can't really code common sense when using this ;-)
Reminds me of some old quote by one of the early inventors of atomic power (which was later used to create the atomic bombs).

The point is not your intention - which is a good one - but how it can be used. But then again, if someone decides to ban a few million players from their server that leaves more players to us !
__________________
Quote:
Originally Posted by Iltafragit View Post
4kg ram i5 processor
Doggie52 is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 19:29.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode