Executing Commands through Http

Are you stuck at a particular point, can't find the answer elsewhere, here's the place to ask.
cbnzb
Posts: 3
Joined: Mon Jul 06, 2015 9:38 am

Executing Commands through Http

Postby cbnzb » Thu Jul 09, 2015 2:29 pm

I've got my hub rooted and have played around with aprontest, but I was wondering if it is possible to get the set_dev_value.php interface back?

CloneNum3
Site Admin
Posts: 107
Joined: Wed Jan 07, 2015 10:02 am

Re: Executing Commands through Http

Postby CloneNum3 » Fri Jul 10, 2015 11:25 pm

I expanded the 00.01 firmware update partition and extracted the php file... you should be able to just copy/paste it back...

/var/www/set_dev_value.php

Code: Select all

<?php
$nodeId = $_POST['nodeId'];
$attrId = $_POST['attrId'];
$v = $_POST['value'];

//$who = exec('whoami');
//echo $who;
//passthru("sudo ls", $retval);

//echo "nodeId=" .$nodeId . " attrId=" . $attrId . " value=" . $v;
$cmd = 'sudo ' . dirname(__FILE__) . '/php2apron set_value ' . $nodeId . " " . $attrId . " " . $v;

//echo $cmd . " ";

passthru($cmd, $retval);
echo "ret_code=" . $retval;

?>


tested...

Code: Select all

curl "http://192.168.41.38/set_dev_value.php" -d "nodeId=a&attrId=;uname -n;"
flex-dvt

CloneNum3
Site Admin
Posts: 107
Joined: Wed Jan 07, 2015 10:02 am

Re: Executing Commands through Http

Postby CloneNum3 » Fri Jul 10, 2015 11:27 pm

and in case anyone wants to do the same in the future...

I did mine on CentOS 6
installed mtd-utils-ubi-1.5.0-2.el6.nux.x86_64.rpm

Code: Select all

modprobe mtdblock
modprobe ubi
modprobe nandsim first_id_byte=0x01 second_id_byte=0xf1 third_id_byte=0x00 fourth_id_byte=0x1d
dd if=app-rootfs.ubi of=/dev/mtdblock0 bs=2048
yum install ./mtd-utils-ubi-1.5.0-2.el6.nux.x86_64.rpm
ubiattach /dev/ubi_ctrl -m 0 -O 2048
mkdir /media/ubifs
mount -t ubifs ubi0_0 /media/ubifs


Return to “Help me, I can't do xyz”

Who is online

Users browsing this forum: No registered users and 4 guests