Giter Club home page Giter Club logo

jscpanelmanager's Introduction

JSCPanelManager

javascript version of https://github.com/simon387/CPanelManager

Why javascript and no more a full java solution? was bored about jaunt being closed source


what is that?

It's an example of full automation of the famous cpanel graphic tool. It changes the DNS IP of a given protocol (www, ftp, ecc).


requirements

  • python2.x +
  • sudo npm install phantomjs -g or, if you got deprecation problems, yarn global add phantomjs-prebuilt
  • sudo npm install casperjs -g
  • adding --unsafe-perm=true --allow-root can helps sometime

execution

  • casperjs --verbose --log-level=debug --ignore-ssl-errors=true --ssl-protocol=any jscpanelmanager.js

  • without the --ignore-ssl-errors=true flag script may fails

  • config.js format:

    var config = {
      'checkipUrl': 'http://checkip.amazonaws.com/',
      'checkipTag': 'pre',
      'proxy': '',
      'url': 'https://cp.tophost.it/',
      'httpAuthUser': '',
      'httpAuthPass': '',
      'editDNSElement': 'body > table:nth-child(4) > tbody > tr:nth-child(1) > td:nth-child(4) > p:nth-child(2) > table:nth-child(2) > tbody > tr:nth-child(2) > td:nth-child(4) > a',
      'editRecordElement': '#div-main > table > tbody > tr > td:nth-child(2) > table:nth-child(3) > tbody > tr:nth-child(8) > td:nth-child(5) > a',
      'recordInputBox': '#td-label2 > input',
    }
  • example of bash running script: sh run.sh


shell output example

[info] [phantom] Starting...
[info] [phantom] Running suite: 8 steps
[debug] [phantom] opening url: http://checkip.amazonaws.com/, HTTP GET
[debug] [phantom] Navigation requested: url=http://checkip.amazonaws.com/, type=Other, willNavigate=true, isMainFrame=true
[debug] [phantom] url changed to "http://checkip.amazonaws.com/"
[debug] [phantom] Successfully injected Casper client-side utilities
[info] [phantom] Step anonymous 2/8 http://checkip.amazonaws.com/ (HTTP 200)
[info] [phantom] Step anonymous 2/8: done in 409ms.
[debug] [phantom] opening url: https://cp.tophost.it/, HTTP GET
[debug] [phantom] Navigation requested: url=https://cp.tophost.it/, type=Other, willNavigate=true, isMainFrame=true
[debug] [phantom] Navigation requested: url=https://cp.tophost.it/, type=Other, willNavigate=true, isMainFrame=true
[debug] [phantom] url changed to "https://cp.tophost.it/"
[debug] [phantom] Successfully injected Casper client-side utilities
[info] [phantom] Step anonymous 4/8 https://cp.tophost.it/ (HTTP 200)
[info] [phantom] Step anonymous 4/8: done in 3279ms.
[info] [phantom] Step anonymous 5/8 https://cp.tophost.it/ (HTTP 200)
[debug] [phantom] Mouse event 'mousedown' on selector: body > table:nth-child(3) > tbody > tr:nth-child(1) > td:nth-child(4) > p:nth-child(2) > table:nth-child(2) > tbody > tr:nth-child(2) > td:nth-child(4) > a
[debug] [phantom] Mouse event 'mouseup' on selector: body > table:nth-child(3) > tbody > tr:nth-child(1) > td:nth-child(4) > p:nth-child(2) > table:nth-child(2) > tbody > tr:nth-child(2) > td:nth-child(4) > a
[debug] [phantom] Mouse event 'click' on selector: body > table:nth-child(3) > tbody > tr:nth-child(1) > td:nth-child(4) > p:nth-child(2) > table:nth-child(2) > tbody > tr:nth-child(2) > td:nth-child(4) > a
[debug] [phantom] Navigation requested: url=https://cp.tophost.it/dnsjump.php, type=LinkClicked, willNavigate=true, isMainFrame=true
[info] [phantom] Step anonymous 5/8: done in 3308ms.
[debug] [phantom] url changed to "https://cp.tophost.it/dnsjump.php"
[debug] [phantom] Navigation requested: url=https://ns1.th.seeweb.it/dnscp/, type=FormSubmitted, willNavigate=true, isMainFrame=true
[warning] [phantom] Loading resource failed with status=fail (HTTP 200): https://ns1.th.seeweb.it/dnscp/
[debug] [phantom] Successfully injected Casper client-side utilities
[debug] [phantom] url changed to "https://ns1.th.seeweb.it/dnscp/"
[debug] [phantom] Successfully injected Casper client-side utilities
[info] [phantom] Step anonymous 6/8 https://ns1.th.seeweb.it/dnscp/ (HTTP 200)
[debug] [phantom] Mouse event 'mousedown' on selector: #div-main > table > tbody > tr > td:nth-child(2) > table:nth-child(3) > tbody > tr:nth-child(8) > td:nth-child(5) > a
[debug] [phantom] Mouse event 'mouseup' on selector: #div-main > table > tbody > tr > td:nth-child(2) > table:nth-child(3) > tbody > tr:nth-child(8) > td:nth-child(5) > a
[debug] [phantom] Mouse event 'click' on selector: #div-main > table > tbody > tr > td:nth-child(2) > table:nth-child(3) > tbody > tr:nth-child(8) > td:nth-child(5) > a
[info] [phantom] Step anonymous 6/8: done in 7101ms.
[debug] [phantom] Navigation requested: url=https://ns1.th.seeweb.it/dnscp/index.php?page=edit_record, type=FormSubmitted, willNavigate=true, isMainFrame=true
[debug] [phantom] url changed to "https://ns1.th.seeweb.it/dnscp/index.php?page=edit_record"
[debug] [phantom] Successfully injected Casper client-side utilities
[info] [phantom] Step anonymous 7/8 https://ns1.th.seeweb.it/dnscp/index.php?page=edit_record (HTTP 200)
[debug] [phantom] Mouse event 'mousedown' on selector: #td-label2 > input
[debug] [phantom] Mouse event 'mouseup' on selector: #td-label2 > input
[debug] [phantom] Mouse event 'click' on selector: #td-label2 > input
[info] [phantom] Step anonymous 7/8: done in 7356ms.
[debug] [phantom] Navigation requested: url=https://ns1.th.seeweb.it/dnscp/index.php?page=edit_record, type=FormSubmitted, willNavigate=true, isMainFrame=true
[debug] [phantom] Navigation requested: url=https://ns1.th.seeweb.it/dnscp/index.php, type=FormSubmitted, willNavigate=true, isMainFrame=true
[debug] [phantom] url changed to "https://ns1.th.seeweb.it/dnscp/index.php"
[debug] [phantom] Successfully injected Casper client-side utilities
[info] [phantom] Step anonymous 8/8 https://ns1.th.seeweb.it/dnscp/index.php (HTTP 200)
[debug] [phantom] Mouse event 'mousedown' on selector: #div-main > table > tbody > tr > td:nth-child(2) > table:nth-child(3) > tbody > tr:nth-child(8) > td:nth-child(5) > a
[debug] [phantom] Mouse event 'mouseup' on selector: #div-main > table > tbody > tr > td:nth-child(2) > table:nth-child(3) > tbody > tr:nth-child(8) > td:nth-child(5) > a
[debug] [phantom] Mouse event 'click' on selector: #div-main > table > tbody > tr > td:nth-child(2) > table:nth-child(3) > tbody > tr:nth-child(8) > td:nth-child(5) > a
[info] [phantom] Step anonymous 8/8: done in 7629ms.
[debug] [phantom] Navigation requested: url=https://ns1.th.seeweb.it/dnscp/index.php?page=edit_record, type=FormSubmitted, willNavigate=true, isMainFrame=true
[debug] [phantom] url changed to "https://ns1.th.seeweb.it/dnscp/index.php?page=edit_record"
[debug] [phantom] Successfully injected Casper client-side utilities
[info] [phantom] Done 8 steps in 7830ms
[debug] [phantom] Navigation requested: url=about:blank, type=Other, willNavigate=true, isMainFrame=true
[debug] [phantom] url changed to "about:blank"

License

MIT

jscpanelmanager's People

Contributors

simon387 avatar

Watchers

James Cloos avatar  avatar  avatar

Forkers

wrestrtdr

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.