第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

故意故意對頁面進(jìn)行編碼

故意故意對頁面進(jìn)行編碼

C#
九州編程 2021-04-08 14:06:53
我正在嘗試編寫一個(gè)故意易受命令注入攻擊的頁面。這是針對培訓(xùn)環(huán)境的。這是我到目前為止的代碼:public ActionResult CommandInjection()    {        string domain = Request.QueryString["domain"];        ViewBag.Domain = domain;        ProcessStartInfo psi = new ProcessStartInfo("nslookup.exe", domain)        {            UseShellExecute = false,            CreateNoWindow = true,            RedirectStandardOutput = true        };        var proc = Process.Start(psi);        string result = proc.StandardOutput.ReadToEnd();        ViewBag.Msg = "This page is vulnerable to Command Injection";        ViewBag.Result = result;        return View();    }看到正常的域查詢請求時(shí),它似乎運(yùn)行良好。但是,當(dāng)它看到這樣的請求時(shí):http://localhost:50159/Home/CommandInjection?domain=www.google.com+%26+dir 它返回一個(gè)空白。我期望的是它將返回域查找的結(jié)果,然后返回dir命令的輸出。C#
查看完整描述

2 回答

?
慕運(yùn)維8079593

TA貢獻(xiàn)1876條經(jīng)驗(yàn) 獲得超5個(gè)贊

在這種情況下,用腳拍自己的腳不是那么容易,但是您可以像這樣:


ProcessStartInfo psi = new ProcessStartInfo("cmd.exe", "/c \"nslookup.exe " + domain + "\"")

{

    UseShellExecute = false,

    CreateNoWindow = true,

    RedirectStandardOutput = true

};


查看完整回答
反對 回復(fù) 2021-04-10
  • 2 回答
  • 0 關(guān)注
  • 142 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)