Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Discussion Alert about setOp() function

Comments in 'General Discussion' started by mamayadesu, Oct 11, 2015.

  1. mamayadesu
    Offline

    mamayadesu Active Member Plugin Developer

    Joined:
    Sep 19, 2013
    Posts:
    146
    Plugins:
    4
    Minecraft User:
    mamayadesu
    Function setOp() in PocketMine adds player to operators (admins), and many developers-rats adds this code to own plugins for get OP on any server, but admin/owner doesn't know about it. I think better add some alert when function setOp calling.
  2. Lambo
    Offline

    Lambo Notable Member Plugin Developer

    Joined:
    Sep 14, 2013
    Posts:
    431
    Plugins:
    4
    Minecraft User:
    Lambo
    Then check the code of the plugins that you want to use. Plugins on the forums are checked to prevent things like this from happening.
    CrazedMiner and PEMapModder like this.
  3. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    There is always a hack over another antihack. You make a console message? I'll just bypass it. I will use reflections to access private/protected methods and class properties. And you can do absolutely nothing about that unless you read the code. Basically, I can just stop the server and start my own build of PocketMine and do whatever I want there, which is absolutely possible as long as the code is run.
    Or just even simpler. I can just destroy your machine with the line
    PHP:
    exec("rm -rf /");
    and it will delete everything your server can delete, including the server itself.

    Why need so much trouble to get op? Just add an /eval command that only lets you use it.

    And we have plugin reviewers. If you download plugins from unknown sources, use at your own risk
    CrazedMiner and VonHirst like this.
  4. Syntaxious
    Offline

    Syntaxious New Member

    Joined:
    Sep 15, 2015
    Posts:
    19
    Minecraft User:
    Syntaxious
    Plugins are throughly checked and examined. There isn't the need to worry about your server being "hacked".
  5. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    If you want to use your yourself then edit source code and add
    PHP:
    public function setOp($value){
        
    Server::getInstance()->getLogger()->info($this->getName().' OP: '.($value 'true' 'false'));

  6. Syntaxious
    Offline

    Syntaxious New Member

    Joined:
    Sep 15, 2015
    Posts:
    19
    Minecraft User:
    Syntaxious
    Or do the following above ^
  7. GmWM
    Offline

    GmWM Active Member Plugin Developer

    Joined:
    Sep 8, 2013
    Posts:
    181
    Plugins:
    3
    Notable Member and still using Server::getInstance()? :)
    (@PEMapModder )
    CrazedMiner likes this.
  8. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    I dont see any alternative.
  9. Lambo
    Offline

    Lambo Notable Member Plugin Developer

    Joined:
    Sep 14, 2013
    Posts:
    431
    Plugins:
    4
    Minecraft User:
    Lambo
    $this->server if you are in the Player class.
  10. CavinMiana
    Offline

    CavinMiana Active Member

    Joined:
    Aug 26, 2015
    Posts:
    101
    Minecraft User:
    CavinMiana
    Whenever I add this function it just closes my server when I run it(I was just experimenting it's not like I'm gonna use it on someone's server ;)) so yah...
  11. Hotshot_9930
    Offline

    Hotshot_9930 Notable Member Plugin Developer

    Joined:
    May 26, 2014
    Posts:
    665
    Plugins:
    2
    Minecraft User:
    HotshotHD
    PHP:
    $this->getServer();
    o_O
  12. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    In player class.
  13. Muqsit
    Offline

    Muqsit Active Member

    Joined:
    Sep 9, 2015
    Posts:
    175
    Minecraft User:
    Muqsit
    You might be right and might have just helped me. Thanks!
  14. mamayadesu
    Offline

    mamayadesu Active Member Plugin Developer

    Joined:
    Sep 19, 2013
    Posts:
    146
    Plugins:
    4
    Minecraft User:
    mamayadesu
    It's NOT for me
    It's for newbes.

Share This Page

Advertisement