Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.IO;
- using System.Linq;
- using System.Net;
- using System.Text;
- using System.Threading.Tasks;
- namespace SQLi_ToolKit
- {
- class Program
- {
- static void Main(string[] args)
- {
- try
- {
- Console.ForegroundColor = ConsoleColor.White;
- if (args.Length == 0)
- {
- Console.WriteLine("Usage:\nSQLi-ToolKit.exe {target url - Example: http://target.com/index.php?id=1}");
- }
- else
- {
- string url = args[0];
- string[] prams;
- prams = File.ReadAllLines("payloads.txt");
- string error = "You have an error in your SQL syntax;";
- Console.ForegroundColor = ConsoleColor.Yellow;
- Console.WriteLine("");
- Console.WriteLine("");
- Console.WriteLine(@" _____ ____ _ _ _______ _ _ ___ _ ");
- Console.WriteLine(@" / ____|/ __ \| | (_) |__ __| | | |/ (_) | ");
- Console.WriteLine(@" | (___ | | | | | _ ______| | ___ ___ | | ' / _| |_ ");
- Console.WriteLine(@" \___ \| | | | | | |______| |/ _ \ / _ \| | < | | __|");
- Console.WriteLine(@" ____) | |__| | |____| | | | (_) | (_) | | . \| | |_ ");
- Console.WriteLine(@" |_____/ \___\_\______|_| |_|\___/ \___/|_|_|\_\_|\__|");
- Console.WriteLine("");
- Console.ForegroundColor = ConsoleColor.Red;
- Console.WriteLine(" By: Josh");
- Console.WriteLine("");
- Console.WriteLine("");
- Console.WriteLine("");
- Console.WriteLine("");
- Console.ForegroundColor = ConsoleColor.White;
- Console.WriteLine("Beginning payload tests on target url: {0}", url);
- Console.WriteLine("");
- Console.WriteLine("");
- foreach (string line in prams)
- {
- HttpWebRequest r = (HttpWebRequest)WebRequest.Create(url + line);
- r.Method = "POST";
- StreamReader contents = new StreamReader(r.GetResponse().GetResponseStream());
- string response = contents.ReadToEnd();
- if (response.Contains(error))
- {
- Console.ForegroundColor = ConsoleColor.Green;
- Console.WriteLine("Payload success: {0}", line);
- }
- else
- if (!response.Contains(error))
- {
- Console.ForegroundColor = ConsoleColor.Red;
- Console.WriteLine("Payload failed: {0}", line);
- }
- Console.ForegroundColor = ConsoleColor.White;
- }
- }
- }
- catch
- {
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement