Esempio n. 1
0
        internal static string []  ListDir(string RequestFile, string rootDir, string HostName, string port, bool ReplaceHost = true)
        {
            List <string> lst = new List <string>();

            if (!System.IO.Directory.Exists(RequestFile))
            {
                return(null);
            }

            string[] lstar  = System.IO.Directory.GetFiles(RequestFile);
            string[] lstdar = System.IO.Directory.GetDirectories(RequestFile);

            bool rootDirRequested = (RequestFile == rootDir);

            string host_et_port = HostName + ":" + port + "/";

            rootDir = rootDir.Replace("\\", "/");

            ///// parent
            if (!rootDirRequested)
            {
                string fx  = AppHelper.GoUpAsDirectory(RequestFile);
                string fx2 = fx.Replace("\\", "/");
                string fx3 = fx2.Replace(rootDir, "");
                string fx4 = WebServer.EncodeUrlChars(fx3);
                string fx5 = "http://" + host_et_port + fx4;
                string fx6 = fx5.Replace("%2F", "/");
                lst.Add(fx6);
            }
            else
            {
                lst.Add("");
            }

            foreach (string f in lstar) //files
            {
                string f2 = f.Replace("\\", "/");
                string f3 = f2.Replace(rootDir, "");
                string f4 = WebServer.EncodeUrlChars(f3);
                string f5 = "http://" + host_et_port + f4;
                string f6 = f5.Replace("%2F", "/");
                lst.Add(f6);
            }
            foreach (string f in lstdar) // dirs
            {
                string f2 = f.Replace("\\", "/");
                string f3 = f2.Replace(rootDir, "");
                string f4 = WebServer.EncodeUrlChars(f3);
                string f5 = "http://" + host_et_port + f4;
                string f6 = f5.Replace("%2F", "/");
                lst.Add(f6);
            }


            return(lst.ToArray());
        }
Esempio n. 2
0
        internal static string ControlCommandListindex(string p1, string p2, string p3, string CSRF, string password)
        {
            string doc = "<a href='exec?ps=$passwd$&CSRF=$CSRFtok$&com=msgbx&mbtitle=hello+It&close=1' >";

            doc += "message box </a><hr />";

            doc += "<a href='exec?ps=$passwd$&CSRF=$CSRFtok$&com=procstr&procnm=notepad' > ";
            doc += "launch Process </a>";

            doc += "<hr /><a href='exec?ps=$passwd$&CSRF=$CSRFtok$&com=closeprocess&procnm=chrome.exe' >";
            doc += "close process </a>";

            doc += "<hr /><a href='exec?ps=$passwd$&CSRF=$CSRFtok$&com=procstr&procnm=explorer.exe&procpar=" + WebServer.EncodeUrlChars("@\"c:\"") + "' >";
            doc += "start explorer  </a>";

            doc += "<hr /><a href='exec?ps=$passwd$&CSRF=$CSRFtok$&com=closeprocess&procnm=explorer' >";
            doc += "close explorer </a>";

            doc += "<hr /><a href='exec?ps=$passwd$&CSRF=$CSRFtok$&com=procstr&procnm=bg.jpg&proctype=pic' >";
            doc += "Display Pic </a>";

            doc += "<hr /><a href='exec?ps=$passwd$&CSRF=$CSRFtok$&com=closeallprocess&procnm=chrome.exe' >";
            doc += "close all Process </a>";

            doc += "<hr /><a href='exec?ps=$passwd$&CSRF=$CSRFtok$&com=mutesys&proctype=sound' >";
            doc += " mute system sound </a>";


            doc += "<hr /><a href='exec?ps=$passwd$&CSRF=$CSRFtok$&com=mvcrs&crsx=35&shftdir=shift' >";
            doc += "move cursor right  </a>";

            doc += "<hr /><a href='exec?ps=$passwd$&CSRF=$CSRFtok$&com=mvcrs&crsx=35&shftdir=shiftback' >";
            doc += "move cursor left  </a>";

            doc += "<hr /><a href='exec?ps=$passwd$&CSRF=$CSRFtok$&com=mvcrs&crsy=35&shftdir=shiftback' >";
            doc += "move cursor up  </a>";


            doc += "<hr /><a href='exec?ps=$passwd$&CSRF=$CSRFtok$&com=ls&drpth=" + WebServer.EncodeUrlChars("/") + "' >";
            doc += "list  </a>";


            doc += "<hr /><a href='exec?ps=$passwd$&CSRF=$CSRFtok$&com=mvcrs&crsy=35&shftdir=shift' >";
            doc += "move cursor  down </a>";


            doc += "<hr /><a href='exec?ps=$passwd$&CSRF=$CSRFtok$&com=msclk' >";
            doc += "left mouse click  </a>";

            doc += "<hr /><a href='exec?ps=$passwd$&CSRF=$CSRFtok$&com=msrclk' >";
            doc += "right mouse click  </a>";


            doc += "<hr /><a href='exec?ps=$passwd$&CSRF=$CSRFtok$&com=prntscr' >";
            doc += "Print screen</a>";

            doc += "<hr /><a href='exec?ps=$passwd$&CSRF=$CSRFtok$&com=hidecl&frm=0' >";
            doc += "Hide Server</a>";
            doc += "<hr /><a href='exec?ps=$passwd$&CSRF=$CSRFtok$&com=showcl&frm=0' >";
            doc += "show Server</a>";
            doc  = doc.Replace("$passwd$", password);
            doc  = doc.Replace("$CSRFtok$", CSRF);
            return(doc);
        }
Esempio n. 3
0
        internal static RykonFile[] ListDir(string RequestFile, string rootDir, string HostName, string port, bool ReplaceHost = true)
        {
            List <RykonFile> lstr = new List <RykonFile>();

            string[] lstar  = System.IO.Directory.GetFiles(RequestFile);
            string[] lstdar = System.IO.Directory.GetDirectories(RequestFile);

            bool   rootDirRequested = (RequestFile == rootDir);
            string host_et_port     = HostName + ":" + port + "/";

            rootDir = rootDir.Replace("\\", "/");

            ///// parent
            if (!rootDirRequested)
            {
                string fx  = AppHelper.GoUpAsDirectory(RequestFile);
                string fx2 = fx.Replace("\\", "/");
                string fx3 = fx2.Replace(rootDir, "");
                string fx4 = WebServer.EncodeUrlChars(fx3);
                string fx5 = "http://" + host_et_port + fx4;
                string fx6 = fx5.Replace("%2F", "/");

                RykonFile r = new RykonFile();
                r.IsDir    = false;
                r.Fullpath = fx;
                r.Webpath  = fx6;
                r.Name     = AppHelper.LastPeice(fx6, "/");
                lstr.Add(r);
            }
            else
            {
                lstr.Add(null);
            }


            foreach (string f in lstar) //files
            {
                string f2 = f.Replace("\\", "/");
                string f3 = f2.Replace(rootDir, "");
                string f4 = WebServer.EncodeUrlChars(f3);
                string f5 = "http://" + host_et_port + f4;
                string f6 = f5.Replace("%2F", "/");

                RykonFile r = new RykonFile();
                r.IsDir    = false;
                r.Fullpath = f;
                r.Webpath  = f6;
                r.Name     = AppHelper.LastPeice(f6, "/");
                lstr.Add(r);
            }
            foreach (string f in lstdar) // dirs
            {
                string f2 = f.Replace("\\", "/");
                string f3 = f2.Replace(rootDir, "");
                string f4 = WebServer.EncodeUrlChars(f3);
                string f5 = "http://" + host_et_port + f4;
                string f6 = f5.Replace("%2F", "/");

                RykonFile r = new RykonFile();
                r.IsDir    = true;
                r.Fullpath = f;
                r.Webpath  = f6 + "/";
                r.Name     = AppHelper.LastPeice(f6, "/");
                lstr.Add(r);
            }
            return(lstr.ToArray());
        }
Esempio n. 4
0
        internal static string ControlCommandListindex(string p1, string p2, string p3, string password)
        {
            string doc = "<a href='exec?passwd&com=msgbx&mbtitle=hello+It' >";

            doc += "message box </a><hr />";

            doc += "<a href='exec?passwd&com=procstr&procnm=notepad' > ";
            doc += "launch Process </a>";

            doc += "<hr /><a href='exec?passwd&com=closeprocess&procnm=chrome.exe' >";
            doc += "close process </a>";

            doc += "<hr /><a href='exec?passwd&com=procstr&procnm=explorer.exe&procpar=" + WebServer.EncodeUrlChars("@\"c:\"") + "' >";
            doc += "start explorer  </a>";

            doc += "<hr /><a href='exec?passwd&com=closeprocess&procnm=explorer' >";
            doc += "close explorer </a>";

            doc += "<hr /><a href='exec?passwd&com=procstr&procnm=bg.jpg&proctype=pic' >";
            doc += "Display Pic </a>";

            doc += "<hr /><a href='exec?passwd&com=closeallprocess&procnm=chrome.exe' >";
            doc += "close all Process </a>";
            doc  = doc.Replace("passwd", password);
            return(doc);
        }