Skip to content

Commit ff030fa

Browse files
authored
Add files via upload
1 parent be8e0e3 commit ff030fa

15 files changed

+367
-0
lines changed

App.config

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<configuration>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
5+
</startup>
6+
</configuration>

Program.cs

Lines changed: 223 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,223 @@
1+
using System;
2+
using System.Linq;
3+
using System.Text;
4+
using System.Net;
5+
using System.IO;
6+
using System.Threading;
7+
using System.Windows.Forms;
8+
namespace ProxyGenerator
9+
{
10+
class Program
11+
{
12+
[STAThread]
13+
static void Main(string[] args)
14+
{
15+
Console.Title = "Proxy Tools | Made by Kye | https://github.com/promasterboy";
16+
int selection = 0;
17+
start: Console.ForegroundColor = ConsoleColor.Blue;
18+
Console.WriteLine("Proxy Tools");
19+
Console.ForegroundColor = ConsoleColor.Green;
20+
Console.WriteLine("");
21+
Console.WriteLine("===============");
22+
Console.WriteLine("");
23+
Console.WriteLine("Proxy Generator");
24+
Console.WriteLine("1 = HTTP");
25+
Console.WriteLine("2 = Socks4");
26+
Console.WriteLine("3 = Socks5");
27+
Console.WriteLine("");
28+
Console.WriteLine("===============");
29+
Console.WriteLine("");
30+
Console.WriteLine("4 = Proxy Checker");
31+
try
32+
{
33+
selection = int.Parse(Console.ReadLine());
34+
}
35+
catch
36+
{
37+
Console.Clear();
38+
goto start;
39+
}
40+
if (selection > 4)
41+
{
42+
Console.Clear();
43+
goto start;
44+
}
45+
46+
if (selection == 1)
47+
{
48+
Console.WriteLine("Getting HTTP Proxies!");
49+
WriteProxy2("https://api.proxyscrape.com/?request=getproxies&proxytype=http&timeout=10000&country=all&ssl=all&anonymity=all", "https://raw.githubusercontent.com/clarketm/proxy-list/master/proxy-list-raw.txt", "HTTP");
50+
}
51+
if (selection == 2)
52+
{
53+
Console.WriteLine("Getting Socks4 Proxies!");
54+
WriteProxy("https://api.proxyscrape.com/?request=getproxies&proxytype=socks4&timeout=10000&country=all", "Socks4");
55+
}
56+
if (selection == 3)
57+
{
58+
Console.WriteLine("Getting Socks5 Proxies!");
59+
WriteProxy("https://api.proxyscrape.com/?request=getproxies&proxytype=socks5&timeout=10000&country=all", "Socks5");
60+
}
61+
62+
if (selection == 4)
63+
{
64+
if (!File.Exists("good_proxies.txt"))
65+
{
66+
File.Create("good_proxies.txt").Close();
67+
}
68+
if (!File.Exists("bad_proxies.txt"))
69+
{
70+
File.Create("bad_proxies.txt").Close();
71+
}
72+
CheckProxies();
73+
}
74+
}
75+
public static int good { get; set; }
76+
public static int bad { get; set; }
77+
public static void CheckProxies()
78+
{
79+
80+
Console.WriteLine("Select a proxy .txt file");
81+
Thread.Sleep(300);
82+
OpenFileDialog o = new OpenFileDialog();
83+
o.Filter = "txt files (*.txt)|*.txt";
84+
o.Title = "Select a Proxy";
85+
o.ShowDialog();
86+
Console.Clear();
87+
string[] proxies = File.ReadAllLines(o.FileName);
88+
Console.Clear();
89+
Console.ForegroundColor = ConsoleColor.Blue;
90+
Console.WriteLine("Checking Proxies");
91+
Console.WriteLine(" ");
92+
Console.WriteLine("============");
93+
Console.WriteLine(" ");
94+
Console.ForegroundColor = ConsoleColor.Green;
95+
Console.WriteLine("Good: " + good);
96+
Console.ForegroundColor = ConsoleColor.Red;
97+
Console.WriteLine("Bad: " + bad);
98+
foreach (string proxy in proxies)
99+
{
100+
Thread.Sleep(800);
101+
string[] data = proxy.Split(':');
102+
if (ProxyCheck(data[0], int.Parse(data[1])) == true)
103+
{
104+
string already = File.ReadAllText("good_proxies.txt");
105+
using (StreamWriter writer = new StreamWriter("good_proxies.txt"))
106+
{
107+
writer.WriteLine(already + data[0] + ":" + data[1]);
108+
}
109+
good++;
110+
}
111+
else
112+
{
113+
string already = File.ReadAllText("bad_proxies.txt");
114+
using (StreamWriter writer = new StreamWriter("bad_proxies.txt"))
115+
{
116+
writer.WriteLine(already + data[0] + ":" + data[1]);
117+
}
118+
bad++;
119+
}
120+
Console.Clear();
121+
Console.ForegroundColor = ConsoleColor.Blue;
122+
Console.WriteLine("Checking Proxies");
123+
Console.WriteLine(" ");
124+
Console.WriteLine("============");
125+
Console.WriteLine(" ");
126+
Console.ForegroundColor = ConsoleColor.Green;
127+
Console.WriteLine("Good: " + good);
128+
Console.ForegroundColor = ConsoleColor.Red;
129+
Console.WriteLine("Bad: " + bad);
130+
}
131+
Console.Clear();
132+
Console.ForegroundColor = ConsoleColor.Blue;
133+
Console.WriteLine("Proxy Results");
134+
Console.WriteLine(" ");
135+
Console.WriteLine("============");
136+
Console.WriteLine(" ");
137+
Console.ForegroundColor = ConsoleColor.Green;
138+
Console.WriteLine(good + " good proxies saved to " + AppDomain.CurrentDomain.BaseDirectory + "good_proxies.txt");
139+
Console.ForegroundColor = ConsoleColor.Red;
140+
Console.WriteLine(bad + " bad proxies saved to " + AppDomain.CurrentDomain.BaseDirectory + "bad_proxies.txt");
141+
Console.ReadKey();
142+
}
143+
144+
public static void WriteProxy(string url, string type)
145+
{
146+
string filename = type + "_proxies.txt";
147+
if (File.Exists(filename))
148+
{
149+
File.Delete(filename);
150+
}
151+
WebClient webClient = new WebClient();
152+
webClient.Timeout = 100000;
153+
string proxies = webClient.DownloadString(url);
154+
using (StreamWriter writer = new StreamWriter(filename))
155+
{
156+
writer.Write(proxies);
157+
}
158+
Console.Clear();
159+
Console.ForegroundColor = ConsoleColor.Blue;
160+
int lineCount = File.ReadLines(filename).Count();
161+
Console.WriteLine("Exported " + lineCount + " proxies to: " + AppDomain.CurrentDomain.BaseDirectory + filename);
162+
Console.ReadKey();
163+
}
164+
165+
public static void WriteProxy2(string url, string url2 ,string type)
166+
{
167+
string filename = type + "_proxies.txt";
168+
if (File.Exists(filename))
169+
{
170+
File.Delete(filename);
171+
}
172+
WebClient webClient = new WebClient();
173+
webClient.Timeout = 100000;
174+
string proxies = webClient.DownloadString(url);
175+
string proxies2 = webClient.DownloadString(url2);
176+
using (StreamWriter writer = new StreamWriter(filename))
177+
{
178+
writer.Write(proxies);
179+
writer.WriteLine(proxies2);
180+
}
181+
Console.Clear();
182+
Console.ForegroundColor = ConsoleColor.Blue;
183+
int lineCount = File.ReadLines(filename).Count();
184+
Console.WriteLine("Exported " + lineCount + " proxies to: " + AppDomain.CurrentDomain.BaseDirectory + filename);
185+
Console.ReadKey();
186+
}
187+
188+
private static readonly string UserAgent = "Mozilla / 5.0(Windows NT 10.0; Win64; x64) AppleWebKit / 537.36(KHTML, like Gecko) Chrome / 70.0.3538.77 Safari / 537.36";
189+
public static bool ProxyCheck(string ipAddress, int port)
190+
{
191+
try
192+
{
193+
ICredentials credentials = CredentialCache.DefaultCredentials;
194+
IWebProxy proxy = new WebProxy(ipAddress, port);
195+
proxy.Credentials = credentials;
196+
using (var wc = new WebClient())
197+
{
198+
wc.Timeout = 5000;
199+
wc.Proxy = proxy;
200+
wc.Encoding = Encoding.UTF8;
201+
wc.Headers.Add("User-Agent", UserAgent);
202+
string result = wc.DownloadString("http://google.com");
203+
return true;
204+
}
205+
}
206+
catch
207+
{
208+
return false;
209+
}
210+
}
211+
private class WebClient : System.Net.WebClient
212+
{
213+
public int Timeout { get; set; }
214+
protected override WebRequest GetWebRequest(Uri uri)
215+
{
216+
WebRequest lWebRequest = base.GetWebRequest(uri);
217+
lWebRequest.Timeout = Timeout;
218+
((HttpWebRequest)lWebRequest).ReadWriteTimeout = Timeout;
219+
return lWebRequest;
220+
}
221+
}
222+
}
223+
}

Properties/AssemblyInfo.cs

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// General Information about an assembly is controlled through the following
6+
// set of attributes. Change these attribute values to modify the information
7+
// associated with an assembly.
8+
[assembly: AssemblyTitle("ProxyGenerator")]
9+
[assembly: AssemblyDescription("A simple Proxy Generator & checker")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("Kye")]
12+
[assembly: AssemblyProduct("ProxyGenerator")]
13+
[assembly: AssemblyCopyright("Copyright © 2020")]
14+
[assembly: AssemblyTrademark("Kye")]
15+
[assembly: AssemblyCulture("")]
16+
17+
// Setting ComVisible to false makes the types in this assembly not visible
18+
// to COM components. If you need to access a type in this assembly from
19+
// COM, set the ComVisible attribute to true on that type.
20+
[assembly: ComVisible(false)]
21+
22+
// The following GUID is for the ID of the typelib if this project is exposed to COM
23+
[assembly: Guid("3705438f-712a-4797-9587-96fbe4bdc5a9")]
24+
25+
// Version information for an assembly consists of the following four values:
26+
//
27+
// Major Version
28+
// Minor Version
29+
// Build Number
30+
// Revision
31+
//
32+
// You can specify all the values or you can default the Build and Revision Numbers
33+
// by using the '*' as shown below:
34+
// [assembly: AssemblyVersion("1.0.*")]
35+
[assembly: AssemblyVersion("1.0.0.0")]
36+
[assembly: AssemblyFileVersion("1.0.0.0")]

ProxyGenerator.csproj

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{3705438F-712A-4797-9587-96FBE4BDC5A9}</ProjectGuid>
8+
<OutputType>Exe</OutputType>
9+
<RootNamespace>ProxyGenerator</RootNamespace>
10+
<AssemblyName>ProxyGenerator</AssemblyName>
11+
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
12+
<FileAlignment>512</FileAlignment>
13+
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
14+
<Deterministic>true</Deterministic>
15+
</PropertyGroup>
16+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
17+
<PlatformTarget>AnyCPU</PlatformTarget>
18+
<DebugSymbols>true</DebugSymbols>
19+
<DebugType>full</DebugType>
20+
<Optimize>false</Optimize>
21+
<OutputPath>bin\Debug\</OutputPath>
22+
<DefineConstants>DEBUG;TRACE</DefineConstants>
23+
<ErrorReport>prompt</ErrorReport>
24+
<WarningLevel>4</WarningLevel>
25+
</PropertyGroup>
26+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
27+
<PlatformTarget>AnyCPU</PlatformTarget>
28+
<DebugType>pdbonly</DebugType>
29+
<Optimize>true</Optimize>
30+
<OutputPath>bin\Release\</OutputPath>
31+
<DefineConstants>TRACE</DefineConstants>
32+
<ErrorReport>prompt</ErrorReport>
33+
<WarningLevel>4</WarningLevel>
34+
</PropertyGroup>
35+
<PropertyGroup>
36+
<ApplicationIcon>kye profile pic.ico</ApplicationIcon>
37+
</PropertyGroup>
38+
<PropertyGroup>
39+
<StartupObject>ProxyGenerator.Program</StartupObject>
40+
</PropertyGroup>
41+
<ItemGroup>
42+
<Reference Include="System" />
43+
<Reference Include="System.Core" />
44+
<Reference Include="System.Windows.Forms" />
45+
<Reference Include="System.Xml.Linq" />
46+
<Reference Include="System.Data.DataSetExtensions" />
47+
<Reference Include="Microsoft.CSharp" />
48+
<Reference Include="System.Data" />
49+
<Reference Include="System.Net.Http" />
50+
<Reference Include="System.Xml" />
51+
</ItemGroup>
52+
<ItemGroup>
53+
<Compile Include="Program.cs" />
54+
<Compile Include="Properties\AssemblyInfo.cs" />
55+
</ItemGroup>
56+
<ItemGroup>
57+
<None Include="App.config" />
58+
</ItemGroup>
59+
<ItemGroup>
60+
<Content Include="kye profile pic.ico" />
61+
</ItemGroup>
62+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
63+
</Project>

ProxyGenerator.sln

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.30002.166
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProxyGenerator", "ProxyGenerator.csproj", "{3705438F-712A-4797-9587-96FBE4BDC5A9}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{3705438F-712A-4797-9587-96FBE4BDC5A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{3705438F-712A-4797-9587-96FBE4BDC5A9}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{3705438F-712A-4797-9587-96FBE4BDC5A9}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{3705438F-712A-4797-9587-96FBE4BDC5A9}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {7EC72034-12CD-480E-8E8B-E82C8A8E5F79}
24+
EndGlobalSection
25+
EndGlobal

bin/Debug/ProxyGenerator.exe

119 KB
Binary file not shown.

bin/Debug/ProxyGenerator.exe.config

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<configuration>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
5+
</startup>
6+
</configuration>

bin/Debug/ProxyGenerator.pdb

27.5 KB
Binary file not shown.

kye profile pic.ico

107 KB
Binary file not shown.
Binary file not shown.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
5a311d5acb4d1fbbb4651daca6efa0025adf7a40
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
C:\Users\ProMa\source\repos\ProxyGenerator\bin\Debug\ProxyGenerator.exe.config
2+
C:\Users\ProMa\source\repos\ProxyGenerator\bin\Debug\ProxyGenerator.exe
3+
C:\Users\ProMa\source\repos\ProxyGenerator\bin\Debug\ProxyGenerator.pdb
4+
C:\Users\ProMa\source\repos\ProxyGenerator\obj\Debug\ProxyGenerator.csprojAssemblyReference.cache
5+
C:\Users\ProMa\source\repos\ProxyGenerator\obj\Debug\ProxyGenerator.csproj.CoreCompileInputs.cache
6+
C:\Users\ProMa\source\repos\ProxyGenerator\obj\Debug\ProxyGenerator.exe
7+
C:\Users\ProMa\source\repos\ProxyGenerator\obj\Debug\ProxyGenerator.pdb
Binary file not shown.

obj/Debug/ProxyGenerator.exe

119 KB
Binary file not shown.

obj/Debug/ProxyGenerator.pdb

27.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)