Author Topic: setup Socks5 proxy over Wifi/3G on your idevice  (Read 981 times)

Markanees

  • Full Member
  • ***
  • Posts: 223
  • Reputation: 15
  • +1 would be appreciated
  • Computers: Dell inspiron 1520
  • iDevices: ipad 2 ios 5.1.1
setup Socks5 proxy over Wifi/3G on your idevice
« on: February 06, 2013, 12:55:58 pm »
ok guys first i give credit in this tutorial to @Cattyhouse
this tutorial will show you how to setup a socks5 proxy from your idevice
first we will need
autamatic ssh
openssh
terminal
ifile
lets start it
Sign up one from webenabled.com, its free
Then, create a site, choose wordpress. After that, go dashboard
You will see your site information, including a shell and password
The password is hidden, you have to click to show it, remember it!
remember these information
1- server: xxx.dev3.webenabled.net (replace xxx with your information from the dashboard )
2- Username w_xxx  (xxx replace with your information from dashboard )
3- Password : very long an complicated ( The password is hidden, you have to click to show it also from dashboard )
they password is long and complicated so we need to make ssh key so we can log in without typing that long password
now go to mobile terminal on your device
type

$ssh-keygen

and hit ENTER to every question it asks
then go to

$cd ~/.ssh

$ls

You see two files (id_rsa, id_rsa.pub)
then type

$chmod 600 *

Then, mv id_rsa.pub authorized_keys
To change to name of .pub file

$mv id_rsa.pub authorized_keys

Now copy the authorized_keys to your server
Use scp to do that, here is the command

$scp authorized_keys w_xxx@xxx.dev3.webenabled.net:~/.ssh/

Now ssh username@server
see if you can log in without password
if you logged in without password that good everythings if fine

now with ifile
go to  /etc/ssh and edit  ssh_config and add this to the end of it


ServerAliveInterval 10
TCPKeepAlive no

and then save it, this step is important

then go to /etc/profile.d
we have file here called coreutils.sh
set alias there by opening it in text and add this to it

alias proxy="autossh -M 0 -Nfq -D 9090 username@server"

save the file and go to mobileterminal again (username@server you know them already change them wth yours )

now we will source /etc/profile.d/coreutils.sh

$source /etc/profile.d/coreutils.sh

ok we are almost done here but we neet to check if the proxy running in background
run in mobile terminal

$proxy

you will see nothing happens thats because the server is in background to see it run


$ps ax |grep ssh

Now you have a socks 5 proxy running at 127.0.0.1:9090

If you want to stop it, just type:
$killall -9 ssh

Then after kill, if you want to start it again, just type:
$proxy

You need to create a pac file
PAC file can be set to wifi/3G to make use of this socks5 proxy

open ifile and blank sheet
add this to it and save ( remember the directory )


function FindProxyForURL(url, host) {

var myproxy = "SOCKS 127.0.0.1:9090;DIRECT";

if (
isPlainHostName(host) ||
shExpMatch(host, "*.local") ||
isInNet(dnsResolve(host), "10.0.0.0", "255.0.0.0") ||
isInNet(dnsResolve(host), "172.16.0.0",  "255.240.0.0") ||
isInNet(dnsResolve(host), "192.168.0.0",  "255.255.0.0") ||
isInNet(dnsResolve(host), "127.0.0.0", "255.255.255.0"))
{
return "DIRECT";
}
return myproxy;

}


now in terminal cd to the directory of the pac file
as root

$chown mobile:mobile xxxx (were xxxx is the name of pac file)
$chmod 777 xxxx (where xxxx is the name of  the pac file)

Now go to wifi settings

Find where to set proxy , choose AUTO
enter the pac file directory
file:///var/root/xxxx (example)(you can change the directory and the file name to whatever you want )

now you are using SOCKS5 on your wifi

totally secure through ssh tunnel

to use it while you are on 3G
we need to edit the following file with iFile:
/var/preferences/SystemConfiguration/preferences.plist
<string>com.apple.CommCenter (ip1)</string>
</dict>. add the following lines under the previous lines
 

<key>Proxies</key>
<dict>
<key>ProxyAutoConfigEnable</key>
 <integer>1</integer>
<key>ProxyAutoConfigURLString</key>
<string>file:///var/root/xxxx</string>
</dict>

save and. reboot

remember to change xxxx and the directory

ok guys i hope this is useful to you
i am sorry about my language
enjoy surfing the internet as anonymous
 
 
« Last Edit: February 09, 2013, 05:18:25 am by Markanees »

Pr0toc0L

  • Noob
  • *
  • Posts: 11
  • Reputation: 1
  • IntelliFFeX LLC
    • my site
  • Computers: MacBook Pro, MacMini
  • iDevices: iPhone 4s
Re: setup Socks5 proxy over Wifi/3G on your idevice
« Reply #1 on: February 06, 2013, 02:24:25 pm »
Thanks man.
I'll try it out when I get a chance
Hackdafied

grinch

  • Administrator
  • Hero Member
  • *****
  • Posts: 1926
  • Reputation: 187
  • the digital grinch who stole your data
    • @DigitalGrinch
  • Badges:
  • iDevices: iPhone 3GS 4.3.3, HTC Evo V 4G ICS
Re: setup Socks5 proxy over Wifi/3G on your idevice
« Reply #2 on: February 06, 2013, 06:38:33 pm »
Really nice tutorial on setting up auto ssh login with dynamic proxy port
+1
I did not realize you could use local .pac file, I previously used a webserver to download it from

It is important to note, although the .pac file is setup, only Safari and http traffic will pass over it by default. All the console apps and hack tools we use will need to be configured to proxy through 127.0.0.1:9090
If I help you or you appreciate my work, clicking that +1 button is the best thanks I could get.

My opinions are my own, you may agree or disagree with them, but they are only just that; opinions
For example: facebook is the microsoft of social networks

http://goo.gl/PiVjI

@DigitalGrinch
https://twitter.com/DigitalGrinch

I follow all iNinjas members back. PM me if I am not following you

Ironman

  • Administrator
  • Hero Member
  • *****
  • Posts: 5104
  • Reputation: 251
  • Badges:
  • Computers: ASUS UL50VT
  • iDevices: iPhone 5, iPhone 4S, iPhone 4, iPhone 3GS
Re: setup Socks5 proxy over Wifi/3G on your idevice
« Reply #3 on: February 06, 2013, 06:57:51 pm »
Nice tut!! +1 for the share!! Good find!!
Click for How to Add Our Repo
If you're going to ask questions....
At least make them good ones.

Knowledge is the one thing that can never be taken from you

Markanees

  • Full Member
  • ***
  • Posts: 223
  • Reputation: 15
  • +1 would be appreciated
  • Computers: Dell inspiron 1520
  • iDevices: ipad 2 ios 5.1.1
Re: setup Socks5 proxy over Wifi/3G on your idevice
« Reply #4 on: February 06, 2013, 08:11:18 pm »

It is important to note, although the .pac file is setup, only Safari and http traffic will pass over it by default. All the console apps and hack tools we use will need to be configured to proxy through 127.0.0.1:9090
is there anyway to push all traffic through it? 

Don't like seeing ads? Click here to register!

grinch

  • Administrator
  • Hero Member
  • *****
  • Posts: 1926
  • Reputation: 187
  • the digital grinch who stole your data
    • @DigitalGrinch
  • Badges:
  • iDevices: iPhone 3GS 4.3.3, HTC Evo V 4G ICS
Re: setup Socks5 proxy over Wifi/3G on your idevice
« Reply #5 on: February 07, 2013, 01:42:36 pm »
The way it is now, no.
A dante SOCKS5 server would have to be setup and the dante client ported to iOS

Your setup here allows all traffic that can be configured to use a proxy to work. A lot of the tools have optional proxy configuration, so this will work for many programs, as long as they are configured to use it
If I help you or you appreciate my work, clicking that +1 button is the best thanks I could get.

My opinions are my own, you may agree or disagree with them, but they are only just that; opinions
For example: facebook is the microsoft of social networks

http://goo.gl/PiVjI

@DigitalGrinch
https://twitter.com/DigitalGrinch

I follow all iNinjas members back. PM me if I am not following you

Markanees

  • Full Member
  • ***
  • Posts: 223
  • Reputation: 15
  • +1 would be appreciated
  • Computers: Dell inspiron 1520
  • iDevices: ipad 2 ios 5.1.1
Re: setup Socks5 proxy over Wifi/3G on your idevice
« Reply #6 on: February 07, 2013, 02:40:44 pm »
can i use proxychains to force tools through the proxy? 

edit :
just tried it but didnt work or maybe i am doing something wrong
some searching on google  found that tsocks may help but i dont know if its ported or not
« Last Edit: February 07, 2013, 04:28:58 pm by Markanees »

Trcx528

  • Haxor
  • Hero Member
  • *****
  • Posts: 4502
  • Reputation: 166
  • Google it!
    • iNinjas
  • Badges:
  • Computers: 13" 2011 Macbook Pro, 120 GB SSD and 16 GB of Ram
  • iDevices: None
Re: setup Socks5 proxy over Wifi/3G on your idevice
« Reply #7 on: February 07, 2013, 03:58:42 pm »
I believe it may be possible using the ipfw command, but I found documentation lacking....it would be similar to iptables though. 

Markanees

  • Full Member
  • ***
  • Posts: 223
  • Reputation: 15
  • +1 would be appreciated
  • Computers: Dell inspiron 1520
  • iDevices: ipad 2 ios 5.1.1
Re: setup Socks5 proxy over Wifi/3G on your idevice
« Reply #8 on: February 07, 2013, 04:34:47 pm »
i will read about ipfw i hope i find something useful
thanks trcx

grinch

  • Administrator
  • Hero Member
  • *****
  • Posts: 1926
  • Reputation: 187
  • the digital grinch who stole your data
    • @DigitalGrinch
  • Badges:
  • iDevices: iPhone 3GS 4.3.3, HTC Evo V 4G ICS
Re: setup Socks5 proxy over Wifi/3G on your idevice
« Reply #9 on: February 07, 2013, 06:57:06 pm »
proxychains is not automatic either, commands are often prefixed with 'proxychains' before running
If I help you or you appreciate my work, clicking that +1 button is the best thanks I could get.

My opinions are my own, you may agree or disagree with them, but they are only just that; opinions
For example: facebook is the microsoft of social networks

http://goo.gl/PiVjI

@DigitalGrinch
https://twitter.com/DigitalGrinch

I follow all iNinjas members back. PM me if I am not following you

Don't like seeing ads? Click here to register!

Markanees

  • Full Member
  • ***
  • Posts: 223
  • Reputation: 15
  • +1 would be appreciated
  • Computers: Dell inspiron 1520
  • iDevices: ipad 2 ios 5.1.1
Re: setup Socks5 proxy over Wifi/3G on your idevice
« Reply #10 on: February 08, 2013, 02:03:44 am »
yes
the IOS version was broken and didnt work

Trcx528

  • Haxor
  • Hero Member
  • *****
  • Posts: 4502
  • Reputation: 166
  • Google it!
    • iNinjas
  • Badges:
  • Computers: 13" 2011 Macbook Pro, 120 GB SSD and 16 GB of Ram
  • iDevices: None
Re: setup Socks5 proxy over Wifi/3G on your idevice
« Reply #11 on: February 08, 2013, 11:41:59 pm »
does ios happen to have the pfctl command?

Markanees

  • Full Member
  • ***
  • Posts: 223
  • Reputation: 15
  • +1 would be appreciated
  • Computers: Dell inspiron 1520
  • iDevices: ipad 2 ios 5.1.1
Re: setup Socks5 proxy over Wifi/3G on your idevice
« Reply #12 on: February 09, 2013, 06:40:09 am »
does ios happen to have the pfctl command?
yeah i think it have i typed pfctl in terminal amd i have the usage..