├── Challenge ├── log.txt ├── images │ ├── image1.jpg │ ├── image2.jpeg │ ├── image3.jpg │ ├── image4.jpeg │ └── image5.jpg ├── serialize.php ├── unserialize.php ├── download.php └── index.php ├── Insecure Deserialization Presentation.pdf └── README.md /Challenge/log.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Challenge/images/image1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raadfhaddad/Insecure-Deserialization/HEAD/Challenge/images/image1.jpg -------------------------------------------------------------------------------- /Challenge/images/image2.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raadfhaddad/Insecure-Deserialization/HEAD/Challenge/images/image2.jpeg -------------------------------------------------------------------------------- /Challenge/images/image3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raadfhaddad/Insecure-Deserialization/HEAD/Challenge/images/image3.jpg -------------------------------------------------------------------------------- /Challenge/images/image4.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raadfhaddad/Insecure-Deserialization/HEAD/Challenge/images/image4.jpeg -------------------------------------------------------------------------------- /Challenge/images/image5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raadfhaddad/Insecure-Deserialization/HEAD/Challenge/images/image5.jpg -------------------------------------------------------------------------------- /Insecure Deserialization Presentation.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raadfhaddad/Insecure-Deserialization/HEAD/Insecure Deserialization Presentation.pdf -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Insecure-Deserialization 2 | Insecure Deserialization is a critical bug, that based on the application behavior with the object. 3 | 4 | You can find here: 5 | - The Lab (the challenge, written in PHP) 6 | - Presentation was represented in OWASP Amman Chapter 2nd meetup (in PDF format). 7 | -------------------------------------------------------------------------------- /Challenge/serialize.php: -------------------------------------------------------------------------------- 1 | price = $pricex; 11 | $this->color = $colorx; 12 | $this->name = $namex; 13 | } 14 | 15 | } 16 | 17 | $obj = new Car(14000,"black","Mercedes"); 18 | echo serialize($obj); 19 | ?> -------------------------------------------------------------------------------- /Challenge/unserialize.php: -------------------------------------------------------------------------------- 1 | price = $pricex; 11 | $this->color = $colorx; 12 | $this->name = $namex; 13 | } 14 | 15 | } 16 | 17 | $ready_serialized_object=unserialize($_GET['obj']); 18 | echo var_dump($ready_serialized_object); 19 | ?> -------------------------------------------------------------------------------- /Challenge/download.php: -------------------------------------------------------------------------------- 1 | path); 11 | if(file_exists($image_path) && $this->operation == "Download") { 12 | header('Content-Description: File Transfer'); 13 | header('Content-Type: image/jpeg'); 14 | header('Content-Disposition: attachment; filename="'.basename($image_path).'"'); 15 | header('Expires: 0'); 16 | header('Cache-Control: must-revalidate'); 17 | header('Pragma: public'); 18 | header('Content-Length: ' . filesize($image_path)); 19 | flush(); 20 | readfile($image_path); 21 | file_put_contents(__DIR__.'/'.$this->logfile,"image :".base64_decode($this->path)." has been downloaded by ".$_SERVER['REMOTE_ADDR']." and is comming from ".$_SERVER['HTTP_REFERER']."\r\n",FILE_APPEND); 22 | } 23 | } 24 | } 25 | 26 | $obj_image=base64_decode($_POST['image_path']); 27 | $get_image=unserialize($obj_image); 28 | ?> 29 | -------------------------------------------------------------------------------- /Challenge/index.php: -------------------------------------------------------------------------------- 1 | 4 | 5 |

Welcome to our new website!

6 | 7 |

Check out new Collection of images:



8 |
9 |
10 | 11 | 12 | 14 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 |
Image 13 | Select 15 |
40 |
41 |
42 | --------------------------------------------------------------------------------