How to check a Bitcoin wallet balance from first generated address (m/44'/0'/0'/0/0) - bitcoin

Is there a way to check a wallet balance from the 1st generated address (parent address) not knowing the child addresses? Need to do it automatically from Linux (API-style) not copy-paste in browser.
Parent address: 1H7wwfstu4e8yianuPtk9CSxUonq4pzLju
0 BTC
Child address: 14ZcreY3y3XxcsRCzfvzz6fWZfBTp6a2ZX
0.00336455 BTC
$ curl -s 'https://blockchain.info/q/addressbalance/1H7wwfstu4e8yianuPtk9CSxUonq4pzLju'
0
$ curl -s 'https://blockchain.info/q/addressbalance/14ZcreY3y3XxcsRCzfvzz6fWZfBTp6a2ZX'
336455
EDIT:
I know the "BIP32 Root Key" and the "BIP32 Extended Public Key", can I do it using any of those?
NEW EDIT:
Thought about using Extended Public Key, can someone confirm if I'm right?
https://blockchain.info/xpub/xpub6Exa9kqjZDFBtx2qftFG3nhqiZ7wZsde2PtygviSLrSunmJeaugdFY67Cv9JSMocDojpvMEykWjzcJFzH8bQtfJdogNSpz5Dy4E6L6yUECV

This can be done using Extended Public Key:
https://blockchain.info/xpub/xpub6Exa9kqjZDFBtx2qftFG3nhqiZ7wZsde2PtygviSLrSunmJeaugdFY67Cv9JSMocDojpvMEykWjzcJFzH8bQtfJdogNSpz5Dy4E6L6yUECV

Related

SoftLayer Curl Command Does Not Match UI Output

I've been creating and deleting VMs, and trying to pull their status throughout the processing of the order.
The output is always '{"id":[ID],"statusId":1001}' no matter where in the process the order is.
In the UI, it may say 'Attaching Primary Disk', but it will always output 'Active' and '1001' using the API.
The command used:
curl https://[username]:[apiKey]#api.softlayer.com/rest/v3/Softlayer_Hardware_Server/[serverID].json
Is there a reason why this doesn't work? Is there a solution to getting the status using the API?
About the status you see in UI "Attaching Primary Disk", I think you are talking about the transaction status, to retrieve that information you can use the following methods
For Virtual Guests:
https://softlayer.github.io/reference/services/SoftLayer_Virtual_Guest/getActiveTransaction
https://softlayer.github.io/reference/services/SoftLayer_Virtual_Guest/getActiveTransactions
https://softlayer.github.io/reference/services/SoftLayer_Virtual_Guest/getLastTransaction
For Hardware Servers:
https://softlayer.github.io/reference/services/SoftLayer_Hardware_Server/getActiveTransaction
https://softlayer.github.io/reference/services/SoftLayer_Hardware_Server/getActiveTransactions
https://softlayer.github.io/reference/services/SoftLayer_Hardware_Server/getLastTransaction
When you create a new VM the status will be ¨Active¨ and statusId= 1001 , it means it is in use, when you cancel a VM the status will be ¨Disconnected¨ and statusId= 1006 before to be canceled completely.
After that the status is ¨RESOURCE RESERVE¨ before removing the VM, in this status the VM is not longer listed for users whether through the api o UI.
For more reference you can see the following link:
SoftLayer Virtual Guest host Status list
Try with below curl command to retrieve the VM status:
curl -k "https://[username]:[apiKey]#api.softlayer.com/rest/v3.1/SoftLayer_Virtual_Guest/[vmId]/getObject.json" | python -mjson.tool
Or you can use the following rest api:
Method: GET
https://[username]:[apiKey]#api.softlayer.com/rest/v3.1/SoftLayer_Virtual_Guest/[vmId]/getObject?objectMask=mask[status]

Bro Script: Hardcoded IP addresses

Ich have one assignment and I need a little help. I have infected.pcap and the following task:
Hardcoded IP addresses Sometimes, malware contains hardcoded IP addresses to download their payload or to communicate with their command and control (C&C) server. Find all such communication. Hint: Such IPs have no preceding DNS request.
I need to solve it with Bro script. This was my idea, but unfortunatelly all my connections have no DNS request:
#load base/protocols/dns/main.bro
event file_timeout(f: fa_file)
{
for ( cid in f$conns )
{
if(f$conns[cid]?$dns){
print f$conns[cid]$dns;
print "DNS";
}else {
print "No DNS";
}
}
}
Do you know maybe what is wrong with my code?
I would suggest that you're using the wrong event for this. The file_timeout only occurs if a file transfer was occurring and then stopped without completing. A much more interesting event correlation would be:
Track DNS address lookup responses (I would likely use event
dns_A_reply(c: connection, msg: dns_msg, ans: dns_answer, a:
addr)).
Record the addresses returned in a set; this will provide
you a set of all addresses that were discovered through a DNS query.
Examine outbound requests (where orig_h on the SYN is an internal
address)
Check to see if the address in id$resp_h is in the set of
addresses step 2. If it is, return, if it isn't,
generate a notice since you have an outbound connection attempt with
no corresponding DNS lookup.

Julia HTTP.get() API key Authorization

A website I'm accessing requires an API key ID and secret key as the username and password for (I'm assuming) basic authorization.
I'm using the HTTP.get function from the HTTP module but I can't find how to include my key ID and secret key.
Example
HTTP.get("https://api.mybitx.com/api/1/balance")
and this returns "HTTP.StatusError: received a '401 - Unauthorized' status in response"
The website has an API guide but the only help they give is an example using cURL $ curl -u keyid:keysecret https://api.mybitx.com/api/1/balance
I would appreciate any help
Links:
https://github.com/JuliaWeb/HTTP.jl
The API requires the key and secret code to be in the form:
temp = Basic " + base64encode("your_api_key_here").
You then create a dictionary like so:
usr = Dict("Authorization" => temp)
and finally
JSON.parse(String(HTTP.get("https://api.mybitx.com/api/1/balance"; headers = usr)))
The JSON.parse(String()) might need to change as I ran the code on quite an old Julia version last time this worked

How to get a public OpenPGP key only knowing its fingerprint?

I have only an OpenPGP key's public fingerprint. I do not know the key ID or almost anything else.
How can I get the corresponding public key? Are there any online service to do this?
How the Fingerprint and Long and Short Key IDs are Related
Each OpenPGP key has a fingerprint attached, calculated mainly from its public key packet which also contains the creation time. The calculation is defined in RFC 4880, OpenPGP, 12.2. Key IDs and Fingerprints.
There are short and long key IDs, which resemble the lower 32 respective 64 bits of the fingerprint. For example, looking at the IDs of my OpenPGP key:
fingerprint: 0D69 E11F 12BD BA07 7B37 26AB 4E1F 799A A4FF 2279
long id: 4E1F 799A A4FF 2279
short id: A4FF 2279
Fingerprints and key IDs are used, as sharing and comparing a whole key with usually 1024 to 8096 bits (adding some more for headers like the creation date) is very impractical.
Receiving Keys from Key Servers
There is a bunch of key servers used to distribute keys -- they communicate with each other, choose any of them. GnuPG's option --keyserver hkp://pool.sks-keyservers.net (often set in it's configuration file ~/.gnupg/gpg.conf for Linux/UNIX systems, another path on Windows) uses a pool that will chose a random one each time you use it.
You can use any of those short and long IDs respective the full fingerprint to fetch the key using the --recv-keys command in GnuPG, while the fingerprint is the most specific (and chances for collisions with short key IDs are highest).
If no colliding keys exist, following statements would fetch the same key:
gpg --recv-keys 0D69E11F12BDBA077B3726AB4E1F799AA4FF2279
gpg --recv-keys 4E1F799AA4FF2279
gpg --recv-keys A4FF2279
If you want to query the key servers from your browser, make sure to search for the fingerprint, long or short key ID prefixed by 0x to indicate a search for key IDs (the GnuPG command line interface will do this for you automatically).
Yes, there are servers for this. You can get key like this:
gpg --recv-keys <KEY_ID>
Update: see how KEY_ID interconnected with fingerprint:
Fingerprint: EC2392F2EDE74488680DA3CF5F2B4756ED873D23
Long Key ID: 5F2B4756ED873D23
Short Key ID: ED873D23

2 DKIM on same domain

We are using an external service for our newsletter, which has required the followin DKIM setup in our domain gipote.dk:
_domainkey.gipote.dk. 43200 IN TXT "o=~"
default._domainkey.gipote.dk. 43200 IN TXT "k=rsa\; p=MIGf...ibnrkoqQIDAQAB"
(I truncated the public key for purpose of readability...)
However we are also sending out e-mail from our own server, which I would also like to sign.
Is it possible to have more than one public-key TXT record in our domain gipote.dk? If so, how should it be set up?
EDIT: I do not have access to the private key, that is used by the newsletter service. So I will not be able to just install that on my own server.
/ Carsten
I found out, that the answer is YES :-)
"default" can easily be replaced with another selector name.
Yes you can change the default to another selector.
BUT if you do the domain it is on will no longer verify the domain.
You need to Add a second key NOT CHANGE whats existing
using Google mail you end up with
default._domainkey "v=DKIM1; k=rsa; p=MIIBIj....."
google._domainkey "v=DKIM1; k=rsa; p=MIGfMA......"