Skip to content

Commit 22077ae

Browse files
authored
Merge pull request #10 from vizzdoom/codex/sprawdź-literówki-i-język-kodu
Fix typos and update build.py language
2 parents 68162d2 + 2d68cbf commit 22077ae

File tree

4 files changed

+30
-34
lines changed

4 files changed

+30
-34
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
## Project website: https://vizzdoom.github.io/sqlmap-command-builder/
44

55
Interactive command line generator for conducting advanced SQLMap pentests.
6-
This project works locally with pure HTML/JS/CSS (no data exchanged to any server).
6+
This project works locally with pure HTML/JS/CSS (no data exchanged to any server).

app.js

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -290,13 +290,13 @@ class SQLMapGenerator {
290290
const tor = document.getElementById('tor').checked;
291291
if (tor) config['--tor'] = tor;
292292

293-
const checTor = document.getElementById('checkTor').checked;
294-
if (checTor) config['--check-tor'] = checTor;
293+
const checkTor = document.getElementById('checkTor').checked;
294+
if (checkTor) config['--check-tor'] = checkTor;
295295

296296
const torPort = document.getElementById('torPort').value.trim();
297297
if (torPort) config['--tor-port'] = torPort;
298298

299-
const torType = document.getElementById('torType').value.trim();;
299+
const torType = document.getElementById('torType').value.trim();
300300
if (torType && torType !== "SOCKS5") config['--tor-type'] = torType;
301301

302302
// Request options
@@ -574,12 +574,12 @@ class SQLMapGenerator {
574574
const copyBtn = document.getElementById('copyBtn');
575575
const copyText = document.getElementById('copyText');
576576
const txt_command_copy_clipboard = 'COPY COMMAND TO CLIPBOARD';
577-
const txt_command_copy_coppied = 'COMMAND COPIED!';
577+
const txt_command_copy_copied = 'COMMAND COPIED!';
578578

579579
try {
580580
await navigator.clipboard.writeText(command);
581581
copyBtn.classList.add('copying');
582-
copyText.textContent = txt_command_copy_coppied;
582+
copyText.textContent = txt_command_copy_copied;
583583

584584
setTimeout(() => {
585585
copyBtn.classList.remove('copying');
@@ -594,7 +594,7 @@ class SQLMapGenerator {
594594
document.execCommand('copy');
595595
document.body.removeChild(textArea);
596596

597-
copyText.textContent = txt_command_copy_coppied;
597+
copyText.textContent = txt_command_copy_copied;
598598
setTimeout(() => {
599599
copyText.textContent = txt_command_copy_clipboard;
600600
}, 3000);
@@ -607,12 +607,12 @@ class SQLMapGenerator {
607607
const copyUrlBtn = document.getElementById('copyUrlBtn');
608608
const copyUrlText = document.getElementById('copyUrlText');
609609
const txt_command_url_clipboard = 'COPY CONFIG URL';
610-
const txt_command_url_coppied = 'URL COPIED!';
610+
const txt_command_url_copied = 'URL COPIED!';
611611

612612
try {
613613
await navigator.clipboard.writeText(command);
614614
copyUrlBtn.classList.add('copying');
615-
copyUrlText.textContent = txt_command_url_coppied;
615+
copyUrlText.textContent = txt_command_url_copied;
616616

617617
setTimeout(() => {
618618
copyUrlBtn.classList.remove('copying');
@@ -629,7 +629,7 @@ class SQLMapGenerator {
629629
document.execCommand('copy');
630630
document.body.removeChild(textArea);
631631

632-
copyUrlText.textContent = txt_command_url_coppied;
632+
copyUrlText.textContent = txt_command_url_copied;
633633
setTimeout(() => {
634634
copyUrlText.textContent = txt_command_url_clipboard;
635635
}, 3000);
@@ -653,11 +653,10 @@ class SQLMapGenerator {
653653
'url': 'url',
654654
'data': 'data',
655655
'requestFile': 'requestFile',
656-
'requestFileScope': 'requestFileScope',
657656
'burpFile': 'burpFile',
658657
'level': 'level',
659658
'risk': 'risk',
660-
'randomAgent': 'randomAgent',
659+
'randomAgent': 'userAgent',
661660
'batch': 'batch',
662661
'dbs': 'dbs'
663662
};
@@ -767,7 +766,7 @@ class SQLMapGenerator {
767766
'--host': 'host',
768767
'-A': 'userAgent',
769768
'--mobile': 'mobileUserAgent',
770-
'--random-agent': 'randomAgent',
769+
'--random-agent': 'userAgent',
771770
'--referer': 'referer',
772771
'-H': 'headers',
773772
'--cookie': 'cookie',

build.py

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,19 @@
1-
# build.py
2-
html = open('index.html').read()
3-
css = open('style.css').read()
4-
js = open('app.js').read()
1+
def read_text(path):
2+
with open(path) as file:
3+
return file.read()
54

6-
# Zakładam, że index.html ma <head>...</head> i </body>
7-
# Dodaj CSS do <head>
8-
html = html.replace('<link rel="stylesheet" href="style.css">', '');
95

10-
html = html.replace(
11-
'</head>',
12-
f'<style>\n{css}\n</style>\n</head>'
13-
)
14-
# Dodaj JS na końcu przed </body>
15-
html = html.replace('<script src="app.js"></script>','');
16-
html = html.replace(
17-
'</body>',
18-
f'<script>\n{js}\n</script>\n</body>'
19-
)
6+
def inline_assets(html, css, js):
7+
page = html.replace('<link rel="stylesheet" href="style.css">', '')
8+
page = page.replace('</head>', f'<style>\n{css}\n</style>\n</head>')
9+
page = page.replace('<script src="app.js"></script>', '')
10+
return page.replace('</body>', f'<script>\n{js}\n</script>\n</body>')
2011

21-
with open('index.html', 'w') as f:
22-
f.write(html)
12+
13+
if __name__ == "__main__":
14+
html = read_text('index.html')
15+
css = read_text('style.css')
16+
js = read_text('app.js')
17+
18+
with open('index.html', 'w') as output:
19+
output.write(inline_assets(html, css, js))

index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!DOCTYPE html>
2-
<html lang="pl">
2+
<html lang="en">
33
<head>
44
<meta charset="UTF-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
@@ -183,7 +183,7 @@ <h3>Proxy Options</h3>
183183
</div>
184184
<!-- --proxy-cred -->
185185
<div class="form-group" title="Use a proxy to connect to the target URL">
186-
<label class="form-label" for="proxyCred">HTTP(S) PROXY CREDENTIALS<br/><span>--proxy-creed</span></label>
186+
<label class="form-label" for="proxyCred">HTTP(S) PROXY CREDENTIALS<br/><span>--proxy-cred</span></label>
187187
<input type="text" id="proxyCred" class="form-control" placeholder="username:password">
188188
</div>
189189
<!-- --proxy-file -->

0 commit comments

Comments
 (0)