add main-site
This commit is contained in:
parent
0bcf58c844
commit
0a3a77a9ff
52 changed files with 11206 additions and 0 deletions
77
main-site/CyberTermHack/CONSOLE/console.html
Normal file
77
main-site/CyberTermHack/CONSOLE/console.html
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<title>CyberTermHack</title>
|
||||
<meta charset="UTF-8">
|
||||
<style>
|
||||
:root{
|
||||
--bg-color: black;
|
||||
--txt-color: white;
|
||||
}
|
||||
html, body{
|
||||
background-color:var(--bg-color);
|
||||
color: var(--txt-color);
|
||||
margin:0;
|
||||
height:100%;
|
||||
min-height:100vh;
|
||||
display:flex;
|
||||
flex-direction:column;
|
||||
word-wrap: break-word;
|
||||
word-break: break-all;
|
||||
z-index:2
|
||||
}
|
||||
.second {
|
||||
flex-grow: 1;
|
||||
}
|
||||
#termcontent{
|
||||
display: fixed;
|
||||
left:0;
|
||||
top:0;
|
||||
height:95%;
|
||||
width:100%;
|
||||
overflow: auto
|
||||
}
|
||||
#divinput{
|
||||
display:flex;
|
||||
left:0;
|
||||
bottom:0;
|
||||
height:5%;
|
||||
width:100%
|
||||
}
|
||||
#terminpt{
|
||||
border: 0px solid !important;
|
||||
background-color: var(--bg-color);
|
||||
color:var(--txt-color);
|
||||
width:95%
|
||||
}
|
||||
/*#terminptdiv{
|
||||
float: none
|
||||
}*/
|
||||
*:focus {
|
||||
outline: none;
|
||||
}
|
||||
/*#divofinfos{
|
||||
float:left
|
||||
}*/
|
||||
#matrixcanvas{
|
||||
width:100%;
|
||||
height:100%;
|
||||
position:fixed;
|
||||
z-index:-1
|
||||
}
|
||||
</style>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
</head>
|
||||
<body>
|
||||
<!--username and ip: green, $ or %: white, commands: white-->
|
||||
<div id="termcontent">
|
||||
</div>
|
||||
<div id="divinput">
|
||||
<span id=spanofinfos><span id="inptindic"></span><span id="inptname"></span></span><span class=second><input id=terminpt type="text"/></span>
|
||||
</div>
|
||||
<canvas id=matrixcanvas style='width:100%; height: 100%'>
|
||||
</canvas>
|
||||
<script src="//api.gzod01.fr/termapi.js"></script>
|
||||
<script src="console.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
10
main-site/CyberTermHack/CONSOLE/console.js
Normal file
10
main-site/CyberTermHack/CONSOLE/console.js
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
function consoleloop(){
|
||||
let x= terminput('')
|
||||
termshow('executing : '+x+' ...')
|
||||
try{
|
||||
let nfunc = new Function(x)
|
||||
termshow(nfunc())
|
||||
}catch(e){
|
||||
termshow('error: '+e)
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,479 @@
|
|||
// TERM API BY GZOD01 (FROM CYBERTERMHACK BY GZOD01)
|
||||
|
||||
|
||||
// the variable to check if the input is complete (if the user press enter)
|
||||
var inputcomplete = false
|
||||
|
||||
// function to choose a random int (random.randint() in python)
|
||||
function randint(min, max){
|
||||
return Math.floor(Math.random() * (max - min + 1) ) + min;
|
||||
}
|
||||
|
||||
// START OF MATRIX CODE
|
||||
// function to stop the matrix (delete the canvas and recreate it)
|
||||
function stopmatrix(){
|
||||
document.getElementById('matrixcanvas').remove()
|
||||
let nc = document.createElement('canvas')
|
||||
nc.setAttribute('id','matrixcanvas')
|
||||
nc.style.width = '100%'
|
||||
nc.style.height ='0%'
|
||||
document.body.appendChild(nc)
|
||||
}
|
||||
//function to start the matrix (start the dropdown of letters etc.)
|
||||
function matrix(color){
|
||||
let tcolor = ''
|
||||
if(color==='cyan'){
|
||||
tcolor ='#0ff'
|
||||
}
|
||||
else if(color==='blue'){
|
||||
tcolor='#00f'
|
||||
}
|
||||
else if(color==='magenta'){
|
||||
tcolor='#f0f'
|
||||
}
|
||||
else if(color==='red'){
|
||||
tcolor='#f00'
|
||||
}
|
||||
else if(color==='green'){
|
||||
tcolor='#0f0'
|
||||
}
|
||||
else if(color==='yellow'){
|
||||
tcolor='#ff0'
|
||||
}
|
||||
else if(color==='white'){
|
||||
tcolor='#fff'
|
||||
}
|
||||
else if(color==='purple'){
|
||||
tcolor='#303'
|
||||
}
|
||||
else{
|
||||
tcolor= '#0f0'
|
||||
}
|
||||
var canvas = document.getElementById('matrixcanvas'),
|
||||
ctx = canvas.getContext('2d');
|
||||
|
||||
canvas.style.height = '100%'
|
||||
canvas.width = window.innerWidth;
|
||||
canvas.height = window.innerHeight;
|
||||
var letters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890&éèçà@æ€ŧøþ@ßðđŋłĸħłµł»¢µ$£ù%^¨';
|
||||
letters = letters.split('');
|
||||
|
||||
|
||||
var fontSize = 10,
|
||||
columns = canvas.width / fontSize;
|
||||
|
||||
|
||||
var drops = [];
|
||||
for (var i = 0; i < columns; i++) {
|
||||
drops[i] = 1;
|
||||
}
|
||||
|
||||
|
||||
function draw() {
|
||||
ctx.fillStyle = 'rgba(0, 0, 0, .1)';
|
||||
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
||||
for (var i = 0; i < drops.length; i++) {
|
||||
var text = letters[Math.floor(Math.random() * letters.length)];
|
||||
ctx.fillStyle = tcolor;
|
||||
ctx.fillText(text, i * fontSize, drops[i] * fontSize);
|
||||
drops[i]++;
|
||||
if (drops[i] * fontSize > canvas.height && Math.random() > .95) {
|
||||
drops[i] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
setInterval(draw, 33);
|
||||
}
|
||||
// END OF MATRIX CODE
|
||||
|
||||
// function like the time.sleep in python
|
||||
function sleep(s) {
|
||||
let ms = s*1000
|
||||
return new Promise(resolve => setTimeout(resolve, ms));
|
||||
}
|
||||
// function like random.choice() in python
|
||||
function randchoice(list){
|
||||
console.log(list[randint(0,list.length-1)])
|
||||
return list[randint(0,list.length-1)]
|
||||
}
|
||||
|
||||
// TODO : var historic = []
|
||||
|
||||
// lastx = the last input do (the input you get when you press up arrow) to replace with an historic
|
||||
var lastx = ""
|
||||
|
||||
// the function to execute when up arrow pressed
|
||||
function historic(){
|
||||
// TODO : terminpt.value=historic[historic.lengh-1-index]
|
||||
document.getElementById('terminpt').value = lastx // to replace with an historic (line above) , set the input value (content) to the last input executed
|
||||
}
|
||||
// when a key is down
|
||||
onkeydown = function(e){
|
||||
// if the key is the tab key (keyCode 9)
|
||||
if(e.keyCode==9){
|
||||
// execute the autocomplete function
|
||||
autocomplete()
|
||||
}
|
||||
}
|
||||
// when a key is up
|
||||
onkeyup = function(e){
|
||||
// if the key is enter key (keyCode 13)
|
||||
if(e.keyCode==13){
|
||||
// set the inputcomplete variable to true to inform the terminput function that the user press enter
|
||||
inputcomplete = true
|
||||
}
|
||||
// if the input is up arrow key (keyCode 38)
|
||||
else if(e.keyCode == 38){
|
||||
// execute the historic function
|
||||
historic()
|
||||
}
|
||||
}
|
||||
// function like the print() function in python, add the text to the #termcontent div
|
||||
function termshow(str){
|
||||
let tc = document.getElementById('termcontent')
|
||||
let nchild = document.createElement('div')
|
||||
str = str.replace('<','<')
|
||||
str= str.replace('>','>')
|
||||
str= str.replace('&infg&','<')
|
||||
str = str.replace('&supd&','>')
|
||||
nchild.innerHTML = str.replace('\n','<br>')
|
||||
tc.appendChild(nchild)
|
||||
document.getElementById('termcontent').scrollTo(0,document.getElementById('termcontent').scrollHeight)
|
||||
}
|
||||
// the input() function of python, check if the input is complete (see the inputcomplete variable and the onkeyup (e.keyCode == 13) execution
|
||||
function terminput(str){
|
||||
let tiname = document.getElementById('inptname')
|
||||
tiname.innerHTML = str
|
||||
let inpt = document.getElementById('terminpt')
|
||||
if(inputcomplete){
|
||||
console.log(inpt.value)
|
||||
inputcomplete=false
|
||||
let resultat = inpt.value
|
||||
inpt.value = ''
|
||||
return resultat
|
||||
}
|
||||
else{
|
||||
//return 'ERR' if the input isn't complete
|
||||
return 'ERR'
|
||||
}
|
||||
}
|
||||
// replace this list with the list of your commands
|
||||
var list_of_command = ['ls','ssh','pbk','exit','theme','matrix','hack','attack','save','import','help','exit']
|
||||
// autocomplete when tab press show all the command starting with the value in your input
|
||||
function autocomplete(){
|
||||
let inptval = document.getElementById('terminpt').value
|
||||
termshow('List of available commands starting with " '+inptval+' " :')
|
||||
for(let i = 0; i<list_of_command.length; i++){
|
||||
if(list_of_command[i].startsWith(inptval)){
|
||||
termshow('- '+list_of_command[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
// x= the current input
|
||||
var x = ""
|
||||
|
||||
// START OF FUNCTIONS TO USE WITHOUT INTERACT WITH THE INTERFACE
|
||||
// Send the current input (function to set the inputcomplete as true)
|
||||
function sendinput(){inputcomplete=true}
|
||||
// setinput(str) function to set the value of the input from function
|
||||
function setinput(str){document.getElementById('terminpt').value=str}
|
||||
// execcommand(str) set input and send input
|
||||
function execcommand(str){setinput(str); sendinput()}
|
||||
// last() historic and sendinput
|
||||
function last(){historic(); sendinput()}
|
||||
// autoc setinput, autocomplete
|
||||
function autoc(str){setinput(str); autocomplete();}
|
||||
// END OF FUNCTIONS TO USE WITHOUT INTERACT WITH THE INTERFACE
|
||||
// END OF THE API CODE
|
||||
|
||||
|
||||
|
||||
// START OF CYBERTERMHACK CODE
|
||||
function splitaddr(complete, cmd){
|
||||
try{
|
||||
let c = complete.substring(cmd.length)
|
||||
let u = c.split('@')[0]
|
||||
let a = c.split('@')[1]
|
||||
if (a==undefined){
|
||||
termshow('Please complete the command like this: '+cmd+' user@address')
|
||||
return 'ERROR'
|
||||
}
|
||||
else{
|
||||
return [u, a]
|
||||
}
|
||||
}
|
||||
catch(e){
|
||||
console.error(e)
|
||||
termshow('Please complete the command like this: '+cmd+' user@address')
|
||||
return 'ERROR'
|
||||
}
|
||||
}
|
||||
function infos(){
|
||||
termshow('01010101010101010<br>1.CyberTermGame.1<br>0.....By GZod01.....0<br>10101010101010101<br>Infos on the game : Hello my name is GZod01 and i make this game in javascript (base game in python) "for fun", I know this game is not reflecting the reality of the command on linux or windows machines but... it is a game...<br>Sorry if the english is not very good i speak french...')
|
||||
}
|
||||
stopmatrix()
|
||||
var passwordlist = ["my_password","helloworld","ultra_secure_password","my_birthday"]
|
||||
var filelist = ['picture.png','personnal_datas.csv', 'helloworld.py','i_hate_hackers.txt','speech_for_tomorrow.md', '.ha_ha_this_is_super_secret_file.txt','mydirectory/']
|
||||
var connected = false
|
||||
var datased = false
|
||||
var STOP = false
|
||||
infos()
|
||||
var user = ""
|
||||
var ip = ""
|
||||
var password = ""
|
||||
var destroyedip = []
|
||||
var codeline = ["fn destroy(oiaf){executeshellcomand('destroy oiaf')}","hack-server()","destroy()","fn hack-server(files){for(var i = 0, i<len(files)){if (type_of_file(files[i])==='password_files_and_datas_files'){execcommand('copyfile_to_my_computer'); destroy(files)};", "print(01020003957058098409438409340&àà_09232983983983923999832983928398329389238938923892382938923899201809381093809é'802984029804802948049820840938éàç8309é_à'ç_éà'_09790872çà'àç_éè409724097240942èàçé'8è290479024798047298047904èé4908éè4) in serverdatas"]
|
||||
termshow('starting session ...')
|
||||
var me = ''
|
||||
named = false
|
||||
// example of serversdatas: "ip":{"destroyed":true (or false), "files":listoffiles, "password":"password"}
|
||||
var gamedatas = {
|
||||
"serversdatas":{},
|
||||
"username": me,
|
||||
'colorscheme': 'default' //it can be green / red / blue / yellow
|
||||
}
|
||||
function gettheme(){
|
||||
let r = document.querySelector(':root')
|
||||
if (gamedatas.colorscheme ==='default'){
|
||||
r.style.setProperty('--txt-color','white')
|
||||
}
|
||||
else if (gamedatas.colorscheme === 'green'){
|
||||
r.style.setProperty('--txt-color','green')
|
||||
}
|
||||
else if (gamedatas.colorscheme === 'red'){
|
||||
r.style.setProperty('--txt-color','red')
|
||||
}
|
||||
else if (gamedatas.colorscheme === 'blue'){
|
||||
r.style.setProperty('--txt-color','blue')
|
||||
}
|
||||
else if (gamedatas.colorscheme === 'yellow'){
|
||||
r.style.setProperty('--txt-color','yellow')
|
||||
}
|
||||
}
|
||||
var ipdatas = {}
|
||||
document.getElementById('terminpt').focus()
|
||||
async function loop(){
|
||||
gamedatas.serversdatas = ipdatas
|
||||
if(named){
|
||||
if(connected){
|
||||
x = terminput(`${user}@${ip} $ `)
|
||||
}
|
||||
else{
|
||||
x = terminput(`${me}@MYCOMPUTER # `)
|
||||
}
|
||||
if(x==='ERR'){}
|
||||
else{
|
||||
//historic.push(x)
|
||||
lastx = x
|
||||
let lowx = x.toLowerCase()
|
||||
if(connected){
|
||||
termshow(`${user}@${ip} $ ${x}`)
|
||||
}
|
||||
else{
|
||||
termshow(`${me}@MYCOMPUTER # ${x}`)
|
||||
}
|
||||
if (lowx.startsWith('ssh')){
|
||||
if (connected){
|
||||
termshow('error you already are in distant server')
|
||||
}
|
||||
else{
|
||||
if (splitaddr(x, 'ssh') === 'ERROR'){
|
||||
}
|
||||
else{
|
||||
user = splitaddr(x, 'ssh')[0]
|
||||
ip = splitaddr(x, 'ssh')[1]
|
||||
if(ipdatas[ip]==undefined){
|
||||
ipdatas[ip]={}
|
||||
}
|
||||
termshow('connect to the computer with the ip '+ip+' from the user '+user+' ...')
|
||||
if (ipdatas[ip]['destroyed']){
|
||||
termshow('error this server is destroyed')
|
||||
}
|
||||
else{
|
||||
if(ipdatas[ip]['password']==undefined){
|
||||
termshow('you don\'t have the password of this server')
|
||||
}
|
||||
else{
|
||||
await sleep(1)
|
||||
termshow('Password: AUTOMATIC_PASSWORD_SYSTEM')
|
||||
// while(temppass != ipdatas[ip]['password']){
|
||||
// temppass = terminput('Password: ')
|
||||
// }
|
||||
await sleep(1)
|
||||
termshow('connected')
|
||||
connected=true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (lowx.startsWith('pbk')){
|
||||
if (connected){
|
||||
termshow('error you are on a distant server')
|
||||
}
|
||||
else{
|
||||
if (splitaddr(x,'pbk')==='ERROR'){
|
||||
splitaddr(x,'pbk')
|
||||
}
|
||||
else{
|
||||
user=splitaddr(x, 'pbk')[0]
|
||||
ip = splitaddr(x, 'pbk')[1]
|
||||
if(ipdatas[ip]==undefined){
|
||||
ipdatas[ip]={}
|
||||
}
|
||||
termshow('Breaking the password of the user '+user+' to the computer with the ip '+ip+' ...')
|
||||
password= randchoice(passwordlist)
|
||||
ipdatas[ip]['password']=password
|
||||
termshow('The password is : '+ password)
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (lowx.startsWith('theme')){
|
||||
if(lowx==='theme'||lowx==='theme '){
|
||||
termshow('Switch the theme with this command,<br> the available colors are : default , yellow , red , blue , green . <br> execute the command like this: theme default or theme yellow , etc.')
|
||||
}
|
||||
else{
|
||||
let nx = x.substring('theme '.length)
|
||||
if(nx==='yellow' || nx ==='blue' || nx==='default' || nx ==='red' || nx === 'green'){
|
||||
gamedatas.colorscheme = nx
|
||||
gettheme()
|
||||
}
|
||||
else{
|
||||
termshow('Switch the theme with this command,<br> the available colors are : default , yellow , red , blue , green . <br> execute the command like this: theme default or theme yellow , etc.')
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (lowx.startsWith('matrix')){
|
||||
if(lowx==='matrix'||lowx==='matrix '){
|
||||
matrix(gamedatas.colorscheme)
|
||||
}
|
||||
else{
|
||||
let nx = x.substring('matrix '.length)
|
||||
if(nx==='yellow' || nx ==='blue' || nx==='white' || nx ==='red' || nx === 'green'||nx=='purple'|| nx=='cyan' || nx=='magenta'){
|
||||
matrix(nx)
|
||||
}
|
||||
else if(nx==='stop'){
|
||||
stopmatrix()
|
||||
}
|
||||
else{
|
||||
termshow('Switch the theme with this command,<br> the available colors are : default , yellow , red , blue , green . <br> execute the command like this: theme default or theme yellow , etc.')
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(lowx==='save'){
|
||||
localStorage.setItem('hackergamedatas',JSON.stringify(gamedatas))
|
||||
termshow('Data saved')
|
||||
termshow(localStorage.getItem('hackergamedatas'))
|
||||
}
|
||||
else if(lowx==='import'){
|
||||
let tmpdatas = localStorage.getItem('hackergamedatas')
|
||||
if (tmpdatas == undefined){
|
||||
termshow('you don\'t have any data saved, please execute the save command before to import')
|
||||
}
|
||||
else{
|
||||
gamedatas = JSON.parse(tmpdatas)
|
||||
}
|
||||
}
|
||||
else if (lowx=='ls'){
|
||||
if (connected){
|
||||
if (ipdatas[ip]['files'] == undefined){
|
||||
termshow('This is the file on the distant machine')
|
||||
let fileiplist = []
|
||||
for(let i=0; i < parseInt(randint(1,10)); i++){
|
||||
let currentchoicefile = randchoice(filelist)
|
||||
termshow('-'+currentchoicefile)
|
||||
fileiplist.push(currentchoicefile)
|
||||
}
|
||||
ipdatas[ip]['files'] = fileiplist
|
||||
}
|
||||
else{
|
||||
termshow('This is the file on the distant machine')
|
||||
for(let i = 0; i<ipdatas[ip]['files'].length; i++){
|
||||
termshow('-'+ ipdatas[ip]['files'][i])
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
if (datased){
|
||||
termshow('This is the file on your computer: <br>- my_datas.zip <br>- servers_data.zip')
|
||||
}
|
||||
else{
|
||||
termshow('This is the file on your computer: <br>- my_datas.zip')
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (lowx=='attack'){
|
||||
if( connected){
|
||||
termshow('the attack start... <br> copying all the data in this server to your servers_data.zip file in your computer (it include all the file, folder etc.)...<br>breaking the server...<br>Disconnected: The server is destroy')
|
||||
connected = false
|
||||
datased = true
|
||||
ipdatas[ip]['destroyed'] = true
|
||||
}
|
||||
else{
|
||||
termshow('error you are not connected, please connect to a distant server before executing this command')
|
||||
}
|
||||
}
|
||||
else if( x==='help'){
|
||||
termshow('The available commands: <br>- help : print this message<br>- ls : list the files and folders<br>- pbk (only in your computer) : Get the password of an user from an ip address<br>- ssh (only in your computer) : conect to a distant server with an user and an ip address (you have to use pbk to get the password)<br>- attack (only in ssh servers) : start an attack that will add all the datas on the server in your servers_data.zip file and will destroy the server (warning this will no destroy only the server from the user it will destroy ALL the server (the address))<br>- theme : switch the theme of the game\n- save : save the game in your localStorage (alternative to cookies)\n- import : import the game from your localStorage\n- matrix : start or stop a matrix rain animation (just for fun...)\n- exit : if you are connected to distant server (ssh) it deconnect you, if you are not connected it exit this game<br>- infos : display infos on this game')
|
||||
}
|
||||
else if (lowx==='exit'){
|
||||
if (connected){
|
||||
termshow('disconnecting...')
|
||||
connected=false
|
||||
}
|
||||
else{
|
||||
termshow('Exiting the session...')
|
||||
termshow('Exiting the game, thank to play to this game, don\'t hesitate to help me or to give me your feedback')
|
||||
STOP = true
|
||||
location = '/'
|
||||
}
|
||||
}
|
||||
else if (lowx==='hack'){
|
||||
if (connected){
|
||||
termshow('--Start-of-the-hacking-program--')
|
||||
for(let i = 0; i<randint(0,50);i++){
|
||||
termshow(randchoice(codeline))
|
||||
}
|
||||
}
|
||||
else{
|
||||
termshow('you have to be connected')
|
||||
}
|
||||
}
|
||||
else if (lowx=='infos'){
|
||||
infos()
|
||||
}
|
||||
else if(x.startsWith('$$$')){
|
||||
if(x === '$$$' || x === '$$$ '){
|
||||
termshow('this command is for execute js code enter your js code after the $$$')
|
||||
}
|
||||
else{
|
||||
try{
|
||||
let tempcode = x.substring('$$$ '.length)
|
||||
let newfunc = new Function (tempcode)
|
||||
newfunc()
|
||||
}
|
||||
catch(e){
|
||||
termshow('Il y a eu une erreur : '+e)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else{
|
||||
let temp = terminput('your name: ')
|
||||
if(temp.length<4){
|
||||
document.getElementById('inptindic').innerHTML ='your name must have more than 4 characters '
|
||||
}
|
||||
else{
|
||||
me = temp
|
||||
named = true
|
||||
document.getElementById('inptindic').innerHTML=''
|
||||
}
|
||||
}
|
||||
window.requestAnimationFrame(loop)
|
||||
}
|
||||
loop()
|
||||
// END OF CYBERTERMHACK CODE
|
||||
|
|
@ -0,0 +1,499 @@
|
|||
// TERM API BY GZOD01 (FROM CYBERTERMHACK BY GZOD01)
|
||||
|
||||
|
||||
// the variable to check if the input is complete (if the user press enter)
|
||||
var inputcomplete = false
|
||||
|
||||
// function to choose a random int (random.randint() in python)
|
||||
function randint(min, max){
|
||||
return Math.floor(Math.random() * (max - min + 1) ) + min;
|
||||
}
|
||||
|
||||
// START OF MATRIX CODE
|
||||
// function to stop the matrix (delete the canvas and recreate it)
|
||||
function stopmatrix(){
|
||||
document.getElementById('matrixcanvas').remove()
|
||||
let nc = document.createElement('canvas')
|
||||
nc.setAttribute('id','matrixcanvas')
|
||||
nc.style.width = '100%'
|
||||
nc.style.height ='0%'
|
||||
document.body.appendChild(nc)
|
||||
}
|
||||
//function to start the matrix (start the dropdown of letters etc.)
|
||||
function matrix(color){
|
||||
let tcolor = ''
|
||||
if(color==='cyan'){
|
||||
tcolor ='#0ff'
|
||||
}
|
||||
else if(color==='blue'){
|
||||
tcolor='#00f'
|
||||
}
|
||||
else if(color==='magenta'){
|
||||
tcolor='#f0f'
|
||||
}
|
||||
else if(color==='red'){
|
||||
tcolor='#f00'
|
||||
}
|
||||
else if(color==='green'){
|
||||
tcolor='#0f0'
|
||||
}
|
||||
else if(color==='yellow'){
|
||||
tcolor='#ff0'
|
||||
}
|
||||
else if(color==='white'){
|
||||
tcolor='#fff'
|
||||
}
|
||||
else if(color==='purple'){
|
||||
tcolor='#303'
|
||||
}
|
||||
else{
|
||||
tcolor= '#0f0'
|
||||
}
|
||||
var canvas = document.getElementById('matrixcanvas'),
|
||||
ctx = canvas.getContext('2d');
|
||||
|
||||
canvas.style.height = '100%'
|
||||
canvas.width = window.innerWidth;
|
||||
canvas.height = window.innerHeight;
|
||||
var letters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890&éèçà@æ€ŧøþ@ßðđŋłĸħłµł»¢µ$£ù%^¨';
|
||||
letters = letters.split('');
|
||||
|
||||
|
||||
var fontSize = 10,
|
||||
columns = canvas.width / fontSize;
|
||||
|
||||
|
||||
var drops = [];
|
||||
for (var i = 0; i < columns; i++) {
|
||||
drops[i] = 1;
|
||||
}
|
||||
|
||||
|
||||
function draw() {
|
||||
ctx.fillStyle = 'rgba(0, 0, 0, .1)';
|
||||
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
||||
for (var i = 0; i < drops.length; i++) {
|
||||
var text = letters[Math.floor(Math.random() * letters.length)];
|
||||
ctx.fillStyle = tcolor;
|
||||
ctx.fillText(text, i * fontSize, drops[i] * fontSize);
|
||||
drops[i]++;
|
||||
if (drops[i] * fontSize > canvas.height && Math.random() > .95) {
|
||||
drops[i] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
setInterval(draw, 33);
|
||||
}
|
||||
// END OF MATRIX CODE
|
||||
|
||||
// function like the time.sleep in python
|
||||
function sleep(s) {
|
||||
let ms = s*1000
|
||||
return new Promise(resolve => setTimeout(resolve, ms));
|
||||
}
|
||||
// function like random.choice() in python
|
||||
function randchoice(list){
|
||||
console.log(list[randint(0,list.length-1)])
|
||||
return list[randint(0,list.length-1)]
|
||||
}
|
||||
|
||||
// TODO : var historic = []
|
||||
|
||||
// lastx = the last input do (the input you get when you press up arrow) to replace with an historic
|
||||
var lastx = ""
|
||||
|
||||
// the function to execute when up arrow pressed
|
||||
function historic(){
|
||||
// TODO : terminpt.value=historic[historic.lengh-1-index]
|
||||
document.getElementById('terminpt').value = lastx // to replace with an historic (line above) , set the input value (content) to the last input executed
|
||||
}
|
||||
// when a key is down
|
||||
onkeydown = function(e){
|
||||
// if the key is the tab key (keyCode 9)
|
||||
if(e.keyCode==9){
|
||||
// execute the autocomplete function
|
||||
autocomplete()
|
||||
}
|
||||
}
|
||||
// when a key is up
|
||||
onkeyup = function(e){
|
||||
// if the key is enter key (keyCode 13)
|
||||
if(e.keyCode==13){
|
||||
// set the inputcomplete variable to true to inform the terminput function that the user press enter
|
||||
inputcomplete = true
|
||||
}
|
||||
// if the input is up arrow key (keyCode 38)
|
||||
else if(e.keyCode == 38){
|
||||
// execute the historic function
|
||||
historic()
|
||||
}
|
||||
}
|
||||
// function like the print() function in python, add the text to the #termcontent div
|
||||
function termshow(str){
|
||||
let tc = document.getElementById('termcontent')
|
||||
let nchild = document.createElement('div')
|
||||
str = str.replace('<','<')
|
||||
str= str.replace('>','>')
|
||||
str= str.replace('&infg&','<')
|
||||
str = str.replace('&supd&','>')
|
||||
nchild.innerHTML = str.replace('\n','<br>')
|
||||
tc.appendChild(nchild)
|
||||
document.getElementById('termcontent').scrollTo(0,document.getElementById('termcontent').scrollHeight)
|
||||
}
|
||||
// the input() function of python, check if the input is complete (see the inputcomplete variable and the onkeyup (e.keyCode == 13) execution
|
||||
function terminput(str){
|
||||
let tiname = document.getElementById('inptname')
|
||||
tiname.innerHTML = str
|
||||
let inpt = document.getElementById('terminpt')
|
||||
if(inputcomplete){
|
||||
console.log(inpt.value)
|
||||
inputcomplete=false
|
||||
let resultat = inpt.value
|
||||
inpt.value = ''
|
||||
return resultat
|
||||
}
|
||||
else{
|
||||
//return 'ERR' if the input isn't complete
|
||||
return 'ERR'
|
||||
}
|
||||
}
|
||||
// replace this list with the list of your commands
|
||||
var list_of_command = ['ls','ssh','pbk','exit','theme','matrix','hack','attack','save','import','help','exit']
|
||||
// autocomplete when tab press show all the command starting with the value in your input
|
||||
function autocomplete(){
|
||||
let inptval = document.getElementById('terminpt').value
|
||||
termshow('List of available commands starting with " '+inptval+' " :')
|
||||
for(let i = 0; i<list_of_command.length; i++){
|
||||
if(list_of_command[i].startsWith(inptval)){
|
||||
termshow('- '+list_of_command[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
// x= the current input
|
||||
var x = ""
|
||||
|
||||
// START OF FUNCTIONS TO USE WITHOUT INTERACT WITH THE INTERFACE
|
||||
// Send the current input (function to set the inputcomplete as true)
|
||||
function sendinput(){inputcomplete=true}
|
||||
// setinput(str) function to set the value of the input from function
|
||||
function setinput(str){document.getElementById('terminpt').value=str}
|
||||
// execcommand(str) set input and send input
|
||||
function execcommand(str){setinput(str); sendinput()}
|
||||
// last() historic and sendinput
|
||||
function last(){historic(); sendinput()}
|
||||
// autoc setinput, autocomplete
|
||||
function autoc(str){setinput(str); autocomplete();}
|
||||
// END OF FUNCTIONS TO USE WITHOUT INTERACT WITH THE INTERFACE
|
||||
// END OF THE API CODE
|
||||
|
||||
|
||||
/TODO:*
|
||||
// START OF CYBERTERMHACK CODE
|
||||
// You can keep this function if you want to split an address
|
||||
function splitaddr(complete, cmd){
|
||||
try{
|
||||
let c = complete.substring(cmd.length)
|
||||
let u = c.split('@')[0]
|
||||
let a = c.split('@')[1]
|
||||
if (a==undefined){
|
||||
termshow('Please complete the command like this: '+cmd+' user@address')
|
||||
return 'ERROR'
|
||||
}
|
||||
else{
|
||||
return [u, a]
|
||||
}
|
||||
}
|
||||
catch(e){
|
||||
console.error(e)
|
||||
termshow('Please complete the command like this: '+cmd+' user@address')
|
||||
return 'ERROR'
|
||||
}
|
||||
}
|
||||
|
||||
function infos(){
|
||||
termshow(YOUR_INFOS_HERE)
|
||||
}
|
||||
stopmatrix()
|
||||
// these three list (password, files and codeline are sample of if you want to use randchoice
|
||||
var passwordlist = ["my_password","helloworld","ultra_secure_password","my_birthday"]
|
||||
var filelist = ['picture.png','personnal_datas.csv', 'helloworld.py','i_hate_hackers.txt','speech_for_tomorrow.md', '.ha_ha_this_is_super_secret_file.txt','mydirectory/']
|
||||
var codeline = ["fn destroy(oiaf){executeshellcomand('destroy oiaf')}","hack-server()","destroy()","fn hack-server(files){for(var i = 0, i<len(files)){if (type_of_file(files[i])==='password_files_and_datas_files'){execcommand('copyfile_to_my_computer'); destroy(files)};", "print(01020003957058098409438409340&àà_09232983983983923999832983928398329389238938923892382938923899201809381093809é'802984029804802948049820840938éàç8309é_à'ç_éà'_09790872çà'àç_éè409724097240942èàçé'8è290479024798047298047904èé4908éè4) in serverdatas"]
|
||||
// variable to check if the user is connected
|
||||
var connected = false
|
||||
// variable to check if the player got file from server
|
||||
var datased = false
|
||||
|
||||
//var STOP = false NON USED
|
||||
|
||||
// display the infos
|
||||
infos()
|
||||
// the name of the user hacked
|
||||
var user = ""
|
||||
// the ip of the server hacked
|
||||
var ip = ""
|
||||
// the password (non really used)
|
||||
var password = ""
|
||||
// the list of the ip destroyed (replaced with serversdatas['password'}
|
||||
var destroyedip = []
|
||||
// show starting session
|
||||
termshow('starting session ...')
|
||||
// name of user
|
||||
var me = ''
|
||||
// variable to check if the user enter his name
|
||||
named = false
|
||||
// example of serversdatas: "ip":{"destroyed":true (or false), "files":listoffiles, "password":"password"}
|
||||
var gamedatas = {
|
||||
"serversdatas":{},
|
||||
"username": me,
|
||||
'colorscheme': 'default' //it can be green / red / blue / yellow
|
||||
}
|
||||
// change the theme of page (with gamedatas.colorscheme)
|
||||
function gettheme(){
|
||||
let r = document.querySelector(':root')
|
||||
if (gamedatas.colorscheme ==='default'){
|
||||
r.style.setProperty('--txt-color','white')
|
||||
}
|
||||
else if (gamedatas.colorscheme === 'green'){
|
||||
r.style.setProperty('--txt-color','green')
|
||||
}
|
||||
else if (gamedatas.colorscheme === 'red'){
|
||||
r.style.setProperty('--txt-color','red')
|
||||
}
|
||||
else if (gamedatas.colorscheme === 'blue'){
|
||||
r.style.setProperty('--txt-color','blue')
|
||||
}
|
||||
else if (gamedatas.colorscheme === 'yellow'){
|
||||
r.style.setProperty('--txt-color','yellow')
|
||||
}
|
||||
}
|
||||
// ipdatas (it will be an easy 'shortcut' to gamedatas.serversdatas)
|
||||
var ipdatas = {}
|
||||
// focus the terminput
|
||||
document.getElementById('terminpt').focus()
|
||||
|
||||
// THE MAIN FUNCTION (LOOP) THAT WILL BE EXECUTE
|
||||
async function loop(){
|
||||
gamedatas.serversdatas = ipdatas
|
||||
if(named){
|
||||
if(connected){
|
||||
x = terminput(`${user}@${ip} $ `)
|
||||
}
|
||||
else{
|
||||
x = terminput(`${me}@MYCOMPUTER # `)
|
||||
}
|
||||
if(x==='ERR'){}
|
||||
else{
|
||||
//historic.push(x)
|
||||
lastx = x
|
||||
let lowx = x.toLowerCase()
|
||||
if(connected){
|
||||
termshow(`${user}@${ip} $ ${x}`)
|
||||
}
|
||||
else{
|
||||
termshow(`${me}@MYCOMPUTER # ${x}`)
|
||||
}
|
||||
if (lowx.startsWith('ssh')){
|
||||
if (connected){
|
||||
termshow('error you already are in distant server')
|
||||
}
|
||||
else{
|
||||
if (splitaddr(x, 'ssh') === 'ERROR'){
|
||||
}
|
||||
else{
|
||||
user = splitaddr(x, 'ssh')[0]
|
||||
ip = splitaddr(x, 'ssh')[1]
|
||||
if(ipdatas[ip]==undefined){
|
||||
ipdatas[ip]={}
|
||||
}
|
||||
termshow('connect to the computer with the ip '+ip+' from the user '+user+' ...')
|
||||
if (ipdatas[ip]['destroyed']){
|
||||
termshow('error this server is destroyed')
|
||||
}
|
||||
else{
|
||||
if(ipdatas[ip]['password']==undefined){
|
||||
termshow('you don\'t have the password of this server')
|
||||
}
|
||||
else{
|
||||
await sleep(1)
|
||||
termshow('Password: AUTOMATIC_PASSWORD_SYSTEM')
|
||||
// while(temppass != ipdatas[ip]['password']){
|
||||
// temppass = terminput('Password: ')
|
||||
// }
|
||||
await sleep(1)
|
||||
termshow('connected')
|
||||
connected=true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (lowx.startsWith('pbk')){
|
||||
if (connected){
|
||||
termshow('error you are on a distant server')
|
||||
}
|
||||
else{
|
||||
if (splitaddr(x,'pbk')==='ERROR'){
|
||||
splitaddr(x,'pbk')
|
||||
}
|
||||
else{
|
||||
user=splitaddr(x, 'pbk')[0]
|
||||
ip = splitaddr(x, 'pbk')[1]
|
||||
if(ipdatas[ip]==undefined){
|
||||
ipdatas[ip]={}
|
||||
}
|
||||
termshow('Breaking the password of the user '+user+' to the computer with the ip '+ip+' ...')
|
||||
password= randchoice(passwordlist)
|
||||
ipdatas[ip]['password']=password
|
||||
termshow('The password is : '+ password)
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (lowx.startsWith('theme')){
|
||||
if(lowx==='theme'||lowx==='theme '){
|
||||
termshow('Switch the theme with this command,<br> the available colors are : default , yellow , red , blue , green . <br> execute the command like this: theme default or theme yellow , etc.')
|
||||
}
|
||||
else{
|
||||
let nx = x.substring('theme '.length)
|
||||
if(nx==='yellow' || nx ==='blue' || nx==='default' || nx ==='red' || nx === 'green'){
|
||||
gamedatas.colorscheme = nx
|
||||
gettheme()
|
||||
}
|
||||
else{
|
||||
termshow('Switch the theme with this command,<br> the available colors are : default , yellow , red , blue , green . <br> execute the command like this: theme default or theme yellow , etc.')
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (lowx.startsWith('matrix')){
|
||||
if(lowx==='matrix'||lowx==='matrix '){
|
||||
matrix(gamedatas.colorscheme)
|
||||
}
|
||||
else{
|
||||
let nx = x.substring('matrix '.length)
|
||||
if(nx==='yellow' || nx ==='blue' || nx==='white' || nx ==='red' || nx === 'green'||nx=='purple'|| nx=='cyan' || nx=='magenta'){
|
||||
matrix(nx)
|
||||
}
|
||||
else if(nx==='stop'){
|
||||
stopmatrix()
|
||||
}
|
||||
else{
|
||||
termshow('Switch the theme with this command,<br> the available colors are : default , yellow , red , blue , green . <br> execute the command like this: theme default or theme yellow , etc.')
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(lowx==='save'){
|
||||
localStorage.setItem('hackergamedatas',JSON.stringify(gamedatas))
|
||||
termshow('Data saved')
|
||||
termshow(localStorage.getItem('hackergamedatas'))
|
||||
}
|
||||
else if(lowx==='import'){
|
||||
let tmpdatas = localStorage.getItem('hackergamedatas')
|
||||
if (tmpdatas == undefined){
|
||||
termshow('you don\'t have any data saved, please execute the save command before to import')
|
||||
}
|
||||
else{
|
||||
gamedatas = JSON.parse(tmpdatas)
|
||||
}
|
||||
}
|
||||
else if (lowx=='ls'){
|
||||
if (connected){
|
||||
if (ipdatas[ip]['files'] == undefined){
|
||||
termshow('This is the file on the distant machine')
|
||||
let fileiplist = []
|
||||
for(let i=0; i < parseInt(randint(1,10)); i++){
|
||||
let currentchoicefile = randchoice(filelist)
|
||||
termshow('-'+currentchoicefile)
|
||||
fileiplist.push(currentchoicefile)
|
||||
}
|
||||
ipdatas[ip]['files'] = fileiplist
|
||||
}
|
||||
else{
|
||||
termshow('This is the file on the distant machine')
|
||||
for(let i = 0; i<ipdatas[ip]['files'].length; i++){
|
||||
termshow('-'+ ipdatas[ip]['files'][i])
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
if (datased){
|
||||
termshow('This is the file on your computer: <br>- my_datas.zip <br>- servers_data.zip')
|
||||
}
|
||||
else{
|
||||
termshow('This is the file on your computer: <br>- my_datas.zip')
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (lowx=='attack'){
|
||||
if( connected){
|
||||
termshow('the attack start... <br> copying all the data in this server to your servers_data.zip file in your computer (it include all the file, folder etc.)...<br>breaking the server...<br>Disconnected: The server is destroy')
|
||||
connected = false
|
||||
datased = true
|
||||
ipdatas[ip]['destroyed'] = true
|
||||
}
|
||||
else{
|
||||
termshow('error you are not connected, please connect to a distant server before executing this command')
|
||||
}
|
||||
}
|
||||
else if( x==='help'){
|
||||
termshow('The available commands: <br>- help : print this message<br>- ls : list the files and folders<br>- pbk (only in your computer) : Get the password of an user from an ip address<br>- ssh (only in your computer) : conect to a distant server with an user and an ip address (you have to use pbk to get the password)<br>- attack (only in ssh servers) : start an attack that will add all the datas on the server in your servers_data.zip file and will destroy the server (warning this will no destroy only the server from the user it will destroy ALL the server (the address))<br>- theme : switch the theme of the game\n- save : save the game in your localStorage (alternative to cookies)\n- import : import the game from your localStorage\n- matrix : start or stop a matrix rain animation (just for fun...)\n- exit : if you are connected to distant server (ssh) it deconnect you, if you are not connected it exit this game<br>- infos : display infos on this game')
|
||||
}
|
||||
else if (lowx==='exit'){
|
||||
if (connected){
|
||||
termshow('disconnecting...')
|
||||
connected=false
|
||||
}
|
||||
else{
|
||||
termshow('Exiting the session...')
|
||||
termshow('Exiting the game, thank to play to this game, don\'t hesitate to help me or to give me your feedback')
|
||||
STOP = true
|
||||
location = '/'
|
||||
}
|
||||
}
|
||||
else if (lowx==='hack'){
|
||||
if (connected){
|
||||
termshow('--Start-of-the-hacking-program--')
|
||||
for(let i = 0; i<randint(0,50);i++){
|
||||
termshow(randchoice(codeline))
|
||||
}
|
||||
}
|
||||
else{
|
||||
termshow('you have to be connected')
|
||||
}
|
||||
}
|
||||
else if (lowx=='infos'){
|
||||
infos()
|
||||
}
|
||||
else if(x.startsWith('$$$')){
|
||||
if(x === '$$$' || x === '$$$ '){
|
||||
termshow('this command is for execute js code enter your js code after the $$$')
|
||||
}
|
||||
else{
|
||||
try{
|
||||
let tempcode = x.substring('$$$ '.length)
|
||||
let newfunc = new Function (tempcode)
|
||||
newfunc()
|
||||
}
|
||||
catch(e){
|
||||
termshow('Il y a eu une erreur : '+e)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else{
|
||||
let temp = terminput('your name: ')
|
||||
if(temp.length<4){
|
||||
document.getElementById('inptindic').innerHTML ='your name must have more than 4 characters '
|
||||
}
|
||||
else{
|
||||
me = temp
|
||||
named = true
|
||||
document.getElementById('inptindic').innerHTML=''
|
||||
}
|
||||
}
|
||||
window.requestAnimationFrame(loop)
|
||||
}
|
||||
loop()
|
||||
// END OF CYBERTERMHACK CODE
|
||||
79
main-site/CyberTermHack/V0.1.2:OPTIMIZED/index.html
Normal file
79
main-site/CyberTermHack/V0.1.2:OPTIMIZED/index.html
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<title>CyberTermHack</title>
|
||||
<meta charset="UTF-8">
|
||||
<style>
|
||||
:root{
|
||||
--bg-color: black;
|
||||
--txt-color: white;
|
||||
}
|
||||
html, body{
|
||||
background-color:var(--bg-color);
|
||||
color: var(--txt-color);
|
||||
margin:0;
|
||||
height:100%;
|
||||
min-height:100vh;
|
||||
display:flex;
|
||||
flex-direction:column;
|
||||
word-wrap: break-word;
|
||||
word-break: break-all;
|
||||
z-index:2
|
||||
}
|
||||
.second {
|
||||
flex-grow: 1;
|
||||
}
|
||||
#termcontent{
|
||||
display: fixed;
|
||||
left:0;
|
||||
top:0;
|
||||
height:95%;
|
||||
width:100%;
|
||||
overflow: auto
|
||||
}
|
||||
#divinput{
|
||||
display:flex;
|
||||
left:0;
|
||||
bottom:0;
|
||||
height:5%;
|
||||
width:100%
|
||||
}
|
||||
#terminpt{
|
||||
border: 0px solid !important;
|
||||
background-color: var(--bg-color);
|
||||
color:var(--txt-color);
|
||||
width:95%
|
||||
}
|
||||
/*#terminptdiv{
|
||||
float: none
|
||||
}*/
|
||||
*:focus {
|
||||
outline: none;
|
||||
}
|
||||
/*#divofinfos{
|
||||
float:left
|
||||
}*/
|
||||
#matrixcanvas{
|
||||
width:100%;
|
||||
height:100%;
|
||||
position:fixed;
|
||||
z-index:-1
|
||||
}
|
||||
</style>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
</head>
|
||||
<body>
|
||||
<!--username and ip: green, $ or %: white, commands: white-->
|
||||
<div id="termcontent">
|
||||
<!-- oldcommands and outputs -->
|
||||
</div>
|
||||
<div id="divinput">
|
||||
<span id=spanofinfos><span id="inptindic"></span><span id="inptname"></span></span><span class=second><input id=terminpt type="text"/></span>
|
||||
<!-- actual command with username and ip, $ or %, input for command, enter to send command -->
|
||||
</div>
|
||||
<canvas id=matrixcanvas style='width:100%; height: 100%'>
|
||||
</canvas>
|
||||
<script src=//api.gzod01.fr/scripts/termapi.js></script>
|
||||
<script src="maincode.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
302
main-site/CyberTermHack/V0.1.2:OPTIMIZED/maincode.js
Normal file
302
main-site/CyberTermHack/V0.1.2:OPTIMIZED/maincode.js
Normal file
|
|
@ -0,0 +1,302 @@
|
|||
var x = ""
|
||||
function splitaddr(complete, cmd){
|
||||
try{
|
||||
let c = complete.substring(cmd.length)
|
||||
let u = c.split('@')[0]
|
||||
let a = c.split('@')[1]
|
||||
if (a==undefined){
|
||||
termshow('Please complete the command like this: '+cmd+' user@address')
|
||||
return 'ERROR'
|
||||
}
|
||||
else{
|
||||
return [u, a]
|
||||
}
|
||||
}
|
||||
catch(e){
|
||||
console.error(e)
|
||||
termshow('Please complete the command like this: '+cmd+' user@address')
|
||||
return 'ERROR'
|
||||
}
|
||||
}
|
||||
function infos(){
|
||||
termshow('01010101010101010\n1.CyberTermGame.1\n0.....By GZod01.....0\n10101010101010101\nInfos on the game : Hello my name is GZod01 and i make this game in javascript (base game in python) "for fun", I know this game is not reflecting the reality of the command on linux or windows machines but... it is a game...\nSorry if the english is not very good i speak french...')
|
||||
}
|
||||
stopmatrix()
|
||||
var passwordlist = ["my_password","helloworld","ultra_secure_password","my_birthday"]
|
||||
var filelist = ['picture.png','personnal_datas.csv', 'helloworld.py','i_hate_hackers.txt','speech_for_tomorrow.md', '.ha_ha_this_is_super_secret_file.txt','mydirectory/']
|
||||
var connected = false
|
||||
var datased = false
|
||||
var STOP = false
|
||||
infos()
|
||||
var user = ""
|
||||
var ip = ""
|
||||
var password = ""
|
||||
var destroyedip = []
|
||||
var codeline = ["fn destroy(oiaf){executeshellcomand('destroy oiaf')}","hack-server()","destroy()","fn hack-server(files){for(var i = 0, i<len(files)){if (type_of_file(files[i])==='password_files_and_datas_files'){execcommand('copyfile_to_my_computer'); destroy(files)};", "print(01020003957058098409438409340&àà_09232983983983923999832983928398329389238938923892382938923899201809381093809é'802984029804802948049820840938éàç8309é_à'ç_éà'_09790872çà'àç_éè409724097240942èàçé'8è290479024798047298047904èé4908éè4) in serverdatas"]
|
||||
termshow('starting session ...')
|
||||
var me = ''
|
||||
var list_of_command = ['ls','ssh','pbk','exit','theme','matrix','hack','attack','save','import','help','exit']
|
||||
function autocomplete(){
|
||||
let inptval = document.getElementById('terminpt').value
|
||||
termshow('List of available commands starting with " '+inptval+' " :')
|
||||
for(let i = 0; i<list_of_command.length; i++){
|
||||
if(list_of_command[i].startsWith(inptval)){
|
||||
termshow('- '+list_of_command[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
named = false
|
||||
// example of serversdatas: "ip":{"destroyed":true (or false), "files":listoffiles, "password":"password"}
|
||||
var gamedatas = {
|
||||
"serversdatas":{},
|
||||
"username": me,
|
||||
'colorscheme': 'default' //it can be green / red / blue / yellow
|
||||
}
|
||||
// START OF MAIN-MODE CODE
|
||||
function gettheme(){
|
||||
let r = document.querySelector(':root')
|
||||
if (gamedatas.colorscheme ==='default'){
|
||||
r.style.setProperty('--txt-color','white')
|
||||
}
|
||||
else if (gamedatas.colorscheme === 'green'){
|
||||
r.style.setProperty('--txt-color','green')
|
||||
}
|
||||
else if (gamedatas.colorscheme === 'red'){
|
||||
r.style.setProperty('--txt-color','red')
|
||||
}
|
||||
else if (gamedatas.colorscheme === 'blue'){
|
||||
r.style.setProperty('--txt-color','blue')
|
||||
}
|
||||
else if (gamedatas.colorscheme === 'yellow'){
|
||||
r.style.setProperty('--txt-color','yellow')
|
||||
}
|
||||
}
|
||||
var ipdatas = {}
|
||||
document.getElementById('terminpt').focus()
|
||||
async function loop(){
|
||||
gamedatas.serversdatas = ipdatas
|
||||
if(named){
|
||||
if(connected){
|
||||
x = terminput(`${user}@${ip} $ `)
|
||||
}
|
||||
else{
|
||||
x = terminput(`${me}@MYCOMPUTER # `)
|
||||
}
|
||||
if(x==='ERR'){}
|
||||
else{
|
||||
//historic.push(x)
|
||||
lastx = x
|
||||
let lowx = x.toLowerCase()
|
||||
if(connected){
|
||||
termshow(`${user}@${ip} $ ${x}`)
|
||||
}
|
||||
else{
|
||||
termshow(`${me}@MYCOMPUTER # ${x}`)
|
||||
}
|
||||
if (lowx.startsWith('ssh')){
|
||||
if (connected){
|
||||
termshow('error you already are in distant server')
|
||||
}
|
||||
else{
|
||||
if (splitaddr(x, 'ssh') === 'ERROR'){
|
||||
}
|
||||
else{
|
||||
user = splitaddr(x, 'ssh')[0]
|
||||
ip = splitaddr(x, 'ssh')[1]
|
||||
if(ipdatas[ip]==undefined){
|
||||
ipdatas[ip]={}
|
||||
}
|
||||
termshow('connect to the computer with the ip '+ip+' from the user '+user+' ...')
|
||||
if (ipdatas[ip]['destroyed']){
|
||||
termshow('error this server is destroyed')
|
||||
}
|
||||
else{
|
||||
if(ipdatas[ip]['password']==undefined){
|
||||
termshow('you don\'t have the password of this server')
|
||||
}
|
||||
else{
|
||||
await sleep(1)
|
||||
termshow('Password: AUTOMATIC_PASSWORD_SYSTEM')
|
||||
// while(temppass != ipdatas[ip]['password']){
|
||||
// temppass = terminput('Password: ')
|
||||
// }
|
||||
await sleep(1)
|
||||
termshow('connected')
|
||||
connected=true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (lowx.startsWith('pbk')){
|
||||
if (connected){
|
||||
termshow('error you are on a distant server')
|
||||
}
|
||||
else{
|
||||
if (splitaddr(x,'pbk')==='ERROR'){
|
||||
splitaddr(x,'pbk')
|
||||
}
|
||||
else{
|
||||
user=splitaddr(x, 'pbk')[0]
|
||||
ip = splitaddr(x, 'pbk')[1]
|
||||
if(ipdatas[ip]==undefined){
|
||||
ipdatas[ip]={}
|
||||
}
|
||||
termshow('Breaking the password of the user '+user+' to the computer with the ip '+ip+' ...')
|
||||
password= randchoice(passwordlist)
|
||||
ipdatas[ip]['password']=password
|
||||
termshow('The password is : '+ password)
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (lowx.startsWith('theme')){
|
||||
if(lowx==='theme'||lowx==='theme '){
|
||||
termshow('Switch the theme with this command,\n the available colors are : default , yellow , red , blue , green . \n execute the command like this: theme default or theme yellow , etc.')
|
||||
}
|
||||
else{
|
||||
let nx = x.substring('theme '.length)
|
||||
if(nx==='yellow' || nx ==='blue' || nx==='default' || nx ==='red' || nx === 'green'){
|
||||
gamedatas.colorscheme = nx
|
||||
gettheme()
|
||||
}
|
||||
else{
|
||||
termshow('Switch the theme with this command,\n the available colors are : default , yellow , red , blue , green . \n execute the command like this: theme default or theme yellow , etc.')
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (lowx.startsWith('matrix')){
|
||||
if(lowx==='matrix'||lowx==='matrix '){
|
||||
matrix(gamedatas.colorscheme)
|
||||
}
|
||||
else{
|
||||
let nx = x.substring('matrix '.length)
|
||||
if(nx==='yellow' || nx ==='blue' || nx==='white' || nx ==='red' || nx === 'green'||nx=='purple'|| nx=='cyan' || nx=='magenta'){
|
||||
matrix(nx)
|
||||
}
|
||||
else if(nx==='stop'){
|
||||
stopmatrix()
|
||||
}
|
||||
else{
|
||||
termshow('Switch the theme with this command,\n the available colors are : default , yellow , red , blue , green . \n execute the command like this: theme default or theme yellow , etc.')
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(lowx==='save'){
|
||||
localStorage.setItem('hackergamedatas',JSON.stringify(gamedatas))
|
||||
termshow('Data saved')
|
||||
termshow(localStorage.getItem('hackergamedatas'))
|
||||
}
|
||||
else if(lowx==='import'){
|
||||
let tmpdatas = localStorage.getItem('hackergamedatas')
|
||||
if (tmpdatas == undefined){
|
||||
termshow('you don\'t have any data saved, please execute the save command before to import')
|
||||
}
|
||||
else{
|
||||
gamedatas = JSON.parse(tmpdatas)
|
||||
}
|
||||
}
|
||||
else if (lowx=='ls'){
|
||||
if (connected){
|
||||
if (ipdatas[ip]['files'] == undefined){
|
||||
termshow('This is the file on the distant machine')
|
||||
let fileiplist = []
|
||||
for(let i=0; i < parseInt(randint(1,10)); i++){
|
||||
let currentchoicefile = randchoice(filelist)
|
||||
termshow('-'+currentchoicefile)
|
||||
fileiplist.push(currentchoicefile)
|
||||
}
|
||||
ipdatas[ip]['files'] = fileiplist
|
||||
}
|
||||
else{
|
||||
termshow('This is the file on the distant machine')
|
||||
for(let i = 0; i<ipdatas[ip]['files'].length; i++){
|
||||
termshow('-'+ ipdatas[ip]['files'][i])
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
if (datased){
|
||||
termshow('This is the file on your computer: \n- my_datas.zip \n- servers_data.zip')
|
||||
}
|
||||
else{
|
||||
termshow('This is the file on your computer: \n- my_datas.zip')
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (lowx=='attack'){
|
||||
if( connected){
|
||||
termshow('the attack start... \n copying all the data in this server to your servers_data.zip file in your computer (it include all the file, folder etc.)...\nbreaking the server...\nDisconnected: The server is destroy')
|
||||
connected = false
|
||||
datased = true
|
||||
ipdatas[ip]['destroyed'] = true
|
||||
}
|
||||
else{
|
||||
termshow('error you are not connected, please connect to a distant server before executing this command')
|
||||
}
|
||||
}
|
||||
else if( x==='help'){
|
||||
termshow('The available commands: \n- help : print this message\n- ls : list the files and folders\n- pbk (only in your computer) : Get the password of an user from an ip address\n- ssh (only in your computer) : conect to a distant server with an user and an ip address (you have to use pbk to get the password)\n- attack (only in ssh servers) : start an attack that will add all the datas on the server in your servers_data.zip file and will destroy the server (warning this will no destroy only the server from the user it will destroy ALL the server (the address))\n- theme : switch the theme of the game\n- save : save the game in your localStorage (alternative to cookies)\n- import : import the game from your localStorage\n- matrix : start or stop a matrix rain animation (just for fun...)\n- exit : if you are connected to distant server (ssh) it deconnect you, if you are not connected it exit this game\n- infos : display infos on this game')
|
||||
}
|
||||
else if (lowx==='exit'){
|
||||
if (connected){
|
||||
termshow('disconnecting...')
|
||||
connected=false
|
||||
}
|
||||
else{
|
||||
termshow('Exiting the session...')
|
||||
termshow('Exiting the game, thank to play to this game, don\'t hesitate to help me or to give me your feedback')
|
||||
STOP = true
|
||||
location = '/'
|
||||
}
|
||||
}
|
||||
else if (lowx==='hack'){
|
||||
if (connected){
|
||||
termshow('--Start-of-the-hacking-program--')
|
||||
for(let i = 0; i<randint(0,50);i++){
|
||||
termshow(randchoice(codeline))
|
||||
}
|
||||
}
|
||||
else{
|
||||
termshow('you have to be connected')
|
||||
}
|
||||
}
|
||||
else if (lowx=='infos'){
|
||||
infos()
|
||||
}
|
||||
else if(x.startsWith('$$$')){
|
||||
if(x === '$$$' || x === '$$$ '){
|
||||
termshow('this command is for execute js code enter your js code after the $$$')
|
||||
}
|
||||
else{
|
||||
try{
|
||||
let tempcode = x.substring('$$$ '.length)
|
||||
let newfunc = new Function (tempcode)
|
||||
newfunc()
|
||||
}
|
||||
catch(e){
|
||||
termshow('Il y a eu une erreur : '+e)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else{
|
||||
let temp = terminput('your name: ')
|
||||
if(temp.length<4){
|
||||
document.getElementById('inptindic').innerHTML ='your name must have more than 4 characters '
|
||||
}
|
||||
else{
|
||||
me = temp
|
||||
named = true
|
||||
document.getElementById('inptindic').innerHTML=''
|
||||
}
|
||||
}
|
||||
window.requestAnimationFrame(loop)
|
||||
}
|
||||
loop()
|
||||
//END OF MAIN-MODE CODE
|
||||
//START OF STORY MODE CODE
|
||||
|
||||
|
||||
// END OF STORY MODE CODE
|
||||
78
main-site/CyberTermHack/V0.1/index.html
Normal file
78
main-site/CyberTermHack/V0.1/index.html
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<title>CyberTermHack</title>
|
||||
<meta charset="UTF-8">
|
||||
<style>
|
||||
:root{
|
||||
--bg-color: black;
|
||||
--txt-color: white;
|
||||
}
|
||||
html, body{
|
||||
background-color:var(--bg-color);
|
||||
color: var(--txt-color);
|
||||
margin:0;
|
||||
height:100%;
|
||||
min-height:100vh;
|
||||
display:flex;
|
||||
flex-direction:column;
|
||||
word-wrap: break-word;
|
||||
word-break: break-all;
|
||||
z-index:2
|
||||
}
|
||||
.second {
|
||||
flex-grow: 1;
|
||||
}
|
||||
#termcontent{
|
||||
display: fixed;
|
||||
left:0;
|
||||
top:0;
|
||||
height:95%;
|
||||
width:100%;
|
||||
overflow: auto
|
||||
}
|
||||
#divinput{
|
||||
display:flex;
|
||||
left:0;
|
||||
bottom:0;
|
||||
height:5%;
|
||||
width:100%
|
||||
}
|
||||
#terminpt{
|
||||
border: 0px solid !important;
|
||||
background-color: var(--bg-color);
|
||||
color:var(--txt-color);
|
||||
width:95%
|
||||
}
|
||||
/*#terminptdiv{
|
||||
float: none
|
||||
}*/
|
||||
*:focus {
|
||||
outline: none;
|
||||
}
|
||||
/*#divofinfos{
|
||||
float:left
|
||||
}*/
|
||||
#matrixcanvas{
|
||||
width:100%;
|
||||
height:100%;
|
||||
position:fixed;
|
||||
z-index:-1
|
||||
}
|
||||
</style>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
</head>
|
||||
<body>
|
||||
<!--username and ip: green, $ or %: white, commands: white-->
|
||||
<div id="termcontent">
|
||||
<!-- oldcommands and outputs -->
|
||||
</div>
|
||||
<div id="divinput">
|
||||
<span id=spanofinfos><span id="inptindic"></span><span id="inptname"></span></span><span class=second><input id=terminpt type="text"/></span>
|
||||
<!-- actual command with username and ip, $ or %, input for command, enter to send command -->
|
||||
</div>
|
||||
<canvas id=matrixcanvas style='width:100%; height: 100%'>
|
||||
</canvas>
|
||||
<script src="jsversion.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
78
main-site/CyberTermHack/V0.1/js-web-CyberTermHack.html
Normal file
78
main-site/CyberTermHack/V0.1/js-web-CyberTermHack.html
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<title>CyberTermHack</title>
|
||||
<meta charset="UTF-8">
|
||||
<style>
|
||||
:root{
|
||||
--bg-color: black;
|
||||
--txt-color: white;
|
||||
}
|
||||
html, body{
|
||||
background-color:var(--bg-color);
|
||||
color: var(--txt-color);
|
||||
margin:0;
|
||||
height:100%;
|
||||
min-height:100vh;
|
||||
display:flex;
|
||||
flex-direction:column;
|
||||
word-wrap: break-word;
|
||||
word-break: break-all;
|
||||
z-index:2
|
||||
}
|
||||
.second {
|
||||
flex-grow: 1;
|
||||
}
|
||||
#termcontent{
|
||||
display: fixed;
|
||||
left:0;
|
||||
top:0;
|
||||
height:95%;
|
||||
width:100%;
|
||||
overflow: auto
|
||||
}
|
||||
#divinput{
|
||||
display:flex;
|
||||
left:0;
|
||||
bottom:0;
|
||||
height:5%;
|
||||
width:100%
|
||||
}
|
||||
#terminpt{
|
||||
border: 0px solid !important;
|
||||
background-color: var(--bg-color);
|
||||
color:var(--txt-color);
|
||||
width:95%
|
||||
}
|
||||
/*#terminptdiv{
|
||||
float: none
|
||||
}*/
|
||||
*:focus {
|
||||
outline: none;
|
||||
}
|
||||
/*#divofinfos{
|
||||
float:left
|
||||
}*/
|
||||
#matrixcanvas{
|
||||
width:100%;
|
||||
height:100%;
|
||||
position:fixed;
|
||||
z-index:-1
|
||||
}
|
||||
</style>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
</head>
|
||||
<body>
|
||||
<!--username and ip: green, $ or %: white, commands: white-->
|
||||
<div id="termcontent">
|
||||
<!-- oldcommands and outputs -->
|
||||
</div>
|
||||
<div id="divinput">
|
||||
<span id=spanofinfos><span id="inptindic"></span><span id="inptname"></span></span><span class=second><input id=terminpt type="text"/></span>
|
||||
<!-- actual command with username and ip, $ or %, input for command, enter to send command -->
|
||||
</div>
|
||||
<canvas id=matrixcanvas style='width:100%; height: 100%'>
|
||||
</canvas>
|
||||
<script src="jsversion.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
440
main-site/CyberTermHack/V0.1/jsversion.js
Normal file
440
main-site/CyberTermHack/V0.1/jsversion.js
Normal file
|
|
@ -0,0 +1,440 @@
|
|||
// CYBERTERMHACK BY GZOD01
|
||||
//START OF CYBERTERMHACK CODE
|
||||
var inputcomplete = false
|
||||
function randint(min, max){
|
||||
return Math.floor(Math.random() * (max - min + 1) ) + min;
|
||||
}
|
||||
function stopmatrix(){
|
||||
document.getElementById('matrixcanvas').remove()
|
||||
let nc = document.createElement('canvas')
|
||||
nc.setAttribute('id','matrixcanvas')
|
||||
nc.style.width = '100%'
|
||||
nc.style.height ='0%'
|
||||
document.body.appendChild(nc)
|
||||
}
|
||||
function matrix(color){
|
||||
let tcolor = ''
|
||||
if(color==='cyan'){
|
||||
tcolor ='#0ff'
|
||||
}
|
||||
else if(color==='blue'){
|
||||
tcolor='#00f'
|
||||
}
|
||||
else if(color==='magenta'){
|
||||
tcolor='#f0f'
|
||||
}
|
||||
else if(color==='red'){
|
||||
tcolor='#f00'
|
||||
}
|
||||
else if(color==='green'){
|
||||
tcolor='#0f0'
|
||||
}
|
||||
else if(color==='yellow'){
|
||||
tcolor='#ff0'
|
||||
}
|
||||
else if(color==='white'){
|
||||
tcolor='#fff'
|
||||
}
|
||||
else if(color==='purple'){
|
||||
tcolor='#303'
|
||||
}
|
||||
var canvas = document.getElementById('matrixcanvas'),
|
||||
ctx = canvas.getContext('2d');
|
||||
|
||||
canvas.style.height = '100%'
|
||||
canvas.width = window.innerWidth;
|
||||
canvas.height = window.innerHeight;
|
||||
var letters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890&éèçà@æ€ŧøþ@ßðđŋłĸħłµł»¢µ$£ù%^¨';
|
||||
letters = letters.split('');
|
||||
|
||||
|
||||
var fontSize = 10,
|
||||
columns = canvas.width / fontSize;
|
||||
|
||||
|
||||
var drops = [];
|
||||
for (var i = 0; i < columns; i++) {
|
||||
drops[i] = 1;
|
||||
}
|
||||
|
||||
|
||||
function draw() {
|
||||
ctx.fillStyle = 'rgba(0, 0, 0, .1)';
|
||||
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
||||
for (var i = 0; i < drops.length; i++) {
|
||||
var text = letters[Math.floor(Math.random() * letters.length)];
|
||||
ctx.fillStyle = tcolor;
|
||||
ctx.fillText(text, i * fontSize, drops[i] * fontSize);
|
||||
drops[i]++;
|
||||
if (drops[i] * fontSize > canvas.height && Math.random() > .95) {
|
||||
drops[i] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
setInterval(draw, 33);
|
||||
}
|
||||
function sleep(s) {
|
||||
let ms = s*1000
|
||||
return new Promise(resolve => setTimeout(resolve, ms));
|
||||
}
|
||||
function randchoice(list){
|
||||
console.log(list[randint(0,list.length-1)])
|
||||
return list[randint(0,list.length-1)]
|
||||
}
|
||||
//var historic = []
|
||||
var lastx = ""
|
||||
function historic(){
|
||||
// terminpt.value=historic[historic.lengh-1-index]
|
||||
document.getElementById('terminpt').value = lastx
|
||||
}
|
||||
onkeydown = function(e){
|
||||
if(e.keyCode==9){
|
||||
autocomplete()
|
||||
}
|
||||
}
|
||||
onkeyup = function(e){
|
||||
if(e.keyCode==13){
|
||||
inputcomplete = true
|
||||
}
|
||||
else if(e.keyCode == 38){
|
||||
historic()
|
||||
}
|
||||
}
|
||||
function termshow(str){
|
||||
let tc = document.getElementById('termcontent')
|
||||
let nchild = document.createElement('div')
|
||||
nchild.innerHTML = str.replace('\n','<br>')
|
||||
tc.appendChild(nchild)
|
||||
document.getElementById('termcontent').scrollTo(0,document.getElementById('termcontent').scrollHeight)
|
||||
}
|
||||
function terminput(str){
|
||||
let tiname = document.getElementById('inptname')
|
||||
tiname.innerHTML = str
|
||||
let inpt = document.getElementById('terminpt')
|
||||
if(inputcomplete){
|
||||
console.log(inpt.value)
|
||||
inputcomplete=false
|
||||
let resultat = inpt.value
|
||||
inpt.value = ''
|
||||
return resultat
|
||||
}
|
||||
else{
|
||||
return 'ERR'
|
||||
}
|
||||
}
|
||||
var x = ""
|
||||
function splitaddr(complete, cmd){
|
||||
try{
|
||||
let c = complete.substring(cmd.length)
|
||||
let u = c.split('@')[0]
|
||||
let a = c.split('@')[1]
|
||||
if (a==undefined){
|
||||
termshow('Please complete the command like this: '+cmd+' user@address')
|
||||
return 'ERROR'
|
||||
}
|
||||
else{
|
||||
return [u, a]
|
||||
}
|
||||
}
|
||||
catch(e){
|
||||
console.error(e)
|
||||
termshow('Please complete the command like this: '+cmd+' user@address')
|
||||
return 'ERROR'
|
||||
}
|
||||
}
|
||||
function infos(){
|
||||
termshow('01010101010101010<br>1.CyberTermGame.1<br>0.....By GZod01.....0<br>10101010101010101<br>Infos on the game : Hello my name is GZod01 and i make this game in javascript (base game in python) "for fun", I know this game is not reflecting the reality of the command on linux or windows machines but... it is a game...<br>Sorry if the english is not very good i speak french...')
|
||||
}
|
||||
stopmatrix()
|
||||
var passwordlist = ["my_password","helloworld","ultra_secure_password","my_birthday"]
|
||||
var filelist = ['picture.png','personnal_datas.csv', 'helloworld.py','i_hate_hackers.txt','speech_for_tomorrow.md', '.ha_ha_this_is_super_secret_file.txt','mydirectory/']
|
||||
var connected = false
|
||||
var datased = false
|
||||
var STOP = false
|
||||
infos()
|
||||
var user = ""
|
||||
var ip = ""
|
||||
var password = ""
|
||||
var destroyedip = []
|
||||
var codeline = ["fn destroy(oiaf){executeshellcomand('destroy oiaf')}","hack-server()","destroy()","fn hack-server(files){for(var i = 0, i<len(files)){if (type_of_file(files[i])==='password_files_and_datas_files'){execcommand('copyfile_to_my_computer'); destroy(files)};", "print(01020003957058098409438409340&àà_09232983983983923999832983928398329389238938923892382938923899201809381093809é'802984029804802948049820840938éàç8309é_à'ç_éà'_09790872çà'àç_éè409724097240942èàçé'8è290479024798047298047904èé4908éè4) in serverdatas"]
|
||||
termshow('starting session ...')
|
||||
var me = ''
|
||||
var list_of_command = ['ls','ssh','pbk','exit','theme','matrix','hack','attack','save','import','help','exit']
|
||||
function autocomplete(){
|
||||
let inptval = document.getElementById('terminpt').value
|
||||
termshow('List of available commands starting with " '+inptval+' " :')
|
||||
for(let i = 0; i<list_of_command.length; i++){
|
||||
if(list_of_command[i].startsWith(inptval)){
|
||||
termshow('- '+list_of_command[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
named = false
|
||||
// example of serversdatas: "ip":{"destroyed":true (or false), "files":listoffiles, "password":"password"}
|
||||
var gamedatas = {
|
||||
"serversdatas":{},
|
||||
"username": me,
|
||||
'colorscheme': 'default' //it can be green / red / blue / yellow
|
||||
}
|
||||
//END OF CYBERTERMHACK CODE
|
||||
// START OF MAIN-MODE CODE
|
||||
function gettheme(){
|
||||
let r = document.querySelector(':root')
|
||||
if (gamedatas.colorscheme ==='default'){
|
||||
r.style.setProperty('--txt-color','white')
|
||||
}
|
||||
else if (gamedatas.colorscheme === 'green'){
|
||||
r.style.setProperty('--txt-color','green')
|
||||
}
|
||||
else if (gamedatas.colorscheme === 'red'){
|
||||
r.style.setProperty('--txt-color','red')
|
||||
}
|
||||
else if (gamedatas.colorscheme === 'blue'){
|
||||
r.style.setProperty('--txt-color','blue')
|
||||
}
|
||||
else if (gamedatas.colorscheme === 'yellow'){
|
||||
r.style.setProperty('--txt-color','yellow')
|
||||
}
|
||||
}
|
||||
var ipdatas = {}
|
||||
document.getElementById('terminpt').focus()
|
||||
async function loop(){
|
||||
gamedatas.serversdatas = ipdatas
|
||||
if(named){
|
||||
if(connected){
|
||||
x = terminput(`${user}@${ip} $ `)
|
||||
}
|
||||
else{
|
||||
x = terminput(`${me}@MYCOMPUTER # `)
|
||||
}
|
||||
if(x==='ERR'){}
|
||||
else{
|
||||
//historic.push(x)
|
||||
lastx = x
|
||||
let lowx = x.toLowerCase()
|
||||
if(connected){
|
||||
termshow(`${user}@${ip} $ ${x}`)
|
||||
}
|
||||
else{
|
||||
termshow(`${me}@MYCOMPUTER # ${x}`)
|
||||
}
|
||||
if (lowx.startsWith('ssh')){
|
||||
if (connected){
|
||||
termshow('error you already are in distant server')
|
||||
}
|
||||
else{
|
||||
if (splitaddr(x, 'ssh') === 'ERROR'){
|
||||
}
|
||||
else{
|
||||
user = splitaddr(x, 'ssh')[0]
|
||||
ip = splitaddr(x, 'ssh')[1]
|
||||
if(ipdatas[ip]==undefined){
|
||||
ipdatas[ip]={}
|
||||
}
|
||||
termshow('connect to the computer with the ip '+ip+' from the user '+user+' ...')
|
||||
if (ipdatas[ip]['destroyed']){
|
||||
termshow('error this server is destroyed')
|
||||
}
|
||||
else{
|
||||
if(ipdatas[ip]['password']==undefined){
|
||||
termshow('you don\'t have the password of this server')
|
||||
}
|
||||
else{
|
||||
await sleep(1)
|
||||
termshow('Password: AUTOMATIC_PASSWORD_SYSTEM')
|
||||
// while(temppass != ipdatas[ip]['password']){
|
||||
// temppass = terminput('Password: ')
|
||||
// }
|
||||
await sleep(1)
|
||||
termshow('connected')
|
||||
connected=true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (lowx.startsWith('pbk')){
|
||||
if (connected){
|
||||
termshow('error you are on a distant server')
|
||||
}
|
||||
else{
|
||||
if (splitaddr(x,'pbk')==='ERROR'){
|
||||
splitaddr(x,'pbk')
|
||||
}
|
||||
else{
|
||||
user=splitaddr(x, 'pbk')[0]
|
||||
ip = splitaddr(x, 'pbk')[1]
|
||||
if(ipdatas[ip]==undefined){
|
||||
ipdatas[ip]={}
|
||||
}
|
||||
termshow('Breaking the password of the user '+user+' to the computer with the ip '+ip+' ...')
|
||||
password= randchoice(passwordlist)
|
||||
ipdatas[ip]['password']=password
|
||||
termshow('The password is : '+ password)
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (lowx.startsWith('theme')){
|
||||
if(lowx==='theme'||lowx==='theme '){
|
||||
termshow('Switch the theme with this command,<br> the available colors are : default , yellow , red , blue , green . <br> execute the command like this: theme default or theme yellow , etc.')
|
||||
}
|
||||
else{
|
||||
let nx = x.substring('theme '.length)
|
||||
if(nx==='yellow' || nx ==='blue' || nx==='default' || nx ==='red' || nx === 'green'){
|
||||
gamedatas.colorscheme = nx
|
||||
gettheme()
|
||||
}
|
||||
else{
|
||||
termshow('Switch the theme with this command,<br> the available colors are : default , yellow , red , blue , green . <br> execute the command like this: theme default or theme yellow , etc.')
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (lowx.startsWith('matrix')){
|
||||
if(lowx==='matrix'||lowx==='matrix '){
|
||||
matrix(gamedatas.colorscheme)
|
||||
}
|
||||
else{
|
||||
let nx = x.substring('matrix '.length)
|
||||
if(nx==='yellow' || nx ==='blue' || nx==='white' || nx ==='red' || nx === 'green'||nx=='purple'|| nx=='cyan' || nx=='magenta'){
|
||||
matrix(nx)
|
||||
}
|
||||
else if(nx==='stop'){
|
||||
stopmatrix()
|
||||
}
|
||||
else{
|
||||
termshow('Switch the theme with this command,<br> the available colors are : default , yellow , red , blue , green . <br> execute the command like this: theme default or theme yellow , etc.')
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(lowx==='save'){
|
||||
localStorage.setItem('hackergamedatas',JSON.stringify(gamedatas))
|
||||
termshow('Data saved')
|
||||
termshow(localStorage.getItem('hackergamedatas'))
|
||||
}
|
||||
else if(lowx==='import'){
|
||||
let tmpdatas = localStorage.getItem('hackergamedatas')
|
||||
if (tmpdatas == undefined){
|
||||
termshow('you don\'t have any data saved, please execute the save command before to import')
|
||||
}
|
||||
else{
|
||||
gamedatas = JSON.parse(tmpdatas)
|
||||
}
|
||||
}
|
||||
else if (lowx=='ls'){
|
||||
if (connected){
|
||||
if (ipdatas[ip]['files'] == undefined){
|
||||
termshow('This is the file on the distant machine')
|
||||
let fileiplist = []
|
||||
for(let i=0; i < parseInt(randint(1,10)); i++){
|
||||
let currentchoicefile = randchoice(filelist)
|
||||
termshow('-'+currentchoicefile)
|
||||
fileiplist.push(currentchoicefile)
|
||||
}
|
||||
ipdatas[ip]['files'] = fileiplist
|
||||
}
|
||||
else{
|
||||
termshow('This is the file on the distant machine')
|
||||
for(let i = 0; i<ipdatas[ip]['files'].length; i++){
|
||||
termshow('-'+ ipdatas[ip]['files'][i])
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
if (datased){
|
||||
termshow('This is the file on your computer: <br>- my_datas.zip <br>- servers_data.zip')
|
||||
}
|
||||
else{
|
||||
termshow('This is the file on your computer: <br>- my_datas.zip')
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (lowx=='attack'){
|
||||
if( connected){
|
||||
termshow('the attack start... <br> copying all the data in this server to your servers_data.zip file in your computer (it include all the file, folder etc.)...<br>breaking the server...<br>Disconnected: The server is destroy')
|
||||
connected = false
|
||||
datased = true
|
||||
ipdatas[ip]['destroyed'] = true
|
||||
}
|
||||
else{
|
||||
termshow('error you are not connected, please connect to a distant server before executing this command')
|
||||
}
|
||||
}
|
||||
else if( x==='help'){
|
||||
termshow('The available commands: <br>- help : print this message<br>- ls : list the files and folders<br>- pbk (only in your computer) : Get the password of an user from an ip address<br>- ssh (only in your computer) : conect to a distant server with an user and an ip address (you have to use pbk to get the password)<br>- attack (only in ssh servers) : start an attack that will add all the datas on the server in your servers_data.zip file and will destroy the server (warning this will no destroy only the server from the user it will destroy ALL the server (the address))<br>- theme : switch the theme of the game\n- save : save the game in your localStorage (alternative to cookies)\n- import : import the game from your localStorage\n- matrix : start or stop a matrix rain animation (just for fun...)\n- exit : if you are connected to distant server (ssh) it deconnect you, if you are not connected it exit this game<br>- infos : display infos on this game')
|
||||
}
|
||||
else if (lowx==='exit'){
|
||||
if (connected){
|
||||
termshow('disconnecting...')
|
||||
connected=false
|
||||
}
|
||||
else{
|
||||
termshow('Exiting the session...')
|
||||
termshow('Exiting the game, thank to play to this game, don\'t hesitate to help me or to give me your feedback')
|
||||
STOP = true
|
||||
location = '/'
|
||||
}
|
||||
}
|
||||
else if (lowx==='hack'){
|
||||
if (connected){
|
||||
termshow('--Start-of-the-hacking-program--')
|
||||
for(let i = 0; i<randint(0,50);i++){
|
||||
termshow(randchoice(codeline))
|
||||
}
|
||||
}
|
||||
else{
|
||||
termshow('you have to be connected')
|
||||
}
|
||||
}
|
||||
else if (lowx=='infos'){
|
||||
infos()
|
||||
}
|
||||
else if(x.startsWith('$$$')){
|
||||
if(x === '$$$' || x === '$$$ '){
|
||||
termshow('this command is for execute js code enter your js code after the $$$')
|
||||
}
|
||||
else{
|
||||
try{
|
||||
let tempcode = x.substring('$$$ '.length)
|
||||
let newfunc = new Function (tempcode)
|
||||
newfunc()
|
||||
}
|
||||
catch(e){
|
||||
termshow('Il y a eu une erreur : '+e)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else{
|
||||
let temp = terminput('your name: ')
|
||||
if(temp.length<4){
|
||||
document.getElementById('inptindic').innerHTML ='your name must have more than 4 characters '
|
||||
}
|
||||
else{
|
||||
me = temp
|
||||
named = true
|
||||
document.getElementById('inptindic').innerHTML=''
|
||||
}
|
||||
}
|
||||
window.requestAnimationFrame(loop)
|
||||
}
|
||||
loop()
|
||||
//END OF MAIN-MODE CODE
|
||||
//START OF STORY MODE CODE
|
||||
|
||||
|
||||
// END OF STORY MODE CODE
|
||||
|
||||
// START OF DEV HELP API:
|
||||
function sendinput(){inputcomplete=true}
|
||||
function setinput(str){document.getElementById('terminpt').value=str}
|
||||
function execcommand(str){setinput(str); sendinput()}
|
||||
function last(){historic(); sendinput()}
|
||||
function autoc(str){setinput(str); autocomplete(); sendinput()}
|
||||
|
||||
|
||||
|
||||
//END OF DEV HELP API
|
||||
118
main-site/CyberTermHack/V0.1/otherjsversion.js
Normal file
118
main-site/CyberTermHack/V0.1/otherjsversion.js
Normal file
|
|
@ -0,0 +1,118 @@
|
|||
var x=""
|
||||
function splitaddr(complete,cmd){
|
||||
try{
|
||||
let c= complete.substring(cmd.length())
|
||||
let u = c.split('@')[0]
|
||||
let a = c.split('@')[1]
|
||||
return [u,a]
|
||||
}
|
||||
catch(e){
|
||||
termshow('Please complete the command like this: '+cmd+'user@address')
|
||||
return 'ERROR'
|
||||
}
|
||||
}
|
||||
function infos(){
|
||||
termshow('01010101010101010\n1 CyberTermGame 1\n0 By GZod01 0\n10101010101010101\nInfos on the game : Hello my name is GZod01 and i make this game in python "for fun", I know this game is not reflecting the reality of the command on linux or windows machines but... it is a game...\nSorry if the english is not very good i speak french...')
|
||||
}
|
||||
var passwordlist = [listofpassword]
|
||||
var filelist = [listoffile]
|
||||
var connected = false
|
||||
var datased = false
|
||||
infos()
|
||||
var user=""
|
||||
var ip=""
|
||||
var password=""
|
||||
var destroyedip=[temporar, i, will, move, to, serverdatas]
|
||||
var codeline = [fake hack codelines]
|
||||
termshow('startingsession...')
|
||||
var me = terminput('your name: ')
|
||||
// example of serversdatas: "user@ip":{"destroyed":True (or False), "files":listoffiles, "password":"password"}
|
||||
var gamedatas = {
|
||||
"serverdatas":{},
|
||||
"username":me
|
||||
}
|
||||
function loop(){
|
||||
if(connected){
|
||||
x = terminput(`[${user}@${ip}] $ `)
|
||||
}
|
||||
else{
|
||||
x = terminput(`[ ${me}@MYCOMPUTER ] %`)
|
||||
}
|
||||
if(x.startswith('ssh')){
|
||||
if(connected){
|
||||
termshow('error, you are already in a distant server')
|
||||
}
|
||||
else{
|
||||
if(splitaddr(x,'ssh')=='ERROR'){
|
||||
}
|
||||
else{
|
||||
user=splitaddr(x, 'ssh')[0]
|
||||
ip = splitaddr(x, 'ssh')[1]
|
||||
termshow('connect to the computer with the ip '+ip+' from the user '+user+' ...')
|
||||
if(ip in destroyedip){
|
||||
termshow('error this server is destroyed')
|
||||
}
|
||||
else{
|
||||
sleep(1)
|
||||
terminput('Password: ')
|
||||
sleep(0.5)
|
||||
termshow('connected')
|
||||
connected = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (x.startswith('pbk')){
|
||||
if(connected){
|
||||
termshow('error you are on a distant server')
|
||||
}
|
||||
else{
|
||||
//TO CONTINUE
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
else:
|
||||
if splitaddr(x,'pbk')=='ERROR':
|
||||
splitaddr(x,'pbk')
|
||||
else:
|
||||
user=splitaddr(x, 'pbk')[0]
|
||||
ip = splitaddr(x, 'pbk')[1]
|
||||
print('Breaking the password of the user '+user+' to the computer with the ip '+ip+' ...')
|
||||
password= random.choice(passwordlist)
|
||||
print('The password is : '+ password)
|
||||
elif x=='ls':
|
||||
if connected:
|
||||
print('This is the file on the distant machine')
|
||||
for i in range(random.randint(1,10)):
|
||||
print('-'+random.choice(filelist))
|
||||
else:
|
||||
if datased:
|
||||
print('This is the file on your computer: \n- my_datas.zip \n- servers_data.zip')
|
||||
else:
|
||||
print('This is the file on your computer: \n- my_datas.zip')
|
||||
elif x=='attack':
|
||||
if connected:
|
||||
print('the attack start... \n copying all the data in this server to your servers_data.zip file in your computer (it include all the file, folder etc.)...\nbreaking the server...\nDisconnected: The server is destroy')
|
||||
connected = False
|
||||
datased = True
|
||||
destroyedip.append(ip)
|
||||
else:
|
||||
print('error you are not connected, please connect to a distant server before executing this command')
|
||||
elif x=='help':
|
||||
print('The available commands: \n- help : print this message\n- ls : list the files and folders\n- pbk (only in your computer) : Get the password of an user from an ip address\n- ssh (only in your computer) : conect to a distant server with an user and an ip address (you have to use pbk to get the password)\n- attack (only in ssh servers) : start an attack that will add all the datas on the server in your servers_data.zip file and will destroy the server\n- exit : if you are connected to distant server (ssh) it deconnect you, if you are not connected it exit this game\n- infos : display infos on this game')
|
||||
elif x=='exit':
|
||||
if connected:
|
||||
print('disconnecting...')
|
||||
connected=False
|
||||
else:
|
||||
print('Exiting the session...')
|
||||
print('Exiting the game, thank to play to this game, don\'t hesitate to help me or to give me your feedback')
|
||||
break
|
||||
elif x=='hack':
|
||||
if connected:
|
||||
print('--Start-of-the-hacking-program--')
|
||||
for i in range(random.randint(0,50)):
|
||||
print(random.choice(codeline))
|
||||
else:
|
||||
print('you have to be connected')*/
|
||||
105
main-site/CyberTermHack/V0.1/py-curses-CyberTermHack.py
Normal file
105
main-site/CyberTermHack/V0.1/py-curses-CyberTermHack.py
Normal file
|
|
@ -0,0 +1,105 @@
|
|||
import time
|
||||
import random
|
||||
import curses
|
||||
x = ""
|
||||
def splitaddr(complete, cmd):
|
||||
try:
|
||||
c = complete[len(cmd):]
|
||||
u = c.split('@')[0]
|
||||
a = c.split('@')[1]
|
||||
return [u, a]
|
||||
except IndexError:
|
||||
print('Please complete the command like this: '+cmd+' user@address')
|
||||
return 'ERROR'
|
||||
def infos():
|
||||
print('01010101010101010\n1 CyberTermGame 1\n0 By GZod01 0\n10101010101010101\nInfos on the game : Hello my name is GZod01 and i make this game in python "for fun", I know this game is not reflecting the reality of the command on linux or windows machines but... it is a game...\nSorry if the english is not very good i speak french...')
|
||||
passwordlist = ["my_password","helloworld","ultra_secure_password","my_birthday"]
|
||||
filelist = ['picture.png','personnal_datas.csv', 'helloworld.py','i_hate_hackers.txt','speech_for_tomorrow.md', '.ha_ha_this_is_super_secret_file.txt','mydirectory/']
|
||||
connected = False
|
||||
datased = False
|
||||
infos()
|
||||
user = ""
|
||||
ip = ""
|
||||
password = ""
|
||||
destroyedip = []
|
||||
codeline = ["fn destroy(oiaf){executeshellcomand('destroy oiaf')}","hack-server()","destroy()","fn hack-server(files){for(var i = 0, i<len(files)){if (type_of_file(files[i])==='password_files_and_datas_files'){execcommand('copyfile_to_my_computer'); destroy(files)};", "print(01020003957058098409438409340&àà_09232983983983923999832983928398329389238938923892382938923899201809381093809é'802984029804802948049820840938éàç8309é_à'ç_éà'_09790872çà'àç_éè409724097240942èàçé'8è290479024798047298047904èé4908éè4) in serverdatas"]
|
||||
print('starting session ...')
|
||||
me = input('your name: ')
|
||||
# example of serversdatas: "user@ip":{"destroyed":True (or False), "files":listoffiles, "password":"password"}
|
||||
gamedatas = {
|
||||
"serversdatas":{},
|
||||
"username": me
|
||||
}
|
||||
def app():
|
||||
while True:
|
||||
if connected:
|
||||
x = input(f'[{user}@{ip}] $ ')
|
||||
else:
|
||||
x = input(f'[{me}@MYCOMPUTER] % ')
|
||||
if x.startswith('ssh'):
|
||||
if connected:
|
||||
print('error you already are in distant server')
|
||||
else:
|
||||
if splitaddr(x, 'ssh') == 'ERROR':
|
||||
splitaddr(x, 'ssh')
|
||||
else:
|
||||
user = splitaddr(x, 'ssh')[0]
|
||||
ip = splitaddr(x, 'ssh')[1]
|
||||
print('connect to the computer with the ip '+ip+' from the user '+user+' ...')
|
||||
if ip in destroyedip:
|
||||
print('error this server is destroyed')
|
||||
else:
|
||||
time.sleep(1)
|
||||
input('Password: ')
|
||||
time.sleep(0.5)
|
||||
print('connected')
|
||||
connected=True
|
||||
elif x.startswith('pbk'):
|
||||
if connected:
|
||||
print('error you are on a distant server')
|
||||
else:
|
||||
if splitaddr(x,'pbk')=='ERROR':
|
||||
splitaddr(x,'pbk')
|
||||
else:
|
||||
user=splitaddr(x, 'pbk')[0]
|
||||
ip = splitaddr(x, 'pbk')[1]
|
||||
print('Breaking the password of the user '+user+' to the computer with the ip '+ip+' ...')
|
||||
password= random.choice(passwordlist)
|
||||
print('The password is : '+ password)
|
||||
elif x=='ls':
|
||||
if connected:
|
||||
print('This is the file on the distant machine')
|
||||
for i in range(random.randint(1,10)):
|
||||
print('-'+random.choice(filelist))
|
||||
else:
|
||||
if datased:
|
||||
print('This is the file on your computer: \n- my_datas.zip \n- servers_data.zip')
|
||||
else:
|
||||
print('This is the file on your computer: \n- my_datas.zip')
|
||||
elif x=='attack':
|
||||
if connected:
|
||||
print('the attack start... \n copying all the data in this server to your servers_data.zip file in your computer (it include all the file, folder etc.)...\nbreaking the server...\nDisconnected: The server is destroy')
|
||||
connected = False
|
||||
datased = True
|
||||
destroyedip.append(ip)
|
||||
else:
|
||||
print('error you are not connected, please connect to a distant server before executing this command')
|
||||
elif x=='help':
|
||||
print('The available commands: \n- help : print this message\n- ls : list the files and folders\n- pbk (only in your computer) : Get the password of an user from an ip address\n- ssh (only in your computer) : conect to a distant server with an user and an ip address (you have to use pbk to get the password)\n- attack (only in ssh servers) : start an attack that will add all the datas on the server in your servers_data.zip file and will destroy the server\n- exit : if you are connected to distant server (ssh) it deconnect you, if you are not connected it exit this game\n- infos : display infos on this game')
|
||||
elif x=='exit':
|
||||
if connected:
|
||||
print('disconnecting...')
|
||||
connected=False
|
||||
else:
|
||||
print('Exiting the session...')
|
||||
print('Exiting the game, thank to play to this game, don\'t hesitate to help me or to give me your feedback')
|
||||
break
|
||||
elif x=='hack':
|
||||
if connected:
|
||||
print('--Start-of-the-hacking-program--')
|
||||
for i in range(random.randint(0,50)):
|
||||
print(random.choice(codeline))
|
||||
else:
|
||||
print('you have to be connected')
|
||||
|
||||
curses.wrapper(app)
|
||||
124
main-site/CyberTermHack/V0.1/py-term-CyberTermHack.py
Normal file
124
main-site/CyberTermHack/V0.1/py-term-CyberTermHack.py
Normal file
|
|
@ -0,0 +1,124 @@
|
|||
import time
|
||||
import random
|
||||
x = ""
|
||||
def splitaddr(complete, cmd):
|
||||
try:
|
||||
c = complete[len(cmd):]
|
||||
u = c.split('@')[0]
|
||||
a = c.split('@')[1]
|
||||
return [u, a]
|
||||
except IndexError:
|
||||
print('Please complete the command like this: '+cmd+' user@address')
|
||||
return 'ERROR'
|
||||
def infos():
|
||||
print('01010101010101010\n1 CyberTermGame 1\n0 By GZod01 0\n10101010101010101\nInfos on the game : Hello my name is GZod01 and i make this game in python "for fun", I know this game is not reflecting the reality of the command on linux or windows machines but... it is a game...\nSorry if the english is not very good i speak french...')
|
||||
passwordlist = ["my_password","helloworld","ultra_secure_password","my_birthday"]
|
||||
filelist = ['picture.png','personnal_datas.csv', 'helloworld.py','i_hate_hackers.txt','speech_for_tomorrow.md', '.ha_ha_this_is_super_secret_file.txt','mydirectory/']
|
||||
connected = False
|
||||
datased = False
|
||||
infos()
|
||||
user = ""
|
||||
ip = ""
|
||||
password = ""
|
||||
destroyedip = []
|
||||
codeline = ["fn destroy(oiaf){executeshellcomand('destroy oiaf')}","hack-server()","destroy()","fn hack-server(files){for(var i = 0, i<len(files)){if (type_of_file(files[i])==='password_files_and_datas_files'){execcommand('copyfile_to_my_computer'); destroy(files)};", "print(01020003957058098409438409340&àà_09232983983983923999832983928398329389238938923892382938923899201809381093809é'802984029804802948049820840938éàç8309é_à'ç_éà'_09790872çà'àç_éè409724097240942èàçé'8è290479024798047298047904èé4908éè4) in serverdatas"]
|
||||
print('starting session ...')
|
||||
me = input('your name: ')
|
||||
# example of serversdatas: "user@ip":{"destroyed":True (or False), "files":listoffiles, "password":"password"}
|
||||
gamedatas = {
|
||||
"serversdatas":{},
|
||||
"username": me
|
||||
}
|
||||
while True:
|
||||
if connected:
|
||||
x = input(f'{user}@{ip} $ ')
|
||||
else:
|
||||
x = input(f'{me}@MYCOMPUTER # ')
|
||||
if x.startswith('ssh'):
|
||||
if connected:
|
||||
print('error you already are in distant server')
|
||||
else:
|
||||
if splitaddr(x, 'ssh') == 'ERROR':
|
||||
splitaddr(x, 'ssh')
|
||||
else:
|
||||
user = splitaddr(x, 'ssh')[0]
|
||||
ip = splitaddr(x, 'ssh')[1]
|
||||
print('connect to the computer with the ip '+ip+' from the user '+user+' ...')
|
||||
if ip in destroyedip:
|
||||
print('error this server is destroyed')
|
||||
else:
|
||||
time.sleep(1)
|
||||
input('Password: ')
|
||||
time.sleep(0.5)
|
||||
print('connected')
|
||||
connected=True
|
||||
elif x.startswith('pbk'):
|
||||
if connected:
|
||||
print('error you are on a distant server')
|
||||
else:
|
||||
if splitaddr(x,'pbk')=='ERROR':
|
||||
splitaddr(x,'pbk')
|
||||
else:
|
||||
user=splitaddr(x, 'pbk')[0]
|
||||
ip = splitaddr(x, 'pbk')[1]
|
||||
print('Breaking the password of the user '+user+' to the computer with the ip '+ip+' ...')
|
||||
password= random.choice(passwordlist)
|
||||
print('The password is : '+ password)
|
||||
elif x=='ls':
|
||||
if connected:
|
||||
print('This is the file on the distant machine')
|
||||
for i in range(random.randint(1,10)):
|
||||
print('-'+random.choice(filelist))
|
||||
else:
|
||||
if datased:
|
||||
print('This is the file on your computer: \n- my_datas.zip \n- servers_data.zip')
|
||||
else:
|
||||
print('This is the file on your computer: \n- my_datas.zip')
|
||||
elif x=='attack':
|
||||
if connected:
|
||||
print('the attack start... \n copying all the data in this server to your servers_data.zip file in your computer (it include all the file, folder etc.)...\nbreaking the server...\nDisconnected: The server is destroy')
|
||||
connected = False
|
||||
datased = True
|
||||
destroyedip.append(ip)
|
||||
else:
|
||||
print('error you are not connected, please connect to a distant server before executing this command')
|
||||
elif x=='help':
|
||||
print('The available commands: \n- help : print this message\n- ls : list the files and folders\n- pbk (only in your computer) : Get the password of an user from an ip address\n- ssh (only in your computer) : conect to a distant server with an user and an ip address (you have to use pbk to get the password)\n- attack (only in ssh servers) : start an attack that will add all the datas on the server in your servers_data.zip file and will destroy the server\n- exit : if you are connected to distant server (ssh) it deconnect you, if you are not connected it exit this game\n- infos : display infos on this game')
|
||||
elif x=='exit':
|
||||
if connected:
|
||||
print('disconnecting...')
|
||||
connected=False
|
||||
else:
|
||||
print('Exiting the session...')
|
||||
print('Exiting the game, thank to play to this game, don\'t hesitate to help me or to give me your feedback')
|
||||
break
|
||||
elif x=='hack':
|
||||
if connected:
|
||||
print('--Start-of-the-hacking-program--')
|
||||
for i in range(random.randint(0,50)):
|
||||
print(random.choice(codeline))
|
||||
else:
|
||||
print('you have to be connected')
|
||||
elif x=='infos':
|
||||
infos()
|
||||
elif x=='$$$':
|
||||
pcode=''
|
||||
ccode=''
|
||||
tocancel=False
|
||||
while True:
|
||||
pcode = input()
|
||||
if pcode=='$$$':
|
||||
break
|
||||
elif pcode=='$HELP$':
|
||||
print('type $$$ to exit the python code')
|
||||
elif pcode=='$CANCEL':
|
||||
tocancel=True
|
||||
else:
|
||||
ccode = ccode+pcode+'\n'
|
||||
if tocancel:
|
||||
pass
|
||||
else:
|
||||
exec(ccode)
|
||||
|
||||
|
||||
|
||||
1
main-site/CyberTermHack/V0.2/devlog.txt
Normal file
1
main-site/CyberTermHack/V0.2/devlog.txt
Normal file
|
|
@ -0,0 +1 @@
|
|||
storymode and custom real program
|
||||
79
main-site/CyberTermHack/V0.2/index.html
Normal file
79
main-site/CyberTermHack/V0.2/index.html
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<title>CyberTermHack</title>
|
||||
<meta charset="UTF-8">
|
||||
<style>
|
||||
:root{
|
||||
--bg-color: black;
|
||||
--txt-color: white;
|
||||
}
|
||||
html, body{
|
||||
background-color:var(--bg-color);
|
||||
color: var(--txt-color);
|
||||
margin:0;
|
||||
height:100%;
|
||||
min-height:100vh;
|
||||
display:flex;
|
||||
flex-direction:column;
|
||||
word-wrap: break-word;
|
||||
word-break: break-all;
|
||||
z-index:2
|
||||
}
|
||||
.second {
|
||||
flex-grow: 1;
|
||||
}
|
||||
#termcontent{
|
||||
display: fixed;
|
||||
left:0;
|
||||
top:0;
|
||||
height:95%;
|
||||
width:100%;
|
||||
overflow: auto
|
||||
}
|
||||
#divinput{
|
||||
display:flex;
|
||||
left:0;
|
||||
bottom:0;
|
||||
height:5%;
|
||||
width:100%
|
||||
}
|
||||
#terminpt{
|
||||
border: 0px solid !important;
|
||||
background-color: var(--bg-color);
|
||||
color:var(--txt-color);
|
||||
width:95%
|
||||
}
|
||||
/*#terminptdiv{
|
||||
float: none
|
||||
}*/
|
||||
*:focus {
|
||||
outline: none;
|
||||
}
|
||||
/*#divofinfos{
|
||||
float:left
|
||||
}*/
|
||||
#matrixcanvas{
|
||||
width:100%;
|
||||
height:100%;
|
||||
position:fixed;
|
||||
z-index:-1
|
||||
}
|
||||
</style>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
</head>
|
||||
<body>
|
||||
<!--username and ip: green, $ or %: white, commands: white-->
|
||||
<div id="termcontent">
|
||||
<!-- oldcommands and outputs -->
|
||||
</div>
|
||||
<div id="divinput">
|
||||
<span id=spanofinfos><span id="inptindic"></span><span id="inptname"></span></span><span class=second><input id=terminpt type="text"/></span>
|
||||
<!-- actual command with username and ip, $ or %, input for command, enter to send command -->
|
||||
</div>
|
||||
<canvas id=matrixcanvas style='width:100%; height: 100%'>
|
||||
</canvas>
|
||||
<script src=//api.gzod01.fr/scripts/termapi.js></script>
|
||||
<script src="maincode.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
426
main-site/CyberTermHack/V0.2/maincode.js
Normal file
426
main-site/CyberTermHack/V0.2/maincode.js
Normal file
|
|
@ -0,0 +1,426 @@
|
|||
var x = ""
|
||||
function splitaddr(complete, cmd){
|
||||
try{
|
||||
let c = complete.substring(cmd.length)
|
||||
let u = c.split('@')[0]
|
||||
let a = c.split('@')[1]
|
||||
if (a==undefined){
|
||||
termshow('Please complete the command like this: '+cmd+' user@address')
|
||||
return 'ERROR'
|
||||
}
|
||||
else{
|
||||
return [u, a]
|
||||
}
|
||||
}
|
||||
catch(e){
|
||||
console.error(e)
|
||||
termshow('Please complete the command like this: '+cmd+' user@address')
|
||||
return 'ERROR'
|
||||
}
|
||||
}
|
||||
function infos(){
|
||||
termshow('01010101010101010\n1.CyberTermGame.1\n0.....By GZod01.....0\n10101010101010101\nInfos on the game : Hello my name is GZod01 and i make this game in javascript (base game in python) "for fun", I know this game is not reflecting the reality of the command on linux or windows machines but... it is a game...\nSorry if the english is not very good i speak french...')
|
||||
}
|
||||
stopmatrix()
|
||||
var passwordlist = ["my_password","helloworld","ultra_secure_password","my_birthday"]
|
||||
var filelist = ['picture.png','personnal_datas.csv', 'helloworld.py','i_hate_hackers.txt','speech_for_tomorrow.md', '.ha_ha_this_is_super_secret_file.txt','mydirectory/']
|
||||
var connected = false
|
||||
var datased = false
|
||||
var STOP = false
|
||||
infos()
|
||||
var user = ""
|
||||
var ip = ""
|
||||
var password = ""
|
||||
var destroyedip = []
|
||||
var codeline = ["fn destroy(oiaf){executeshellcomand('destroy oiaf')}","hack-server()","destroy()","fn hack-server(files){for(var i = 0, i<len(files)){if (type_of_file(files[i])==='password_files_and_datas_files'){execcommand('copyfile_to_my_computer'); destroy(files)};", "print(01020003957058098409438409340&àà_09232983983983923999832983928398329389238938923892382938923899201809381093809é'802984029804802948049820840938éàç8309é_à'ç_éà'_09790872çà'àç_éè409724097240942èàçé'8è290479024798047298047904èé4908éè4) in serverdatas"]
|
||||
termshow('starting session ...')
|
||||
var me = ''
|
||||
var list_of_command = ['ls','ssh','pbk','exit','theme','matrix','hack','attack','save','import','help','exit']
|
||||
function autocomplete(){
|
||||
let inptval = document.getElementById('terminpt').value
|
||||
termshow('List of available commands starting with " '+inptval+' " :')
|
||||
for(let i = 0; i<list_of_command.length; i++){
|
||||
if(list_of_command[i].startsWith(inptval)){
|
||||
termshow('- '+list_of_command[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
named = false
|
||||
// example of serversdatas: "ip":{"destroyed":true (or false), "files":listoffiles, "password":"password"}
|
||||
var gamedatas = {
|
||||
"serversdatas":{},
|
||||
"username": me,
|
||||
'colorscheme': 'default' //it can be green / red / blue / yellow
|
||||
}
|
||||
// START OF MAIN-MODE CODE
|
||||
function gettheme(){
|
||||
let r = document.querySelector(':root')
|
||||
if (gamedatas.colorscheme ==='default'){
|
||||
r.style.setProperty('--txt-color','white')
|
||||
}
|
||||
else if (gamedatas.colorscheme === 'green'){
|
||||
r.style.setProperty('--txt-color','green')
|
||||
}
|
||||
else if (gamedatas.colorscheme === 'red'){
|
||||
r.style.setProperty('--txt-color','red')
|
||||
}
|
||||
else if (gamedatas.colorscheme === 'blue'){
|
||||
r.style.setProperty('--txt-color','blue')
|
||||
}
|
||||
else if (gamedatas.colorscheme === 'yellow'){
|
||||
r.style.setProperty('--txt-color','yellow')
|
||||
}
|
||||
}
|
||||
var ipdatas = {}
|
||||
document.getElementById('terminpt').focus()
|
||||
async function loop(){
|
||||
gamedatas.serversdatas = ipdatas
|
||||
if(named){
|
||||
if(connected){
|
||||
x = terminput(`${user}@${ip} $ `)
|
||||
}
|
||||
else{
|
||||
x = terminput(`${me}@MYCOMPUTER # `)
|
||||
}
|
||||
if(x==='ERR'){}
|
||||
else{
|
||||
//historic.push(x)
|
||||
lastx = x
|
||||
let lowx = x.toLowerCase()
|
||||
if(connected){
|
||||
termshow(`${user}@${ip} $ ${x}`)
|
||||
}
|
||||
else{
|
||||
termshow(`${me}@MYCOMPUTER # ${x}`)
|
||||
}
|
||||
if (lowx.startsWith('ssh')){
|
||||
hackssh(x)
|
||||
}
|
||||
else if (lowx.startsWith('pbk')){
|
||||
hackpbk(x)
|
||||
}
|
||||
|
||||
else if (lowx.startsWith('theme')){
|
||||
hacktheme(x)
|
||||
}
|
||||
else if (lowx.startsWith('matrix')){
|
||||
hackmatrix(x)
|
||||
}
|
||||
else if(lowx==='save'){
|
||||
hacksave()
|
||||
}
|
||||
else if(lowx==='import'){
|
||||
hackimport()
|
||||
}
|
||||
else if (lowx=='ls'){
|
||||
hackls()
|
||||
}
|
||||
else if (lowx=='attack'){
|
||||
hackattack()
|
||||
}
|
||||
else if( x==='help'){
|
||||
hackhelp()
|
||||
}
|
||||
else if (lowx==='exit'){
|
||||
hackexit()
|
||||
}
|
||||
else if (lowx==='hack'){
|
||||
hackhack()
|
||||
}
|
||||
else if (lowx=='infos'){
|
||||
infos()
|
||||
}
|
||||
else if(x.startsWith('$$$')){
|
||||
execjscode(x)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else{
|
||||
let temp = terminput('your name: ')
|
||||
if(temp.length<4){
|
||||
document.getElementById('inptindic').innerHTML ='your name must have more than 4 characters '
|
||||
}
|
||||
else{
|
||||
me = temp
|
||||
named = true
|
||||
document.getElementById('inptindic').innerHTML=''
|
||||
}
|
||||
}
|
||||
window.requestAnimationFrame(loop)
|
||||
}
|
||||
loop()
|
||||
//----------------------------------------------------------------------------------------------
|
||||
//END OF MAIN-MODE CODE
|
||||
// START OF COMMAND FUNCTIONS
|
||||
async function execjscode(cx){
|
||||
if(cx === '$$$' || cx === '$$$ '){
|
||||
termshow('this command is for execute js code enter your js code after the $$$')
|
||||
}
|
||||
else{
|
||||
try{
|
||||
let tempcode = cx.substring('$$$ '.length)
|
||||
let newfunc = new Function (tempcode)
|
||||
newfunc()
|
||||
}
|
||||
catch(e){
|
||||
termshow('Il y a eu une erreur : '+e)
|
||||
}
|
||||
}
|
||||
}
|
||||
async function hackhack(){
|
||||
if (connected){
|
||||
termshow('--Start-of-the-hacking-program--')
|
||||
for(let i = 0; i<randint(0,50);i++){
|
||||
termshow(randchoice(codeline))
|
||||
}
|
||||
}
|
||||
else{
|
||||
termshow('you have to be connected')
|
||||
}
|
||||
}
|
||||
async function hackexit(){
|
||||
if (connected){
|
||||
termshow('disconnecting...')
|
||||
connected=false
|
||||
}
|
||||
else{
|
||||
termshow('Exiting the session...')
|
||||
termshow('Exiting the game, thank to play to this game, don\'t hesitate to help me or to give me your feedback')
|
||||
STOP = true
|
||||
location = '/'
|
||||
}
|
||||
}
|
||||
function hackhelp(){
|
||||
|
||||
termshow('The available commands: \n- help : print this message\n- ls : list the files and folders\n- pbk (only in your computer) : Get the password of an user from an ip address\n- ssh (only in your computer) : conect to a distant server with an user and an ip address (you have to use pbk to get the password)\n- attack (only in ssh servers) : start an attack that will add all the datas on the server in your servers_data.zip file and will destroy the server (warning this will no destroy only the server from the user it will destroy ALL the server (the address))\n- theme : switch the theme of the game\n- save : save the game in your localStorage (alternative to cookies)\n- import : import the game from your localStorage\n- matrix : start or stop a matrix rain animation (just for fun...)\n- exit : if you are connected to distant server (ssh) it deconnect you, if you are not connected it exit this game\n- infos : display infos on this game')
|
||||
}
|
||||
async function hackattack(){
|
||||
|
||||
if( connected){
|
||||
termshow('the attack start... \n copying all the data in this server to your servers_data.zip file in your computer (it include all the file, folder etc.)...\nbreaking the server...\nDisconnected: The server is destroy')
|
||||
connected = false
|
||||
datased = true
|
||||
ipdatas[ip]['destroyed'] = true
|
||||
}
|
||||
else{
|
||||
termshow('error you are not connected, please connect to a distant server before executing this command')
|
||||
}
|
||||
}
|
||||
async function hackls(){
|
||||
|
||||
if (connected){
|
||||
if (ipdatas[ip]['files'] == undefined){
|
||||
termshow('This is the file on the distant machine')
|
||||
let fileiplist = []
|
||||
for(let i=0; i < parseInt(randint(1,10)); i++){
|
||||
let currentchoicefile = randchoice(filelist)
|
||||
termshow('-'+currentchoicefile)
|
||||
fileiplist.push(currentchoicefile)
|
||||
}
|
||||
ipdatas[ip]['files'] = fileiplist
|
||||
}
|
||||
else{
|
||||
termshow('This is the file on the distant machine')
|
||||
for(let i = 0; i<ipdatas[ip]['files'].length; i++){
|
||||
termshow('-'+ ipdatas[ip]['files'][i])
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
if (datased){
|
||||
termshow('This is the file on your computer: \n- my_datas.zip \n- servers_data.zip')
|
||||
}
|
||||
else{
|
||||
termshow('This is the file on your computer: \n- my_datas.zip')
|
||||
}
|
||||
}
|
||||
}
|
||||
async function hackimport(){
|
||||
|
||||
let tmpdatas = localStorage.getItem('hackergamedatas')
|
||||
if (tmpdatas == undefined){
|
||||
termshow('you don\'t have any data saved, please execute the save command before to import')
|
||||
}
|
||||
else{
|
||||
gamedatas = JSON.parse(tmpdatas)
|
||||
}
|
||||
}
|
||||
function hacksave(){
|
||||
|
||||
localStorage.setItem('hackergamedatas',JSON.stringify(gamedatas))
|
||||
termshow('Data saved')
|
||||
termshow(localStorage.getItem('hackergamedatas'))
|
||||
}
|
||||
function hackmatrix(lowx){
|
||||
|
||||
if(lowx==='matrix'||lowx==='matrix '){
|
||||
matrix(gamedatas.colorscheme)
|
||||
}
|
||||
else{
|
||||
let nx = x.substring('matrix '.length)
|
||||
if(nx==='yellow' || nx ==='blue' || nx==='white' || nx ==='red' || nx === 'green'||nx=='purple'|| nx=='cyan' || nx=='magenta'){
|
||||
matrix(nx)
|
||||
}
|
||||
else if(nx==='stop'){
|
||||
stopmatrix()
|
||||
}
|
||||
else{
|
||||
termshow('Switch the theme with this command,\n the available colors are : default , yellow , red , blue , green . \n execute the command like this: theme default or theme yellow , etc.')
|
||||
}
|
||||
}
|
||||
}
|
||||
function hacktheme(lowx){
|
||||
|
||||
if(lowx==='theme'||lowx==='theme '){
|
||||
termshow('Switch the theme with this command,\n the available colors are : default , yellow , red , blue , green . \n execute the command like this: theme default or theme yellow , etc.')
|
||||
}
|
||||
else{
|
||||
let nx = x.substring('theme '.length)
|
||||
if(nx==='yellow' || nx ==='blue' || nx==='default' || nx ==='red' || nx === 'green'){
|
||||
gamedatas.colorscheme = nx
|
||||
gettheme()
|
||||
}
|
||||
else{
|
||||
termshow('Switch the theme with this command,\n the available colors are : default , yellow , red , blue , green . \n execute the command like this: theme default or theme yellow , etc.')
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
async function hackpbk(x){
|
||||
|
||||
if (connected){
|
||||
termshow('error you are on a distant server')
|
||||
}
|
||||
else{
|
||||
if (splitaddr(x,'pbk')==='ERROR'){
|
||||
splitaddr(x,'pbk')
|
||||
}
|
||||
else{
|
||||
user=splitaddr(x, 'pbk')[0]
|
||||
ip = splitaddr(x, 'pbk')[1]
|
||||
if(ipdatas[ip]==undefined){
|
||||
ipdatas[ip]={}
|
||||
}
|
||||
termshow('Breaking the password of the user '+user+' to the computer with the ip '+ip+' ...')
|
||||
password= randchoice(passwordlist)
|
||||
ipdatas[ip]['password']=password
|
||||
termshow('The password is : '+ password)
|
||||
}
|
||||
}
|
||||
}
|
||||
async function hackssh(x){
|
||||
|
||||
if (connected){
|
||||
termshow('error you already are in distant server')
|
||||
}
|
||||
else{
|
||||
if (splitaddr(x, 'ssh') === 'ERROR'){
|
||||
}
|
||||
else{
|
||||
user = splitaddr(x, 'ssh')[0]
|
||||
ip = splitaddr(x, 'ssh')[1]
|
||||
if(ipdatas[ip]==undefined){
|
||||
ipdatas[ip]={}
|
||||
}
|
||||
termshow('connect to the computer with the ip '+ip+' from the user '+user+' ...')
|
||||
if (ipdatas[ip]['destroyed']){
|
||||
termshow('error this server is destroyed')
|
||||
}
|
||||
else{
|
||||
if(ipdatas[ip]['password']==undefined){
|
||||
termshow('you don\'t have the password of this server')
|
||||
}
|
||||
else{
|
||||
await sleep(1)
|
||||
termshow('Password: AUTOMATIC_PASSWORD_SYSTEM')
|
||||
// while(temppass != ipdatas[ip]['password']){
|
||||
// temppass = terminput('Password: ')
|
||||
// }
|
||||
await sleep(1)
|
||||
termshow('connected')
|
||||
connected=true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------------
|
||||
// END OF COMMAND FUNCTIONS
|
||||
|
||||
|
||||
if(true){}
|
||||
else{
|
||||
//START OF INGAME PROGRAM CODES
|
||||
//sorry it is too difficult to create
|
||||
//t and x for transform and execute
|
||||
function tandx(code, originactions={'ALERTME':'','ADD':''}){
|
||||
let lcode = code.split('\n')
|
||||
for(let i =0; i<lcode.length; i++){
|
||||
if(lcode==='ALERTME'){
|
||||
termshow('ALERT : '+originactions['ALERTME'])
|
||||
}
|
||||
else if(lcode==='ADD'){
|
||||
try{
|
||||
new Function(originactions['ADD'])()
|
||||
}
|
||||
catch(e){cwarn('ERREUR DANS LE CODE SOURCE: '+e)}
|
||||
}
|
||||
}
|
||||
}
|
||||
var listofconnected = []
|
||||
var connectedevent = {
|
||||
'name':'',
|
||||
'ip':''
|
||||
}
|
||||
function on_connected_to_me(code){
|
||||
let actions={
|
||||
'ALERTME': 'ALERT SOMEONE CONNECT TO YOU',
|
||||
'ADD':'listofconnected.push(connectedevent.name+";"+connectedevent.ip")'
|
||||
}
|
||||
tandx(code, actions)
|
||||
}
|
||||
// END OF REAL PROGRAM CODES
|
||||
|
||||
// sorry it's very difficult
|
||||
//START OF STORY MODE CODE
|
||||
var lifes = 3
|
||||
function storyloop(condition, toexecute, quantity_of_try=3){
|
||||
x = terminput(me+'@'+'storymode')
|
||||
let trys=0
|
||||
if(x==='ERR'){}
|
||||
else{
|
||||
if(condition){
|
||||
toexecute()
|
||||
}
|
||||
else{
|
||||
quantity
|
||||
}
|
||||
}
|
||||
}
|
||||
async function chap1m1(){
|
||||
termshow('WELCOME TO THE STORY MODE')
|
||||
await sleep(2)
|
||||
termshow('NOW YOU WILL HAVE TO HACK A SERVER')
|
||||
await sleep(2)
|
||||
termshow('SORRY YOU DON\'T KNOW WHO I AM')
|
||||
await sleep(0.5)
|
||||
termshow('MY NAME IS HACKIA AND I\'M AN IA CREATED TO HELP THE HACKER BEGINNER')
|
||||
termshow('NOW SSH TO THE SERVER AT THE IP 1234.5678.9012 FROM THE USER ROBERT (type ssh name_of_user@ip_of_server)')
|
||||
|
||||
}
|
||||
|
||||
// END OF STORY MODE CODE
|
||||
}
|
||||
|
||||
81
main-site/CyberTermHack/api.html
Normal file
81
main-site/CyberTermHack/api.html
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
<!--YOUR PAGE HAVE TO CONTAIN THESE ELEMENT FOR THE API TO WORK:-->
|
||||
<script>
|
||||
document.body.innerText = `
|
||||
YOUR PAGE HAVE TO CONTAIN THESE ELEMENT FOR THE API TO WORK:
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<title>TO REPLACE WITH YOUR TITLE</title>
|
||||
<meta charset="UTF-8">
|
||||
<style>
|
||||
:root{
|
||||
--bg-color: black;
|
||||
--txt-color: white;
|
||||
}
|
||||
html, body{
|
||||
background-color:var(--bg-color);
|
||||
color: var(--txt-color);
|
||||
margin:0;
|
||||
height:100%;
|
||||
min-height:100vh;
|
||||
display:flex;
|
||||
flex-direction:column;
|
||||
word-wrap: break-word;
|
||||
word-break: break-all;
|
||||
z-index:2
|
||||
}
|
||||
.second {
|
||||
flex-grow: 1;
|
||||
}
|
||||
#termcontent{
|
||||
display: fixed;
|
||||
left:0;
|
||||
top:0;
|
||||
height:95%;
|
||||
width:100%;
|
||||
overflow: auto
|
||||
}
|
||||
#divinput{
|
||||
display:flex;
|
||||
left:0;
|
||||
bottom:0;
|
||||
height:5%;
|
||||
width:100%
|
||||
}
|
||||
#terminpt{
|
||||
border: 0px solid !important;
|
||||
background-color: var(--bg-color);
|
||||
color:var(--txt-color);
|
||||
width:95%
|
||||
}
|
||||
/*#terminptdiv{
|
||||
float: none
|
||||
}*/
|
||||
*:focus {
|
||||
outline: none;
|
||||
}
|
||||
/*#divofinfos{
|
||||
float:left
|
||||
}*/
|
||||
#matrixcanvas{
|
||||
width:100%;
|
||||
height:100%;
|
||||
position:fixed;
|
||||
z-index:-1
|
||||
}
|
||||
</style>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
</head>
|
||||
<body>
|
||||
<!--username and ip: green, $ or %: white, commands: white-->
|
||||
<div id="termcontent">
|
||||
</div>
|
||||
<div id="divinput">
|
||||
<span id=spanofinfos><span id="inptindic"></span><span id="inptname"></span></span><span class=second><input id=terminpt type="text"/></span>
|
||||
</div>
|
||||
<canvas id=matrixcanvas style='width:100%; height: 100%'>
|
||||
</canvas>
|
||||
<script src="//api.gzod01.fr/scripts/termapi.js"></script>
|
||||
</body>
|
||||
</html>`</script>
|
||||
32
main-site/CyberTermHack/index.html
Normal file
32
main-site/CyberTermHack/index.html
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="icon" href="//api.gzod01.fr/pictures/gzod01.ico">
|
||||
<link rel="stylesheet" href="//api.gzod01.fr/css/style.css">
|
||||
<script src="//api.gzod01.fr/scripts/main.js"></script>
|
||||
<title>index.html</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="header"></div>
|
||||
<div class=content>
|
||||
<ul><h1>Liste des versions</h1><li-a ref="V0.1/">Version 0.1</li-a><li-a ref="./V0.1.2:OPTIMIZED/">Version O.1.2 OPTIMISEE</li-a><li-a ref="V0.2/">Version 0.2 <span style="color:white; background-color:red">NEWEST</span></li-a></ul>
|
||||
<script>
|
||||
class ListAnchor extends HTMLElement { // (1)
|
||||
connectedCallback() {
|
||||
let t_li = document.createElement('li')
|
||||
let t_a = document.createElement('a')
|
||||
t_a.href= this.getAttribute('ref')
|
||||
t_a.innerHTML = this.innerHTML
|
||||
t_li.appendChild(t_a)
|
||||
this.replaceWith(t_li)
|
||||
}
|
||||
}
|
||||
customElements.define("li-a", ListAnchor);
|
||||
</script>
|
||||
</div>
|
||||
<div id="footer"></div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in a new issue