This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var visualStudio = new VisualStudio_2010(); | |
| var targetfile = @"E:\O2_V4\O2.FluentSharp\O2.FluentSharp.REPL\Ascx\ascx_Simple_Script_Editor.cs"; | |
| var type = "ascx_Simple_Script_Editor"; | |
| visualStudio.open_Document(targetfile); | |
| var hostPanel = visualStudio.open_Panel("for type:" + type); | |
| hostPanel.toolWindowPane().as_Dock(); | |
| Action compileAndShow = |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var visualStudio = new VisualStudio_2010(); | |
| var topPanel = "topPanel".o2Cache<Panel>(false,()=> visualStudio.open_Panel()) | |
| .add_Panel(true); | |
| var toolStrip = topPanel.insert_Above_ToolStrip(); | |
| toolStrip.beginUpdate() | |
| .add_New(()=>{}) | |
| .add_Open(()=>{}) | |
| .add_Save(()=>{}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //var topPanel = panel.add_Panel(true); | |
| var topPanel = "Util - Windows Handles - View Handle Screenshot".popupWindow(450,350); | |
| WindowFinder windowFinder = null; | |
| TextBox textBox_CurrentHandle = null; | |
| PictureBox pictureBox = null; | |
| Bitmap lastScreenShot = null; | |
| Label userMessage = null; | |
| Action<IntPtr> onHandleChange = |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // This file is part of the OWASP O2 Platform (http://www.owasp.org/index.php/OWASP_O2_Platform) and is released under the Apache 2.0 License (http://www.apache.org/licenses/LICENSE-2.0) | |
| using System; | |
| using System.IO; | |
| using System.Collections.Generic; | |
| using System.Diagnostics; | |
| using System.Text; | |
| using O2.Kernel; | |
| using O2.Kernel.ExtensionMethods; | |
| using O2.DotNetWrappers.ExtensionMethods; | |
| using O2.XRules.Database.APIs; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //descriptions from http://www.lunametrics.com/blog/2011/10/04/utmgif-request-parameters/ | |
| var utmwv = "5.3.8"; // Tracking code version | |
| var utms = "1"; // Session requests. Updates every time a __utm.gif request is made. Stops incrementing at 500 (max number of GIF requests per session). | |
| var utmn = "1797201820"; // Unique ID generated for each GIF request to prevent caching of the GIF image | |
| var utmhn = "teammentor-33-ci"; // Host name, which is a URL-encoded string | |
| var utmcs = "ISO-8859-1"; // Language encoding for the browser. Some browsers don’t set this, in which case it is set to “-” | |
| var utmsr = "1440x852"; // Screen resolution | |
| var utmvp = "1440x751"; // Size of Viewing Pane | |
| var utmsc = "32-bit"; // Screen color depth | |
| var utmul = "en-us"; // Browser language |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| int GUIDS_TO_CREATE = 1000000; //10000000; | |
| //The code below was converted from https://gist.github.com/kofisarfo/5420710 | |
| //public static class CSPRNG { | |
| //public static byte[] GetBytes(int entropy) | |
| Func<int, byte[]> GetBytes = | |
| (entropy)=>{ | |
| if (entropy < 8) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var ie = "ie_xpHky".o2Cache<WatiN_IE>(()=> panel.clear().add_IE()).silent(true); // ie ramdon value for o2cache makes this object to unique amongst multiple instances of this control | |
| ie.open("http://www.w3schools.com/tags/tryit.asp?filename=tryhtml_iframe"); //Load test page | |
| ie.waitForComplete(); // Wait for it to load the IFrames | |
| var hostIFrames = ie.IE.Frames; // Get All frames from the tryhtml_iframe page (using the Frame property from the WatiN's IE object) | |
| var hostIFrame = (Frame)hostIFrames.last(); // Get the right-hand-side IFrame | |
| //this is a hacked way to change the frame's host width) | |
| var hostHtml = hostIFrame.Html; // Gets the html which is the same as the text shown on the left-hand-side textbox |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var jni4Net = new API_Jni4Net(); | |
| jni4Net.setUpBride(); | |
| var jarPath = @"E:\_Code_Tests\OWASP_AppSensor\_O2_Test"; | |
| var jars = jarPath.files("*.jar"); | |
| var classLoader = jni4Net.systemClassLoader().loadJars(jars); | |
| var esapi = classLoader.loadClass("org.owasp.esapi.ESAPI"); | |
| var encoder = esapi.getMethod("encoder",null).invoke(null,null); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //based on code sample from this MSDN article: http://msdn.microsoft.com/en-us/library/system.security.cryptography.aes(v=vs.100).aspx) | |
| Func<byte[], byte[],byte[], string> decryptStringFromBytes_AES = | |
| (cipherText, Key, IV) => | |
| { | |
| // Check arguments. | |
| if (cipherText == null || cipherText.Length <= 0) | |
| throw new ArgumentNullException("cipherText"); | |
| if (Key == null || Key.Length <= 0) | |
| throw new ArgumentNullException("Key"); | |
| if (IV == null || IV.Length <= 0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var topPanel = "{name}".popupWindow(700,200); | |
| //var topPanel = panel.clear().add_Panel(); | |
| "Loading data".info(); | |
| var baseFolder = @"C:\Users\o2\AppData\Roaming\OWASP_O2_Platform_5.3\8_12_2013\MD5_Hashes"; | |
| var md5HashesFile = baseFolder.pathCombine("(10x numbers - 2x length) M5_for_10_chars_with_2_depth.txt"); | |
| var md5Hashes = md5HashesFile.fileContents(); | |
| var mappings = new Dictionary<string,string>(); | |
| foreach(var line in md5Hashes.lines()) | |
| { |