Hacking Articles Tips Tricks Videos Tutorials
Photo
Hacking on Medium
Funbox: 1 write-up
https://cdn-images-1.medium.com/max/1519/1*A30qBYo1o8jsVRnFc84Hfw.png
This is a boot2 root machine from vulnhub this machine rated as easy to medium so today we are gonna exploit it : )
Continue reading on Medium Β»
Funbox: 1 write-up
https://cdn-images-1.medium.com/max/1519/1*A30qBYo1o8jsVRnFc84Hfw.png
This is a boot2 root machine from vulnhub this machine rated as easy to medium so today we are gonna exploit it : )
Continue reading on Medium Β»
AWS S3 Bucket Misconfiguration in Trading Website
https://muhdaffa.medium.com/aws-s3-bucket-misconfiguration-in-trading-website-1794d48dccc3?source=rss------bug_bounty-5
https://muhdaffa.medium.com/aws-s3-bucket-misconfiguration-in-trading-website-1794d48dccc3?source=rss------bug_bounty-5
Hello, my name is Muhammad Daffa, in this post I will share my simple writeup about AWS S3 Bucket Misconfiguration that I found on theβ¦Continue reading on Medium Β» (https://muhdaffa.medium.com/aws-s3-bucket-misconfiguration-in-trading-website-1794d48dccc3?source=rss------bug_bounty-5)
CallObfuscator - Obfuscate Specific Windows Apis With Different APIs
http://www.kitploit.com/2021/03/callobfuscator-obfuscate-specific.html
http://www.kitploit.com/2021/03/callobfuscator-obfuscate-specific.html
Obfuscate (hide) the PE imports from static/dynamic analysis tools.
Theory
This's pretty forward, let's say I've used VirtualProtect and I want to obfuscate it with Sleep, the tool will manipulate the IAT so that the thunk that points to VirtualProtect will point instead to Sleep, now at executing the file, windows loader will load Sleep instead of VirtualProtect, and moves the execution to the entry point, from there the execution will be redirected to the shellcode, the tool put before, to find the address of VirtualProtect and use it to replace the address of Sleep which assigned before by the loader.
How to use
It can be included directly as a library, see the following snippet (based on the example), also you can take a look at cli.cpp (https://github.com/d35ha/CallObfuscator/blob/master/cli/cli.cpp).
#include
int main() {
cobf obf_file = cobf("sample.exe");
obf_file.load_pe();
obf_file.obf_sym("kernel32.dll", "SetLastError", "Beep");
obf_file.obf_sym("kernel32.dll", "GetLastError", "GetACP");
obf_file.generate("sample_obfuscated.exe");
obf_file.unload_pe();
return 0;
}; Also can be used as a command line (https://www.kitploit.com/search/label/Command%20Line) tool by supplying it with the input PE path, the output PE path and optionally the path to the configuration file (default is config.ini).
cobf.exe [config file]
The config file contains the obfuscations needed (dlls, symbols, ...).
Here is a template for the config file content
; Template for the config file:
; * Sections can be written as:
; [dll_name]
; old_sym=new_sym
; * The dll name is case insensitive, but
; the old and the new symbols are not.
; * You can use the wildcard on both the
; dll name and the old symbol.
; * You can use '#' at the start of
; the old or the new symbol to flag
; an ordinal.
; * The new symbol should be exported
; by the dll so the windows loader can resolve it.
; For example:
; * Obfuscating all of the symbols
; imported from user32.dll with ordinal 1600.
[user32.dll]
*=#1600
; * Obfuscating symbols imported from both
; kernel32.dll and kernelbase.dll with Sleep.
[kernel*.dll]
*=Sleep
; * Obfuscating fprintf with exit.
[*]
fprintf=exit
Example
Build this code sample
#include
#include
int main() {
SetLastError(5);
printf("Last error is %d\n", GetLastError());
return 0;
}; After building it, this is how the kernel32 imports look like
Theory
This's pretty forward, let's say I've used VirtualProtect and I want to obfuscate it with Sleep, the tool will manipulate the IAT so that the thunk that points to VirtualProtect will point instead to Sleep, now at executing the file, windows loader will load Sleep instead of VirtualProtect, and moves the execution to the entry point, from there the execution will be redirected to the shellcode, the tool put before, to find the address of VirtualProtect and use it to replace the address of Sleep which assigned before by the loader.
How to use
It can be included directly as a library, see the following snippet (based on the example), also you can take a look at cli.cpp (https://github.com/d35ha/CallObfuscator/blob/master/cli/cli.cpp).
#include
int main() {
cobf obf_file = cobf("sample.exe");
obf_file.load_pe();
obf_file.obf_sym("kernel32.dll", "SetLastError", "Beep");
obf_file.obf_sym("kernel32.dll", "GetLastError", "GetACP");
obf_file.generate("sample_obfuscated.exe");
obf_file.unload_pe();
return 0;
}; Also can be used as a command line (https://www.kitploit.com/search/label/Command%20Line) tool by supplying it with the input PE path, the output PE path and optionally the path to the configuration file (default is config.ini).
cobf.exe [config file]
The config file contains the obfuscations needed (dlls, symbols, ...).
Here is a template for the config file content
; Template for the config file:
; * Sections can be written as:
; [dll_name]
; old_sym=new_sym
; * The dll name is case insensitive, but
; the old and the new symbols are not.
; * You can use the wildcard on both the
; dll name and the old symbol.
; * You can use '#' at the start of
; the old or the new symbol to flag
; an ordinal.
; * The new symbol should be exported
; by the dll so the windows loader can resolve it.
; For example:
; * Obfuscating all of the symbols
; imported from user32.dll with ordinal 1600.
[user32.dll]
*=#1600
; * Obfuscating symbols imported from both
; kernel32.dll and kernelbase.dll with Sleep.
[kernel*.dll]
*=Sleep
; * Obfuscating fprintf with exit.
[*]
fprintf=exit
Example
Build this code sample
#include
#include
int main() {
SetLastError(5);
printf("Last error is %d\n", GetLastError());
return 0;
}; After building it, this is how the kernel32 imports look like
Now let's obfuscate both SetLastError and GetLastError with Beep and GetACP (actually any api from kernel32 will be ok even if it's not imported at all).
The used configurations are
[kernel32.dll]
SetLastError=Beep
GetLastError=GetACP Here is the output (also you can use the library directly as shown above).
The used configurations are
[kernel32.dll]
SetLastError=Beep
GetLastError=GetACP Here is the output (also you can use the library directly as shown above).
Again let's have a look on the kernel32 imports
There's no existence of SetLastError or GetLastError
A confirmation that two files will work properly
A confirmation that two files will work properly
Impact
IDA HexRays Decompiler
IDA HexRays Decompiler
IDA Debugger