History or a Mystery?
History is always written by the Winners.
Hey learners,
This is the part-25 of our series, how was the monday? not that great I guess. Most of the days the things are tiresome, some days It’s more than just tiresome. But at the end, the struggle and the constant grind is worth it. Let’s see the topics.
- Dead Code The term “Dead code” can have a lot of different meanings, the one I’m referring here is the code segments which will not be used by the kernel/hardware, In simple terms It’s just some junk code, which isn’t needed or used. If you had read the details about operation triangulation, you may have understood the importance of cleaning up dead code. The security researchers used a part of code which wasn’t being used by the device, they compromised the device because of it. Not solely, a part of the sophisticated chain attack. Why is it there? It can have various reasons, such as foreseen features, overlooking security on the basis of pure functionality and optimizations and most of *“What can possibly happen?” *things from the employees. 2. Domain Trust Policy Domain trust policy is the practice of ensuring enough security policies whenever a user/employee visits a particular domain by using the company’s network. This is a good thing to follow, employees can make mistakes and fall for phishing/social engineering attacks due to the heat of the moment. Domain trust can be implemented to mitigate the risks and allow for efficient user interaction as well as client interaction. Firewalls can be configured, but these days attackers are evolving at a rapid phase. If they use a series of attacks which even the firewall cannot stop, the employee becomes vulnerable and may expose company’s sensitive data. Lot of work just to be safe isn’t it? you can never be less careful, in today’s world!
- Introduction to Interactive Dis-Assembler
IDA is developed by hex-rays, It is one of the popular tools to fetch human readable code(assembly language) from machine-executable binary codes. IDA is great to know what happens behind the curtains, you don’t need to do a masters in computer architecture. So, don’t be worried.
Disassembled assembly code
So, that’s how it looks, download it once and view some binary codes from it.
4. Binary File Execution
How do we execute a binary file? binary files don’t include an extension most of the times, If you’re running on linux just give the file execution permissions and execute it.$ chmod +X binaryfile
$ ./binaryfile
There we go, you’ve successfully executed it!
Okay, but how can we view the data which is inside it? These text editors won’t be any useful. we have to use “hexdump” to see the contents and “hexedit” to modify and change the binary codes over the CLI interface.#To view
$ hexdump -C binaryfile
00000000 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00 |.ELF…|
00000010 03 00 3e 00 01 00 00 00 60 11 00 00 00 00 00 00 |..%lt;…`…|
00000020 40 00 00 00 00 00 00 00 48 31 00 00 00 00 00 00 |@…H1…|
00000030 00 00 00 00 40 00 38 00 0d 00 40 00 1d 00 1c 00 |…@.8…@…|
00000040 06 00 00 00 04 00 00 00 40 00 00 00 00 00 00 00 |…@…|
000001c0 08 00 00 00 00 00 00 00 04 00 00 00 04 00 00 00 |…|
000001d0 38 03 00 00 00 00 00 00 38 03 00 00 00 00 00 00 |8…8…|
000001e0 38 03 00 00 00 00 00 00 30 00 00 00 00 00 00 00 |8…0…|
000001f0 30 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00 |0…|
00000200 04 00 00 00 04 00 00 00 68 03 00 00 00 00 00 00 |…h…|
00000210 68 03 00 00 00 00 00 00 68 03 00 00 00 00 00 00 |h…h…|
00000220 44 00 00 00 00 00 00 00 44 00 00 00 00 00 00 00 |D…D…|
00000230 04 00 00 00 00 00 00 00 53 e5 74 64 04 00 00 00 |…S.td…|
00000240 38 03 00 00 00 00 00 00 38 03 00 00 00 00 00 00 |8…8…|
00000250 38 03 00 00 00 00 00 00 30 00 00 00 00 00 00 00 |8…0…|
00000260 30 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00 |0…|
#To edit the code
$ hexedit binaryfile
00000500 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 B0 00 00 00 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 … …
00000528 3C 00 00 00 11 00 1A 00 10 40 00 00 00 00 00 00 08 00 00 00 00 00 00 00 01 00 00 00 22 00 00 00 00 00 00 00 00 00 00 00 <…@…“…
00000550 00 00 00 00 00 00 00 00 00 5F 5F 63 78 61 5F 66 69 6E 61 6C 69 7A 65 00 6D 61 6C 6C 6F 63 00 5F 5F 6C 69 62 63 5F 73 74 …__cxa_finalize.malloc.__libc_st
00000578 61 72 74 5F 6D 61 69 6E 00 73 74 72 63 6D 70 00 67 65 74 73 00 73 74 72 63 70 79 00 73 74 64 6F 75 74 00 70 75 74 73 00 art_main.strcmp.gets.strcpy.stdout.puts.
000005A0 66 66 6C 75 73 68 00 73 79 73 74 65 6D 00 73 74 72 6C 65 6E 00 70 72 69 6E 74 66 00 6C 69 62 63 2E 73 6F 2E 36 00 47 4C fflush.system.strlen.printf.libc.so.6.GL
---binaryfile—0x0/0x3888—0%---------------------------------------------------------------------------------------------------------------------------------------------------
These are very useful when you’re working on binary exploitation and forensics. 5. User Account Permissions Be it in any operating system, account permissions are important, they control what a user can do and cannot do. Account permissions are shared for people who use the same account to do their tasks, the permissions are needed by a fresh user to start. For e.g. we need a set of permissions just to see some files, the permissions include read, write and execute. We all know that an administrator can give access and can revoke at the same time. That’s why most of the attackers try to compromise the admin account first, then they continue their goals afterwards. That’s for today, hope you got it. I’ll see you tomorrow again!