Giter Site home page Giter Site logo

hackersandbox's People

Contributors

unix-ninja avatar watsoncj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hackersandbox's Issues

addUsers creates user on last vm created, not current vm.

The addUsers code doesn't track the current vm, any users created after the VM initialization process end up being created on the last vm initialized. Here is a quick mis pack for testing.

-- load test VM
newVM ("test")
setProperty( { ip = "1.1.1.1" })
addFile ({ name = "/bin/addu", content = garbage(10), exec="addu", acl="777"})
addUser ( "root", "toor" )

-- load test2 VM
newVM("test2")
setProperty ({ ip = "1.1.1.2" })
addService ({ port = "23", name = "telnetd", exec = "", start="true", poll="Login:" })
addUser ( "root", "go" )

function addu()
addUser ( "newguy", "password" )
end

function intro()
login ({ host = "test", user = "root"})
end

Running addu on test results i newguy on test2.
Super close to working I think, thanks!

adduser from function results in current user being replaced by random data - can cause segfault

Attempting to add a user to a vm through a function based on a file set as executable.
(function condensed to bare minimum to show issue)

-- load test VM
newVM ("test")
setProperty( { ip = "1.1.1.1" })
setProperty ({ on_root = "f_test_root", hint = "Test" })
addFile ({ name = "/bin/addu", content = garbage(10), exec="addu", acl="777"})
addUser ( "root", "toor" )

function f_test_root()
end

function addu()
addUser ( "jeff", "password" )
end

function intro()
login ({ host = "test", user = "root"})
end
--end mission pack

----- Terminal Sandbox Loading mission pack - steps to segfault
./sandbox function.mis
Loading mission pack (function.mis)...
$ whoami
root
$ /bin/addu
$ whoami
�R�
$ cd /home
$ ls
jeff/
$ cd jeff
Segmentation fault

The problem seems to be related to line 335 of vm.cpp when the new user is added to the user vector.
edit: the push_back to users vector can cause the reallocation of memory, breaking the pointer for the user_chain. Reserving the memory in the VM like users.reserve(64); fixes this issue.

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.