@hyperdbg

@hyperdbg / Public archive of HyperDbg Telegram messages.

  • 2025

    • Mar 2025 (385)
    • Feb 2025 (220)
    • Jan 2025 (167)
  • 2024

    • Dec 2024 (72)
    • Nov 2024 (235)
    • Oct 2024 (83)
    • Sep 2024 (263)
    • Aug 2024 (332)
    • Jul 2024 (403)
    • Jun 2024 (570)
    • May 2024 (245)
    • Apr 2024 (156)
    • Mar 2024 (90)
    • Feb 2024 (134)
    • Jan 2024 (309)
  • 2023

    • Dec 2023 (62)
    • Nov 2023 (326)
    • Oct 2023 (76)
    • Sep 2023 (315)
    • Aug 2023 (757)
    • Jul 2023 (2215)
    • Jun 2023 (778)
    • May 2023 (300)
    • Apr 2023 (1)
    • Feb 2023 (5)
    • Jan 2023 (1)
  • 2022

    • Nov 2022 (1)
    • Oct 2022 (2)
    • Sep 2022 (1)
    • Aug 2022 (1)
    • Jul 2022 (39)
    • Jun 2022 (23)
    • May 2022 (256)
  • 2021

    • Dec 2021 (1)
    • Oct 2021 (82)
    • Jun 2021 (1)
    • Feb 2021 (1)
    • Jan 2021 (2)
  • 2020

    • Dec 2020 (1)
    • Nov 2020 (2)
RSS feed.    Made with tg-archive
  • 1
  • 2
  • 3
  • 4
  • 5
  • 06 July 2023 (295 messages)
  • @HughEverett ↶ Reply to #2079 #2080 10:34 AM, 06 Jul 2023
    I didn't test it yet. But, I'm gonna test it right now.
  • @ricnar #2081 10:38 AM, 06 Jul 2023
    !exception pid 1b50 script {if(@cr2 > 401000 && @cr2 < 402000){pause();}}
  • @HughEverett #2082 10:40 AM, 06 Jul 2023
    But the thing is once this event is triggered, the page is still not valid.
  • @HughEverett #2083 10:40 AM, 06 Jul 2023
    In this case, you can put a breakpoint on the next instruction (@rip).
  • @ricnar #2084 10:43 AM, 06 Jul 2023

    photo_2023-07-06_10-43-25.jpg
  • @ricnar #2085 10:43 AM, 06 Jul 2023
    it works here
  • @ricnar #2086 10:44 AM, 06 Jul 2023

    photo_2023-07-06_10-44-02.jpg
  • @ricnar #2087 10:44 AM, 06 Jul 2023
    the x addition to the monitor command is in the last source code?
  • @ricnar #2088 10:44 AM, 06 Jul 2023
    if i put the x option the command does not work
  • @HughEverett ↶ Reply to #2087 #2089 10:44 AM, 06 Jul 2023
    x? 🤨
  • @ricnar #2090 10:45 AM, 06 Jul 2023
    monitor
  • @ricnar #2091 10:45 AM, 06 Jul 2023
    rwx
  • @ricnar #2092 10:45 AM, 06 Jul 2023
    heare only rw is accepted
  • @ricnar #2093 10:45 AM, 06 Jul 2023
    in my code
  • @HughEverett #2094 10:45 AM, 06 Jul 2023
    No, the 'x' is not supported.
  • @ricnar #2095 10:45 AM, 06 Jul 2023
    ah
  • @HughEverett #2096 10:46 AM, 06 Jul 2023
    This is not supported by HyperDbg, but I think it can be easily added. 🤔
  • @HughEverett #2097 10:47 AM, 06 Jul 2023
    I'll check it tonight to see if I can add this feature with a trivial patch.
  • @ricnar #2098 10:48 AM, 06 Jul 2023
    thanks
  • @ricnar #2099 10:48 AM, 06 Jul 2023
    another thing
  • @ricnar #2100 10:49 AM, 06 Jul 2023
    how this command can be disabled
  • @ricnar #2101 10:49 AM, 06 Jul 2023
    !exception pid 1470 script {if(@cr2 > 401000 && @cr2 < 622000){pause();}}
  • @ricnar #2102 10:49 AM, 06 Jul 2023
    after it stops i need to disable
  • @ricnar #2103 10:50 AM, 06 Jul 2023
    and how a monitor command can be disabled
  • @ricnar #2104 10:55 AM, 06 Jul 2023
    event c 1
  • @ricnar #2105 10:55 AM, 06 Jul 2023
    i see
  • @HughEverett ↶ Reply to #2104 #2106 10:57 AM, 06 Jul 2023
    No, it clears (removes) the event. It won't disable it.
  • @HughEverett #2107 10:58 AM, 06 Jul 2023
    event d 1
  • @HughEverett #2108 10:58 AM, 06 Jul 2023
    is for disabling it.
  • @ricnar #2109 10:58 AM, 06 Jul 2023
    thanks
  • @ricnar #2110 10:58 AM, 06 Jul 2023
    the packer catch the event and closes
  • @ricnar #2111 10:58 AM, 06 Jul 2023
    after stops
  • @HughEverett ↶ Reply to #2109 #2112 10:59 AM, 06 Jul 2023
    you can also use this function in script engine: https://docs.hyperdbg.org/commands/scripting-language/functions/events/event_disable
    event_disable

    Description of 'event_disable' function in HyperDbg Scripts

  • @ricnar #2113 10:59 AM, 06 Jul 2023
    i disable the event but the process closes
  • @ricnar #2114 10:59 AM, 06 Jul 2023
    it detects something
  • @HughEverett #2115 10:59 AM, 06 Jul 2023
    The difference between clearing and disabling is that clearing continues the debuggee, but disabling won't continue the debuggee.
  • @ricnar #2116 10:59 AM, 06 Jul 2023
    ah
  • @ricnar #2117 11:00 AM, 06 Jul 2023
    i try
  • @HughEverett #2118 11:01 AM, 06 Jul 2023
    Disabling means the event is logically disabled but it's effects is still working (e.g., page-faults still cause vm-exit) and by disabling it, you just tell the HyperDbg, won't trigger actions of this event for me.
  • @HughEverett #2119 11:01 AM, 06 Jul 2023
    but by removing, you just tell HyperDbg to remove it's effects and terminate it. Like I don't want #pf vm-exits anymore.
  • @ricnar #2120 11:07 AM, 06 Jul 2023

    photo_2023-07-06_11-07-18.jpg
  • @ricnar #2121 11:07 AM, 06 Jul 2023
    the executable catches and closes
  • @ricnar #2122 11:07 AM, 06 Jul 2023
    it does not continue
  • @ricnar #2123 11:08 AM, 06 Jul 2023
    it dos not run anymore
  • @ricnar #2124 11:08 AM, 06 Jul 2023
    hehe
  • @ricnar #2125 11:08 AM, 06 Jul 2023
    closing the process t does not start again
  • @ricnar #2126 11:09 AM, 06 Jul 2023
    well sorry i continue by me
  • @ricnar #2127 11:09 AM, 06 Jul 2023
    thanks for your help
  • @HughEverett ↶ Reply to #2125 #2128 11:10 AM, 06 Jul 2023
    Does it crash the target process? Or BSOD the system?
  • @HughEverett ↶ Reply to #2126 #2129 11:10 AM, 06 Jul 2023
    no, I'm here to help. Tell us whatever happened there.
  • @ricnar ↶ Reply to #2128 #2130 11:14 AM, 06 Jul 2023
    nope
  • @ricnar #2131 11:14 AM, 06 Jul 2023
    but it does not continue running
  • @ricnar #2132 11:14 AM, 06 Jul 2023
    and it does not run again
  • @HughEverett ↶ Reply to #2131 #2133 11:14 AM, 06 Jul 2023
    the process? or the system?
  • @ricnar #2134 11:14 AM, 06 Jul 2023
    it closes
  • @ricnar #2135 11:14 AM, 06 Jul 2023
    the process
  • @ricnar #2136 11:14 AM, 06 Jul 2023
    the system continues perfectly
  • @HughEverett #2137 11:15 AM, 06 Jul 2023
    did you change anything in the process?
  • @ricnar #2138 11:15 AM, 06 Jul 2023
    nope
  • @ricnar #2139 11:15 AM, 06 Jul 2023
    only putting the script
  • @ricnar #2140 11:15 AM, 06 Jul 2023
    it does not like it
  • @HughEverett #2141 11:18 AM, 06 Jul 2023
    Are you using the 'dev' branch ?
  • @HughEverett #2142 11:19 AM, 06 Jul 2023
    I made some changes in the page-fault handler recently, I suspect those modifications might be problematic. 🤔
  • @HughEverett #2143 11:19 AM, 06 Jul 2023
    because, otherwise, we just re-inject the #PF. It should work normally.
  • @ricnar #2144 11:35 AM, 06 Jul 2023
    i use the source code downloaded a week ago when we are looking for the first bug
  • @HughEverett ↶ Reply to #2144 #2145 11:35 AM, 06 Jul 2023
    I'm currently working on the HyperDbg to add the 'x' feature to the !monitor.
  • @ricnar #2146 11:54 AM, 06 Jul 2023
    thanks
  • @ricnar #2147 11:54 AM, 06 Jul 2023
    do you think the complied version 0.3.0 can manage the exceptions better?
  • @HughEverett ↶ Reply to #2147 #2148 11:58 AM, 06 Jul 2023
    The problem is I don't know what is happening there. The script is just a simple interceptor for page-fault. If the problem is with #pf re-injector, then you should see the crash immediately. I think something else is happening there, because we simply re-inject the page-fault.
  • @HughEverett #2149 11:58 AM, 06 Jul 2023
    But wait a minute, I want to double check one thing
  • @HughEverett ↶ Reply to #2147 #2150 12:03 PM, 06 Jul 2023
    Can you remove these lines from the master branch and re-test it?

    https://github.com/HyperDbg/HyperDbg/blob/a571781e8651998b982a9f53edf8f3d3501a6b2e/hyperdbg/hprdbghv/code/vmm/vmx/IdtEmulation.c#L145

    photo_2023-07-06_12-03-00.jpg
  • @ricnar #2151 12:03 PM, 06 Jul 2023
    yes
  • @HughEverett ↶ Reply to #2150 #2152 12:03 PM, 06 Jul 2023
    I suspect, maybe this callback is problematic. 🤔
  • @ricnar #2153 12:03 PM, 06 Jul 2023
    but givme some time i'm at work now
  • @ricnar #2154 12:03 PM, 06 Jul 2023
    later i will do
  • @HughEverett ↶ Reply to #2153 #2155 12:03 PM, 06 Jul 2023
    sure, I'm gonna add the 'x' feature now.
  • @ricnar #2156 12:34 PM, 06 Jul 2023

    photo_2023-07-06_12-34-49.jpg
  • @ricnar #2157 12:36 PM, 06 Jul 2023
    it gives me errors now
  • @ricnar #2158 12:37 PM, 06 Jul 2023
    i redownloaded again and gives me errors
  • @ricnar #2161 12:39 PM, 06 Jul 2023

    photo_2023-07-06_12-39-19.jpg
  • @HughEverett ↶ Reply to #2161 #2163 12:41 PM, 06 Jul 2023
    Did you use '--recursive' in the git?
  • @ricnar #2165 12:42 PM, 06 Jul 2023
    yes
  • @ricnar #2166 12:42 PM, 06 Jul 2023

    photo_2023-07-06_12-42-26.jpg
  • @HughEverett #2167 12:43 PM, 06 Jul 2023
    How it's possible 🫠
    Something that works previously in the same system is no longer building? 😳😳😳
  • @ricnar #2168 12:43 PM, 06 Jul 2023
    yes
  • @ricnar #2169 12:43 PM, 06 Jul 2023
    i rebuild the last project i had
  • @ricnar #2170 12:43 PM, 06 Jul 2023
    and get the same error
  • @ricnar #2171 12:43 PM, 06 Jul 2023
    ii create a new proyecy
  • @ricnar #2172 12:44 PM, 06 Jul 2023
    project
  • @HughEverett #2173 12:44 PM, 06 Jul 2023
    😕
  • @ricnar #2174 12:44 PM, 06 Jul 2023
    and clone the code
  • @ricnar #2175 12:44 PM, 06 Jul 2023
    and get the same error
  • @HughEverett #2176 12:45 PM, 06 Jul 2023
    Can you compile each of them separately? I mean, do not compile the solution, just compiling each project in VS.
  • @HughEverett ↶ Reply to #2175 #2177 12:45 PM, 06 Jul 2023
    And, are you using the same VS2022? Any Visual Studio update?
  • @ricnar #2178 12:46 PM, 06 Jul 2023

    photo_2023-07-06_12-46-58.jpg
  • @ricnar #2179 12:47 PM, 06 Jul 2023
    this fails
  • @ricnar #2180 12:47 PM, 06 Jul 2023
    the machine was updated with the monthly patch
  • @ricnar #2181 12:47 PM, 06 Jul 2023

    photo_2023-07-06_12-47-57.jpg
  • @HughEverett ↶ Reply to #2178 #2182 12:48 PM, 06 Jul 2023
    This seems to be a problem with WDK. 🤔
  • @ricnar #2183 12:48 PM, 06 Jul 2023
    Severity Code Description Project File Line Suppression State
    Error MSB4062 The "ValidateNTTargetVersion" task could not be loaded from the assembly C:\Program Files (x86)\Windows Kits\10\build\bin\Microsoft.DriverKit.Build.Tasks.17.0.dll. Could not load file or assembly 'file:///C:\Program Files (x86)\Windows Kits\10\build\bin\Microsoft.DriverKit.Build.Tasks.17.0.dll' or one of its dependencies. The system cannot find the file specified. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask. hprdbghv C:\Program Files (x86)\Windows Kits\10\build\WindowsDriver.common.targets 302
  • @ricnar #2184 12:49 PM, 06 Jul 2023
    i reinstall the wdk
  • @ricnar #2185 12:49 PM, 06 Jul 2023
    ahh
  • @ricnar #2186 12:49 PM, 06 Jul 2023
    i know
  • @ricnar #2187 12:50 PM, 06 Jul 2023
    i build in another machine
  • @HughEverett #2188 12:50 PM, 06 Jul 2023
    https://learn.microsoft.com/en-us/answers/questions/838453/driver-samples-give-build-errors
    Driver samples give build errors - Microsoft Q&A

    I have windows 10, vs2019, the latest WDK and SDK. I can't get the windows driver samples to build. The samples were downloaded today and are dated late March PLX9x5x gives the following Severity Code Description Project File Line Suppression State…

  • @ricnar #2189 12:50 PM, 06 Jul 2023
    in the livingroom machine not here
  • @ricnar #2190 12:50 PM, 06 Jul 2023
    i copied the compiled code to this machine
  • @ricnar #2191 12:50 PM, 06 Jul 2023
    this is the problem
  • @ricnar #2192 12:50 PM, 06 Jul 2023
    sorry
  • @HughEverett #2193 12:50 PM, 06 Jul 2023
    np
  • @ricnar #2194 12:50 PM, 06 Jul 2023
    i will reinstall wdk here
  • @HughEverett #2195 12:51 PM, 06 Jul 2023
    this is a good reason for never updating the visual studio.
  • @HughEverett #2196 12:51 PM, 06 Jul 2023
    Each time that I update this Visual Studio, something is changed that prevent me from compiling my previous projects 🫠
  • @ricnar #2197 01:08 PM, 06 Jul 2023

    photo_2023-07-06_13-08-16.jpg
  • @HughEverett #2198 01:09 PM, 06 Jul 2023
    One thing that I'm worried about adding 'rwx' to the !monitor is that what we should do after the event is triggered. 🤔
  • @HughEverett #2199 01:10 PM, 06 Jul 2023
    Maybe we could force Windows to context switch to a new process, by injecting IPI or CLOCK_INTR. But, not sure if it breaks Windows or not.
  • @ricnar #2200 01:10 PM, 06 Jul 2023

    photo_2023-07-06_13-10-26.jpg
  • @ricnar #2201 01:11 PM, 06 Jul 2023

    photo_2023-07-06_13-11-18.jpg
  • @HughEverett ↶ Reply to #2201 #2202 01:11 PM, 06 Jul 2023
    No, keep the last function.
  • @HughEverett #2203 01:12 PM, 06 Jul 2023
    IdtEmulationHandlePageFaults should be called. Otherwise, HyperDbg ignores page-faults and BSOD you immediately. 😅
  • @ricnar #2204 01:12 PM, 06 Jul 2023

    photo_2023-07-06_13-12-30.jpg
  • @HughEverett ↶ Reply to #2204 #2205 01:12 PM, 06 Jul 2023
    👍
  • @HughEverett #2206 01:15 PM, 06 Jul 2023
    If we couldn't solve the problem using page-fault, we could write a simple assembly code that reads the target section and patch the current RIP. That's a simple solution to the problem. But, I'm really curious to see why page-fault handler is not working in this special case. Because generally, it handles thousands of PFs each seconds. So, if it's not working then it should BSOD you immediately, because your system is not able to handle page-faults but this special case is interesting.
  • @ricnar #2207 01:29 PM, 06 Jul 2023

    photo_2023-07-06_13-29-27.jpg
  • @ricnar #2208 01:32 PM, 06 Jul 2023
    the process ctach the exception in some form and closes
  • @ricnar #2209 01:32 PM, 06 Jul 2023
    but at least ican be run again
  • @ricnar #2210 01:32 PM, 06 Jul 2023
    without this modificaion the executable does not run anymore
  • @ricnar #2211 01:33 PM, 06 Jul 2023
    but the exception is catched
  • @ricnar #2212 01:33 PM, 06 Jul 2023
    by the process and it closes
  • @HughEverett #2213 01:33 PM, 06 Jul 2023
    you mean the modification didn't work?
  • @ricnar #2214 01:34 PM, 06 Jul 2023
    previuosly the exception was catched and the process closes and does not run anymore
  • @ricnar #2215 01:34 PM, 06 Jul 2023
    now the exception is catched and the process closes but can run again
  • @ricnar #2216 01:34 PM, 06 Jul 2023
    is better but not enough
  • @ricnar #2217 01:35 PM, 06 Jul 2023
    the process catch the exception and closes
  • @ricnar #2218 01:35 PM, 06 Jul 2023
    this does not change
  • @ricnar #2219 01:36 PM, 06 Jul 2023
    only now the system was not stuck and the process can run again
  • @ricnar #2220 01:37 PM, 06 Jul 2023
    i will try with another packer (with less antidebuggers)
  • @HughEverett #2221 01:37 PM, 06 Jul 2023
    okay, this seems to be a complex problem to solve.
  • @HughEverett #2222 01:38 PM, 06 Jul 2023
    Oh, if the packer get the timestamp of the system, then it can detect the wait time here.
  • @HughEverett ↶ Reply to #2220 #2223 01:39 PM, 06 Jul 2023
    But, I'm currently working on finishing the !monitor's rwx, I'll let you know once it's ready to test.
  • @ricnar #2224 01:55 PM, 06 Jul 2023
    yes
  • @ricnar #2225 01:55 PM, 06 Jul 2023
    i can test
  • @HughEverett ↶ Reply to #2198 #2226 01:55 PM, 06 Jul 2023
    .
  • @HughEverett ↶ Reply to #2226 #2227 01:55 PM, 06 Jul 2023
    My only concern is this.
  • @ricnar #2228 01:56 PM, 06 Jul 2023
    by the way the script method has some problems, with a simple upx canot work
  • @ricnar #2229 01:56 PM, 06 Jul 2023
    and it has no anitidebug or time stamp
  • @ricnar #2230 01:56 PM, 06 Jul 2023
    another method is needed
  • @HughEverett #2231 01:56 PM, 06 Jul 2023
    what's the issue?
  • @ricnar #2232 01:57 PM, 06 Jul 2023
    to stop when the section is used
  • @ricnar #2233 01:57 PM, 06 Jul 2023
    it does not run
  • @ricnar #2234 01:57 PM, 06 Jul 2023
    it does not complete the execution and closes
  • @ricnar #2235 01:57 PM, 06 Jul 2023
    and it cannot be executed again
  • @ricnar #2236 01:58 PM, 06 Jul 2023
    some thing is happenning
  • @HughEverett #2237 01:58 PM, 06 Jul 2023
    I didn't get it, what do you mean that is closes?
  • @ricnar #2238 01:58 PM, 06 Jul 2023
    i disble
  • @ricnar #2239 01:58 PM, 06 Jul 2023

    photo_2023-07-06_13-58-39.jpg
  • @ricnar #2240 01:58 PM, 06 Jul 2023
    press G
  • @HughEverett ↶ Reply to #2234 #2241 01:58 PM, 06 Jul 2023
    Is there any special script that failed?
  • @ricnar #2242 01:58 PM, 06 Jul 2023
    the process can't run
  • @ricnar #2243 01:59 PM, 06 Jul 2023
    and i can run normally
  • @ricnar #2244 01:59 PM, 06 Jul 2023
    but this method affect the execution
  • @HughEverett #2245 01:59 PM, 06 Jul 2023
    You mean after disabling the !exception, the target process crashes?
  • @ricnar #2246 01:59 PM, 06 Jul 2023
    crash or exit
  • @ricnar #2247 02:00 PM, 06 Jul 2023
    it does not run
  • @ricnar #2248 02:00 PM, 06 Jul 2023
    and UPX has no antidebugging tricks
  • @ricnar #2249 02:00 PM, 06 Jul 2023
    after that
  • @ricnar #2250 02:01 PM, 06 Jul 2023
    each new execution with start path
  • @ricnar #2251 02:01 PM, 06 Jul 2023

    photo_2023-07-06_14-01-10.jpg
  • @ricnar #2252 02:01 PM, 06 Jul 2023
    does not stop anymore
  • @HughEverett ↶ Reply to #2252 #2253 02:01 PM, 06 Jul 2023
    This is the problem I mentioned about the '.start'.
  • @ricnar #2254 02:01 PM, 06 Jul 2023
    and is not in the process list
  • @HughEverett #2255 02:01 PM, 06 Jul 2023
    We have to change our implementation.
  • @ricnar #2256 02:01 PM, 06 Jul 2023
    it does not start
  • @ricnar #2257 02:02 PM, 06 Jul 2023
    i see
  • @ricnar #2258 02:02 PM, 06 Jul 2023
    i will try the rwx option when you finish it
  • @HughEverett #2259 02:02 PM, 06 Jul 2023
    All of them will be fixed for the next version.
  • @HughEverett ↶ Reply to #2258 #2260 02:03 PM, 06 Jul 2023
    👌👍
  • @hamed_53_demah #2261 03:04 PM, 06 Jul 2023
    Joined.
  • @HughEverett ↶ Reply to #2223 #2262 04:25 PM, 06 Jul 2023
    I added the initial codes for RWX support in the !monitor command (https://github.com/HyperDbg/HyperDbg/commit/1c08354453f44bc2a075250d808087e2aad49455).

    But I didn't test it yet. So, please wait until I fully test it (hopefully tomorrow) and after that, I'll let you know so you can test it. @ricnar
    initial support for monitor RWX · HyperDbg/HyperDbg@1c08354

    State-of-the-art native debugging tool. Contribute to HyperDbg/HyperDbg development by creating an account on GitHub.

  • @ricnar #2263 04:42 PM, 06 Jul 2023
    Perfect
  • @ricnar #2264 04:43 PM, 06 Jul 2023
    I wait till tomorrow
  • 07 July 2023 (141 messages)
  • @ricnar #2265 08:43 AM, 07 Jul 2023
    Hello
  • @HughEverett ↶ Reply to #2265 #2266 08:52 AM, 07 Jul 2023
    Hi, I didn't finish it yet 😬
    But, I'm gonna start working on that right now.
  • @ricnar #2267 08:53 AM, 07 Jul 2023
    document_2023-07-07_08-53-25.mp4
  • @ricnar #2268 09:20 AM, 07 Jul 2023
    windbg has the command pagein
  • @ricnar #2269 09:20 AM, 07 Jul 2023
    https://learn.microsoft.com/en-us/windows-hardware/drivers/debugger/-pagein--page-in-memory-
    .pagein (Page In Memory) - Windows drivers

    The .pagein command pages in the specified region of memory.

  • @ricnar #2270 09:20 AM, 07 Jul 2023
    The .pagein command pages in the specified region of memory.
  • @HughEverett ↶ Reply to #2269 #2271 09:24 AM, 07 Jul 2023
    We could implment it too, by manually injecting page-faults into the guest. But, the thing is, how we can detect it when the page is finished loading into the memory. Do you have any idea for that?
  • @HughEverett #2272 09:26 AM, 07 Jul 2023
    WinDbg functionalities are compiled by Windows source code, that's how they can put some hooks somewhere in the code and notify the debugger about the last step of page-fault handler. We don't have this option, so we have to find a CPU-based solution.
  • @ricnar #2273 09:35 AM, 07 Jul 2023
    Is there any other way for the system to know that the memory is not paged than by throwing an exception? because the other packaged executable that I have does not stop in the script that catches the exceptions and later you see that the memory is already paged
  • @ricnar #2274 09:36 AM, 07 Jul 2023
    the only difference I see is that the code is much smaller in the latter
  • @ricnar #2275 09:38 AM, 07 Jul 2023
    in the first it stops in the exception when the system is going to paginate that section and in the second it doesn't, it passes by and then you see it paginated
  • @ricnar #2276 09:39 AM, 07 Jul 2023
    or maybe some faults are not captured
  • @HughEverett ↶ Reply to #2273 #2277 09:44 AM, 07 Jul 2023
    If I understand it correctly. The answer is no. The system handles page-fault transparently without throwing exceptions to the user-mode. The user-mode never knows that a page-fault happened during its execution.
  • @ricnar #2278 09:46 AM, 07 Jul 2023
    maybe the state of the page is on a wait list or so an intermediate state, and it does not produce an excepcion?
  • @HughEverett #2279 09:46 AM, 07 Jul 2023
    The user-mode is not supposed to know about page-faults as long as I know.
  • @ricnar #2280 09:49 AM, 07 Jul 2023
    I tried many times yesterday and when it stops at the entry point the section is not paginated, I put the exception command with the script and press G and it starts executing the code in that section without stopping, I can see that it prints the program strings on the console, If I break I see that the section is already paginated with db xxxxx I can see its content, but it never stopped on the exception.
  • @ricnar #2281 09:51 AM, 07 Jul 2023

    photo_2023-07-07_09-51-39.jpg
  • @ricnar #2282 09:52 AM, 07 Jul 2023

    photo_2023-07-07_09-52-04.jpg
  • @HughEverett ↶ Reply to #2278 #2283 09:52 AM, 07 Jul 2023
    Once a page-fault happens the IRQL is raised to higher IRQLs, so, there is no waiting here. The user-mode code is always at PASSIVE_LEVEL which means there is no wait. It should be handled immediately.
  • @ricnar #2284 09:52 AM, 07 Jul 2023

    photo_2023-07-07_09-52-45.jpg
  • @ricnar #2285 09:54 AM, 07 Jul 2023

    photo_2023-07-07_09-54-33.jpg
  • @ricnar #2286 09:54 AM, 07 Jul 2023
    now i press G
  • @HughEverett #2287 09:56 AM, 07 Jul 2023
    The problem is that the debugger continued the system for some time and while hyperdbg is processing the user command, the target module's page fault is arrived and handled.
  • @ricnar #2288 09:57 AM, 07 Jul 2023

    photo_2023-07-07_09-57-16.jpg
  • @HughEverett #2289 09:57 AM, 07 Jul 2023
    After that, HyperDbg configure the !exception and we loose the target #PF.
  • @ricnar #2290 10:00 AM, 07 Jul 2023
    i see
  • @ricnar #2291 10:02 AM, 07 Jul 2023
    maybe put the threads in suspended mode can help?
  • @HughEverett ↶ Reply to #2287 #2292 10:04 AM, 07 Jul 2023
    The way that we currently manage events is sending the user configurations to the user-mode of the debuggee and from user-mode we start sending the buffer to the kernel and then to VMX-root. That's why the debugger continues the debuggee for some times. It's surely not a good design, and has to be changed in the future versions but it's not trivial bug fix. Some of the mechanisms should be changed so we can support setting the events immediately.
  • @HughEverett ↶ Reply to #2291 #2293 10:04 AM, 07 Jul 2023
    Yes, it probably works like this.
  • @HughEverett #2294 10:05 AM, 07 Jul 2023
    Make sure to access to the buffer at least one time, e.g., using assembly code to access the buffer, mov something from it.
  • @HughEverett #2295 10:06 AM, 07 Jul 2023
    After that the address is paged-in.
  • @ricnar #2296 10:09 AM, 07 Jul 2023
    yes this happen, when i press enter to the exception, the program runs
  • @ricnar #2297 10:09 AM, 07 Jul 2023

    photo_2023-07-07_10-09-54.jpg
  • @HughEverett #2298 10:10 AM, 07 Jul 2023
    no
  • @HughEverett ↶ Reply to #2297 #2299 10:10 AM, 07 Jul 2023
    you didn't specify an argument for the !exception.
  • @HughEverett #2300 10:11 AM, 07 Jul 2023
    using the above function you grab ALL exceptions 😅
  • @ricnar #2301 10:11 AM, 07 Jul 2023
    only for try i put the shorter command possible
  • @HughEverett #2302 10:11 AM, 07 Jul 2023
    Starting from 0th entry of IDT to 32nd entry of IDT.
  • @ricnar #2303 10:11 AM, 07 Jul 2023
    and the program runs when i press enter
  • @HughEverett #2304 10:11 AM, 07 Jul 2023
    Just intercept page-faults using '!exception e'
  • @HughEverett #2305 10:11 AM, 07 Jul 2023
    this 'e' refers to page-faults.
  • @ricnar #2306 10:12 AM, 07 Jul 2023
    the goal was look if the program continues running when i press enter
  • @ricnar #2307 10:12 AM, 07 Jul 2023
    and it does
  • @HughEverett #2308 10:12 AM, 07 Jul 2023
    so, it continues?
  • @HughEverett #2309 10:12 AM, 07 Jul 2023
    ah, okay.
  • @HughEverett #2310 10:13 AM, 07 Jul 2023
    now, what we can conclude here?
  • @HughEverett #2311 10:13 AM, 07 Jul 2023
    🤔
  • @ricnar #2312 10:15 AM, 07 Jul 2023
    it was not obvious to me the program runs with a instruction not concluded
  • @HughEverett ↶ Reply to #2312 #2313 10:16 AM, 07 Jul 2023
    You suspended the thread? Am I right?
  • @ricnar #2314 10:16 AM, 07 Jul 2023

    photo_2023-07-07_10-16-46.jpg
  • @ricnar #2315 10:16 AM, 07 Jul 2023
    nope
  • @HughEverett #2316 10:16 AM, 07 Jul 2023
    And after that, you were able to access the memory?
  • @ricnar #2317 10:17 AM, 07 Jul 2023
    i does not suspend the thread yet
  • @ricnar #2318 10:17 AM, 07 Jul 2023
    i don't know which is the command to suspend the tthread resume in hyperdbg
  • @ricnar #2319 10:18 AM, 07 Jul 2023
    In my mind I thought that the program was suspended until g t o p was pressed, I had not conceived the possibility that it would run only when executing an instruction
  • @HughEverett #2320 10:19 AM, 07 Jul 2023
    '!exception e' should be followed by a process ID. Otherwise, it gets all page-faults in the system which is not what we expect it.
  • @HughEverett #2321 10:19 AM, 07 Jul 2023
    This is a correct script:

    !exception e pid 1234 script {

    printf("Page-fault happened in process: %x, on address: %llx", $pid, @cr2);

    }
  • @ricnar #2322 10:19 AM, 07 Jul 2023
    yes but is the same
  • @HughEverett ↶ Reply to #2321 #2323 10:19 AM, 07 Jul 2023
    Make sure set the PID.
  • @ricnar #2324 10:20 AM, 07 Jul 2023
    the program will continue running when i press enter
  • @HughEverett ↶ Reply to #2322 #2325 10:20 AM, 07 Jul 2023
    It's the same because, HyperDbg continues the debuggee. And all the page-faults happen in the target process and handled by the system. After that we set it to intercept them, that why we loose it.
  • @HughEverett #2326 10:21 AM, 07 Jul 2023
    We have to find another way, it's probably not a good idea to use page-faults here.
  • @HughEverett #2327 10:21 AM, 07 Jul 2023
    Give me some times, I'll try to run your target packet binary with some injected assembly codes.
  • @HughEverett #2328 10:22 AM, 07 Jul 2023
    Once I finished this !monitor's 'x' feature, I'll come to the packet.
  • @ricnar #2329 10:22 AM, 07 Jul 2023
    this my target now
  • @ricnar #2331 10:22 AM, 07 Jul 2023
    the code is very small
  • @ricnar #2333 10:23 AM, 07 Jul 2023

    photo_2023-07-07_10-23-07.jpg
  • @ricnar #2334 10:23 AM, 07 Jul 2023
    the code section is 7000
  • @HughEverett ↶ Reply to #2331 #2335 10:23 AM, 07 Jul 2023
    yeah it's okay. I think we could use some injected assembly codes to force page-in in the target process. After that, we could formulate our approach as a command in HyperDbg.
  • @ricnar #2336 10:23 AM, 07 Jul 2023
    but only has few lines of code
  • @ricnar #2337 10:24 AM, 07 Jul 2023
    but i don't want you loose your time continue with rwx part
  • @HughEverett #2338 10:24 AM, 07 Jul 2023
    I'll get back to you once the rwx is finished.
  • @HughEverett #2339 10:45 AM, 07 Jul 2023
    The very first results shows that it works (not yet ready available for test). 🧐

    photo_2023-07-07_10-45-09.jpg
  • @ricnar #2340 10:49 AM, 07 Jul 2023
    👍
  • @HughEverett #2341 01:08 PM, 07 Jul 2023
    @ricnar Please switch to the 'dev' branch. It's now ready to test.
  • @HughEverett #2342 01:09 PM, 07 Jul 2023
    Please note that, I changed the '.start' command's mechanism in the 'dev' branch, so in this branch you cannot use the '.start' command for now. You have to wait until I fix the process starting.
  • @HughEverett #2343 01:10 PM, 07 Jul 2023
    And also, please test it on a simple example for now. Together we have to find a solution for the pages that are not paged-in yet. But for now, just test it on simple examples. For example, I test it with 32-bit shellcode.
  • @ricnar #2344 01:11 PM, 07 Jul 2023
    document_2023-07-07_13-11-08.mp4
  • @HughEverett #2345 01:11 PM, 07 Jul 2023
    ExecCodeStack.cpp
  • @HughEverett ↶ Reply to #2345 #2346 01:11 PM, 07 Jul 2023
    This is the code that I test 'rwx' feature.
  • @HughEverett #2347 01:13 PM, 07 Jul 2023
    Please note that, event short-circuiting blocks the execution in the target address. For example, assume that you want to prevent the execution in your target page, in this cases, you should short-circuit the event. E.g.,

    !monitor x 7e0000 7e0999 pid 3a4c script {
    printf("target address is executed: %llx\n", $context);
    event_sc(1);
    }
  • @HughEverett #2348 01:13 PM, 07 Jul 2023
    Adding event_sc(1); will tell HyperDbg to block the execution and don't let the target to run any codes in target page.
  • @HughEverett #2349 01:15 PM, 07 Jul 2023
    But if you don't use event_sc(1); then HyperDbg by default will let the target to be executed normally for only one instruction and after that, a vm-exit happens. Again, the event will be triggered for the next instruction and so on.
  • @ricnar #2350 01:16 PM, 07 Jul 2023
    i will try when complete some work tasks
  • @ricnar #2351 01:16 PM, 07 Jul 2023
    thanks
  • @HughEverett #2352 01:18 PM, 07 Jul 2023
    So, if you don't use event_sc(1); then it's like stepping through the instructions one by one (each instruction in the target address range that wants to be executed will trigger the event). But, if you specify event_sc(1); then it simply blocks the execution and won't let your target code in the target page to run.
  • @ricnar ↶ Reply to #2341 #2353 01:30 PM, 07 Jul 2023
    i will try this git clone -b dev --recursive https://github.com/HyperDbg/HyperDbg.git
    GitHub - HyperDbg/HyperDbg: State-of-the-art native debugging tool

    State-of-the-art native debugging tool. Contribute to HyperDbg/HyperDbg development by creating an account on GitHub.

  • @ricnar #2354 01:30 PM, 07 Jul 2023
    git clone -b dev --recursive https://github.com/HyperDbg/HyperDbg.git
    GitHub - HyperDbg/HyperDbg: State-of-the-art native debugging tool

    State-of-the-art native debugging tool. Contribute to HyperDbg/HyperDbg development by creating an account on GitHub.

  • @ricnar #2355 01:44 PM, 07 Jul 2023

    photo_2023-07-07_13-44-21.jpg
  • @HughEverett ↶ Reply to #2355 #2356 01:44 PM, 07 Jul 2023
    this is a 32-bit shell code.
  • @ricnar #2357 01:45 PM, 07 Jul 2023
    ah
  • @ricnar #2358 01:49 PM, 07 Jul 2023

    photo_2023-07-07_13-49-29.jpg
  • @HughEverett ↶ Reply to #2358 #2359 01:49 PM, 07 Jul 2023
    You missed the last }
  • @HughEverett #2360 01:50 PM, 07 Jul 2023
    }
  • @ricnar #2361 01:50 PM, 07 Jul 2023
    oh
  • @ricnar #2362 01:53 PM, 07 Jul 2023

    photo_2023-07-07_13-53-59.jpg
  • @ricnar #2363 01:55 PM, 07 Jul 2023

    photo_2023-07-07_13-55-51.jpg
  • @ricnar #2364 01:56 PM, 07 Jul 2023
    if I break its stopped in the line
  • @HughEverett ↶ Reply to #2362 #2365 01:56 PM, 07 Jul 2023
    Yes. It seems that it's working. Did you expecting the same?
  • @ricnar #2366 01:56 PM, 07 Jul 2023
    but it works
  • @ricnar #2367 01:56 PM, 07 Jul 2023
    but
  • @ricnar #2368 01:56 PM, 07 Jul 2023
    the repeating lines are not cool
  • @ricnar #2369 01:57 PM, 07 Jul 2023
    if it can stop at once without break will be better
  • @HughEverett #2370 01:57 PM, 07 Jul 2023
    So, why do you switch to the process? You can use pause(); in your script.
  • @ricnar #2371 01:57 PM, 07 Jul 2023
    ah
  • @ricnar #2372 01:57 PM, 07 Jul 2023
    i copied lexactly like you gave me
  • @ricnar #2373 01:57 PM, 07 Jul 2023
    i will add the pause
  • @HughEverett #2374 01:58 PM, 07 Jul 2023
    yes. I mean if you want to break in this case, instead of switching to the target process, you can use pause();
  • @ricnar #2375 02:00 PM, 07 Jul 2023

    photo_2023-07-07_14-00-07.jpg
  • @HughEverett ↶ Reply to #2368 #2376 02:00 PM, 07 Jul 2023
    No, the repetition is because Windows tries to run instruction in that special page, but each time HyperDbg blocks it. So, it again attempts to context switch to the target process and execute the instruction, again blocked. That's why you see repeating lines.
  • @ricnar #2377 02:00 PM, 07 Jul 2023
    yes it worked using pause
  • @HughEverett ↶ Reply to #2376 #2378 02:00 PM, 07 Jul 2023
    You can remove the 'printf' and it won't show anything.
  • @HughEverett ↶ Reply to #2377 #2379 02:01 PM, 07 Jul 2023
    Great. Is exactly the thing you want?
  • @ricnar #2380 02:01 PM, 07 Jul 2023

    photo_2023-07-07_14-01-52.jpg
  • @ricnar #2381 02:01 PM, 07 Jul 2023
    yes
  • @ricnar #2382 02:02 PM, 07 Jul 2023
    the only problem now is the pages
  • @HughEverett #2383 02:02 PM, 07 Jul 2023
    I think we could now find solutions for two remained problems. First, fixing the '.start' command so we can start processes correctly, second, we should find a way to bring pages-in.
  • @ricnar #2384 02:02 PM, 07 Jul 2023
    non paged
  • @ricnar #2385 02:02 PM, 07 Jul 2023
    thanks
  • @ricnar #2386 02:02 PM, 07 Jul 2023
    great job
  • @HughEverett ↶ Reply to #2382 #2387 02:03 PM, 07 Jul 2023
    Yes. Let me ask from my folks in twitter to see if they have any idea of how we can intercept the execution after injecting #PFs.
  • @ricnar #2388 02:03 PM, 07 Jul 2023
    document_2023-07-07_14-03-50.mp4
  • @5138215154 #2389 05:46 PM, 07 Jul 2023
    Hey, cool project. I setup 2 vms (since I'm on linux) but upon connecting via serial, it just hangs. I'm using latest dev version.

    I ran the following command on my host vm first: .debug remote serial 115200 com2
    And when I try to connect from the guest vm, it just gets stuck (see image). Any ideas how to fix or debug that?

    photo_2023-07-07_17-46-41.jpg
  • @HughEverett ↶ Reply to #2389 #2390 05:59 PM, 07 Jul 2023
    Hi,
    Thanks for using HyperDbg ^^

    First of all, always make sure to test the latest source code from the 'master' branch. Don't use the 'dev' branch as it might not work as expected.

    Another question, are you using VMware workstation?

    The order of commands that you used it wrong. First, you should listen on the debugger, after that you can run the debuggee. I think you didn't do it in order.
  • @HughEverett ↶ Reply to #2389 #2391 06:01 PM, 07 Jul 2023
    And something to check. What is the COM port on debuggee and debugger? Can you verify that it's working and connected correctly? For example, by using a serial program like Putty or XCTU. Just make sure that you can send data successfully.
  • @5138215154 ↶ Reply to #2390 #2392 07:17 PM, 07 Jul 2023
    I'm using Virt-manager with Qemu/KVM on Linux. That's why I have 2 virtual machines with Windows connected over a serial port. I got it working now, but I get another error that the checksum is invalid. I'm using v0.3.0

    photo_2023-07-07_19-17-03.jpg
  • @5138215154 #2393 07:25 PM, 07 Jul 2023
    Double checked with Putty, I'm getting data.

    photo_2023-07-07_19-25-40.jpg
  • @HughEverett ↶ Reply to #2392 #2394 07:26 PM, 07 Jul 2023
    We never test HyperDbg on such a virtual machine. So, it might not work. But, it might work and the fastest way to check it, is connecting in VMI mode. Instead of connecting to another VM, try to see if the hypervisor is successfully loading in local debugging or not.
  • @HughEverett #2395 07:26 PM, 07 Jul 2023
    Run these commands in your VM:

    .connect local
    load vmm
  • @HughEverett ↶ Reply to #2395 #2396 07:27 PM, 07 Jul 2023
    And let me know, if these commands freeze or BSOD your system or if it's working.
  • @5138215154 ↶ Reply to #2396 #2397 07:31 PM, 07 Jul 2023
    yes, it's working. but i can't really do much in vmi mode. Most of the time I just get the warning that it's still in beta and not stable

    photo_2023-07-07_19-31-21.jpg
  • @5138215154 ↶ Reply to #2396 #2398 07:31 PM, 07 Jul 2023

    photo_2023-07-07_19-31-22.jpg
  • @HughEverett ↶ Reply to #2397 #2399 07:34 PM, 07 Jul 2023
    Oh, that's a really good news that it's working there. 😅
  • @HughEverett ↶ Reply to #2398 #2400 07:35 PM, 07 Jul 2023
    Okay, now let's return to our case, what happens once you connect over serial? Is there any error? Do you see checksum errors?
  • @HughEverett #2401 07:36 PM, 07 Jul 2023
    Will it freeze the system? Or you can use your system after that?
  • @5138215154 #2402 07:43 PM, 07 Jul 2023
    No, it's just the hyperdbg-cli window that freezes. The system continues to work normally.
  • @HughEverett ↶ Reply to #2402 #2403 07:45 PM, 07 Jul 2023
    Okay, so we can conclude that it's a user-mode bug and fortunately user-mode bugs are easy to investigate. Do you have the VS2022+WDK in your target machine to build HyperDbg?
  • @HughEverett ↶ Reply to #2403 #2404 07:46 PM, 07 Jul 2023
    I'm thinking of tracing HyperDbg using VS debugger to see where it stucked that leads to freezing its user-mode part.
  • @5138215154 #2405 07:51 PM, 07 Jul 2023
    Unfortunately the serial connection seems to be kinda unstable. Now I can't connect anymore, even though I didn't change anything. I'll try and setup hyperdbg locally and get the bug reproduced.
  • @HughEverett ↶ Reply to #2405 #2406 07:53 PM, 07 Jul 2023
    Let me know if you find anything about it. This is a good news that HyperDbg works on KVM (at least on VMI mode). We have to make it stable and create a documentation entry about running it on KVM.
  • @5138215154 ↶ Reply to #2406 #2407 08:51 PM, 07 Jul 2023
    placed a breakpoint on the checksum error to find all the packets that are not valid.
    Screencast from 2023-07-07 22-44-58.webm
  • 08 July 2023 (6 messages)
  • @Ffcbht #2408 06:29 AM, 08 Jul 2023
    Joined.
  • @HughEverett ↶ Reply to #2407 #2409 09:02 AM, 08 Jul 2023
    This is really weird. Because serial ports in virtual machine are supposed to transmit data without error. The same error was reported by @prekvapko on physical systems. So, I'm thinking of maybe a raise condition exists somewhere in transmission of data which won't reveal itself because of the way VMware workstation transmits the data. 🤔
  • @HughEverett #2411 09:12 AM, 08 Jul 2023
    By the way, I'm not familiar with virtualization in Linux at all. I only used virtualbox on Linux. But I'm gonna test this problem after I solved the problem with the '.start' and bringing the pages in. Is virt-manager the most popular way of using KVM in Linux? Is there any alternatives? What is the easiest and most used way of using KVM in the way that I can test HyperDbg on Windows?
  • @prekvapko #2412 10:59 AM, 08 Jul 2023
    Qemu?
  • @HughEverett ↶ Reply to #2412 #2413 11:08 AM, 08 Jul 2023
    I don't know that much about Qemu but from what I know they used Qemu in KVM. For example, instead of handling continuous VM-exits for serving IOMMUs, they used Qemu to emulate MOV instructions, preventing unnecessary VM-exits (EPT violations). Other than that, I don't have any idea how Qemu is related to KVM. If anybody knows, I would be thankful to know.
  • @symeonp ↶ Reply to #2413 #2414 08:09 PM, 08 Jul 2023
    would that help you a bit?
    https://doar-e.github.io/blog/2021/07/15/building-a-new-snapshot-fuzzer-fuzzing-ida/#2-fast-2-furious-kvm-backend
    Building a new snapshot fuzzer & fuzzing IDA
  • 09 July 2023 (1 messages)
  • @HughEverett ↶ Reply to #2414 #2415 12:13 PM, 09 Jul 2023
    yes, thanks
  • 10 July 2023 (225 messages)
  • @ricnar #2416 11:37 AM, 10 Jul 2023
    hello
  • @ricnar #2417 11:38 AM, 10 Jul 2023
    i,m triying to connect two vms to use hyoperdbg
  • @ricnar #2418 11:38 AM, 10 Jul 2023
    i set the target as usual with its serial port
  • @ricnar #2419 11:38 AM, 10 Jul 2023

    photo_2023-07-10_11-38-52.jpg
  • @ricnar #2420 11:39 AM, 10 Jul 2023
    in the host vm i add the same serial port
  • @ricnar #2421 11:39 AM, 10 Jul 2023

    photo_2023-07-10_11-39-36.jpg
  • @ricnar #2422 11:39 AM, 10 Jul 2023
    can be connected in this way?
  • @ricnar #2423 11:40 AM, 10 Jul 2023
    the target machine tries to connect to the com port of my physical machine
  • @ricnar #2424 11:40 AM, 10 Jul 2023
    not the host vm
  • @HughEverett ↶ Reply to #2416 #2425 11:40 AM, 10 Jul 2023
    Hi,
    Just for your information, the problem with the '.start' command is fixed and the code is now in a working state (in the 'dev' branch), and right now I'm working on adding the '.pagein' equivalent command to the HyperDbg, it will probably finished tomorrow.
  • @ricnar #2426 11:41 AM, 10 Jul 2023

    photo_2023-07-10_11-41-27.jpg
  • @ricnar #2427 11:41 AM, 10 Jul 2023
    thanks
  • @ricnar #2428 11:42 AM, 10 Jul 2023
    i'm using this guide
  • @ricnar #2429 11:42 AM, 10 Jul 2023
    https://community.spiceworks.com/topic/1632797-allow-multiple-vmware-vms-to-use-single-serial-port
    Allow Multiple VMWare VMs To Use Single Serial Port

    I have a server with a single physical serial port. I'm running ESXi 5.5. I would like to allow two (or more) virtual machines to use this port. Does anybody know if this can be...

  • @HughEverett ↶ Reply to #2426 #2430 11:42 AM, 10 Jul 2023
    Of course, the namedpipe is not valid in the target guest. I've never connect it like this but I'm sure several users reported that they connect it like this.
  • @ricnar #2432 11:44 AM, 10 Jul 2023
    in the host
  • @HughEverett ↶ Reply to #2432 #2433 11:44 AM, 10 Jul 2023
    🤨🤨
  • @ricnar #2434 11:47 AM, 10 Jul 2023
    the guide https://community.spiceworks.com/topic/1632797-allow-multiple-vmware-vms-to-use-single-serial-port
    Allow Multiple VMWare VMs To Use Single Serial Port

    I have a server with a single physical serial port. I'm running ESXi 5.5. I would like to allow two (or more) virtual machines to use this port. Does anybody know if this can be...

  • @ricnar #2435 11:47 AM, 10 Jul 2023
    says the named pipes will be available to both vm
  • @ricnar ↶ Reply to #2425 #2436 11:49 AM, 10 Jul 2023
    this will be awesome thanks
  • @ricnar #2437 11:54 AM, 10 Jul 2023

    photo_2023-07-10_11-54-20.jpg
  • @ricnar #2438 11:54 AM, 10 Jul 2023
    it connects to the physical machine
  • @ricnar #2439 11:54 AM, 10 Jul 2023
    not to the vm
  • @ricnar #2440 11:58 AM, 10 Jul 2023
    seems this not work between two vms directly maybe only if the target vm is nested inside the host
  • @HughEverett ↶ Reply to #2440 #2441 11:59 AM, 10 Jul 2023
    I think it's better to test it with other serial port applications like XCTU or PuTTY.
  • @HughEverett #2442 12:01 PM, 10 Jul 2023
    Because, generally, HyperDbg just needs a simple serial connection, and there is no need to load driver, etc. Maybe it's better to test the serial connection with simple serial listening applications and after that we can use it in HyperDbg.
  • @HughEverett ↶ Reply to #2440 #2443 12:16 PM, 10 Jul 2023
    Btw, if none of them worked, there are some applications that create virtual serial drives on the host. I think you can use them to create serveral virtual serial devices and then use VMware to connect them together. But, that's probably a very weird approach 😅
  • @ricnar #2444 12:20 PM, 10 Jul 2023
    seems i missed one step
  • @ricnar #2445 12:21 PM, 10 Jul 2023

    photo_2023-07-10_12-21-05.jpg
  • @ricnar #2446 12:21 PM, 10 Jul 2023
    i don;t know if this work with hyperdbg
  • @ricnar #2447 12:22 PM, 10 Jul 2023
    seems to be for windbg
  • @HughEverett ↶ Reply to #2447 #2448 12:23 PM, 10 Jul 2023
    I think it's the same. I mean as long as there is a simple serial connection between 2 VMs, HyperDbg is able to work.
  • @ricnar #2449 12:34 PM, 10 Jul 2023

    photo_2023-07-10_12-34-34.jpg
  • @ricnar #2450 12:34 PM, 10 Jul 2023
    virtual serial ports are available
  • @ricnar #2451 12:34 PM, 10 Jul 2023
    in both machines
  • @HughEverett #2453 12:36 PM, 10 Jul 2023
    Are you sure that the named pipe version is valid? Can you run HyperDbg debugger (not debuggee)? Will it listen for the connection?
  • @ricnar #2454 12:38 PM, 10 Jul 2023
    i connected to the same target from the physical machine
  • @ricnar #2455 12:38 PM, 10 Jul 2023
    both machines has the same version
  • @HughEverett ↶ Reply to #2454 #2456 12:39 PM, 10 Jul 2023
    Do you mean that you connect guest to the host?
  • @ricnar #2457 12:44 PM, 10 Jul 2023
    nop
  • @ricnar #2458 12:45 PM, 10 Jul 2023
    i cannot connect
  • @ricnar #2459 12:45 PM, 10 Jul 2023
    the serial port is not recognized
  • @ricnar #2460 12:45 PM, 10 Jul 2023

    photo_2023-07-10_12-45-39.jpg
  • @ricnar #2461 12:45 PM, 10 Jul 2023
    using com2 seems to coonect but
  • @ricnar #2462 12:46 PM, 10 Jul 2023
    when i reset the target it remains connected
  • @ricnar #2463 12:46 PM, 10 Jul 2023
    this is bad
  • @ricnar #2464 12:46 PM, 10 Jul 2023
    but the target cannot connect
  • @HughEverett ↶ Reply to #2460 #2465 12:46 PM, 10 Jul 2023
    As it shows the named pipe is not valid. I think VMware won't connect named pipe to the guest VMs.
  • @ricnar #2466 12:47 PM, 10 Jul 2023

    photo_2023-07-10_12-47-24.jpg
  • @ricnar #2467 12:48 PM, 10 Jul 2023
    when i made this connection from pyhisical machine if i reset the target it disconnects
  • @ricnar #2468 12:48 PM, 10 Jul 2023
    using vms the host remain connected
  • @ricnar #2469 12:48 PM, 10 Jul 2023
    this is a bad signal
  • @HughEverett #2470 12:49 PM, 10 Jul 2023
    Are you sure that COM2 is connected to the correct VM? Can you verify it? You should use for example putty, or XCTU to send and receive something over serial.
  • @HughEverett ↶ Reply to #2467 #2471 12:50 PM, 10 Jul 2023
    This method will prove whether the serial connection is working or not.
  • @ricnar #2472 12:50 PM, 10 Jul 2023
    it is connecting to the physical machine to me
  • @HughEverett ↶ Reply to #2472 #2473 12:52 PM, 10 Jul 2023
    So, it's a VMware misconfiguration. Am I right?
  • @HughEverett #2474 12:54 PM, 10 Jul 2023
    I'm pretty sure someone did the same thing. I think it was mentioned in OST2 discussions. Let me check it.
  • @ricnar ↶ Reply to #2473 #2475 12:54 PM, 10 Jul 2023
    i think so
  • @ricnar #2476 12:56 PM, 10 Jul 2023
    using serial ports always was a pain to me
  • @ricnar #2477 12:57 PM, 10 Jul 2023
    for this reason i was relieved when windbg add net connection
  • @ricnar #2478 01:02 PM, 10 Jul 2023
    uau
  • @ricnar #2479 01:02 PM, 10 Jul 2023
    it works
  • @ricnar #2480 01:03 PM, 10 Jul 2023

    photo_2023-07-10_13-03-00.jpg
  • @ricnar #2481 01:03 PM, 10 Jul 2023

    photo_2023-07-10_13-03-16.jpg
  • @ricnar #2482 01:04 PM, 10 Jul 2023
    It seems that it doesn't realize when you reset the target but the same if after resetting you connect the target using com2 it works
  • @ricnar #2483 01:04 PM, 10 Jul 2023
    it works
  • @HughEverett ↶ Reply to #2483 #2484 01:07 PM, 10 Jul 2023
    Oh, that's great. I have to add an explanation about how to connect two VMs to the docs.
  • @ricnar #2485 01:08 PM, 10 Jul 2023
    i follow this
  • @ricnar #2486 01:08 PM, 10 Jul 2023
    https://voidsec.com/windows-kernel-debugging-exploitation/
    Windows Kernel Debugging & Exploitation Part1 – Setting up the lab - VoidSec

    How-to set up a VMware lab with Windows Kernel mode debugging enabled via Serial Port (or UART), a step by step guide.

  • @ricnar #2487 01:08 PM, 10 Jul 2023
    this method has some little differences
  • @HughEverett ↶ Reply to #2482 #2488 01:09 PM, 10 Jul 2023
    Also, make sure to test new implemention of the '.start' command. Pull it from the git's dev branch. I'll add the .pagein command tomorrow.
  • @HughEverett ↶ Reply to #2486 #2489 01:09 PM, 10 Jul 2023
    Thanks 🙏
  • @ricnar #2490 01:09 PM, 10 Jul 2023
    i changed this
  • @ricnar #2491 01:09 PM, 10 Jul 2023

    photo_2023-07-10_13-09-27.jpg
  • @ricnar #2492 01:09 PM, 10 Jul 2023
    and made this modifications
  • @ricnar #2493 01:10 PM, 10 Jul 2023

    photo_2023-07-10_13-10-00.jpg
  • @HughEverett ↶ Reply to #2493 #2494 01:10 PM, 10 Jul 2023
    Thanks 👍
  • @ricnar #2495 01:10 PM, 10 Jul 2023
    maybe is not important
  • @ricnar #2496 01:10 PM, 10 Jul 2023
    but now it works
  • @ricnar #2497 01:26 PM, 10 Jul 2023
    Perhaps these last changes were not necessary and testing as it was before, it still worked just using the port number instead of the pipe name
  • @ricnar #2498 01:28 PM, 10 Jul 2023
    What happened to me is that when I restarted the target to disable the signatures, the host did not disconnect, so I did not continue testing and stopped at that point, surely it would connect the same after restarting the target
  • @ricnar #2499 01:51 PM, 10 Jul 2023
    ups
  • @ricnar #2500 01:52 PM, 10 Jul 2023

    photo_2023-07-10_13-52-00.jpg
  • @ricnar #2501 01:52 PM, 10 Jul 2023
    when i press G a BSOD happen
  • @HughEverett ↶ Reply to #2500 #2502 01:53 PM, 10 Jul 2023
    Is it reproducible?
  • @ricnar #2503 01:53 PM, 10 Jul 2023
    i will retry now
  • @ricnar #2504 02:04 PM, 10 Jul 2023
    the host is waiting
  • @ricnar #2505 02:04 PM, 10 Jul 2023

    photo_2023-07-10_14-04-53.jpg
  • @ricnar #2506 02:10 PM, 10 Jul 2023

    photo_2023-07-10_14-10-10.jpg
  • @ricnar #2507 02:10 PM, 10 Jul 2023
    i will break in the host with ctrl +c
  • @ricnar #2508 02:10 PM, 10 Jul 2023

    photo_2023-07-10_14-10-34.jpg
  • @ricnar #2509 02:10 PM, 10 Jul 2023

    photo_2023-07-10_14-10-49.jpg
  • @ricnar #2510 02:11 PM, 10 Jul 2023
    now i will resume typing G
  • @ricnar #2511 02:11 PM, 10 Jul 2023
    now it works
  • @ricnar #2512 02:11 PM, 10 Jul 2023
    the target is running
  • @ricnar #2513 02:11 PM, 10 Jul 2023
    i will break again
  • @ricnar #2514 02:13 PM, 10 Jul 2023
    sym download will not connect i'm in host only mode
  • @HughEverett ↶ Reply to #2514 #2515 02:14 PM, 10 Jul 2023
    Will not download? Are you sure the connection to the internet is okay?
  • @ricnar #2516 02:15 PM, 10 Jul 2023
    host only does not have internet connection
  • @ricnar #2517 02:15 PM, 10 Jul 2023
    only between vms
  • @ricnar #2518 02:16 PM, 10 Jul 2023
    i copied the symbols downloaded in the physical machine
  • @ricnar #2519 02:16 PM, 10 Jul 2023
    the target was the same
  • @ricnar #2520 02:17 PM, 10 Jul 2023

    photo_2023-07-10_14-17-02.jpg
  • @HughEverett #2521 02:17 PM, 10 Jul 2023
    So, did you configure the symbol path in target machine?
  • @ricnar #2522 02:17 PM, 10 Jul 2023
    no
  • @ricnar #2523 02:18 PM, 10 Jul 2023
    in the host vm
  • @ricnar #2524 02:18 PM, 10 Jul 2023

    photo_2023-07-10_14-18-03.jpg
  • @ricnar #2525 02:18 PM, 10 Jul 2023
    i copied from the phisycal host to the vm host
  • @HughEverett #2526 02:18 PM, 10 Jul 2023
    So, it isn't loaded?
  • @ricnar #2527 02:18 PM, 10 Jul 2023
    the symbols downloaded from previus sesions with the same target
  • @ricnar #2528 02:18 PM, 10 Jul 2023
    it loads the copied symbols
  • @ricnar #2529 02:19 PM, 10 Jul 2023
    the symbols are the same
  • @ricnar #2530 02:19 PM, 10 Jul 2023
    when i debug the same target from the physical machine
  • @ricnar #2531 02:19 PM, 10 Jul 2023
    i copied to the vm host from the physical machine
  • @ricnar #2532 02:19 PM, 10 Jul 2023
    it works
  • @ricnar #2533 02:20 PM, 10 Jul 2023
    not BSOD in this try
  • @ricnar #2534 02:24 PM, 10 Jul 2023
    is more verbose
  • @ricnar #2535 02:24 PM, 10 Jul 2023

    photo_2023-07-10_14-24-11.jpg
  • @HughEverett ↶ Reply to #2535 #2536 02:24 PM, 10 Jul 2023
    No, you didn't pull the latest commit.
  • @ricnar #2537 02:24 PM, 10 Jul 2023
    but is the previous dev version, now i will download the last dev version
  • @ricnar #2538 02:25 PM, 10 Jul 2023
    yes
  • @ricnar #2539 02:25 PM, 10 Jul 2023
    this is the previous
  • @ricnar #2540 02:25 PM, 10 Jul 2023
    i will download now
  • @ricnar #2541 02:32 PM, 10 Jul 2023

    photo_2023-07-10_14-32-10.jpg
  • @ricnar #2542 02:32 PM, 10 Jul 2023
    i fetch and it tells me there is no new commits
  • @HughEverett ↶ Reply to #2542 #2543 02:33 PM, 10 Jul 2023
    https://github.com/HyperDbg/HyperDbg/tree/dev
    GitHub - HyperDbg/HyperDbg at dev

    State-of-the-art native debugging tool. Contribute to HyperDbg/HyperDbg development by creating an account on GitHub.

  • @ricnar #2544 02:33 PM, 10 Jul 2023
    this is the repo
  • @HughEverett ↶ Reply to #2542 #2545 02:34 PM, 10 Jul 2023
    There multiple commits after that. There is a problem with your fetch application. Can you use 'git pull' command?
  • @ricnar #2546 02:34 PM, 10 Jul 2023
    but there is no changes from the last
  • @ricnar #2547 02:34 PM, 10 Jul 2023
    i will try
  • @HughEverett ↶ Reply to #2547 #2548 02:35 PM, 10 Jul 2023
    And also make sure you have an internet connection as you're running between two isolated VMs.
  • @ricnar #2549 02:35 PM, 10 Jul 2023
    this is not the last?
  • @ricnar #2550 02:35 PM, 10 Jul 2023

    photo_2023-07-10_14-35-21.jpg
  • @ricnar #2551 02:35 PM, 10 Jul 2023
    10/7
  • @ricnar #2552 02:35 PM, 10 Jul 2023
    is today
  • @HughEverett ↶ Reply to #2550 #2553 02:35 PM, 10 Jul 2023
    It's the latest 👍
  • @ricnar #2554 02:36 PM, 10 Jul 2023
    i pull and it adjusts
  • @ricnar #2555 02:37 PM, 10 Jul 2023
    i am building now
  • @ricnar #2556 03:21 PM, 10 Jul 2023

    photo_2023-07-10_15-21-02.jpg
  • @ricnar #2557 03:21 PM, 10 Jul 2023

    photo_2023-07-10_15-21-37.jpg
  • @HughEverett ↶ Reply to #2557 #2558 03:24 PM, 10 Jul 2023
    Works as expected?
  • @ricnar #2559 03:26 PM, 10 Jul 2023

    photo_2023-07-10_15-26-47.jpg
  • @ricnar #2560 03:27 PM, 10 Jul 2023

    photo_2023-07-10_15-27-14.jpg
  • @ricnar #2561 03:27 PM, 10 Jul 2023
    sorry
  • @ricnar #2562 03:28 PM, 10 Jul 2023
    i copy the 64 bits version
  • @ricnar #2563 03:28 PM, 10 Jul 2023
    i forgot is the 32 bits version
  • @ricnar #2564 03:33 PM, 10 Jul 2023

    photo_2023-07-10_15-33-06.jpg
  • @ricnar #2565 03:33 PM, 10 Jul 2023

    photo_2023-07-10_15-33-21.jpg
  • @ricnar #2566 03:34 PM, 10 Jul 2023
    the allocated buffer seems to be not paged yet
  • @ricnar #2567 03:34 PM, 10 Jul 2023
    but you are working on this
  • @ricnar #2568 03:35 PM, 10 Jul 2023
    was the context changed?
  • @ricnar #2569 03:35 PM, 10 Jul 2023

    photo_2023-07-10_15-35-36.jpg
  • @ricnar #2570 03:39 PM, 10 Jul 2023
    seems to be a problem with the print of the buffer, when it stops in the entry point is not printedd yet
  • @ricnar #2571 03:39 PM, 10 Jul 2023
    but when i press G it prints and ends loading without press any key
  • @ricnar #2572 03:39 PM, 10 Jul 2023
    maybe some key press is cached
  • @ricnar #2573 03:40 PM, 10 Jul 2023
    but the entry point works
  • @ricnar #2574 03:40 PM, 10 Jul 2023
    the only concern is if it will be detected if is a software breakpoint
  • @ricnar #2575 03:41 PM, 10 Jul 2023
    some programs looks if the entry point has CC and exits
  • @ricnar #2576 03:41 PM, 10 Jul 2023
    in TLS for example
  • @HughEverett ↶ Reply to #2567 #2577 03:42 PM, 10 Jul 2023
    Yes. The only thing that remain unsolved is the '.pagein' command which hopefully will be finished tomorrow.
  • @ricnar #2578 03:42 PM, 10 Jul 2023
    its executed previous to the entry point
  • @ricnar #2579 03:42 PM, 10 Jul 2023
    and it can check if the entry point has a CC
  • @ricnar #2580 03:42 PM, 10 Jul 2023
    and exits
  • @ricnar #2581 03:42 PM, 10 Jul 2023
    but all the debuggers put a CC in the entry point
  • @ricnar #2582 03:42 PM, 10 Jul 2023
    maybe there is not better solution
  • @HughEverett #2583 03:43 PM, 10 Jul 2023
    We could hide it by EPT.
  • @HughEverett ↶ Reply to #2582 #2584 03:43 PM, 10 Jul 2023
    No, it's pretty fine we could easily mitigate this problem but employing EPT.
  • @ricnar #2585 03:43 PM, 10 Jul 2023
    perfect
  • @ricnar #2586 03:44 PM, 10 Jul 2023
    let me know when you have the page in ready to try thanks
  • @HughEverett ↶ Reply to #2586 #2587 03:47 PM, 10 Jul 2023
    The idea is to inject #PF to the debuggee while setting the trap flag (RFLAGS.TF), so once the debuggee is continued, the page-fault is delivered to operating system and after running one instruction from the current context, a #DB is thrown which leads to a VM-exit and HyperDbg captures the debugee again.
  • @ricnar #2588 03:58 PM, 10 Jul 2023
    the monitor x works
  • 1
  • 2
  • 3
  • 4
  • 5
  • 01 Jul 2023 (23)
  • 02 Jul 2023 (9)
  • 03 Jul 2023 (238)
  • 04 Jul 2023 (6)
  • 05 Jul 2023 (110)
  • 06 Jul 2023 (295)
  • 07 Jul 2023 (141)
  • 08 Jul 2023 (6)
  • 09 Jul 2023 (1)
  • 10 Jul 2023 (225)
  • 11 Jul 2023 (164)
  • 12 Jul 2023 (48)
  • 13 Jul 2023 (114)
  • 14 Jul 2023 (14)
  • 15 Jul 2023 (31)
  • 16 Jul 2023 (34)
  • 17 Jul 2023 (6)
  • 18 Jul 2023 (17)
  • 19 Jul 2023 (22)
  • 20 Jul 2023 (10)
  • 21 Jul 2023 (2)
  • 22 Jul 2023 (14)
  • 23 Jul 2023 (121)
  • 24 Jul 2023 (43)
  • 25 Jul 2023 (5)
  • 26 Jul 2023 (29)
  • 27 Jul 2023 (19)
  • 28 Jul 2023 (1)
  • 29 Jul 2023 (7)
  • 30 Jul 2023 (396)
  • 31 Jul 2023 (64)