.NET POP3 Library that supports Proxy - c#

I am looking for a pop3 library that will let me use a proxy. I have tried OpenPop.NET but it doesn't support proxy. Thanks in advance.

I am one of the developers of OpenPop.NET.
I have thought about supporting proxies, but have not added it as of yet. However, the Pop3Client Connect method takes a stream, which it uses to communicate with the server. If you supply a stream, which is a proxied stream, then OpenPop.NET would work fine with it.
I have found a starksoft proxy project that should be able to deliver such streams. I have not tested it though. Also see this for more information on the starksoft proxy.
Hope it helps.

You may try Mail.dll POP3 component. Please note that it's a commercial product that I've created.
It supports HTTP and SOCKS proxies:
http://www.limilabs.com/blog/imap-pop3-smtp-via-http-socks-proxy

I guess there aren't many proxy types able to connect a POP server other than SOCKS.
A quick search on google lead me to this. It allows you to establish a TcpClient connection through a proxy.
Here is the best POP3 client I have ever seen (and used many times), especially if you need to work with the content of retrieved mails. It uses the TcpClient class to establish connections with the POP server and the code is full of comments.
You'll just have to modify the sources (mainly Pop3MailClient) here and there to improve the client so it can use a SOCKS proxy.

Shameless plug:
aspNetPOP3 supports Socks proxy servers.
http://www.aspNetPOP3.com
--Dave

Related

C# - .NET SOCKS 4/5 Support [duplicate]

According to my research whilst trying to solve this problem, it turns out that the .Net WebProxy class does not support Socks proxies - a tad annoying. I also can't seem to find any code or information which explains how to implement Socks 4/5 support via a class which can easily be used with HttpWebRequest (the Proxy property, to be exact).
I've found limited information via google on how I could do this. One suggestion involves changing internet explorer proxy settings - something I'd rather not do.
Does anyone know of anything which could do the job or have any suggestions? Any help would be much appreciated.
I tried numerous .Net libraries which claimed to support Socks4/5 but found many of them just did not work or would error trying to connect to proxies I knew were functioning.
I've ended up using Chilkat Software's Sock/SSL component which seems to work well for me even if I do have to manually construct the HTTP requests instead of using HttpWebRequest as I would have liked.
Update note: Chilkat.Http (similar to the HttpWebRequest class) does inherently have support for SOCKS proxies. So don't spend time trying to code your own HTTP requests as I did; just use the Chilkat.Http.SocksHostname, Chilkat.Http.SocksPort and Chilkat.Http.SocksVersion properties.
Changing IE's proxy settings won't help you at all-- the other poster was just observing that it works for IE. Because the .NET Framework doesn't support SOCKS, you'd have to write your own CERN-Proxy to SOCKS-Proxy converter, such that .NET talks to the CERN proxy (the type it supports) and your code converts that to a SOCKS proxy call.
FWIW, this is something I'm presently looking to add to FiddlerCore (www.fiddler2.com/core) because I already have almost all of the code. The only thing I really need is a SOCKSv4a proxy to test against.
Since .NET 6, socks proxies can be used natively with HttpClient. See this issue on GitHub.
Use Privoxy or same to create http proxy gateway to your socks.
Add this to main config to chain Privoxy and socks:
forward-socks5 / proxy_host:port .
And something like that to enable direct access to your local network:
forward 192.168.*.*/ .
forward 10.*.*.*/ .
forward 127.*.*.*/ .

Dynamic port forwarding libssh C

I am looking for a solution/way to implement the dynamic port forwarding functions built into ssh (also known as the -D option). I have been reading for the last day, and I can't seem to find a reliable library to aid in this.
I found ssh.net which is a C# library, but its dynamic port forwarding is broken in such a way that its proxy handler does not forward dns requests breaking pretty much everything. I have patched the code to a semi working state, but it is not stable, and really slow.
I am looking into libssh right now and it has port forwarding options, although it does not have a dynamic option which spawns a socks server to use. I assume I would have to do this myself.
If that is so, do I have to have a socks server running on both the client and server, then just use a normal tcpip forwarding tunnel, or what. How would I attempt to implement this.
Overall, I want to find a way to achieve the same effects as the -D option on ssh or what putty does when it creates a tunnel. Any links or general information about this, or even code/library samples would be appreciated.
Other notes: This is for windows, so libraries that are cross platform or windows only will be needed. Also I cant seem to figure out how to compile libssh2 with mingw or cygwin so that library is not usable.
Thanks for your time.
I am looking into libssh right now and it has port forwarding options, although it does not
have a dynamic option which spawns a socks server to use. I assume I would have to do this > myself.
libssh gives you everything to implement dynamic forwarding using the SSH protocol.

What API can be used to send DHCP Discovery, Request, and Acknowledgement?

I have been searching for quite a while and cannot seem to find a working DHCP Client implementation example in C#. I am brand spankin' new to Network Programming, but am doing some research that requires me to write a manual DHCP client and to implement Auto-IP if there is no DHCP server.
Any code examples, or names of built-in C# classes that can help me with this would be appreciated.
You are not going to find that; the reason is “security”.
Regular net APIs allow you to handle Level-3 and up but
a DHCP client must be able to handle Level-2; i.e. for broadcasting to MAC FF:FF:FF:FF:FF:FF on DHCP DISCOVERY packets
For security reasons Microsoft today does not allow you to craft Ethernet packages at such a low level.
You cannot use raw sockets; read here why:
Limitations on Raw Sockets
http://msdn.microsoft.com/en-us/library/ms740548(v=vs.85).aspx
You can install the pccap driver on your pc and use that apI to send raw packets

SSL without SslStream because I'd like to connect through a SOCKS5 Proxy

BACKGROUND INFORMATION: PROGRAM WRITTEN IN C#
I'm working on a program right now that connects through a SOCKS5 proxy (coded from scratch. works well enough.), but I'd also like to (through that proxy) communicate to a DESTINATION through SSL.
I've done some research, googled many a time, and have come to the conclusion that SslStream won't be ideal for my situation. I NEED to first authenticate with the SSL through the proxy, and THEN start sending encrypted packets, once I receive the key.
QUESTIONS:
How can I encrypt my packets with TLS in C#? For some reason I can't at all figure it out. I'm stuck! :(
What is the raw syntax required to even REQUEST said SSL certificate?
You might want to have a look at the TLS implementation in the open source Bouncy Castle cryptography library. If it won't work as-is, you can hack it into doing what you need. If you want to deep-dive the specification itself, you'll find it as IETF RFC 5246.
As you've probably discovered, though, doing any portion of the connection setup work yourself leaves you with no way to use the WebRequest family of classes to handle the HTTP portion of the protocol work. That leaves you with two options I can see: do the HTTP yourself as well (I found a trivial example HTTP client floating around the net), or change the current user proxy server settings
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings]
"ProxyEnable"=dword:00000001
"ProxyServer"="socks=socks.example.net:1080"
then send the request normally using the WebRequest classes.
I'd like to offer you SSLBlackbox package of our SecureBlackbox product. Among numerous other components it has a simple SSL client component that is socket-based, can connect via different proxies (SOCKS, HTTPS CONNECT) and supports all features of SSL/TLS up to TLS 1.2. If you need more control, you can use any custom socket, and not just built-in socket support. This lets you use the components for securing traffic that goes not via sockets at all (pigeon mail can be secured this way as well).
An HTTPS client is available and included into SSLBlackbox as well.

Implementing SSL tunnel in C#

As a part of a larger application I need to implement an SSL tunnel in C#. I was wondering if there's a better way of doing that instead of writing each step of SSL negotiation myself which sounds like reinventing the wheel.
Do you know if there are any libraries that I could use to minimize the code I need to write or any tutorials which show how this or similar thing can be implemented most efficiently in .NET?
SSlStream should do most of the work for you.
It's not clear what you mean by SSL tunnel. If I understand it right, you need some client-side software which acts as a local server (to which other applications connect), this software then connects using SSL to your server-side software, which in turn takes the data out of the SSL tunnel, and routes them further. In this case you would need client-side and server-side SSL/TLS components. You can use our SecureBlackbox for this task. SecureBlackbox provides comprehensive support for SSL/TLS protocol with complete control over connection and certificate management.
It can be that you need not plain SSL channel, but some kind of encrypting proxy. In this case you need to decide what exactly kind of proxy you want (will it be SOCKS proxy or HTTP CONNECT proxy) and implement it on the client side. one of the benefits of such proxy is that it can transfer the real connection address (i.e. where the client wants to go to) to the remote server, and that remote server will perform connection. This is more flexible approach, but it would require some (minimal, I should say) coding to implement the stuff, related to SOCKS or HTTP CONNECT request parsing and response generation.
.NET includes SSL support, centred around the System.Net.Security.SslStream class.

Categories

Resources