forked from rohitcoderCdefense/vulnCodes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCWE-614.cs
27 lines (26 loc) · 828 Bytes
/
CWE-614.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
using System;
using System.Net;
using System.Text;
using System.IO;
using System.Web;
using System.Collections.Specialized;
namespace Test
{
class Program
{
static void Main(string[] args)
{
string url = "https://www.example.com";
string cookie = "cookie";
string value = "value";
string cookieValue = cookie + "=" + value + "; Secure";
string cookieHeader = "Cookie: " + cookieValue;
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
request.Method = "GET";
request.Headers.Add(cookieHeader);
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
Console.WriteLine(response.StatusCode);
Console.WriteLine(response.Headers);
}
}
}