These are chat archives for Nithmr/ProxyHelper

4th
Jun 2016
Akarshit Wal
@Akarshit
Jun 04 2016 06:07
OK I will try to explain what I had in my mind.
Proxyhelper is supposed to solve most of the problems that students of NITH(or any other college) face because of proxy.
Now there are many problems and we are going to all one by one. If we make separate applications to solve each problem that means the user would have to run all of them. But we both know that people are too lazy to do that. So we will be making a single script to solve them all.
Now we are prioritizing the problems so the most imp. one was to select the best proxy. Next one which I feel is the most imp. is keeping the tor connection alive.
Utkarsh Raj
@clearnote01
Jun 04 2016 06:10
I think I understand... It looks pretty cool, it's kinda things that should have been already made but people were too lazy...
But that tor thing will create some issues... it does't support ICMP and I don't have in-depth konwledge of how tor works
can you elaborate onn how you think we can implement this?
Akarshit Wal
@Akarshit
Jun 04 2016 06:14
Now about the Tor. Tor uses a chain of computers to make a connection so if any one of them closes the connection because of inactivity, the whole chain breaks.
So what we are going to do is
  • Detect through which port Tor is connected(we might ask this from the user in the installation script)
  • Snoop packets going through that port and if there is no packet sent within a specified time interval send a packet to say bing(google will block us after sometime)
  • The script will run all the time
  • If the connection has been lost(no activity for a threshold time interval) stop the script from sending packets.
What I suggest you to do is read about how Tor works. Spend a day or two(it is really cool). And then you would be easily able to see how things could be done.
PS. I haven't read how Tor works too. So if you find a good and detailed link post it here.
And yes your suggestion are more than welcome.
Utkarsh Raj
@clearnote01
Jun 04 2016 06:22
Shouldn't TCP work simply through SOCKS5 proxy?
I thinks it's fairly easy if we use socks. 127.0.0.1:9150
I just need to create a python script which simulates ICMP ping in someway....
should not that hard
*not be
Akarshit Wal
@Akarshit
Jun 04 2016 06:24
OK cool but I think there will be more to it than we are seeing right now. But lets start the work and see where it goes.
Do you want me to open issues that breakdown the task? Or is #9 covering it all?
Utkarsh Raj
@clearnote01
Jun 04 2016 06:25
Yeah, I don't think either, but let's try anyway
I think it is enough
Akarshit Wal
@Akarshit
Jun 04 2016 06:26
OK cool GTG. TTYL
Utkarsh Raj
@clearnote01
Jun 04 2016 06:26
However, ProxyHelper(the current one) should work through tor as well, I think that warrants a new issue
maybe
Akarshit Wal
@Akarshit
Jun 04 2016 06:30
Can you expain what you mean by
work through TOr
Utkarsh Raj
@clearnote01
Jun 04 2016 08:30
I mean, if the system is connected through(/with/in, i think you understand what I mean) tor, ProxyHelper cannot do its function, which is setting the best proxy for the system via pinging multiple proxies(since ping doesn't work with tor connection)
So a new ping needs to created which works via SOCKS5 and simulate the same behaviour. This is actually perfectly in sync with the earlier idea... send packets continuously to maintain connection,etc
Creating a ping which works through SOCKS5 basically solves both issues.
Akshendra Pratap Singh
@akshendra
Jun 04 2016 08:34
Can we not use use proxychains or torsocks to ping through tor?
Utkarsh Raj
@clearnote01
Jun 04 2016 08:42
does it work with ping?
I don't have a lot of experience with tor, but if it works then that's great. However, I still think external dependencies are annoying and if we could do everything in pure python/bash it would have been best.
pure aka 'with built-in interfaces'
Utkarsh Raj
@clearnote01
Jun 04 2016 08:57
Umm... I don't even know how to connect tor via command line i/f. Can somebody help with that?
I'll be testing torsocks now... if it works then there would simplify everything
Utkarsh Raj
@clearnote01
Jun 04 2016 09:19
@Akarshit Actually ignore everything I said at 14:00 I really had forgotten all about tor... there is no need for ProxyHelper to work through tor Just ignore everything I said lol
Akshendra Pratap Singh
@akshendra
Jun 04 2016 09:47
You have to install tor with apt-get, add proxy to /etc/torrc, and start the tor service. It runs as a dameon.
You can check it's log in /var/logs/tor/
Utkarsh Raj
@clearnote01
Jun 04 2016 09:47
how do I start it?
Akshendra Pratap Singh
@akshendra
Jun 04 2016 09:49
sudo service tor restart or sudo service tor reload, as it starts with the system login
And yes the port will be 9050
Utkarsh Raj
@clearnote01
Jun 04 2016 09:54
kk, thnx!
ERROR: ping is setuid. torsocks will not work on a setuid executable.
torsocks doesn't work afterall.... that really sucks
Akarshit Wal
@Akarshit
Jun 04 2016 10:36
Tor doesn't support ICMP(i think). So may be we can use any API of any website or perhaps use websockets.
Akshendra Pratap Singh
@akshendra
Jun 04 2016 10:37
SOCKS5 doesn't support ICMP
And so does tor
Also I am not sure about the reason, why tor disconnects, is it inactivity or something else?
Utkarsh Raj
@clearnote01
Jun 04 2016 10:39
Yeah, so we need some kind of interface which simulates ping operation through socks, should be possible imo
Akshendra Pratap Singh
@akshendra
Jun 04 2016 10:40
Yep, but what actually do you mean by simulating
Ping
Utkarsh Raj
@clearnote01
Jun 04 2016 10:41
I am not sure myself, but kinda like create packets of data(64K/16K) and send it to DN via socks with some interval
Also receive packets in some form. I don't really know how, but it should be possible
Akshendra Pratap Singh
@akshendra
Jun 04 2016 10:43
But for that the DNS server should understand your message
Utkarsh Raj
@clearnote01
Jun 04 2016 10:43
Yeah... there must be an API for something like this
or... we could create one and host it somewhere
Akshendra Pratap Singh
@akshendra
Jun 04 2016 10:46
Yes that can be a solution, but it's gonna take some time to implement
Utkarsh Raj
@clearnote01
Jun 04 2016 10:47
Yeah... it looks like a lot of work
Especially since my knowledge of socket level prog is very very basic
But should be possible to work out
Akarshit Wal
@Akarshit
Jun 04 2016 10:48
Can't we just send requests to bing.com?
Utkarsh Raj
@clearnote01
Jun 04 2016 10:49
It has to be through SOCKS5 proxy
9050 port
Akshendra Pratap Singh
@akshendra
Jun 04 2016 10:49
Sending request will be easier
Utkarsh Raj
@clearnote01
Jun 04 2016 10:49
I don't thinks python modules requests or urllib support this
Akshendra Pratap Singh
@akshendra
Jun 04 2016 10:50
Through socks is not a problem, if they don't support socks we could use polipo or privoxy to have an http proxy
Utkarsh Raj
@clearnote01
Jun 04 2016 10:51
Well again I don't like the idea of relying on an external interface... it kinda complicates everythin
If we could do everything with built-in things that would have been best imp
*imo
Akarshit Wal
@Akarshit
Jun 04 2016 10:52
Yes @clearnote01 has a point first let us try to use the python lib. If no option is left then we can rely on polipo or privoxy
Request support socks, so there is no problem
Utkarsh Raj
@clearnote01
Jun 04 2016 10:55
Yeah I just saw that too
Apparently they added it just last year... 30th December 2015
It simplies things quite a bit.
Akarshit Wal
@Akarshit
Jun 04 2016 10:56
I read some other answer too. Sending the links
Utkarsh Raj
@clearnote01
Jun 04 2016 10:57
Yeah... so it looks possible
What about the API? Should we create one and host it
Akarshit Wal
@Akarshit
Jun 04 2016 10:58
I think bing would be fine.
Akshendra Pratap Singh
@akshendra
Jun 04 2016 10:59
That is not really needed and would require a lot of effort and time.
Utkarsh Raj
@clearnote01
Jun 04 2016 10:59
okay
Akshendra Pratap Singh
@akshendra
Jun 04 2016 10:59
Instead of bing maybe use some light website, with less data
Utkarsh Raj
@clearnote01
Jun 04 2016 10:59
so we just send a GET req at some interval to a DNS
that's is the plan?
Akshendra Pratap Singh
@akshendra
Jun 04 2016 11:00
Yep
Interval of a minute will be just fine
Akarshit Wal
@Akarshit
Jun 04 2016 11:02
Yes initially this. Then maybe later we will send the packet only if there are no packets already being sent.
Utkarsh Raj
@clearnote01
Jun 04 2016 11:02
seems pretty neat, i was thinking more on a socket level, so we could have created a connections and used it to packet transmission....
but hopefully this should work as well since the interval is pretty large
Akarshit Wal
@Akarshit
Jun 04 2016 11:04
Take the easy way whenever possible.
For now the first task is send a packet of some size at a interval of 60sec through a specified port using socks5.
Cool?
Utkarsh Raj
@clearnote01
Jun 04 2016 11:05
yeah
Akshendra Pratap Singh
@akshendra
Jun 04 2016 11:06
It looks like a python module for controlling tor
Utkarsh Raj
@clearnote01
Jun 04 2016 11:27
Yeah, it should work pretty well. Built-in would have been better but this is the simplest solution
BTW, how can we close a tor connection??
I did sudo service tor stop but I think it hasn't stopped
Akshendra Pratap Singh
@akshendra
Jun 04 2016 11:33
It should stop, check with ps -ef
manishvishnoi2
@manishvishnoi2
Jun 04 2016 13:21
This message was deleted
Utkarsh Raj
@clearnote01
Jun 04 2016 14:18
On closer inspection stem is not built for our purpose. I will be trying out requests