Welcome, Register for free! or Login below:
EduGeek.net RSS Feeds Register FAQ Members Social Groups User Map Calendar Search Today's Posts Mark Forums Read

Go Back   EduGeek.net Forums > Coding and Web Development > Coding
Reply
 
LinkBack Thread Tools Search Thread Language
Sponsored Links
Old 26-06-2008, 10:16 PM   #1
 
Warren-Plus's Avatar
 
Join Date: Nov 2007
Posts: 51
Thanks: 8
Thanked 0 Times in 0 Posts
Rep Power: 0 Warren-Plus has a little shameless behaviour in the past
Send a message via MSN to Warren-Plus
Exclamation Java Attacks Can I Reverse The Effect ?

Hi. I have a game server which is written in Java.

One problem, someone released a program which can be used on games like mine to crash them.

Basically it logs in hundreds of accounts using the name SYIPkpker(random letter)

This is getting really annoying as ive been attacked twice in the last 2 days so i was wondering is there a way i could make a If statement so if the name began with SYI it would block the connection and send it back ?

P.S. Im quite new to java

Thanks for your help

Brendan
  Reply With Quote
Old 27-06-2008, 12:09 AM   #2
 
dhicks's Avatar
 
Join Date: Aug 2005
Location: Alton, Hampshire
Posts: 1,427
Thanks: 124
Thanked 93 Times in 88 Posts
Rep Power: 28 dhicks is a name known to alldhicks is a name known to alldhicks is a name known to alldhicks is a name known to alldhicks is a name known to alldhicks is a name known to all
Default

Quote:
Originally Posted by Warren-Plus View Post
i was wondering is there a way i could make a If statement so if the name began with SYI it would block the connection and send it back?
I don't know the details of the software you are running, but it sounds like somewhere you should find a bit of code that reads in the username from the user (probably something reading a variable in from an HTML GET or POST request). You need to check this String to see if it begins with "SYI". You could use one of the methods of the String class to do this:

String (Java 2 Platform SE v1.4.2)

Or use regular expressions:

Lesson: Regular Expressions (The Java™ Tutorials > Essential Classes)

Is this your first go at programming? You might find it a little tricky to wade right in with trying to fix someone else's code, you might want to write a bit of your own code first to get the idea of what you're doing.

--
David Hicks
  Reply With Quote
Old 27-06-2008, 08:18 AM   #3
 
el8linuxel8's Avatar
 
Join Date: Nov 2007
Location: Preston
Posts: 98
uk
Thanks: 2
Thanked 4 Times in 4 Posts
Rep Power: 3 el8linuxel8 is on a distinguished road
Default

Id just drop the IP via a htaccess for iptables (if you have root). You could even filter GET/POST via htaccess.
  Reply With Quote
Old 27-06-2008, 03:54 PM   #4
 
Warren-Plus's Avatar
 
Join Date: Nov 2007
Posts: 51
Thanks: 8
Thanked 0 Times in 0 Posts
Rep Power: 0 Warren-Plus has a little shameless behaviour in the past
Send a message via MSN to Warren-Plus
Default

Umm thats all confusing to me.

It is someone elses code but i have added things to it and edited others etc.

Its basically just lots of .class files with a few other folders to store information on all characters.

Its run using command prompt. A sample of the code can be downloaded here:

http://www.brenzscape.co.uk/Server/client.java

This is the main .class file in its Java form.

Plz Help

Thnx Brendan
  Reply With Quote
Old 27-06-2008, 05:16 PM   #5
 
dhicks's Avatar
 
Join Date: Aug 2005
Location: Alton, Hampshire
Posts: 1,427
Thanks: 124
Thanked 93 Times in 88 Posts
Rep Power: 28 dhicks is a name known to alldhicks is a name known to alldhicks is a name known to alldhicks is a name known to alldhicks is a name known to alldhicks is a name known to all
Default

Quote:
Originally Posted by Warren-Plus View Post
Umm thats all confusing to me.
Well, yes, hence you need to go and learn more about games servers / general networking / Java / general programming! There's probably a forum somewhere dedicated to the piece of software you're using to run your server, would that have details of available patches or additions to the software? If not, you'll need to write one yourself.

Quote:
It is someone elses code but i have added things to it and edited others etc.
Sounds like a good start, but you might find it beneficial to try creating a couple of your own simple programs so you get the ideas behind what you're doing.

Quote:
Its run using command prompt.
Is this thing web-based? Does the program implement its own web server, or is it a servlet installed on a web server?

--
David Hicks
  Reply With Quote
Old 27-06-2008, 11:15 PM   #6
 
Warren-Plus's Avatar
 
Join Date: Nov 2007
Posts: 51
Thanks: 8
Thanked 0 Times in 0 Posts
Rep Power: 0 Warren-Plus has a little shameless behaviour in the past
Send a message via MSN to Warren-Plus
Default

Its just run from my home machine.

Players access the game using our downloadable client or a webclient like the one on moparscape.org

Brendan
  Reply With Quote
Old 29-06-2008, 01:03 AM   #7
 
dhicks's Avatar
 
Join Date: Aug 2005
Location: Alton, Hampshire
Posts: 1,427
Thanks: 124
Thanked 93 Times in 88 Posts
Rep Power: 28 dhicks is a name known to alldhicks is a name known to alldhicks is a name known to alldhicks is a name known to alldhicks is a name known to alldhicks is a name known to all
Default

Quote:
Originally Posted by Warren-Plus View Post
Its just run from my home machine.
As its own web server, or as part of another web server?

Quote:
Players access the game using our downloadable client or a webclient like the one on moparscape.org
If someone else has written a fix for the software you are using then you need to find it and install it - a dedicated forum will probably be the best place to find something like that. Otherwise, you need to write a fix yourself. If you don't know how to do this then you need to learn.

--
David Hicks
  Reply With Quote
Old 30-06-2008, 01:39 PM   #8
 
OutToLunch's Avatar
 
Join Date: Feb 2006
Posts: 682
Thanks: 21
Thanked 50 Times in 43 Posts
Rep Power: 18 OutToLunch is a jewel in the roughOutToLunch is a jewel in the roughOutToLunch is a jewel in the roughOutToLunch is a jewel in the rough
Default

Quote:
Originally Posted by Warren-Plus View Post
If statement so if the name began with SYI it would block the connection and send it back ?
Why would you send it back? That's similar to the old 'antispam' tools that claimed to be beneficial by bouncing back your spam. You just use more of your own bandwidth to do this - double that of what it would take to just detect the nickname and close the connection. This would be a lot more useful especially if you're hosting on a home connection.

To patch it, if someone else hasn't already, you'd need to search the java code for the nickname registration section, add a string comparison to find the SYI starting point of the nickname and simply exit the routine cleanly.
  Reply With Quote
Old 30-06-2008, 02:14 PM   #9
 
el8linuxel8's Avatar
 
Join Date: Nov 2007
Location: Preston
Posts: 98
uk
Thanks: 2
Thanked 4 Times in 4 Posts
Rep Power: 3 el8linuxel8 is on a distinguished road
Default

If you can access apachce/IIS logs paste the "attackers" IP and GET requests.

easy way to generate a htaccess for you: .HTACCESS IP, Referrer, and Hotlink Banning Generator
  Reply With Quote
Reply

Register now for FREE and post messages!


Username: Password: Confirm Password: E-Mail: Confirm E-Mail:
Birthday:      
Image Verification
  I agree to forum rules 

Similar Threads
Thread Thread Starter Forum Replies Last Post
[News] 'Sex pest' seal attacks penguin ZeroHour Jokes/Interweb Things 2 02-05-2008 05:48 PM
One quick trick prevents AutoRun attacks ChrisP Windows 0 29-11-2007 12:04 PM
Funky desktop effect, how? Dos_Box Windows Vista 20 13-02-2007 01:51 PM
Spam attacks mark *nix 5 15-12-2006 07:21 PM
Phone effect in Audacity? dagza Educational Software 4 03-11-2005 06:50 PM



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search Thread
Search Thread:

Advanced Search

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
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT +1. The time now is 02:18 AM.
Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 ©2008, Crawlability, Inc.
Copyright EduGeek.net