Luigi Auriemma

aluigi.org (ARCHIVE-ONLY FORUM!)
It is currently 19 Jul 2012 19:08

All times are UTC [ DST ]





Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 
Author Message
 Post subject: About proxyserver code ,help me!
PostPosted: 22 Apr 2009 15:54 

Joined: 22 Apr 2009 14:59
Posts: 4
Hello everyone,
I wrote a proxy software, proxy function has been completed, I would like to add a function, follow the specified procedure to allow my agent, I would like to ask, how to achieve, it is best DELPHI code, Thank you!
PS: My English not good, the above description is used in translation software, and look very hard, SORRY


????????????
??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????DELPHI??????????????????

PS????????????????????????????????????????????????????????????????????????????????????????????????SORRY


Attachments:
AAA.JPG
AAA.JPG [ 75.88 KiB | Viewed 882 times ]
Top
 Profile  
 
 
 Post subject: Re: About proxyserver code ,help me!
PostPosted: 22 Apr 2009 16:11 

Joined: 13 Aug 2007 21:44
Posts: 4068
Location: http://aluigi.org
uhmmm it's not much clear.
you talk about a "proxy function" so I guess you want to modify the send()/recv() functions in some way but in the image you show sockscap which is a standard proxyfier so I'm a bit confused about what you really want to do.

example:
- do you want to modify the data sent or received by a specific application? (like hooking)
- do you want to proxify a specific application (using a proxy server) only for some hosts/websites?


Top
 Profile  
 
 Post subject: Re: About proxyserver code ,help me!
PostPosted: 22 Apr 2009 19:46 

Joined: 22 Apr 2009 14:59
Posts: 4
THIS :
- do you want to modify the data sent or received by a specific application?
=================================================



Yes, that such an approach, I hope to have your help, thank you!


Top
 Profile  
 
 Post subject: Re: About proxyserver code ,help me!
PostPosted: 22 Apr 2009 21:29 

Joined: 13 Aug 2007 21:44
Posts: 4068
Location: http://aluigi.org
in this case you have at least two options for modifying the traffic and various ways to do this in practice.

the first and most obvious method is the hooking of the send or recv API of Windows which can be made though the loading of the dll (containing all the needed code for modifying the import table and doing what you want) inside the process of the application that you want to control.
at the moment I don't have a simple example for doing this (probably microsoft detour could do the job easily).

the other alternative is through the dll proxy where the process is not touched: application -> proxy_ws2_32.dll -> real_ws2_32.dll
an example of this method is my proxocket project where it allows also to modify the traffic through the writing of a simple dll plugin: http://aluigi.org/mytoolz.htm#proxocket

another option is creating a datapipe (the target host is fixed) or a minimalistic socks proxy with your code inside it for modifying the traffic of the proxyfied application.

I don't know exactly what you need to do and what part of the traffic you want to modify (incoming or outgoing or both) and so what solution can be better in your case.
in my opinion the dll plugin for proxocket is a good idea.


Top
 Profile  
 
 Post subject: Re: About proxyserver code ,help me!
PostPosted: 23 Apr 2009 15:39 

Joined: 22 Apr 2009 14:59
Posts: 4
aluigi Thank you for your information, c language seems to me some difficulty, I will try , once,again to thanks!


Top
 Profile  
 
 Post subject: Re: About proxyserver code ,help me!
PostPosted: 23 Apr 2009 21:31 

Joined: 13 Aug 2007 21:44
Posts: 4068
Location: http://aluigi.org
the dll can be created in any language, you need only to export the following two function where you need to place your code:
Code:
function myrecv(s:integer, buf:pchar, len:integer, flags:integer): integer; cdecl;

function mysend(s:integer, buf:ppchar, len:integet, flags:integer): integer; cdecl;

obviously this is only an example, if you need to modify only the outgoing data you must export only mysend (attention to the usage of buf which is a ppchar) while for the incoming data only myrecv while if the application uses udp data you must use the mysendto/myrecvfrom functions.

I don't know delphi so that's the max I can suggest in regard to the possible proxocket solution.


Top
 Profile  
 
 Post subject: Re: About proxyserver code ,help me!
PostPosted: 26 Apr 2009 17:37 

Joined: 22 Apr 2009 14:59
Posts: 4
sorry,?????????????????????,??????????????????,????????????????????????,????????????Dll??????????????????????????????????????????????API HOOK?

???????????????????????????dll??????

????????????????????? program.exe -> ws2_32.dll(WSASend/WSARecv)

???????????????Ws2_32.DLL(my)

????????????Program.exe ?????? ws2_32.dll(WSASend/WSARecv) (my) ->ws2_32.dll(WSASend/WSARecv)

???????????????????????????????????????????????????????????????????

==================

sorry, after a week-long study, or did not succeed, I do not know how to do, I do not know whether contact Dll function? is another API HOOK?

I write a method call dll function

Under normal circumstances is program.exe -> ws2_32.dll (WSASend / WSARecv)

I wrote a Ws2_32.DLL (my)

Program.exe now call ws2_32.dll (WSASend / WSARecv) (my) -> ws2_32.dll (WSASend / WSARecv)

I would like to ask the suitability of this method in which the use of this agent?


Attachments:
ASK.JPG
ASK.JPG [ 50.18 KiB | Viewed 800 times ]
Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 

All times are UTC [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for: