-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathFormsDecrypt.cs
34 lines (32 loc) · 1.07 KB
/
FormsDecrypt.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web;
using System.Web.Security;
namespace FormsTicketCrypt
{
class Program
{
static void Main(string[] args)
{
// Test if input arguments were supplied.
if (args.Length == 0)
{
Console.WriteLine("Please supply encrypted forms ticket");
return;
}
string encryptedTicket = args[0];
FormsAuthenticationTicket unencryptedTicket = FormsAuthentication.Decrypt(encryptedTicket);
Console.WriteLine(unencryptedTicket.Version);
Console.WriteLine(unencryptedTicket.Name);
Console.WriteLine(unencryptedTicket.IssueDate);
Console.WriteLine(unencryptedTicket.Expiration);
Console.WriteLine(unencryptedTicket.IsPersistent);
Console.WriteLine(unencryptedTicket.UserData);
Console.WriteLine(unencryptedTicket.CookiePath);
Console.ReadLine();
}
}
}