Choose Exit node of Tor Python Stem - tor

How do we choose an exit node of a different country for a Tor controller? I am using python stem library to achieve this. If I use Signal.NEWNYM(), I am able to change exit node's identity but not necessarily its country. Any random exit node of any country would work.

You can achieve this by setting a configuration value for ExitNodes to the countries you want to try to use.
# tell Tor to try to use exit nodes from USA, Canada and Russia
my_controller.set_options({
'ExitNodes': '{US}, {CA}, {RU}'
})
This isn't really a guarantee. If no exit nodes are available for the countries specified it will fall back. If you change identities frequently there's also good changes you'll end up using the same exits over and over.

Related

How to use PyVISA on Ubuntu to interact with a vector network analyzer?

Using PyVISA on an Ubuntu-operating computer (Ubuntu 20.04.5 LTS), I would like to interact with a VNA machine (E8361A, Agilent technologies) in the following way,
1- Connect to the VNA through a port.
2- Send a signal to VNA to start S-parameter measurements within a specified frequency range at specified number of points.
3- Send a signal to VNA to stop S-parameter measurement, fetch the S-parameter data, transfer the data to the PC and save the data.
Q1: Which VNA port do you recommend to use (GPIB, Ethernet or USB), and why?
Q2: Depending on the VNA port, what hardware is required to connect the PC to the VNA?
Q3: Is there a way to adjust the power level of the VNA stimulus signal? If yes, how to inquire the maximum and minimum power levels? Can the power level be adjusted continuously or only discrete power levels are avilable? (Basically, how to control VNA's internal amplifiers/attenuators?
Q4: Can you please share a sample Python code which uses PyVISA to save S-paramater data in the fashion described in steps 1--3?
Q5: Does trigger port have to do anything with sending signals to the VNA to start and stop measurements?
Since I am not working on ubuntu, nor I have the machine you have I can't say much. I am also rather new to pyVISA so my knowledge there is also limited, but since no one else answered:
Q1. I use a usb port since it is the only one I have, but the faster the better i would assume. There seems to me to be more GPIB examples found on the internet so maybe it is an easier starting point.
Q2. As with others (like mine) I would assume only a cable.
Q3. Yes, see the [write][1] function. It may look something like this:
# Connect PNA to computer using resource_manager etc., it is well documented
PNA.Write(f':SOUR{channel_num}:POW:LEV:IMM:AMPL {source_level},"{source_name}"')
For the maximum and minimum values see the documentation of your hardware.
Q4. Your 'Send a signal' I don't know how to do. But you could just while-loop and send-and-recieve in each instance until you want it to stop. Here is an example from keysight:
https://edadocs.software.keysight.com/kkbopen/a-python-programming-example-for-the-pna-family-vnas-sweep-time-various-point-counts-no-error-correction-577935568.html
Q5. I don't know.
EDIT: On Q4: I found this [link][2] , which would what I believe result in
PNA.write('SENS:SWE:MODE CONT') for continous sweeping and
PNA.write('SENS:SWE:MODE SING') for single sweeping.
In this case change from CONT to SING when appropriate and it should stop sweeping.
[1]: https://pyvisa.readthedocs.io/en/latest/_modules/pyvisa/resources/messagebased.html#MessageBasedResource.write
[2]: https://rfmw.em.keysight.com/wireless/helpfiles/89600b/webhelp/Subsystems/gui/content/mnu_control_sweep.htm

How to change the middle node location in the torrc?

I am trying to edit my torrc and make all of the nodes funnel through one country.
So far I am able to force the entry and exit nodes but don't know how to change the middle node... any ideas?
I have already tried "MiddleNodes" and "RelayNodes"
EntryNodes {us},{ca}
ExitNodes {us},{ca}
StrictNodes 1
It's possible to restrict to MiddleNodes per Tor docs: https://2019.www.torproject.org/docs/tor-manual.html.en
MiddleNodes node,node,…
A list of identity fingerprints and country
codes of nodes to use for "middle" hops in your normal circuits.
Normal circuits include all circuits except for direct connections to
directory servers. Middle hops are all hops other than exit and entry.
This is an experimental feature that is meant to be used by
researchers and developers to test new features in the Tor network
safely. Using it without care will strongly influence your anonymity.
This feature might get removed in the future. The HSLayer2Node and
HSLayer3Node options override this option for onion service circuits,
if they are set. The vanguards addon will read this option, and if
set, it will set HSLayer2Nodes and HSLayer3Nodes to nodes from this
set. The ExcludeNodes option overrides this option: any node listed in
both MiddleNodes and ExcludeNodes is treated as excluded. See the
ExcludeNodes option for more information on how to specify nodes.
Edit: See new answer by #user1652110 describing MiddleNodes option which was added in January 2019.
There is no option to do so. The closest option you can try is ExcludeNodes by using as large a list of country codes as you can come up with that doesn't include the countries you do want to use.
Also note, at the time of writing, limiting your circuits' entry and exit points to relays in the US and Canada might severely limit your performance, anonymity, and reliability since there just aren't that many high-bandwidth exits and guards in these two countries.

z/OS - IMS/VTAM - INIT SELF FAILED WITH SENSE 08570002

I am a new mainframer and I have been given access to/control of a test system to play around in and learn. We have been trying to get IMS set up on the system but when I try to log into IMS 14 I get the error
"INIT SELF FAILED WITH SENSE 08570002".
I have found that the error code means, "The SSCP-PLU session is inactive."
I am thinking that the issue is with the VTAM configuration but I am not sure what exactly needs to be fixed or where in z/OS to look for it.
I have asked around and dug through documentation with no luck so any help would be very much appreciated.
The message indicates an attempt was made to establish a connection from the SSCP (VTAM) and a Primary LU (an application) and the application was not available. This is done on behalf of an SLU (secondary logical unit) which is generally a terminal or printer.
This could the result of several situations but here are some common ones:
An attempt was made to log on to something like TSO, CICS, IMS, ... before the VTAM ACB was actually opened. You can attempt the request again later when the service is up
To determine if the PLU (application is available) use the the VTAM command D NET,ID=vtamappl where vtamappl is the application ID your are trying to connect to. This command is entered on the console directly or through a secondary means like SDSF.
There may be a LOGAPPL= statement coded on the LU definition that tells VTAM to attempt to initiate a session when starting the LU. In your case this would appear to be happening before the PLU (application) is up. The LU definition (or generic definition) is in the VTAMLST concatenation.
This manual describes the sense code in more detail.

How to specify the circuit to be used by Tor in stem.process.launch_tor_with_config

In stem.process.launch_tor_with_config
How can we specify the circuit to be used by Tor?
In the config dict for launch_tor_with_config(), you can specify which entry and exit nodes to use/exclude, as well as excluding specific relays from being used in circuits (assuming StrictNodes == 1). But there is no way to define specific circuits to use from within the config there.
You can use the extend_circuit() function from the stem.Controller library to create circuits with a specified path, listing the relay fingerprints you want the circuit to use.
To define your own circuits and ensure that Tor doesn't automatically replace them:
(1) In the config that you use to launch_tor_with_config(), set NewCircuitPeriod and MaxCircuitDirtiness to very high values, so that circuits are not automatically destroyed. The default is that they are marked dirty and not used for new connections 600 seconds (10 mins) after their first use. This means that your custom circuits will likely be automatically replaced after 10 mins, unless you tell Tor not to. The maximum value for MaxCircuitDirtiness is 30 days. The config option MaxCircuitDirtiness is specified in seconds, so this would be 60⋅60⋅24⋅30 = 2592000 seconds. If your application needed to run continuously for longer than 30 days, you would have to manually destroy/create new circuits every month or so ...
(2) Create the desired circuits with extend_circuit(). As described in the documentation, you basically just provide a list of relay fingerprints to define the path you want for the circuit. For example:
controller.extend_circuit('0', ['718BCEA286B531757ACAFF93AE04910EA73DE617',
'30BAB8EE7606CBD12F3CC269AE976E0153E7A58D',
'2765D8A8C4BBA3F89585A9FFE0E8575615880BEB'])
... the first argument '0' tells it to create a new circuit using the path specified in the list.
(3) close all other circuits that were created by default with Stem.controller.close_circuit()
If you do the above, the only circuits that should exist are the ones with the paths you created, and they would not be marked dirty and get replaced for 30 days.

Full statement from ISO 8583

I would like to know if it is possible to do a full statement (between a date range) through ISO 8583, I have seen ATMs which do full statements and was wondering what method they used. I know balance inquiry and mini statements are possible on a POS devise over 8583.
If it is possible does anyone have an information on the structure of the message, ideally for FLexcube.
we did something similar to that back in 1999 in one of the banks, where we would send the statement data in one of the generic private use fields, where it would allow the format ANS 999
but that means you are either to restrict the data to less than 999 characters, or to split the data on multiple messages. and have a multi legged transaction.
you would have the following flow
Customer request for statement on ATM
ATM sends NDC/D912 message to ATM Switch
ATM Switch look up account number after authenticating the card and forward the request to Core Banking Application
Core banking application would generate the statement and format it according to predesigned template and send the statement data into a generic field (say 72)
ATM Switch collects the data and formats it to NDC or D912 format where the statement data is tagged to statement printer (in NDC it is a field called q and the value should be ‘8’ - Print on statement printer only)
and on the field r place the preformatted data
however, it is not a good practice to do so, since we have faster means to generate a statement and send to email or internet banking. but this is the bank's preference anyways.
It depends upon implementation,
I had implemented NCR central switch, where I incorporate initial checking stuffs in the Central application itself rather than passing everything to Auth Host.
My implementation.
ATM Sends (NCD) the transaction requests based on State Machine setup in ATM to Central Application.
Central does basic checkings such as Validity of BIN (initial 6 digit of card no.) and also checks if the requested amount of cash is available in the ATM etc.
The the Central App sends the packet (ISO8583/BASE24) is sent to the Acquirer for further processing.
Acquires Sends it to CA and then it goes to Issuer for Approval.
Hope this helps.
The mini-statement is not part of ISO 8583 (or MVA). It is usually implemented as a proprietary extension. Hence you need to go to an ATM owned by your bank, or, is part of a consortium of banks that share an ATM infrastructure with your bank.
We implemented mini-statements in our ISO-8583 specification utilizing a $0.00 0200 (DE003 = 91xxxx) message and the statement data coming back from the host on DE125 on both Connex and Base24 and then modified our stateful loads to print the data at the ATM.
Though full statements fell out of use years ago so we removed it to just be mini-statements now utilizing the receipt printer vs. full page statements. There is a limited number of entries and not all host support it but it is used today on NCR & Diebold ATMs. I've personally participated in the testing in getting it to work on Base24 and Postilion.
The mini-statement data we do print is 40 characters per line and prints about 10 transactions I believe.

Resources