Help! Trying to use KOLMafia from work - Proxy+Firewall?

Hi everybody,

Lately, I've been trying to find a way to use Mafia from work, since it's the place I usually play from. When I get home from the office (after a not-so-short commute, even) I'm not mentally fresh enough to play decently, and I end up making stupid mistakes.

Anyway, to get to the point... The security in my workplace is pretty tight, and I must admit I have no idea about WHAT is exactly up. I know for a fact there's a proxy, which uses an automatic proxy configuration script. Also, the proxy requires an username and password to allow web access. Furthermore, even with username and password, I think there's a firewall (or, at any rate, most ports aren't open). When I click on a forum link, it tries to open forums.kingdomofloathing.com:8080, and it doesn't work. If I remove the :8080 part, it lets me open the website.

I admit I lack the necessary knowledge to know exactly what "defenses" are in place here, but Mafia won't let me connect. I tried opening the proxy configuration script and set up Mafia with the proxy settings, but still it won't connect. I also setup the Java console to point to the autoconfig script.

I tried to connect both with the "use a proxy to connect" checkbox on and off. If it's on, the program tries to connect to all the servers in a rapid sequence (<1 sec) and then gives me back control of the login window. With the setting disabled, it tries to contact a server for a while (~10 sec?), eventually tries them all and again gives me back control of the login window.

At this point, I don't know what else to do, and I ask for your help. I'll monitor this post frequently, so I can provide whatever information is needed. Thanks in advance to everyone who'll answer.
 

Winterbay

Active member
What I did was to go to the proxy-settings in my web-browser and copy all settings I could find that looked similar to what Mafia wanted and that seems to have worked...
 
The browser gets the settings from a proxy.pac script, which I've opened in Notepad and whose settings I have used to configure Mafia. Alas, it doesn't work.
 

mredge73

Member
I like to experiment with the connection settings on mafia.
The only way I can connect at work is through www7 and with all boxes checked on the connections settings.
Websence seems to let that one pass through, not sure why.
I still don't have access to the KOL image server but that only affects the relay browser.
Good Luck.
 
The weirdest thing ever is that connecting to KOL from work through the browser works perfectly fine, but no amount of tinkering with the Mafia settings will allow me to connect. I've tried pretty much every settings combination so far.

Edit: Is there any way to have a log of what Mafia tries to do when connecting?
 
Sorry to insist, but I'd really like to use Mafia from work. Most of the times I don't have the time to keep following the game regularly, and the help Mafia provides is invaluable. Can anyone help me? :(
 

fronobulax

Developer
Staff member
You're not being ignored. It's just that we have (almost) run out of ideas.

However, it occurs to me that the problem might not be the proxy as much as your local computer. If a Windows box is locked down, for example, Java is often not allowed to connect to the internet because of Windows firewall settings. I'd have to know a lot more about your infrastructure to determine that but if you think it is a possibility maybe we could find some other Java to test with. If the other program cannot connect then the problem is probably not mafia's proxy settings.
 
That may be a possibility. At least it would give us (if I may be so bold as to suppose you'll keep helping me, for which I'd be very grateful ^_^) some more empirical evidence on what's wrong... Which other Java program could I try to use?
 

fronobulax

Developer
Staff member
I went here and right clicked on the executable jar link and downloaded JMap.jar. I then launched it, entered kingdomofloathig.com as the Hostname and pressed scan. I got a progress bar and about 5 minutes later it told me
kingdomofloathing.com(69.16.150.196)
22 tcp ssh OPEN
25 tcp smtp DROPPED
80 tcp www OPEN
110 tcp pop3 OPEN
135 tcp loc-srv DROPPED
137 tcp netbios-ns DROPPED
138 tcp netbios-dgm DROPPED
139 tcp netbios-ssn DROPPED
443 tcp https OPEN
445 tcp microsoft-ds DROPPED

199 Ports Scanned
4 ports open
6 ports dropped
189 ports closed

That means I connected to the internet and scanned a bunch of ports. If it is Java that is not allowed to connect then I would have expected an error or 199 ports scanned and none open. I did virus scan the jar file and there was no sign that it was trying anything malicious but remember that you are downloading a jar file from a complete stranger at the suggestion of another one. Obviously that doesn't bother me, but I figured I'd mention it. Also if your workplace has an acceptable use policy for computing you may want to make sure that downloading a jar file and running it is not a violation. It is a violation you have already committed by trying to run KoLmafia but I have been at places where doing that would get me fired with no opportunity to appeal.

In any event running JMap should help us figure out where the problem might be.
 
Ok, I finally tried this (sorry, was sick for a while). Results are:

199 Ports Scanned
2 ports open
197 ports dropped
0 ports closed

Only ports 80 and 8080 register as open. What could this mean?
 

Winterbay

Active member
Interestingly enough I can get through just fine but I only get one port open:
Code:
	21	tcp	UNKNOWN	OPEN

2048	Ports Scanned (scanned UDP as well)
1	ports open
0	ports dropped
2047	ports closed

That said, I didn't find a way in the program to set proxy-information so that might be the problem.
Also: Now I want to know why the FTP-port is open on my work computer (and nothing else)...
 

fronobulax

Developer
Staff member
Since the hypothesis was that a firewall was blocking java, it seems to me that the fact that some ports are open suggests that Java is not being blocked. This, in turn, suggests that I am clueless as to what to try next.
 
Isn't there a way to have a verbose log of what Mafia tries to do while connecting? That might give us a bit more insight, after all the proxy settings specify port 8080, which JMap reported as being one of the two open ones. I don't have extensive or in-depth knowledge about networks, but I, too, fail to see what the cause might be.
 

slyz

Developer
If you uncheck Auto-Login from the start-up window, you can start a debug log (Help -> Start Debug Log) before trying to log in. I never tried using a proxy server though, so I don't know if information about that will be logged.
 
That's exactly what I was looking for. Stupid me, how could I not notice? :)

Thanks, slyz, I'll try it up as soon as I have a second and check whether this can help in pinpointing the problem. In the meantime, I'd like to thank everybody who helped so far, I really appreciate it :)
 
Validating login server (www.kingdomofloathing.com)...
class net.sourceforge.kolmafia.request.LoginRequest
Connecting to game.php...

Requesting: http://www.kingdomofloathing.com/game.php
1 request properties

Field: User-Agent = [KoLmafia v14.2]

Retrieving server reply...
Time out during response (game.php).
Choosing new login server (www7.kingdomofloathing.com)...
Connecting to game.php...

This is what I keep getting from the KolMafia log. I seriously don't know how to make this work, I'm on the verge of giving up...
 

asturia

Minion
Do what I do:
I have a ssh server and proxy at home.
I use putty to connect to my pc at home.
Then I configured putty to redirect all traffic on one port to a certain port at home.
On that port at home, I configured the proxy server.
Now I only need to enter in Kolmafia the ipaddress (127.0.0.1) and port.

This works like magic.
People at work can not see what you are doing, since all traffic in the ssh connection is encrypted.

Not that I need to hide anything, since I'm the sysem admin.
I just do it because I can.
 
I am sorry, but I fail to understand exactly. Please let me understand. We're talking about 2 computers, work and home.

Home has ssh server and proxy.
Work has Putty.

This is where I get lost. Could you explain it a bit more in detail? I have a machine I could run a proxy and ssh server 24/7 on. I am not knowledgeable enough to do that yet, but there are many manuals on the net. Which steps should I take, both on my home and work computer?

Thanks a lot in advance.
 
Top