0

I'm new writing iOS tweak, and i want to write a tweak to intercept a request to a server from an app to change the destination server.

Example:

App make a request to server A -> I intercept it, and i change the server A to server B, so the request will be made to server B, and the app will receive the response from server B.

The app is a webview, so i cant hook app's functions.. Specifically I want to change the request to a PHP script which answers some information, and i want to change this information.

Someone knows what functions should i hook?

Thanks!! :)

Alberto Segura
  • 437
  • 4
  • 9

2 Answers2

0

If specific to a webview, you can hook -[UIWebView loadRequest:], check the request data and alter it before sending it to %orig().

radj
  • 4,360
  • 7
  • 26
  • 41
  • Hi! First thanks for your help! :) But i haven't be able to get it working.. this is my tweak code: http://pastebin.com/Qur5jvSz I have use an alert to watch when this function is called, but it isn't showed never. In any application.. :( The tweak has been installed well, i see it on Cydia. i have tried with this example: http://www.andyibanez.com/create-mobilesubstrate-tweaks-ios/ and it works.. – Alberto Segura Jun 13 '15 at 08:54
  • @AlbertoSegura have you tried hooking other basic methods? Maybe your whole tweak is not loaded for the specific app. – radj Jun 15 '15 at 03:55
  • No, i haven't. Finally I have hacked the app using an XSS vulnerability which works without jailbreak :) Thanks for your help! For people with the same question, i have discovered Frida (www.frida.re), this tool seems to be useful, but i haven't tried it yet. :) – Alberto Segura Jul 06 '15 at 10:51
0

Check this out, it may have the hooks you are looking for.

https://github.com/rpetrich/URLConnectionLog/blob/master/Tweak.x