Skip to content

Commit

Permalink
initial\ commit
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Sep 2, 2019
1 parent 09ab840 commit c157384
Show file tree
Hide file tree
Showing 18 changed files with 2,398 additions and 0 deletions.
Binary file added Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
140 changes: 140 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
var ques_num=12;
var conn=-1;
function secret()
{
console.log("congrat!!!! u hacked me!!!!!! copy this 'hjvwehjfgwehjgu3' code and submit this on competition page");
}
function dbConn()
{
for(var i=1;i<=ques_num;i++)
{
var ac;
query="ques_" + i;
var ques_query=firebase.database().ref("student_data/"+query);
ques_query.on("value",snap=>ac=snap.val());
}
}
function getReplyFirebase(ques)
{
var data;
var ques_query=firebase.database().ref("ctf_query").child(ques);
ques_query.on("value",snap=>data=snap.val());
//console.log(data);
return data;
}
function getResult(val)
{
var ac;
query="ques_" + val;
var ques_query=firebase.database().ref("student_data/"+query);
ques_query.on("value",snap=>ac=snap.val());
if(ac==null)
{
document.getElementById("result_here").innerHTML="NO ONE HAS SOLVED IT";
}
else{
var succ_ids=Object.keys(ac);
document.getElementById("result_here").innerHTML="THIS PROBLEM IS SOLVED BY:-"+"<br>"+succ_ids;
}
}
function getQuestions()
{
var i;
for(i=1;i<=ques_num;i++)
{
var ques="ques_"+i;
data=getReplyFirebase(ques);
if(data==null)
{
var flag_0=document.getElementById("default_text");
flag_0.classList.remove("hidden");
document.getElementById("default_text").innerHTML="<b>"+"NOTE"+"</b>"+": YOUR QUESTIONS WILL BE DISPLAYED AFTER CLICKING ON ABOVE BUTTON." +"<BR>"+"AFTER SOLVING THE QUESTION SUBMIT THE FLAG IN BOX ON RIGHT HAND SIDE ACCORDINGLY."+"<b>"+"<br>"+"YOU CAN ACCESS TO RESOURCES BY CLICKING ON THE INFOSEC ICON."+"</b>"+"<BR>"+"PLEASE FETCH THE QUESTIONS TO CONTINUE";

}
else {
var flag_temp;
flag_temp=document.getElementById("question_box");
flag_temp.classList.remove("hide");
flag_temp=document.getElementById("grow-spinner");
flag_temp.classList.add("hide");
//flag_temp=document.getElementById("fetch-question-btn");
// flag_temp.classList.add("hide")
flag_temp=document.getElementById("default_text");
flag_temp.classList.add("hide");
document.getElementById(ques).innerHTML=data;
}

}
}
function reload()
{
document.getElementById("enter_answer").value="";
document.getElementById("enterId").value="";
}
function get_resouces()
{
window.location.href="resources.html";
}
function get_flag()
{
var flag;
var e = document.getElementById("select_ques");
var opt_val = e.options[e.selectedIndex].value;
query="ans_"+opt_val;
temp=firebase.database().ref("ctf_query").child(query);
temp.on("value",snap=>flag=snap.val());
return flag;
}
function openForm() {
document.getElementById("myForm").style.display = "block";
}

function closeForm() {
document.getElementById("myForm").style.display = "none";
}
function appendID(id,node)
{
queries="student_data/"+node;
input_ref=firebase.database().ref(queries);
input_ref.child(id).set("true");
}
function check_flag()
{
var flag_cr;
var id=document.forms.credentials.cllg_id.value;
flag_cr=get_flag();
var e = document.getElementById("select_ques");
var opt_val = e.options[e.selectedIndex].value;
var searchFor="ques_"+opt_val;
var usr_flag=document.forms.credentials.usr_input.value;
if(usr_flag=="" || id=="")
{
alert("PLEASE ENTER THE FLAG AND ID BEFORE SUBMITTING");
}
else {
var index=flag_cr.localeCompare(usr_flag);
if(index!=0)
{
alert("YOU ARE NOT TOO SMART"+"\n"+"PLEASE TRY AGAIN ;) ;)");
}
else{
appendID(id,searchFor);
alert("BRAVO!!!!"+"DON'T BE OVERCONFIDENT"+"\n"+"SOLVE ATLEAST 7 QUESTIONS");
}
}

}
function openModal() {
flag=document.getElementById("myModal");
flag.style.display = "block";
}
function close_modal() {
flag=document.getElementById("myModal");
flag.style.display = "none";
}
window.onclick = function(event) {
flag=document.getElementById("myModal");
if (event.target == flag) {
flag.style.display = "none";
}
}
121 changes: 121 additions & 0 deletions app_1.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@

particlesJS('particles-js',

{
"particles": {
"number": {
"value": 80,
"density": {
"enable": true,
"value_area": 800
}
},
"color": {
"value": "#00ff04"
},
"shape": {
"type": "circle",
"stroke": {
"width": 0,
"color": "#00ff04"
},
"polygon": {
"nb_sides": 5
},
"image": {
"src": "img/github.svg",
"width": 100,
"height": 100
}
},
"opacity": {
"value": 0.5,
"random": false,
"anim": {
"enable": false,
"speed": 1,
"opacity_min": 0.1,
"sync": false
}
},
"size": {
"value": 5,
"random": true,
"anim": {
"enable": false,
"speed": 40,
"size_min": 0.1,
"sync": false
}
},
"line_linked": {
"enable": true,
"distance": 150,
"color": "#00ff04",
"opacity": 0.4,
"width": 1
},
"move": {
"enable": true,
"speed": 6,
"direction": "none",
"random": false,
"straight": false,
"out_mode": "out",
"attract": {
"enable": false,
"rotateX": 600,
"rotateY": 1200
}
}
},
"interactivity": {
"detect_on": "canvas",
"events": {
"onhover": {
"enable": true,
"mode": "repulse"
},
"onclick": {
"enable": true,
"mode": "push"
},
"resize": true
},
"modes": {
"grab": {
"distance": 400,
"line_linked": {
"opacity": 1
}
},
"bubble": {
"distance": 400,
"size": 40,
"duration": 2,
"opacity": 8,
"speed": 3
},
"repulse": {
"distance": 200
},
"push": {
"particles_nb": 4
},
"remove": {
"particles_nb": 2
}
}
},
"retina_detect": true,
"config_demo": {
"hide_card": false,
"background_color": "#000000",
"background_image": "",
"background_position": "50% 50%",
"background_repeat": "no-repeat",
"background_size": "cover"
}
}

);
Binary file added back.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added hacker.ico
Binary file not shown.
Binary file added img.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
135 changes: 135 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
<!DOCTYPE HTML>
<html>
<head>
<title>INFOSEC CONTEST</title>
<meta name=”viewport” content=”width=device-width, initial-scale=1″>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
<link rel="shortcut icon" href="hacker.ico"/>
<link rel="stylesheet" href="style.css">


<!-- The core Firebase JS SDK is always required and must be listed first -->
<script src="https://www.gstatic.com/firebasejs/6.5.0/firebase-app.js"></script>
<script src="https://www.gstatic.com/firebasejs/3.1.0/firebase-database.js"></script>
<!-- The core Firebase JS SDK is always required and must be listed first -->

<!-- TODO: Add SDKs for Firebase products that you want to use
https://firebase.google.com/docs/web/setup#config-web-app -->
<!-- here is the flag hint : do u know the secret and its fuunction-->

<script>
// Your web app's Firebase configuration
var firebaseConfig = {
apiKey: "AIzaSyAmQdt00eDFHc6u3Wf1jfvAK-4ngpBWE6M",
authDomain: "infosec-ea981.firebaseapp.com",
databaseURL: "https://infosec-ea981.firebaseio.com",
projectId: "infosec-ea981",
storageBucket: "",
messagingSenderId: "36358204978",
appId: "1:36358204978:web:e3a2f331d4d50acf"
};
// Initialize Firebase
firebase.initializeApp(firebaseConfig);
</script>
<script src="app.js"></script>
<meta charset="utf-8">
</head>

<body onload="getQuestions(),reload(),dbConn()" >
<!--script for particles js-->
<div id="particles-js"></div>
<script src="particles.js"></script>
<script src="app_1.js"></script>
<!--end-->
<div class="img-container">
<img src="Logo.png" onclick="get_resouces()" id="center" alt="InfoSec">
</div>
<div id="page-content">
<div id="question" >
<button id="fetch-question-btn" name="fetch-ques" onclick="getQuestions()">FETCH QUESTIONS</button>
<p id="default_text" class="hidden"></p>
<div id="myModal" class="modal">
<div class="modal-content">
<span class="close" onclick="close_modal()">&times;</span>
<p id="result_here"></p>
</div>

</div>
<div id="grow-spinner" class="spinner-grow fetch_box"></div>
<div id="question_box" class="hide"><br><br>
<span class="section_inline">
<p id="ques_1" class="ques_fetch"></p><button class="ac_result" id="btn-1" onclick="getResult(1),openModal()">RESULTS</button>
</span>
<span class="section_inline">
<p id="ques_2" class="ques_fetch"></p><button class="ac_result" id="btn-2" onclick="getResult(2),openModal()" >RESULTS</button>
</span>
<span class="section_inline">
<p id="ques_3" class="ques_fetch"></p><button class="ac_result" id="btn-3" onclick="getResult(3),openModal()">RESULTS</button>
</span>
<span class="section_inline">
<p id="ques_4" class="ques_fetch"></p><button class="ac_result" id="btn-4"onclick="getResult(4),openModal()">RESULTS</button>
</span>
<span class="section_inline">
<p id="ques_5" class="ques_fetch"></p><button class="ac_result" id="btn-5"onclick="getResult(5),openModal()">RESULTS</button>
</span>
<span class="section_inline">
<p id="ques_6" class="ques_fetch"></p><button class="ac_result" id="btn-6"onclick="getResult(6),openModal()">RESULTS</button>
</span>
<span class="section_inline">
<p id="ques_7" class="ques_fetch"></p><button class="ac_result" id="btn-7"onclick="getResult(7),openModal()">RESULTS</button>
</span>
<span class="section_inline">
<p id="ques_8" class="ques_fetch"></p><button class="ac_result" id="btn-8"onclick="getResult(8),openModal()">RESULTS</button>
</span>
<span class="section_inline">
<p id="ques_9" class="ques_fetch"></p><button class="ac_result" id="btn-9"onclick="getResult(9),openModal()">RESULTS</button>
</span>
<span class="section_inline">
<p id="ques_10" class="ques_fetch"></p><button class="ac_result" id="btn-10"onclick="getResult(10),openModal()">RESULTS</button>
</span>
<span class="section_inline">
<p id="ques_11" class="ques_fetch"></p><button class="ac_result" id="btn-11"onclick="getResult(11),openModal()">RESULTS</button>
</span>
<span class="section_inline">
<p id="ques_12" class="ques_fetch"></p><button class="ac_result" id="btn-12"onclick="getResult(12),openModal()">RESULTS</button>
</span>

</div>
</div>

<div id="answer">
<form name="credentials" id="form_1">
<div id="enter_details">
<input type="text" class="spacing" id="enterId" name="cllg_id" placeholder="ENTER YOUR COLLEGE ID"><br>
<select name="questions" class="spacing" id="select_ques">
<option value="default" selected>SELECT QUESTION</option>
<option value="1">QUESTION 1</option>
<option value="2">QUESTION 2</option>
<option value="3">QUESTION 3</option>
<option value="4">QUESTION 4</option>
<option value="5">QUESTION 5</option>
<option value="6">QUESTION 6</option>
<option value="7">QUESTION 7</option>
<option value="8">QUESTION 8</option>
<option value="9">QUESTION 9</option>
<option value="10">QUESTION 10</option>
<option value="10">QUESTION 11</option>
<option value="10">QUESTION 12</option>

</select><br>
<input type="text" class="spacing" onclick="get_flag()" id="enter_answer" name="usr_input" placeholder="ENTER THE FLAG"><br>
</div>
</form>
<button id="submit-button" onclick="check_flag()">SUBMIT</button>
</div>
</div>



</body>

</body>
</html>
Loading

0 comments on commit c157384

Please sign in to comment.