Skip to content

Commit

Permalink
updated mytools webpage
Browse files Browse the repository at this point in the history
  • Loading branch information
alecmaly committed Sep 5, 2021
1 parent 014180d commit 1a35f8b
Show file tree
Hide file tree
Showing 11 changed files with 70 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#### Clone buffer overflow to current directory
```
git clone https://[email protected]/alecjmaly/hacking-myTools.git && mv hacking-myTools/buffer_overflow/* . && rm -rf hacking-myTools
git clone https://[email protected]/alecjmaly/hacking-myTools.git && mv hacking-myTools/exploit_development/buffer_overflow/* . && rm -rf hacking-myTools
```

#### Install depedency packages
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
30 changes: 30 additions & 0 deletions exploit_development/python3_offline-install_windows.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# WINDOWS

# [online] create
## virtual environment
python -m venv ./venv
.\venv\Scripts\activate.bat

# install from requirements (pip install -r requirements.txt)
pip install pyperclip pykd pwntools keystone-engine
#### INSTALL NEW DEPENDENCIES

### pip freeze and download
pip freeze > requirements.txt
powershell remove-item packages -recurse
pip3 download -r requirements.txt -d packages

## download + zip packages
copy requirements.txt packages
powershell Compress-Archive .\packages\*.* packages.zip -force







# [offline] install
powershell Expand-Archive packages.zip -force
cd packages
pip install --no-index --find-links . -r requirements.txt
44 changes: 38 additions & 6 deletions tools/http/mywebtools.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@
</style>

<body>
<p id='output_length'>(\n) Length: 0 | Hex: 0<br>(\r\n) Length: 0 | Hex: 0</p>
<p id='output_length' style='white-space: pre'>(\n) Length: 0 | Hex: 0<br>(\r\n) Length: 0 | Hex: 0</p>


<textarea
id='text'
placeholder='Enter text here to calculate length. Newlines \n are converted to \r\n'
Expand Down Expand Up @@ -96,7 +97,7 @@ <h2>Tools</h2>
// main function
function update() {
let text = document.querySelector('#text').value
updateLength(text)
updateLength()

// update encode hrml
try {
Expand Down Expand Up @@ -176,11 +177,23 @@ <h2>Tools</h2>


// subroutines
function updateLength(text) {
let new_length = text.replaceAll('\n', '\r\n').length;
function updateLength() {
let text = document.querySelector('#text').value
let length_with_return = text.replaceAll('\n', '\r\n').length || 0;

let selected_text = getSelectionText()
let selected_length_with_return = selected_text.replaceAll('\n', '\r\n').length || 0;


document.querySelector('#output_length').innerText =
'(\\n) Length: ' + text.length + ' | Hex: ' + text.length.toString(16) + '\n' +
'(\\r\\n)\t Length: ' + new_length + ' | Hex: ' + new_length.toString(16)
`(\\n)\t Length: ${text.length} | Hex: ${text.length.toString(16)}` +
`\t\t [SELECTED] Length: ${selected_text.length} | Hex: ${selected_text.length.toString(16)}` +
`\t\t [UNSELECTED] Length: ${text.length - selected_text.length} | Hex: ${(text.length - selected_text.length).toString(16)}` +

'\n' +
`(\\r\\n) Length: ${length_with_return} | Hex: ${length_with_return.toString(16)}` +
`\t\t [SELECTED] Length: ${selected_length_with_return} | Hex: ${selected_length_with_return.toString(16)}` +
`\t\t [UNSELECTED] Length: ${length_with_return - selected_length_with_return} | Hex: ${(length_with_return - selected_length_with_return).toString(16)}`
}

function updateDecodeHtml(html) {
Expand Down Expand Up @@ -272,6 +285,25 @@ <h2>Tools</h2>
this.style.height = "auto";
this.style.height = (this.scrollHeight) + "px";
}

function getSelectionText() {
var text = "";
var activeEl = document.activeElement;
var activeElTagName = activeEl ? activeEl.tagName.toLowerCase() : null;
if (
(activeElTagName == "textarea") || (activeElTagName == "input" &&
/^(?:text|search|password|tel|url)$/i.test(activeEl.type)) &&
(typeof activeEl.selectionStart == "number")
) {
text = activeEl.value.slice(activeEl.selectionStart, activeEl.selectionEnd);
} else if (window.getSelection) {
text = window.getSelection().toString();
}

return text;
}

document.onmouseup = document.onkeyup = document.onselectionchange = updateLength
</script>
</body>

Expand Down
2 changes: 1 addition & 1 deletion tools/http/xss.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

delimiter = '-'
orig_string = r'''sdfsdf-'-&#x27;-"-&quot;-`-<-&lt;->-&gt;-&-&amp;-(-)-\-+-*-{-}-;-$-${1+1}-{{1+1}}-<><sCrIPt>-&lt;&gt;&lt;sCrIPt&gt;-sdfsdf'''
end_string = r'''sdfsdf-'-'-"-"-`-&lt;-&lt;-&gt;-&gt;-&amp;-&amp;-(-)-\-+-*-{-}-;-$-${1+1}-{{1+1}}-&lt;&gt;<script>-&lt;&gt;&lt;sCrIPt&gt;-sdfsdf'''
end_string = r'''sdfsdf-'-&#x27;-"-&quot;-\`-<-&lt;->-&gt;-&-&amp;-(-)-\\-+-*-{-}-;-$-${1+1}-{{1+1}}-<%= 1+1 %>-&lt;%= 1+1 %&gt;-${1+1}-%{1+1}-@(1+1)-<><sCrIPt>-&lt;&gt;&lt;sCrIPt&gt;-sdfsdf'''


print(f'old payload: {orig_string}')
Expand Down

0 comments on commit 1a35f8b

Please sign in to comment.