I've got a TPLink TL-SG1024DE switch and want to pull some stats off it for giggles.  It doesn't seem to have SNNO, but does have port mirroring.


But it's also got a pretty page with stats on all the ports:


Port    Status     Link Status       TxGoodPkt    TxBadPkt      RxGoodPkt     RxBadPkt
Port 1  Enabled   100Full           498251196    0                 131304668        210126
Port 2  Enabled   Link Down       366673044    0                  89192528                0
Port 3  Enabled   1000Full         311815473    0                  866313613               0




I've been trying to play with curl to log in and access this page.  It seems to call a login.cgi page, with a form 




    1. Request URL: http://sg1024.lan/logon.cgi
    2. Request Method: POST
    3. Status Code:   200 OK
    4. Remote Address: [::1]:3000


  1. Response Headersview source



    1. Cache-Control: no-cache
    2. Connection: close
    3. Expires: -1
    4. Pragma: no-cache


  2. Request Headersview source



    1. Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
    2. Accept-Encoding: gzip, deflate
    3. Accept-Language: en-US,en;q=0.8
    4. Cache-Control: max-age=0
    5. Connection: keep-alive
    6. Content-Length: 41
    7. Content-Type: application/x-www-form-urlencoded
    8. DNT: 1
    9. Host: sg1024.lan
    10. Origin: http://sg1024.lan
    11. Referer: http://sg1024.lan/
    12. Upgrade-Insecure-Requests: 1
    13. User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36


  3. Form Dataview sourceview URL encoded



    1. username: admin
    2. password: admin
    3. logon: Login





From there once logged in they have a menu system, but I know the page I want is PortStatisticsRpm.htm




I've looked and tried the command: curl -d "username=admin" -d "password=admin" -d "logon=Login"  http://sg1024.lan/login.cgi  and I've tried  curl -d "username=admin&password=admin&logon=Login" -c cookies http://sg1024.lan/login.cgi




But this gets an empty response.  I've tried saving cookies but it doesn't look like it gets those either.  Any ideas?