<?php
//unset($_COOKIE['aiepsso']);
$userid="aaron.aguirre";
$rut="17317380";
$timestamp=time();
$courseid="null";
$ruta="null";
$sharedSecret="AIEP";
$macParamsString=$courseid.$rut.$ruta.$timestamp.$userid.$sharedSecret;
$md5String=md5($macParamsString);
$auth=base64_encode($macParamsString);//$md5String);
$host="location:https://aieptest.blackboard.com";
$hostV="https://aiepclone.blackboard.com";
$hostVL="location:https://aiepclone.blackboard.com";
$hostT="location:http://localhost:9876";
$autoSignOnURL="/webapps/oslt-auth-provider-autosignon-BBLEARN/service/login/_142_1";
$params="timestamp=".$timestamp."&userId=".$userid."&courseid=".$courseid."&ruta=".$ruta."&rut=".$rut."&auth=".$md5String;//.$auth;
$bbURL=$hostV.$autoSignOnURL;//.$params;
// header("location:".$bbURL."?".$params);
/////////////////////////CURL////////////////////////
/*$curl=curl_init();
$postParameters=array();
$postParameters['timestamp']=$timestamp;
$postParameters['userId']=$userid;
$postParameters['courseid']=$courseid;
$postParameters['ruta']=$ruta;
$postParameters['rut']=$rut;
$postParameters['auth']=$md5String;
curl_setopt($curl,CURLOPT_URL,$bbURL);
curl_setopt($curl,CURLOPT_POST,sizeof($postParameters));
curl_setopt($curl,CURLOPT_POSTFIELDS,http_build_query($postParameters));
curl_setopt($curl, CURLOPT_HEADER, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);
curl_setopt($curl,CURLOPT_COOKIE, $cookiesIn);
curl_setopt($curl,CURLOPT_COOKIEFILE, "");
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
//curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "POST");
$result = curl_exec($curl);
$header = curl_getinfo( $curl );
$err = curl_errno( $curl );
$errmsg = curl_error( $curl );
curl_close($curl);
$header_content = substr($result, 0, $header['header_size']);
$postValue=file_get_contents($bbURL);
$body_content = trim(str_replace($header_content, '', $result));
$pattern = "#Set-Cookie:\\s+(?<cookie>[^=]+=[^;]+)#m";
preg_match_all($pattern, $header_content, $matches);
$cookiesOut = implode("; ", $matches['cookie']);
$header['errno'] = $err;
$header['errmsg'] = $errmsg;
$header['headers'] = $header_content;
$header['content'] = $body_content;
$header['cookies'] = $cookiesOut;
$cookiesValue1=explode("=",$matches[cookie][0]);
$cookiesValue2=explode("=",$matches[cookie][1]);
$cookiesValue3=explode("=",$matches[cookie][2]);
$cookiesValue4=explode("=",$matches[cookie][3]);
$cookiename1=$cookiesValue1[0];
$cookiename2=$cookiesValue2[0];
$cookiename3=$cookiesValue3[0];
$cookiename4=$cookiesValue4[0];
$cookieValue1=$cookiesValue1[1];
$cookieValue2=$cookiesValue2[1];
$cookieValue3=$cookiesValue3[1];
$cookieValue4=$cookiesValue4[1];*/
/* setcookie($cookiename1,$cookieValue1,0,"/");
setcookie($cookiename2,$cookieValue2,0,"/");
setcookie($cookiename3,$cookieValue3,0,"/");
setcookie($cookiename4,$cookieValue4,0,"/");
*/
/* preg_match_all('|Location: (.*)\n|U', $result, $results);
$location = implode(';', $results[1]);
$realLocationA=$results[1];//implode(";",$location);
$realLocation=$realLocationA[2];
setcookie("",$cookiesOut,0,"/",$realLocation);*/
/*setcookie($cookiename1,$cookieValue1,0,"/",$realLocation);
setcookie($cookiename2,$cookieValue2,0,"/",$realLocation);
setcookie($cookiename3,$cookieValue3,0,"/",$realLocation);
setcookie($cookiename4,$cookieValue4,0,"/",$realLocation);*/
//header("Location: $realLocation");
//header("location:".$header['redirect_url']);
//////////////////////////////////////////////////////////////////
///////////////////////////////////////File Get Contents ///////////////////////////
/*$curl=curl_init();
$postParameters=array();
$postParameters['timestamp']=$timestamp;
$postParameters['userId']=$userid;
$postParameters['courseid']=$courseid;
$postParameters['ruta']=$ruta;
$postParameters['rut']=$rut;
$postParameters['auth']=$md5String;
curl_setopt($curl,CURLOPT_URL,$bbURL);
curl_setopt($curl,CURLOPT_POST,sizeof($postParameters));
curl_setopt($curl,CURLOPT_POSTFIELDS,http_build_query($postParameters));
curl_setopt($curl, CURLOPT_HEADER, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);
curl_setopt($curl,CURLOPT_COOKIE, $cookiesIn);
curl_setopt($curl,CURLOPT_COOKIEFILE, "");
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
//curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "POST");
$result = curl_exec($curl);
$header = curl_getinfo( $curl );
$err = curl_errno( $curl );
$errmsg = curl_error( $curl );
curl_close($curl);
$authLocation="location:".$header['url'];
//print $result;
header($authLocation);*/
/* $postdata=http_build_query(array(
'timestamp' => $timestamp,
'userId' => $userid,
'courseid' => $courseid,
'ruta' => $ruta,
'rut' => $rut,
'auth' => $md5String));
$opts=array('https'=>array('method'=>'POST','header'=>"Connection: close\r\n"."Content-Length: ".strlen($postdata)."\r\n",'content'=>$postdata));//$postdata));
$context=stream_context_create($opts);
$resultHtml=file_get_contents($bbURL,false,$context);
echo $resultHtml;*/
//var_dump($result);
//header("location:".$bbURL);
////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////HTTPRequest//////////////////////
/* $http = new HttpRequest($bbURL, HttpRequest::METH_POST);
$http->addPostFields(array(
'timestamp' => $timestamp,
'userId' => $userid,
'courseid' => $courseid,
'ruta' => $ruta,
'rut' => $rut,
'auth' => $md5String
));
$response = $http->send();*/
////////////////////////////////////////////////////////////////
/////////////////////////CURL Less/////////////////////////////
/*$data = array('timestamp' => $timestamp, 'userId' => $userid,'courseid' => $courseid,'ruta' => $ruta,'rut' => $rut, 'auth' => $md5String);
$options = array(
'http' => array(
'header' => "Content-type: application/x-www-form-urlencoded\r\n",
'method' => 'POST',
'content' => http_build_query($data),
),
);
$context = stream_context_create($options);
//$result = file_get_contents($bbURL, false, $context);
$fp = fopen($bbURL, 'r', false, $context);
*/
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////http_post_fields()///////////////////////////
/* $postdata=array(
'timestamp' => $timestamp,
'userId' => $userid,
'courseid' => $courseid,
'ruta' => $ruta,
'rut' => $rut,
'auth' => $md5String);
$response=http_post_fields($bbURL,$postdata);
*/
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////HTTP Request////////////////////////////////////////
$r=new http_request($bbURL);
$r->setMethod(HTTP_REQUEST_METHOD_POST);
$r->addPostData('timestamp',$timestamp);
$r->addPostData('userId',$userid);
$r->addPostData('courseid',$courseid);
$r->addPostData('ruta',$ruta);
$r->addPostData('rut',$rut);
$r->addPostData('auth',$md5String);
$r->sendRequest();
$page=$r->getResponseBody();
echo $page;
/////////////////////////////////////////////////////////////////////////////////////
?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename: /in/FT6qi
function name: (null)
number of ops: 80
compiled vars: !0 = $userid, !1 = $rut, !2 = $timestamp, !3 = $courseid, !4 = $ruta, !5 = $sharedSecret, !6 = $macParamsString, !7 = $md5String, !8 = $auth, !9 = $host, !10 = $hostV, !11 = $hostVL, !12 = $hostT, !13 = $autoSignOnURL, !14 = $params, !15 = $bbURL, !16 = $r, !17 = $page
line #* E I O op fetch ext return operands
-------------------------------------------------------------------------------------
4 0 E > ASSIGN !0, 'aaron.aguirre'
5 1 ASSIGN !1, '17317380'
6 2 INIT_FCALL 'time'
3 DO_ICALL $20
4 ASSIGN !2, $20
7 5 ASSIGN !3, 'null'
8 6 ASSIGN !4, 'null'
9 7 ASSIGN !5, 'AIEP'
10 8 CONCAT ~25 !3, !1
9 CONCAT ~26 ~25, !4
10 CONCAT ~27 ~26, !2
11 CONCAT ~28 ~27, !0
12 CONCAT ~29 ~28, !5
13 ASSIGN !6, ~29
12 14 INIT_FCALL 'md5'
15 SEND_VAR !6
16 DO_ICALL $31
17 ASSIGN !7, $31
13 18 INIT_FCALL 'base64_encode'
19 SEND_VAR !6
20 DO_ICALL $33
21 ASSIGN !8, $33
14 22 ASSIGN !9, 'location%3Ahttps%3A%2F%2Faieptest.blackboard.com'
15 23 ASSIGN !10, 'https%3A%2F%2Faiepclone.blackboard.com'
16 24 ASSIGN !11, 'location%3Ahttps%3A%2F%2Faiepclone.blackboard.com'
17 25 ASSIGN !12, 'location%3Ahttp%3A%2F%2Flocalhost%3A9876'
18 26 ASSIGN !13, '%2Fwebapps%2Foslt-auth-provider-autosignon-BBLEARN%2Fservice%2Flogin%2F_142_1'
19 27 CONCAT ~40 'timestamp%3D', !2
28 CONCAT ~41 ~40, '%26userId%3D'
29 CONCAT ~42 ~41, !0
30 CONCAT ~43 ~42, '%26courseid%3D'
31 CONCAT ~44 ~43, !3
32 CONCAT ~45 ~44, '%26ruta%3D'
33 CONCAT ~46 ~45, !4
34 CONCAT ~47 ~46, '%26rut%3D'
35 CONCAT ~48 ~47, !1
36 CONCAT ~49 ~48, '%26auth%3D'
37 CONCAT ~50 ~49, !7
38 ASSIGN !14, ~50
20 39 CONCAT ~52 !10, !13
40 ASSIGN !15, ~52
203 41 NEW $54 'http_request'
42 SEND_VAR_EX !15
43 DO_FCALL 0
44 ASSIGN !16, $54
204 45 INIT_METHOD_CALL !16, 'setMethod'
46 FETCH_CONSTANT ~57 'HTTP_REQUEST_METHOD_POST'
47 SEND_VAL_EX ~57
48 DO_FCALL 0
205 49 INIT_METHOD_CALL !16, 'addPostData'
50 SEND_VAL_EX 'timestamp'
51 SEND_VAR_EX !2
52 DO_FCALL 0
206 53 INIT_METHOD_CALL !16, 'addPostData'
54 SEND_VAL_EX 'userId'
55 SEND_VAR_EX !0
56 DO_FCALL 0
207 57 INIT_METHOD_CALL !16, 'addPostData'
58 SEND_VAL_EX 'courseid'
59 SEND_VAR_EX !3
60 DO_FCALL 0
208 61 INIT_METHOD_CALL !16, 'addPostData'
62 SEND_VAL_EX 'ruta'
63 SEND_VAR_EX !4
64 DO_FCALL 0
209 65 INIT_METHOD_CALL !16, 'addPostData'
66 SEND_VAL_EX 'rut'
67 SEND_VAR_EX !1
68 DO_FCALL 0
210 69 INIT_METHOD_CALL !16, 'addPostData'
70 SEND_VAL_EX 'auth'
71 SEND_VAR_EX !7
72 DO_FCALL 0
211 73 INIT_METHOD_CALL !16, 'sendRequest'
74 DO_FCALL 0
212 75 INIT_METHOD_CALL !16, 'getResponseBody'
76 DO_FCALL 0 $66
77 ASSIGN !17, $66
213 78 ECHO !17
217 79 > RETURN 1
Generated using Vulcan Logic Dumper, using php 8.0.0
preferences:
155.57 ms | 1400 KiB | 19 Q