123
123
End Sub
End Sub
End Sub
Dim i As Integer
Dim quyen As Boolean
quyen = False
For i = 0 To quyenId.Count - 1
If (quyenId(i) = idQuyen) Then
quyen = True
End If
Next
Return quyen
End If
End If
Return False
End Function
Else
context.Response.Redirect("~/Default.aspx")
context.Response.End()
End If
End If
End If
Dim urlToPermissions As New Dictionary(Of String, List(Of Integer))() From
{
{"/baocaodonviguidenubndt.aspx", New List(Of Integer)() From {554}},
{"/baocaodonvinhantuubndt.aspx", New List(Of Integer)() From {555}},
{"/baocaoguinhanvbdt.aspx", New List(Of Integer)() From {1014}},
{"/baocaothvbdenphongban.aspx", New List(Of Integer)() From {146}},
{"/baocaothvbdenphongbanchitiet.aspx", New List(Of Integer)() From
{146}},
{"/baocaotong.aspx", New List(Of Integer)() From {126}},
{"/baocaovbdenphongban.aspx", New List(Of Integer)() From {146}},
{"/baocaovbdenphongbanchitiet.aspx", New List(Of Integer)() From
{146}},
{"/baocaovbdiphongban.aspx", New List(Of Integer)() From {146}},
{"/baocaovbdiphongbanchitiet.aspx", New List(Of Integer)() From {146}},
{"/baocaovpdt.aspx", New List(Of Integer)() From {137}},
{"/baocaovpdtchitiet.aspx", New List(Of Integer)() From {146}},
{"/dangnhap.aspx", New List(Of Integer)() From {56}},
{"/duyetvanban.aspx", New List(Of Integer)() From {57}},
{"/sovanbanden.aspx", New List(Of Integer)() From {67}},
{"/sovanbandi.aspx", New List(Of Integer)() From {67}},
{"/thongdiep.aspx", New List(Of Integer)() From {129}},
{"/thongdiepchitiet.aspx", New List(Of Integer)() From {129}},
{"/udfilesize.aspx", New List(Of Integer)() From {57}},
{"/xemvanban.aspx", New List(Of Integer)() From {57}},
{"/xemvanban_n.aspx", New List(Of Integer)() From {57}},
{"/chitiettinhhinhxulyvbden_4089cp.aspx", New List(Of Integer)() From
{1035}},
{"/insoden_4089cp.aspx", New List(Of Integer)() From {1030}},
{"/insodi_4089cp.aspx", New List(Of Integer)() From {1031}},
{"/tonghoptinhhinhxulyvbdencb_4089cp.aspx", New List(Of Integer)() From
{1034}},
{"/tonghoptinhhinhxulyvbdendv_4089cp.aspx", New List(Of Integer)() From
{1032}},
{"/tonghopvanbanden_4089cp.aspx", New List(Of Integer)() From {1033}},
{"/tonghopvbdi_4089cp.aspx", New List(Of Integer)() From {1036}},
{"/capnhatcongviec.aspx", New List(Of Integer)() From {47}},
{"/chitietcongviec.aspx", New List(Of Integer)() From {46}},
{"/loaicongviec.aspx", New List(Of Integer)() From {30}},
{"/taocongviec.aspx", New List(Of Integer)() From {47}},
{"/butphe.aspx", New List(Of Integer)() From {999}},
{"/canbo.aspx", New List(Of Integer)() From {16}},
{"/chucvu.aspx", New List(Of Integer)() From {9}},
{"/danhmucchucvuhop.aspx", New List(Of Integer)() From {86}},
{"/danhmuchinhthuc.aspx", New List(Of Integer)() From {82}},
{"/danhmuclinhvuc.aspx", New List(Of Integer)() From {83}},
{"/danhmucloaihinh.aspx", New List(Of Integer)() From {81}},
{"/danhmucloaithietbi.aspx", New List(Of Integer)() From {84}},
{"/danhmucphonghop.aspx", New List(Of Integer)() From {87}},
{"/danhmucthietbi.aspx", New List(Of Integer)() From {85}},
{"/dantoc.aspx", New List(Of Integer)() From {6}},
{"/donvi.aspx", New List(Of Integer)() From {31}},
{"/linhvuc.aspx", New List(Of Integer)() From {10}},
{"/linhvuccv.aspx", New List(Of Integer)() From {10, 1251}},
{"/loai.aspx", New List(Of Integer)() From {11}},
{"/loaisovanban.aspx", New List(Of Integer)() From {65}},
{"/loaisovbdi.aspx", New List(Of Integer)() From {66}},
{"/loaithongdiep.aspx", New List(Of Integer)() From {59}},
{"/menu.aspx", New List(Of Integer)() From {15}},
{"/nhomquyen.aspx", New List(Of Integer)() From {17}},
{"/noigui.aspx", New List(Of Integer)() From {53}},
{"/noinhan.aspx", New List(Of Integer)() From {42}},
{"/phuongxa.aspx", New List(Of Integer)() From {5}},
{"/quanhuyen.aspx", New List(Of Integer)() From {4}},
{"/to.aspx", New List(Of Integer)() From {15}},
{"/tongiao.aspx", New List(Of Integer)() From {7}},
{"/trinhdo.aspx", New List(Of Integer)() From {8}},
{"/ykienchidaoxuly.aspx", New List(Of Integer)() From {160}},
{"/baocaoqlcvchitietdonvi.aspx", New List(Of Integer)() From {146}},
{"/baocaoqlcvtheocanhan.aspx", New List(Of Integer)() From {146}},
{"/baocaoqlcvtonghopdonvi.aspx", New List(Of Integer)() From {146}},
{"/baocaoqlcvtonghoptheotrangthai.aspx", New List(Of Integer)() From
{146}},
{"/capnhatgiaoviec.aspx", New List(Of Integer)() From {1251}},
{"/dashboardqlcv.aspx", New List(Of Integer)() From {1251, 701}},
{"/quanlycongviec.aspx", New List(Of Integer)() From {1251}},
{"/taogiaoviec.aspx", New List(Of Integer)() From {1251}},
{"/thongtincongviec.aspx", New List(Of Integer)() From {1251}},
{"/capnhatsdtdonvi.aspx", New List(Of Integer)() From {1006}},
{"/capnhattaikhoan.aspx", New List(Of Integer)() From {17}},
{"/cauhinhbrandname.aspx", New List(Of Integer)() From {26}},
{"/dangkyotp.aspx", New List(Of Integer)() From {13}},
{"/danhba.aspx", New List(Of Integer)() From {128}},
{"/danhsachdonvitructhuoc.aspx", New List(Of Integer)() From {90}},
{"/dinhnghiachutrinhvb.aspx", New List(Of Integer)() From {136}},
{"/doimatkhau.aspx", New List(Of Integer)() From {12}},
{"/importcb.aspx", New List(Of Integer)() From {42}},
{"/lienhe.aspx", New List(Of Integer)() From {29}},
{"/nhatky.aspx", New List(Of Integer)() From {14}},
{"/phanquyen.aspx", New List(Of Integer)() From {17}},
{"/phantocb.aspx", New List(Of Integer)() From {42}},
{"/thongbao.aspx", New List(Of Integer)() From {18}},
{"/thongtin.aspx", New List(Of Integer)() From {20}},
{"/capnhatchude.aspx", New List(Of Integer)() From {47}},
{"/chitietchude.aspx", New List(Of Integer)() From {46}},
{"/loaichude.aspx", New List(Of Integer)() From {30}},
{"/taochude.aspx", New List(Of Integer)() From {47}},
{"/capquyendangkylct.aspx", New List(Of Integer)() From {42}},
{"/dangkychitietlich.aspx", New List(Of Integer)() From {50}},
{"/dangkytuancanhan.aspx", New List(Of Integer)() From {50}},
{"/dangkytuandonvi.aspx", New List(Of Integer)() From {50}},
{"/dangkytuantocm.aspx", New List(Of Integer)() From {52}},
{"/phanquyenlcttocm.aspx", New List(Of Integer)() From {42}},
{"/xembaocaocn.aspx", New List(Of Integer)() From {49}},
{"/xembaocaodv.aspx", New List(Of Integer)() From {49}},
{"/xembaocaodv_all.aspx", New List(Of Integer)() From {49}},
{"/xembaocaotocm.aspx", New List(Of Integer)() From {49}},
{"/xemlctcn.aspx", New List(Of Integer)() From {49}},
{"/xemlichcanhan.aspx", New List(Of Integer)() From {49}},
{"/xemlichcongtac.aspx", New List(Of Integer)() From {49}},
{"/xemlichdonvi.aspx", New List(Of Integer)() From {49}},
{"/xemlichphong.aspx", New List(Of Integer)() From {49}},
{"/capnhatcuochop.aspx", New List(Of Integer)() From {88}},
{"/chitietcuochop.aspx", New List(Of Integer)() From {88}},
{"/diemdanhthanhphanhop.aspx", New List(Of Integer)() From {88}},
{"/lichhop.aspx", New List(Of Integer)() From {88}},
{"/moihop.aspx", New List(Of Integer)() From {89}},
{"/chiase.aspx", New List(Of Integer)() From {134}},
{"/tailieu.aspx", New List(Of Integer)() From {133}},
{"/tailieuchiase.aspx", New List(Of Integer)() From {133}},
{"/thungrac.aspx", New List(Of Integer)() From {135}},
{"/chitietgui.aspx", New List(Of Integer)() From {43}},
{"/chitietnhan.aspx", New List(Of Integer)() From {41}},
{"/chuyentiep.aspx", New List(Of Integer)() From {41, 43}},
{"/danhan.aspx", New List(Of Integer)() From {41, 41}},
{"/gui.aspx", New List(Of Integer)() From {42}},
{"/taonhom.aspx", New List(Of Integer)() From {44}},
{"/chuyenthumoi.aspx", New List(Of Integer)() From {121}},
{"/danhsachthumoi.aspx", New List(Of Integer)() From {121}},
{"/duyetthumoi.aspx", New List(Of Integer)() From {121}},
{"/sothumoi.aspx", New List(Of Integer)() From {123}},
{"/taothumoi.aspx", New List(Of Integer)() From {122}},
{"/xemchitietthumoi.aspx", New List(Of Integer)() From {121}},
{"/guitinnhan.aspx", New List(Of Integer)() From {62}},
{"/guitinnhantufile.aspx", New List(Of Integer)() From {62}},
{"/taonhomtinnhan.aspx", New List(Of Integer)() From {63}},
{"/capnhatchitiet.aspx", New List(Of Integer)() From {42}},
{"/chitiettintuc.aspx", New List(Of Integer)() From {42}},
{"/danhmuctintuc.aspx", New List(Of Integer)() From {42}},
{"/xemchitiettin1.aspx", New List(Of Integer)() From {42}},
{"/xemtintuc.aspx", New List(Of Integer)() From {42}},
{"/baocaogiaiquyetnhiemvu.aspx", New List(Of Integer)() From {42}},
{"/baocaophancongcv.aspx", New List(Of Integer)() From {42, 42}},
{"/baocaotonghop.aspx", New List(Of Integer)() From {124}},
{"/baocaoxulyvb.aspx", New List(Of Integer)() From {42}},
{"/capnhatvanban.aspx", New List(Of Integer)() From {21}},
{"/capnhatvbden.aspx", New List(Of Integer)() From {21}},
{"/capnhatvbdenchuyen.aspx", New List(Of Integer)() From {21}},
{"/capnhatvbdenkp.aspx", New List(Of Integer)() From {21}},
{"/capnhatvbdi.aspx", New List(Of Integer)() From {27}},
{"/chovaoso.aspx", New List(Of Integer)() From {21}},
{"/duyetden.aspx", New List(Of Integer)() From {24}},
{"/duyetden_chitiet.aspx", New List(Of Integer)() From {24}},
{"/duyetden_duyet.aspx", New List(Of Integer)() From {24}},
{"/duyetdi.aspx", New List(Of Integer)() From {25}},
{"/duyetdi_chitiet.aspx", New List(Of Integer)() From {25}},
{"/duyetdi_chuyen.aspx", New List(Of Integer)() From {25}},
{"/duyetphathanh.aspx", New List(Of Integer)() From {27}},
{"/inphieutrinh.aspx", New List(Of Integer)() From {49}},
{"/luuden.aspx", New List(Of Integer)() From {21}},
{"/luudicv.aspx", New List(Of Integer)() From {27}},
{"/phathanhvanbandi.aspx", New List(Of Integer)() From {22}},
{"/phathanhvanbandicapnhatvb.aspx", New List(Of Integer)() From {22}},
{"/quatrinh_xuly.aspx", New List(Of Integer)() From {21, 22, 24, 25,
28, 19}},
{"/quatrinh_xulydi.aspx", New List(Of Integer)() From {21, 22, 24, 25,
28}},
{"/searchvanbanden.aspx", New List(Of Integer)() From {23}},
{"/searchvanbandenv2.aspx", New List(Of Integer)() From {23}},
{"/searchvanbandi.aspx", New List(Of Integer)() From {26}},
{"/searchvanbandiv2.aspx", New List(Of Integer)() From {26}},
{"/taonhomlienthong.aspx", New List(Of Integer)() From {34}},
{"/taonhomnn_ngoaidv.aspx", New List(Of Integer)() From {33}},
{"/taonhomnn_vanban.aspx", New List(Of Integer)() From {33}},
{"/timkiemvanban.aspx", New List(Of Integer)() From {127}},
{"/uyquyen.aspx", New List(Of Integer)() From {32}},
{"/xemchitiettonghop.aspx", New List(Of Integer)() From {124}},
{"/xemden.aspx", New List(Of Integer)() From {19}},
{"/xemden_chuahoantat.aspx", New List(Of Integer)() From {19}},
{"/xemden_chualuu.aspx", New List(Of Integer)() From {1020}},
{"/xemden_chuyen.aspx", New List(Of Integer)() From {19}},
{"/xemden_vbhanxl.aspx", New List(Of Integer)() From {19}},
{"/xemdi.aspx", New List(Of Integer)() From {27}},
{"/xemvb_phathanh.aspx", New List(Of Integer)() From {27}},
{"/xem_chitiet.aspx", New List(Of Integer)() From {19}},
{"/xulyden.aspx", New List(Of Integer)() From {21}},
{"/xulydenedoc_luu.aspx", New List(Of Integer)() From {21}},
{"/xulyden_capnhat.aspx", New List(Of Integer)() From {21}},
{"/xulyden_chitiet.aspx", New List(Of Integer)() From {21}},
{"/xulyden_chuyen.aspx", New List(Of Integer)() From {21}},
{"/xulyden_luu.aspx", New List(Of Integer)() From {21}},
{"/xulydi.aspx", New List(Of Integer)() From {22}},
{"/xulydicv.aspx", New List(Of Integer)() From {27}},
{"/xulydicv_chitiet.aspx", New List(Of Integer)() From {28}},
{"/xulydi_capnhat.aspx", New List(Of Integer)() From {22}},
{"/xulydi_capnhatvb.aspx", New List(Of Integer)() From {22}},
{"/xulydi_capnhat_.aspx", New List(Of Integer)() From {22}},
{"/xulydi_chitiet.aspx", New List(Of Integer)() From {22}},
{"/capnhat_vbnb.aspx", New List(Of Integer)() From {42}},
{"/guivanbannoibo.aspx", New List(Of Integer)() From {42}},
{"/quatrinhxuly_vbnb.aspx", New List(Of Integer)() From {42}},
{"/taonhomvanbannoibo.aspx", New List(Of Integer)() From {44}},
{"/vanbannoibo_chocapso.aspx", New List(Of Integer)() From {69}},
{"/vanbannoibo_gui.aspx", New List(Of Integer)() From {42}},
{"/vanbannoibo_nhan.aspx", New List(Of Integer)() From {42}},
{"/xemchitiet_vbnb.aspx", New List(Of Integer)() From {42}},
{"/baocaoplvb473.aspx", New List(Of Integer)() From {146}},
{"/baocaovbcdtonghop.aspx", New List(Of Integer)() From {1001}},
{"/baocaovbcdtonghopnhanvien.aspx", New List(Of Integer)() From
{1001}},
{"/baocaovbcdtonghop_n.aspx", New List(Of Integer)() From {1001}},
{"/vbcdduyetden.aspx", New List(Of Integer)() From {24}},
{"/vbcdduyetden_chitiet.aspx", New List(Of Integer)() From {24}},
{"/vbcdduyetden_duyet.aspx", New List(Of Integer)() From {24}},
{"/vbcdduyetdi.aspx", New List(Of Integer)() From {25}},
{"/vbcdduyetdi_chitiet.aspx", New List(Of Integer)() From {25}},
{"/vbcdduyetdi_chuyen.aspx", New List(Of Integer)() From {25}},
{"/vbcdluudicv.aspx", New List(Of Integer)() From {27}},
{"/vbcdphathanhvanbandi.aspx", New List(Of Integer)() From {22}},
{"/vbcdtheodoi.aspx", New List(Of Integer)() From {21}},
{"/vbcdtheodoidinhky.aspx", New List(Of Integer)() From {21}},
{"/vbcdxemden.aspx", New List(Of Integer)() From {19}},
{"/vbcdxemden_chuyen.aspx", New List(Of Integer)() From {19}},
{"/vbcdxem_chitiet.aspx", New List(Of Integer)() From {19}},
{"/vbcdxulyden_capnhat.aspx", New List(Of Integer)() From {21}},
{"/vbcdxulyden_chitiet.aspx", New List(Of Integer)() From {21}},
{"/vbcdxulyden_chuyen.aspx", New List(Of Integer)() From {21}},
{"/vbcdxulyden_luu.aspx", New List(Of Integer)() From {21}},
{"/vbcdxulydi.aspx", New List(Of Integer)() From {22}},
{"/vbcdxulydicv.aspx", New List(Of Integer)() From {27}},
{"/vbcdxulydicv_chitiet.aspx", New List(Of Integer)() From {28}},
{"/vbcdxulydi_capnhat.aspx", New List(Of Integer)() From {22}},
{"/vbcdxulydi_chitiet.aspx", New List(Of Integer)() From {22}}
}
matchIndex = n
Return False
End Function
Do While True
Dim bytesRead As Integer = Request.InputStream.Read(buffer1, 0,
1024)
If bytesRead = 0 Then Exit Do
requestBody.AddRange(buffer1.Take(bytesRead)) ' Thêm dữ liệu vào
danh sách
Loop
Request.InputStream.Position = 0
End If
For Each key In Request.Form.AllKeys
If (key IsNot Nothing) Then
If (key.ToUpper() <> "__EVENTTARGET" And key.ToUpper() <>
"__EVENTARGUMENT" And key.ToUpper() <> "__VIEWSTATEGENERATOR" And key.ToUpper() <>
"__VIEWSTATE" And key.ToUpper() <> "__EVENTVALIDATION" And key.ToUpper() <>
"__LASTFOCUS") Then
Dim value As String = Request.Form(key)
If (key.ToUpper() <> "__CALLBACKPARAM" And key.ToUpper() <>
"__CALLBACKID" And checkSQL_Injection(value) = False) Then
Response.Write("loi param 1")
Response.End()
Return
End If
If
(Request.Url.AbsolutePath.ToLower().Contains("thongdiep/gui.aspx")) Then
If IsDangerousString(value, 0) = True Then
Response.Write("loi param 2")
Response.End()
Return
End If
End If
End If
End If
Next
Do While True
Dim bytesRead As Integer =
file.InputStream.Read(fileBuffer, 0, 1024)
If bytesRead = 0 Then Exit Do
fileBody.AddRange(fileBuffer.Take(bytesRead)) '
Thêm dữ liệu vào danh sách
Loop
fileContent =
Encoding.UTF8.GetString(fileBody.ToArray()) ' Chuyển đổi byte sang chuỗi
If fileContent.ToLower().Contains("javascript") Then
Response.Write("File khong hop le 1")
Response.End()
End If
file.InputStream.Position = 0
End If
'Return
' Xử lý logic tại đây nếu file hợp lệ
' Ví dụ: Lưu file vào thư mục hoặc thực hiện xử lý khác
Else
' Xử lý logic nếu file không hợp lệ
' Ví dụ: Hiển thị thông báo lỗi
Response.Write("File khong hop le 2")
Response.End()
End If
End If
Next
End If
'If Request.Url.AbsolutePath.ToLower.Contains(".pdf") And
Request.Url.AbsolutePath.ToLower.Contains("vm01d2rfqxhnak09") Then
' Dim pdfContent As Byte() =
System.IO.File.ReadAllBytes(Server.MapPath(Request.Url.AbsolutePath))
' Dim fileName As String =
Path.GetFileName(Request.Url.AbsolutePath.ToLower)
' Response.Clear()
' Response.AddHeader("Content-Disposition", "inline; filename=" &
fileName & ".pdf")
' Response.AddHeader("Content-Length", pdfContent.Length.ToString())
' Response.ContentType = "application/pdf"
' Response.BinaryWrite(pdfContent)
' Response.End()
' Return
'End If
End Sub
' List of SQL keywords and patterns commonly used in SQL injection attacks
Dim sqlKeywords As String() = {
"SELECT", "INSERT", "UPDATE", "DELETE", "CREATE", "ALTER", "COMMIT",
"ROLLBACK",
"UNION", "JOIN", "WHERE", "INTO", "VALUES", "EXEC", "TRUNCATE",
"DECLARE",
"NVARCHAR", "CAST", "CONVERT", "EXECUTE", "INFORMATION_SCHEMA",
"TABLE_NAME",
"COLUMN_NAME", "CHAR", " AND ", " OR ", "AND ", "OR ", " AND", " OR",
";--", "/*", "*/", "CHAR(",
"NCHAR(", "VARCHAR(", "NVARCHAR(", "ALTER", "BEGIN", "DROP", "EXECUTE",
"FETCH",
"GRANT", "INSERT", "KILL", "MERGE", "OPEN", "SHUTDOWN", "SLEEP",
"SLEEP", "SYSTEM",
"TRUNCATE", "WAITFOR", "GREATEST", "BETWEEN", "SCHEMA", "DATABASE",
"DATATABLE",
"DBMS_NETWORK_ACL_ADMIN",
"UTL_SMTP",
"DBMS_XDB",
"DBMS_SCHEDULER",
"DBMS_XDB_CONFIG",
"DBMS_AQ",
"UTL_MAIL",
"DBMS_AQELM",
"DBMS_NETWORK_ACL_UTILITY",
"DBMS_MGD_ID_UTL",
"UTL_TCP",
"DBMS_MGWADM",
"DBMS_STREAMS_ADM",
"UTL_HTTP",
"DBMS_PIPE.RECEIVE_MESSAGE",
"DBMS_XMLQUERY.GETXML"
}
Return True
End Function
Return result.ToString()
End Function
</script>