unix-ninja / hackersandbox Goto Github PK
View Code? Open in Web Editor NEWThe Hacker's Sandbox
License: BSD 2-Clause "Simplified" License
The Hacker's Sandbox
License: BSD 2-Clause "Simplified" License
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!
Thanks for the update to fix the alloc error. This (or maybe the engine change) seems to introduce a bug where only the first VM created can add a root user. Can be seen in the destiny.mis pack. The only root user added is the one on the area6 VM.
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
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.