More PFSESNE collect the DCHP table

  • I have six PFSENSE I hope to integrate the DHCP form
    May I ask how you want to use a CURL login PFSESEN to the DCHP page?
    Thank you

  • I tried using the following code to try to login
    But they are unable to successfully
    May I ask which side is wrong yet?

    // usernamefld   admin
    // passwordfld   #00000@0#
    $form_vars = array();
    $username = 'admin';
    $password = ' #00000@0#';
    $loginUrl = '';
    $user_agent="Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)";
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $loginUrl);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, 'usernamefld'.$username.'passwordfld'.$password);
    curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt ($ch, CURLOPT_USERAGENT, $user_agent);
    $store = curl_exec($ch);
    echo $store

  • I tried using the LYNC login CENTOS
    A need to agree to two COOKIE start
    May ask the problem is here to assist you modify the code
    Thank you!!
 cookie:PHPSESSID=c5fd9a26bfd47842da6274f0087e0169 是否接受? (Y/N/Always/neVer) cookie:cookie_test=1381989432 是否接受? (Y/N/Always/neVer)
    Enter username and password to login.
    * System
    + Advanced
    + Cert Manager
    + Firmware
    + General Setup
    + High Avail. Sync
    + Logout
    + Packages
    + Routing
    + Setup Wizard
    + User Manager
    * Interfaces

  • i try edit code like this
    still ERROR  :(

    // usernamefld   admin
    // passwordfld   #00000@0#
    $form_vars = array();
    $username = 'admin';
    $password = '#00000@0#';
    $loginUrl = '';
    $user_agent="Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20070725 Firefox/";
    $form_data= 'login=Login&usernamefld=admin&passwordfld=#00000@0#';
    $ckfile = "/tmp/Cookiefile.txt";
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $loginUrl);
    curl_setopt($ch, CURLOPT_COOKIEJAR, $ckfile);
    //curl_setopt($ch, CURLOPT_COOKIEFILE, $ckfile);
    // curl_setopt($ch, CURLOPT_COOKIE, "A=01;B=02;C=03");
    curl_setopt($ch, CURLOPT_POST, TRUE);
    curl_setopt($ch, CURLOPT_POSTFIELDS, 'login=Login&usernamefld=admin&passwordfld=#00000@0#');
    //curl_setopt($ch, CURLOPT_POSTFIELDS, $form_data);
    //curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
    //curl_setopt($ch, CURLOPT_USERAGENT, $user_agent);
    //curl_setopt($ch, CURLOPT_REFERER, $postUrl); 
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
    curl_setopt($ch, CURLOPT_URL, $postUrl);
    curl_setopt($ch, CURLOPT_COOKIEFILE, $ckfile);
    $store = curl_exec($ch);
    echo $store;
    CSRF check failed. Either your session has expired, this page has been inactive too long, or you need to enable cookies.

Log in to reply