8 bytes unsigned int (u64) to javascript ‘number’

I have a u64 (unsigned integer) stored in 8 bytes of memory. Clearly the range is 0-2^64 integers.

I am converting it to a javascript number by turning each byte into hex and making a hex string:

let s = '0x'
s += buffer.slice(0,1).toString("hex")
s += buffer.slice(1,2).toString("hex")
...
n = parseInt(s)

Works great for everything I have done so far.

But when I look at how javascript stores numbers, I become unsure. Javascript uses 8 bytes for numbers, but treats all numbers the same. This internal javascript “number” representation can also hold floating point numbers.

Can a javascript number store all integers from 0 to 2^64 ?

cryptography – Zerologon vulnerability (CVE-2020-1472)- does the client challenge have to be eight 0 bytes for the session key to be uniformly distributed?

so I was digging into the Whitepaper published by Secura about the Zerologon vulnerability (https://www.secura.com/pathtoimg.php?id=2055) and I was wondering:
is it required that the client challenge will be eight 0x00 bytes for the session key to be uniformly distributed, thereby rendering the probability for an output of a 0x00 byte 1/256, or will a randomly generated client challenge will also result in the same probability?

thanks!

sql server – ¿Error al obtener el un valor de tipo bytes en visual basic?

He recibido un error al obtener un valor de tipo bytes que devuelve un procedimiento almacenado al pasarlo a un objeto.

Mi Objeto

Public Class SolicitudDevModel

    Private Data As Byte()
    Public Property _Data() As Byte()
        Get
            Return Data
        End Get
        Set(ByVal value As Byte())
            Data = value
        End Set
    End Property


End Class

Mi Método que recibe los datos que devuelve mi procedimiento almacenado

Public Function rptDevolucionVacios(ByVal numSolicitud As Integer, ByVal usuario As String) As List(Of SolicitudDevModel)
        Dim listaDev As New List(Of SolicitudDevModel)

        Try
            Dim cn As SqlConnection = New SqlConnection(cadenadeConexion)
            Dim cmd As SqlCommand = New SqlCommand("spListadoVaDocumentosSolDevElecCodigo", cn)
            'cmd.Connection = cn'
            cn.Open()
            cmd.CommandType = CommandType.StoredProcedure
            cmd.Parameters.AddWithValue("@NumSolVacElec", numSolicitud)
            cmd.Parameters.AddWithValue("@usuario", usuario)

            Using dr As SqlDataReader = cmd.ExecuteReader()
                If dr.HasRows Then
                    While dr.Read()
                        Dim objDev As New SolicitudDevModel With {

                            ._Data = dr.GetBytes(0) 'Error al obtener el campo de tipo varbinary(max) sql server'

                        }
                        listaDev.Add(objDev)
                    End While
                End If
            End Using
            cn.Close()


        Catch ex As Exception
            Throw
        End Try

        Return listaDev
    End Function

El error que me marca el codigo resaltado dice lo siguiente:

error de resolucion de sobrecarga porque ninguna de las funciones getBytes a las que se tiene acceso acepta este numero de argumentos

file recovery – How to recover a Word document on a Mac that was spontaneously turned to 0 bytes?

I was working on a rather large ~25 page document with track changes. I was saving it frequently and suddenly the most recent time I saved it, it closed and turned into a 0 byte document. I am not sure how to recover it.

One issue is that the document may have been saved originally in the “com.microsoft.Word” container on my computer (because that’s where it appears I saved it after an earlier auto-recovery.)

I tried the EaseUS Data Recovery Wizard, and there was a folder called “Other lost files” with an executable file called “temp25058742” that was last modified at the time where my document disappeared that was roughly the same number of megabytes as my document. I was wondering if anyone knows if it is possible that the document is recoverable from this executable file or if not are there other possible ways to recover the file.

Thank you so much!

Convertir hexadecimal numérico string a bytes python

No se si el titulo esta especifico pero tengo un problema al convertir un string de hexadecimal a bytes, he utilizado la función bytes.fromhex y funciona cuando el hexadecimal es con caracteres pero cuando tiene un numero que es hexadecimal no funciona, ejemplo:

>>>bytes.fromhex('ab')
b'xab'
>>>bytes.fromhex('32')
b'2'

No se si estoy haciendo algo mal pero según yo debería salirme b’x32′

Agradezco a quien pueda ayudarme,
Cordial saludo

metasploit – buffer overflow exploit: vulnserver with additional 20 bytes of data?

Vulnserver is a multithreaded Windows based TCP server that listens
for client connections on port 9999 (by default) and allows the user
to run a number of different commands that are vulnerable to various
types of exploitable buffer overflows.

This software is intended mainly as a tool for learning how to find
and exploit buffer overflow bugs, and each of the bugs it contains is
subtly different from the others, requiring a slightly different
approach to be taken when writing the exploit.

https://github.com/stephenbradshaw/vulnserver

In this tutorial, sh3llc0d3r created 5040 bytes data using Metasploit pattern_create.rb.

Vulnserver – TRUN command buffer overflow exploit

/usr/share/metasploit-framework/tools/pattern_create.rb 5040

But in the following Python script, he/she using 5060 instead of 5040.

buffer = "TRUN /.:/" + "A" * 2003 + "x42x42x42x42" + "C" * (5060 - 2003 - 4)

What happens to the other additional 20 bytes of data?

Where did it come from?

memory hardware – A computer employs RAM chips of 1024 x 8 and ROM chips of 2048 x 4 but needs 2K bytes of RAM, and 2K bytes of ROM

A computer employs RAM chips of 1024 x 8 and ROM chips of 2048 x 4. The computer system needs 2K bytes of RAM, and 2K bytes of ROM and an interface unit with 256 registers each. A memory-mapped I/O configuration is used. The two higher -order bits of the address bus are assigned 00 for RAM, 01 for ROM, and 10 for interface.

a)How many RAM and ROM chips are needed? Draw a memory-address map for the system and Give the address range in hexadecimal for RAM, ROM

Can someone help me out , i solved the (a) part as: The following ROM and RAM Will be used 8 RAM chips and 4 ROM chips are required Explanation: RAM chip size = 256 multiply 8

Required memory size = 2000 bytes = 2 multiply 1024 bytes = 2 multiply 1024 multiply 8 bits

Total number of RAM chip required –

(2 multiply 1024 multiply 8)/(256 multiply 8) = 8 chips

ROM chip size = 1024 multiply 8

Required memory size = 4k bytes = 4 multiply 1024 bytes = 4 multiply 1024 multiply 8 bits

Total number of ROM chips required –

(4 multiply 1024 multiply 8)/(1024 multiply8) = 4 chips

But i am clueless as how to draw the Memory address map

memory – Where are the actual bytes located within DIMM modules in dual or multi-channel mode?

I’m trying to find out how memory is arranged in dual channel mode, i.e. which memory addresses are on which DIMM. What I have currently found out is that there are two modes “ganged” and “unganged” and that there is little difference between them performance-wise.

With ganged mode I understood that each 128-bit word is split in a two 64 bit words, and those are combined when read / written using two channels at the same time. That would mean that for every 128 bits one would probably contain the lower 64 bits (/8 bytes) and the other the higher 64 bits. So byte addresses 0-7 are on one DIMM, and the next 8-15 are on the other. Is this correct?

What’s entirely unclear to me is how memory is arranged in “unganged” mode. Is the memory still spread over the two modules using “sectors” of a specific size? Or is another scheme used?

Do these arrangements differ per processor or is this kind of operation standardized somewhere?

syslog – grep tells “Binary file … matches” – how to find the line(s), which contains “binary” bytes?

I have a log file, written by syslog-ng.
The grep tells me “Binary file syslog matches”.
How can I find that line or lines which cause this?
I’ve tried to read it with a simple python program:

with open("syslog","rt",encoding="utf-8") f:
  l=f.readlines()

It can read that log with no errors. (even if I put it in a try – expect block)
How can I find that “binary” line?

magento2 – Magento 2.4 HTTPD Memory Leak | Allowed memory size of 792723456 bytes exhausted

After upgrading to Magento 2.4, I’ve been unable to run a stable production environment. HTTPD spawns the maximum number of processes and uses all of my systems memory and swap (it takes 5-20 minutes to reach this point).

I’m constantly seeing the following errors in httpd error_log:

(Mon Aug 17 19:40:48.077047 2020) (php7:error) (pid 16939:tid 140670127806208) (client 127.0.0.1:40644) PHP Fatal error:  Allowed memory size of 792723456 bytes exhausted (tried to allocate 20480 bytes) in /var/www/html/vendor/magento/module-csp/Model/BlockCache.php on line 108
(Mon Aug 17 19:40:48.125051 2020) (php7:error) (pid 16939:tid 140670127806208) (client 127.0.0.1:40644) PHP Fatal error:  Allowed memory size of 792723456 bytes exhausted (tried to allocate 40960 bytes) in Unknown on line 0
(Mon Aug 17 19:40:50.052935 2020) (php7:error) (pid 16932:tid 140669993522944) (client 127.0.0.1:40654) PHP Fatal error:  Allowed memory size of 792723456 bytes exhausted (tried to allocate 48238592 bytes) in /var/www/html/vendor/magento/framework/Serialize/Serializer/Json.php on line 24
(Mon Aug 17 19:40:51.592030 2020) (php7:error) (pid 16933:tid 140670169769728) (client 127.0.0.1:40666) PHP Fatal error:  Allowed memory size of 792723456 bytes exhausted (tried to allocate 20480 bytes) in /var/www/html/vendor/magento/module-csp/Model/BlockCache.php on line 108
(Mon Aug 17 19:41:12.706529 2020) (php7:error) (pid 17146:tid 140670127806208) (client 127.0.0.1:40702) PHP Fatal error:  Allowed memory size of 792723456 bytes exhausted (tried to allocate 20480 bytes) in /var/www/html/vendor/magento/module-csp/Model/BlockCache.php on line 108
(Mon Aug 17 19:41:12.740424 2020) (php7:error) (pid 17146:tid 140670127806208) (client 127.0.0.1:40702) PHP Fatal error:  Allowed memory size of 792723456 bytes exhausted (tried to allocate 122880 bytes) in Unknown on line 0
(Mon Aug 17 19:41:24.887257 2020) (php7:error) (pid 16939:tid 140670111020800) (client 127.0.0.1:40798) PHP Fatal error:  Allowed memory size of 792723456 bytes exhausted (tried to allocate 4096 bytes) in /var/www/html/vendor/magento/module-csp/Model/BlockCache.php on line 78
(Mon Aug 17 19:41:24.913106 2020) (php7:error) (pid 16939:tid 140670111020800) (client 127.0.0.1:40798) PHP Fatal error:  Allowed memory size of 792723456 bytes exhausted (tried to allocate 65536 bytes) in Unknown on line 0
(Mon Aug 17 19:41:39.997127 2020) (php7:error) (pid 16933:tid 140670152984320) (client 127.0.0.1:40904) PHP Fatal error:  Allowed memory size of 792723456 bytes exhausted (tried to allocate 20480 bytes) in /var/www/html/vendor/magento/module-csp/Model/BlockCache.php on line 108, referer: http://ip-of-my-ec2-instance:80/
(Mon Aug 17 19:41:40.030659 2020) (php7:error) (pid 16933:tid 140670152984320) (client 127.0.0.1:40904) PHP Fatal error:  Allowed memory size of 792723456 bytes exhausted (tried to allocate 40960 bytes) in Unknown on line 0, referer: http://ip-of-my-ec2-instance:80/
(Mon Aug 17 19:42:08.849538 2020) (php7:error) (pid 17146:tid 140670111020800) (client 127.0.0.1:41016) PHP Fatal error:  Allowed memory size of 792723456 bytes exhausted (tried to allocate 20480 bytes) in /var/www/html/vendor/magento/framework/Serialize/Serializer/Json.php on line 42
(Mon Aug 17 19:42:08.865389 2020) (php7:error) (pid 17146:tid 140670111020800) (client 127.0.0.1:41016) PHP Fatal error:  Allowed memory size of 792723456 bytes exhausted (tried to allocate 32768 bytes) in Unknown on line 0
(Mon Aug 17 19:44:23.245570 2020) (php7:error) (pid 17146:tid 140670027093760) (client 127.0.0.1:41798) PHP Fatal error:  Allowed memory size of 792723456 bytes exhausted (tried to allocate 20480 bytes) in /var/www/html/vendor/magento/framework/Serialize/Serializer/Json.php on line 42, referer: https://www.google.com/
(Mon Aug 17 19:44:23.312177 2020) (php7:error) (pid 17146:tid 140670027093760) (client 127.0.0.1:41798) PHP Fatal error:  Allowed memory size of 792723456 bytes exhausted (tried to allocate 45056 bytes) in Unknown on line 0, referer: https://www.google.com/
(Mon Aug 17 19:44:29.224653 2020) (php7:error) (pid 16939:tid 140670052271872) (client 127.0.0.1:41742) PHP Fatal error:  Allowed memory size of 792723456 bytes exhausted (tried to allocate 20480 bytes) in /var/www/html/vendor/magento/module-csp/Model/BlockCache.php on line 108
(Mon Aug 17 19:44:29.264725 2020) (php7:error) (pid 16939:tid 140670052271872) (client 127.0.0.1:41742) PHP Fatal error:  Allowed memory size of 792723456 bytes exhausted (tried to allocate 90112 bytes) in Unknown on line 0
(Mon Aug 17 19:44:34.254009 2020) (php7:error) (pid 17146:tid 140670043879168) (client 127.0.0.1:41688) PHP Fatal error:  Allowed memory size of 792723456 bytes exhausted (tried to allocate 20480 bytes) in /var/www/html/vendor/magento/module-csp/Model/BlockCache.php on line 108
(Mon Aug 17 19:44:34.294439 2020) (php7:error) (pid 17146:tid 140670043879168) (client 127.0.0.1:41688) PHP Fatal error:  Allowed memory size of 792723456 bytes exhausted (tried to allocate 36864 bytes) in Unknown on line 0
(Mon Aug 17 19:44:40.650547 2020) (php7:error) (pid 17146:tid 140670010308352) (client 127.0.0.1:41882) PHP Fatal error:  Allowed memory size of 792723456 bytes exhausted (tried to allocate 20480 bytes) in /var/www/html/vendor/magento/framework/Serialize/Serializer/Json.php on line 42
(Mon Aug 17 19:44:40.690603 2020) (php7:error) (pid 17146:tid 140670010308352) (client 127.0.0.1:41882) PHP Fatal error:  Allowed memory size of 792723456 bytes exhausted (tried to allocate 49152 bytes) in Unknown on line 0
(Mon Aug 17 19:44:49.990225 2020) (php7:error) (pid 16939:tid 140670144591616) (client 127.0.0.1:42006) PHP Fatal error:  Allowed memory size of 792723456 bytes exhausted (tried to allocate 33554440 bytes) in /var/www/html/vendor/magento/module-csp/Model/Collector/DynamicCollector.php on line 31

Before upgrading to 2.4, I switched to Elasticsearch 6.7 and upgraded to php7.3 (7.4 isn’t available on Amazon Linux AMI as far as I can tell).
My system.log and exception.log don’t show any relevant errors. What can I do to debug this?