Skip to content

Commit

Permalink
Merge pull request #68 from muratbulut/main
Browse files Browse the repository at this point in the history
path-traversal added.
  • Loading branch information
mozlercelik authored Mar 30, 2024
2 parents 80d61e2 + 6f8048b commit 0e26387
Show file tree
Hide file tree
Showing 13 changed files with 249 additions and 0 deletions.
25 changes: 25 additions & 0 deletions app/lab/path-traversal/path-traversal-2/en.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
lang="en"
title="List of products"
productTitle1="DANIEL DEFOE - ROBIN CRUSOE"
productTitle2="20000 Leagues Under the Sea - JULES VERNE"
productTitle3="FATHERS and SONS - IVAN SERGEYEVIÇ TURGENYEV"
productTitle4="PINOKYO - CARLO COLLODI"
productDes1="Robinson Crusoe is fond of adventure. He is passionate about sailing the seas and seeing new places. He gives up his passion because of two dangerous sea voyages. However, after a while he goes on a journey again. The ship he is traveling on sinks. Only he is saved. He starts life on a deserted island. He builds a shelter for himself. He tames wild goats. He cultivates the land. The diaries he kept there will also form the subject of his novel.
An event that Robinson experienced in the middle of his twenty-fourth year on the island changed the shape of his life. Unexpected guests come to the island. He fights with them and manages to detain one of the captives with them. He is no longer alone on the island. He gives the man the name of the day he caught him. They start calling him Friday. It educates him.
After a while, a riot breaks out on a ship around the island. He takes advantage of this and takes over the ship. Robinson Crusoe, who spent most of his 54-year life away from his homeland in pursuit of adventure, eventually returns to his country, England. Despite all these experiences, his passion for adventure never ends."
productDes2="In 1866, many ships sank at sea for unknown reasons. Everyone thinks this thing is a monster. A group is formed to find out what this thing that sinks ships is. The group also includes French scientist Arannox and his assistant. They set out to do research on the ship named Abraham Lincon.
When the ship approaches Japan, they encounter something in the water. Although they try to catch it, they are counter-attacked and Aronnox and a few others fall from the ship onto the thing that attacked them. Contrary to what everyone thinks, this thing that sank their ships is not a monster but a submarine.
Arannox and his companions are taken into the submarine. The captain of this submarine is a man named Nemo, and he explained that he and the people on the ship went out to explore the seas, away from society, and if anyone attacked them, they sank them. He wants the delegation to see that they are now captives on the ship, but he wants them to see the new things they have discovered. Although Arronnox did not like this situation at first, he saw many different things that he had never known before in his life. They discovered poles and corals and many different places. But they are still prisoners there.
During their journey, captain Nemo and his crew sink whatever attacks them. The delegation makes a plan to find a way to escape from there. Captain Nemo also attacks a ship and causes the people there to die. This makes him very sad and decides to quit his job. Our delegation starts to escape with a lifeboat they have dismantled, but they cannot stand it for long due to the waves in the sea and they topple over. When Aronnox opens his eyes, he is on an island, but some of his friends are gone."
productDes3="Nikolay Petrovich Kirsanov, his son Arkady, who graduated from university, and his friend Bazarov go to the farm where they live. Nikolay is a reformist who shared his land with the villagers. He lives on the farm with his older brother Pavel Petrovich and a young lady who has a class difference with him.
After the young people come to the farm, the traditionalist father and uncle often argue about the young people's nihilist (nothingness) ideas. Bazarov is a medically educated person, and draws the thunder of Uncle Pavel by saying that the purpose of science is above emotion and tradition and that he does not recognize any authority. Bazarov does not even take these discussions into consideration and conducts experiments and research related to his profession. The two young people meet Anna Sergeyevna Odintsova at the ball they attend. The two friends are amazed by the woman's beauty and intelligence. Odintsova is also impressed by Bazarov's courage to believe in nothing and invites them to her house. Odintsova, who lives with her sister Katya, is a widow. She lives luxuriously with her husband's inheritance and is a woman who attaches importance to order. After a while, Bazarov falls in love with Anna and Arkady falls in love with Katya."
productDes4="Once upon a time, in ancient times, there lived an old toymaker named Geppetto. He made a living by making and selling wooden toys. He has never had a child and all he wants is to have one. He went to the forest and said he would find a beautiful tree and make a wonderful toy from it. He created Pinocchio from the log he took from the forest. He didn't even realize he was alive when he heard voices. Pinocchio was now shaped and while cleaning the surroundings, he heard the voice "hello". He heard Pinocchio moving and talking. He was surprised when he saw him and said, "The boy is exactly what I wanted." He was not flesh and blood, but he was alive and now he had a child he could love. He named it Pinocchio.
Master Geppetto gave money for Pinocchio to go to school. On his way to school, he stopped by the circus show on the streets with curiosity. While he was looking inside, his owner suddenly caught him. He was very happy to see the puppet moving without strings and thought he could make a lot of money from it. The fairy godmother went to Pinocchio and said, "I will save you from here, but don't break your father's word again."
Master Geppetto was very worried that Pinocchio would not return home. He went out to the streets and looked for himself. Then he found Pinocchio aside and said, "Son, I am your father." They were very happy to see each other. Pinocchio never disobeyed his father's words again. He learned never to lie to his father, knowing that if he lied, his nose would grow."
productError="Product Not Found!"
back="back"
25 changes: 25 additions & 0 deletions app/lab/path-traversal/path-traversal-2/fr.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
lang="fr"
title="Liste des produits"
productTitle1="DANIEL DEFOE - ROBIN CRUSOE"
productTitle2="20 000 lieues sous les mers - JULES VERNE"
productTitle3="PÈRES et FILS - IVAN SERGEYEVIÇ TURGENYEV"
productTitle4="PINOKYO - CARLO COLLODI"
productDes1="Robinson Crusoé aime l'aventure. Il est passionné par la navigation sur les mers et la découverte de nouveaux endroits. Il abandonne sa passion à cause de deux voyages en mer dangereux. Cependant, après un certain temps, il repart en voyage. Le navire sur lequel il voyage coule. Lui seul est sauvé. Il commence sa vie sur une île déserte. Il se construit un abri. Il apprivoise les chèvres sauvages. Il cultive la terre. Les journaux qu'il y tenait feront également l'objet de son roman.
Un événement que Robinson a vécu au milieu de sa vingt-quatrième année sur l'île a changé la forme de sa vie. Des invités inattendus arrivent sur l'île. Il se bat avec eux et parvient à retenir l'un des captifs avec eux. Il n'est plus seul sur l'île. Il donne à l'homme le nom du jour où il l'a attrapé. Ils commencent à l'appeler vendredi. Cela l'éduque.
Au bout d'un moment, une émeute éclate sur un bateau autour de l'île. Il en profite et reprend le navire. Robinson Crusoé, qui a passé la majeure partie de sa vie de 54 ans loin de son pays natal à la poursuite de l'aventure, retourne finalement dans son pays, l'Angleterre. Malgré toutes ces expériences, sa passion pour l'aventure ne s'arrête jamais."
productDes2="En 1866, de nombreux navires coulent en mer pour des raisons inconnues. Tout le monde pense que cette chose est un monstre. Un groupe se forme pour découvrir ce qu'est cette chose qui coule les navires. Le groupe comprend également le scientifique français Arannox et son assistant. Ils entreprirent de faire des recherches sur le navire nommé Abraham Lincon.
Lorsque le navire s'approche du Japon, ils rencontrent quelque chose dans l'eau. Bien qu'ils tentent de l'attraper, ils sont contre-attaqués et Aronnox et quelques autres tombent du navire sur l'objet qui les a attaqués. Contrairement à ce que tout le monde pense, cet engin qui a coulé leurs navires n'est pas un monstre mais un sous-marin.
Arannox et ses compagnons sont emmenés dans le sous-marin. Le capitaine de ce sous-marin est un homme nommé Nemo, et il a expliqué que lui et les gens à bord du navire partaient explorer les mers, loin de la société, et que si quelqu'un les attaquait, ils les coulaient. Il veut que la délégation voie qu'ils sont désormais captifs sur le navire, mais il veut qu'ils voient les nouvelles choses qu'ils ont découvertes. Bien qu'Arronnox n'ait pas aimé cette situation au début, il a vu beaucoup de choses différentes qu'il n'avait jamais connues auparavant de sa vie. Ils ont découvert des pôles, des coraux et de nombreux endroits différents. Mais ils y sont toujours prisonniers.
Au cours de leur voyage, le capitaine Nemo et son équipage coulent tout ce qui les attaque. La délégation élabore un plan pour trouver un moyen de s'échapper de là. Le capitaine Nemo attaque également un navire et provoque la mort des personnes qui s'y trouvent, ce qui le rend très triste et décide de quitter son travail. Notre délégation commence à s'enfuir avec un canot de sauvetage qu'ils ont démonté, mais à cause des vagues dans la mer, ils ne peuvent pas le supporter longtemps et ils basculent. Quand Aronnox ouvre les yeux, il est sur une île, mais certains de ses amis sont disparu."
productDes3="Nikolaï Petrovitch Kirsanov, son fils Arkady, diplômé de l'université, et son ami Bazarov se rendent à la ferme où ils vivent. Nikolaï est un réformateur qui partageait ses terres avec les villageois. Il vit à la ferme avec son frère aîné Pavel Petrovich et une jeune femme qui a une différence de classe avec lui.
Après l'arrivée des jeunes à la ferme, le père et l'oncle traditionalistes se disputent souvent à propos des idées nihilistes (du néant) des jeunes. Bazarov est une personne de formation médicale et s'attire la foudre de l'oncle Pavel en disant que le but de la science est au-dessus de l'émotion et de la tradition et qu'il ne reconnaît aucune autorité. Bazarov ne prend même pas ces discussions en considération et mène des expériences et des recherches liées à son métier. Les deux jeunes gens rencontrent Anna Sergueïevna Odintsova au bal auquel ils assistent. Les deux amis sont émerveillés par la beauté et l'intelligence de la femme. Odintsova est également impressionnée par le courage de Bazarov de ne croire en rien et les invite chez elle. Odintsova, qui vit avec sa sœur Katya, est veuve, vit luxueusement avec l'héritage de son mari et est une femme qui attache de l'importance à l'ordre. Au bout d'un moment, Bazarov tombe amoureux d'Anna et Arkady tombe amoureux de Katya."
productDes4="Il était une fois, dans les temps anciens, un vieux fabricant de jouets nommé Geppetto. Il gagnait sa vie en fabriquant et en vendant des jouets en bois. Il n'a jamais eu d'enfant et tout ce qu'il veut c'est en avoir un. Il est allé dans la forêt et a dit qu'il trouverait un bel arbre et en ferait un merveilleux jouet. Il a créé Pinocchio à partir de la bûche qu'il a récupérée dans la forêt. Il n'avait même pas réalisé qu'il était vivant lorsqu'il entendit des voix. Pinocchio était maintenant façonné et pendant qu'il nettoyait les environs, il entendit la voix "bonjour". Il entendit Pinocchio bouger et parler. Il a été surpris quand il l'a vu et a dit : « Le garçon est exactement ce que je voulais. » Il n'était ni chair ni sang, mais il était vivant et il avait désormais un enfant qu'il pouvait aimer. Il l'a nommé Pinocchio.
Maître Geppetto a donné de l'argent pour que Pinocchio aille à l'école. Sur le chemin de l'école, il s'est arrêté avec curiosité au spectacle de cirque dans les rues. Alors qu'il regardait à l'intérieur, son propriétaire l'a soudainement attrapé. Il était très heureux de voir la marionnette bouger sans ficelles et pensait qu'il pourrait en tirer beaucoup d'argent. La fée marraine alla voir Pinocchio et lui dit : « Je te sauverai d'ici, mais ne romps plus la parole de ton père. »
Maître Geppetto était très inquiet que Pinocchio ne rentre pas chez lui. Il est descendu dans la rue et s'est cherché. Puis il trouva Pinocchio à l'écart et lui dit : « Mon fils, je suis ton père. Ils étaient très heureux de se revoir. Pinocchio n'a plus jamais désobéi aux paroles de son père. Il a appris à ne jamais mentir à son père, sachant que s'il mentait, son nez pousserait."
productError="Produit non trouvé!"
back="dos"
Binary file added app/lab/path-traversal/path-traversal-2/img/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/lab/path-traversal/path-traversal-2/img/2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/lab/path-traversal/path-traversal-2/img/3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
66 changes: 66 additions & 0 deletions app/lab/path-traversal/path-traversal-2/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<?php require("../../../lang/lang.php");
$lang = tr();
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Path Traversal</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<style>
.product-card {
margin-bottom: 20px;
cursor: pointer;
}

.product-card img {
max-width: 100%;
height: auto;
}

.product-card-header {
margin-top: 10px;
}
</style>
</head>
<body>
<div class="container mt-5">
<div class="row">
<?php
$imageCount = 4;

for ($i = 1; $i <= $imageCount; $i++) {
$productId = $i;
$imageName = $i . ".png";

echo '<div class="col-md-3">';
echo '<div class="product-card">';
echo '<a href="product-detail.php?productId=' . $productId . '.png' . '">';
echo '<img src="img/' . $imageName . '">';
echo '<h4 class="product-card-header">';
switch ($productId) {
case 1:
echo $lang['productTitle1'];
break;
case 2:
echo $lang['productTitle2'];
break;
case 3:
echo $lang['productTitle3'];
break;
case 4:
echo $lang['productTitle4'];
break;
}
echo '</h4>';
echo '</a>';
echo '</div>';
echo '</div>';
}
?>
</div>
</div>
<script id="VLBar" title="Path Traversal" category-id="15" src="/public/assets/js/vlnav.min.js"></script>
</body>
</html>
65 changes: 65 additions & 0 deletions app/lab/path-traversal/path-traversal-2/product-detail.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<?php require("../../../lang/lang.php");
$lang = tr();
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Path Traversal</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<style>
.detail-inclusive {
text-align: center;
margin-top: 50px;
}

.detail-inclusive img {
max-width: 100%;
height: auto;
}
</style>
</head>
<body>
<div class="container mt-5">
<div class="detail-inclusive">
<?php
$productId = $_GET['productId'];

$filePath = str_replace("../","", $productId);
$fileContent = file_get_contents("/var/www/html/lab/path/img/" . $filePath);

if ($fileContent != false) {
echo "<pre>" . htmlspecialchars($fileContent) . "</pre>";
}

echo '<img src="img/' . $productId . '">';

switch ($productId) {
case '1.png':
echo '<h2>' . $lang['productTitle'] . '</h2>';
echo '<p>' . $lang['productDes1'] . '</p>';
break;
case '2.png':
echo '<h2>' . $lang['productTitle'] . '</h2>';
echo '<p>' . $lang['productDes2'] . '</p>';
break;
case '3.png':
echo '<h2>' . $lang['productTitle'] . '</h2>';
echo '<p>' . $lang['productDes3'] . '</p>';
break;
case '4.png':
echo '<h2>' . $lang['productTitle'] . '</h2>';
echo '<p>' . $lang['productDes4'] . '</p>';
break;
default:
echo '<h2>' . $lang['productError'] . '</h2>';
break;
}
?>
<a href="index.php" class="btn btn-primary mt-3"><?php echo $lang['back']; ?></a>
</div>
</div>
<script id="VLBar" title="Path Traversal" category-id="15" src="/public/assets/js/vlnav.min.js"></script>
</body>
</html>
Loading

0 comments on commit 0e26387

Please sign in to comment.