Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions FckESC/Core/LoginIntranet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public static async Task<bool> LoginAsync(string account, string password)
httpClient.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("*/*"));
httpClient.DefaultRequestHeaders.Add("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36 Edg/87.0.664.66");

var httpResponse = await httpClient.GetAsync("http://172.17.18.2:8080/byod/index.xhtml");
var httpResponse = await httpClient.GetAsync("http://172.17.18.2:9092/byod/index.xhtml");

if (httpResponse.IsSuccessStatusCode)
{
Expand Down Expand Up @@ -61,7 +61,7 @@ public static async Task<bool> LoginAsync(string account, string password)
var content = new StringContent(data);
content.Headers.ContentType.MediaType = "application/x-www-form-urlencoded";

httpResponse = await httpClient.PostAsync("http://172.17.18.2:8080/byod/index.xhtml", content);
httpResponse = await httpClient.PostAsync("http://172.17.18.2:9092/byod/index.xhtml", content);

// 清空,后面用
var redirectUrl = "";
Expand All @@ -72,7 +72,7 @@ public static async Task<bool> LoginAsync(string account, string password)
// 重定向的地址
redirectUrl = httpResponse.RequestMessage.RequestUri.ToString();
Console.WriteLine(redirectUrl);
// "http://172.17.18.2:8080/byod/templatePage/20200318110733542/guestRegister.jsf"
// "http://172.17.18.2:9092/byod/templatePage/20200318110733542/guestRegister.jsf"
httpResponse = await httpClient.GetAsync(redirectUrl);

if (httpResponse.IsSuccessStatusCode)
Expand Down Expand Up @@ -123,7 +123,7 @@ public static async Task<bool> LoginAsync(string account, string password)
Regex regex = new Regex("(?<=url=\").+ (?= \")");
if (regex.IsMatch(html))
{
redirectUrl = "http://172.17.18.2:8080" + regex.Match(html).Value;
redirectUrl = "http://172.17.18.2:9092" + regex.Match(html).Value;

httpResponse = await httpClient.GetAsync(redirectUrl);
if (httpResponse.IsSuccessStatusCode)
Expand Down
2 changes: 1 addition & 1 deletion FckESC/Util/NetworkUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public static async Task<ConnectResult> ConnectAsync()
{
// 上面没拿到,就尝试用tcp连接,看看能不能成。
// 如果走到这里,八成是连接不上了。
if (tcp.ConnectAsync(INTRANETIP, 8080).Wait(1500))
if (tcp.ConnectAsync(INTRANETIP, 9092).Wait(1500))
{
string ip = ((System.Net.IPEndPoint)tcp.Client.LocalEndPoint).Address.ToString();
Console.WriteLine(ip);
Expand Down
4 changes: 2 additions & 2 deletions 内网登录过程.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ javax.faces.ViewState: N8QBoU0SYLMEO+J0+0V4WpquoRG+Cg9rDflycI7/6S5H9PnJi51MrnySv

N8QBoU0SYLMEO%2BJ0%2B0V4WpquoRG%2BCg9rDflycI7%2F6S5OmdqsPyrlwDTzgp834LDpOP6v%2FBr0DZjEK3JJ4cK3QMKaiLNL%2FK6vFOhgGx%2BspSOsElJt

无cookie状态,打开http://172.17.18.2:8080/byod/index.xhtml,
无cookie状态,打开http://172.17.18.2:9092/byod/index.xhtml,

找到action="/byod/index.xhtml;jsessionid=7E3F85BF2279D91EBF7E01C7AD088238",

并找到参数javax.faces.ViewState=N8QBoU0SYLMEO%2BJ0%2B0V4WpquoRG%2BCg9rDflycI7%2F6S5OmdqsPyrlwDTzgp834LDpOP6v%2FBr0DZjEK3JJ4cK3QMKaiLNL%2FK6vFOhgGx%2BspSOsElJt
(等号后面要进行url编码)

对http://172.17.18.2:8080/byod/index.xhtml;jsessionid=7E3F85BF2279D91EBF7E01C7AD088238进行post请求
对http://172.17.18.2:9092/byod/index.xhtml;jsessionid=7E3F85BF2279D91EBF7E01C7AD088238进行post请求
参数为
wlannasid=&usermac=&userurl=&userip=&ssid=&btn=&j_id_3_SUBMIT=1&javax.faces.ViewState=N8QBoU0SYLMEO%2BJ0%2B0V4WpquoRG%2BCg9rDflycI7%2F6S5OmdqsPyrlwDTzgp834LDpOP6v%2FBr0DZjEK3JJ4cK3QMKaiLNL%2FK6vFOhgGx%2BspSOsElJt

Expand Down