Bug fixes, logic improvements

This commit is contained in:
d4rkr41n
2019-12-05 15:24:27 -06:00
parent 3a3c51ea53
commit b393602715
4 changed files with 27 additions and 7 deletions
+12
View File
@@ -1 +1,13 @@
# TinyCTF # TinyCTF
## How to use
Install dependancies, see below...
Add your teams and flags to the config.json file
Finally run app.js with node
## Requirements
`npm install colors`
`npm install express`
`npm install path`
`npm install body-parser`
`npm install ejs`
+1 -1
View File
@@ -29,5 +29,5 @@ if(numActive != 1){
console.log(colors.yellow("[*] Loaded " + config.flags.length + " flags!")); console.log(colors.yellow("[*] Loaded " + config.flags.length + " flags!"));
// Mark Starting Time for Team // Mark Starting Time for Team
fs.appendFileSync('correctlog.txt', "(" + config.teamcfg.name + ")" + " Start (" + Date.now() + ')\n'); fs.appendFileSync('correctlog.txt', "(" + config.teamcfg.teams[team].name + ")" + " Start (" + Date.now() + ')\n');
webserv.rundashserver(config.servercfg.dashboard.bindaddr, config.servercfg.dashboard.bindport,config.flags,config.teamcfg.teams[team].name); webserv.rundashserver(config.servercfg.dashboard.bindaddr, config.servercfg.dashboard.bindport,config.flags,config.teamcfg.teams[team].name);
+14 -5
View File
@@ -22,14 +22,23 @@
"teamcfg" : { "teamcfg" : {
"teams" : [ "teams" : [
{"name":"cyber1", "active":"1"}, {"name":"cyber1", "active":"1"},
{"name":"cyber2", "active":"0"},
{"name":"cyber3", "active":"0"} {"name":"cyber3", "active":"0"}
] ]
}, },
"flags" : [ "flags" : [
{"flag":"cyber1", "value":"1"}, {"flag":"ursneaky", "value":"1"},
{"flag":"cyber2", "value":"10"}, {"flag":"FISHAREHOT", "value":"1"},
{"flag":"cyber3", "value":"100"}, {"flag":"PlsNoHax", "value":"1"},
{"flag":"cyber4", "value":"1000"} {"flag":"iamroot1!", "value":"1"},
{"flag":"ruaMAZEd?", "value":"1"},
{"flag":"KALI", "value":"1"},
{"flag":"redherring", "value":"1"},
{"flag":"youcanpickyourlock", "value":"1"},
{"flag":"youcanlockyourpick", "value":"1"},
{"flag":"butyoucantpickyourfriendspick", "value":"1"},
{"flag":"BombDefusalNovice", "value":"1"},
{"flag":"ManyFailedAttempts", "value":"1"},
{"flag":"Kaboom", "value":"1"},
{"flag":"YouGotFar", "value":"1"}
] ]
} }
-1
View File
@@ -8,5 +8,4 @@ read -p "Pick a team: " tnum
activeTeam="${MAPFILE[$tnum]}" activeTeam="${MAPFILE[$tnum]}"
#activeTeam=$(cat config.json | grep \"name\" | grep \"active\"\:\"1\" | cut -d '"' -f 4 | awk '{print $1}' | sed "s/^/\(/" | sed "s/$/\)/")
echo $(cat correctlog.txt | grep "$activeTeam" | grep -v "Start" | awk '{print $2$3$4}' | sort -u | wc -l) flags found echo $(cat correctlog.txt | grep "$activeTeam" | grep -v "Start" | awk '{print $2$3$4}' | sort -u | wc -l) flags found