# AT Commands

```
busybox microcom /dev/ttyUSB0
```

<table><thead><tr><th width="151.9532562854401" align="center">Functionality</th><th width="226.0638684132275">Storage location in SIM  and USIM cards</th><th>AT command</th></tr></thead><tbody><tr><td align="center">Extraction of IMSI</td><td>Stored in 6F07 (decimal 28423) for SIM and USIM</td><td><p>(SIM/USIM)</p><p>AT+CRSM=176,28423,0,0,3</p></td></tr><tr><td align="center"><p>Extraction of Ciphering</p><p>Indicator</p></td><td>Stored in 6FAD (decimal 28589) for SIM and USIM</td><td><p>(SIM/USIM)</p><p>AT+CRSM=176,28589,0,0,3</p></td></tr><tr><td align="center"><p>Extraction of Ciphering</p><p>Key Kc</p></td><td>Stored in 6F20 (decimal 28448 for SIM and 4F20 (decimal 20256) for USIM</td><td><p>(SIM)</p><p>AT+CRSM=176,28448,0,0,9</p><p>(USIM)</p><p>AT+CRSM=176,20256,0,0,9</p></td></tr><tr><td align="center"><p>Extraction of Ciphering</p><p>Key KcGPRS</p></td><td>Stored in 6F52 (decimal 28498 for SIM and 4F52 (decimal 20306) for USIM</td><td><p>(SIM)</p><p>AT+CRSM=176,28498,0,0,9</p><p>(USIM)</p><p>AT+CRSM=176,20306,0,0,9</p></td></tr><tr><td align="center"><p>Extraction of Ciphering</p><p>Key CK and Integrity Key</p><p>IK</p></td><td>Stored in 6F08 (decimal 28424), applied to USIM only</td><td><p>(USIM)</p><p>AT+CRSM=176,28424,0,0,33</p></td></tr><tr><td align="center"><p>Extraction of TMSI,</p><p>TMSI TIME and LAI</p></td><td>Stored in 6F7E (decimal 28542 for SIM and USIM</td><td><p>(SIM/USIM)</p><p>AT+CRSM=176,28542,0,0,11</p></td></tr><tr><td align="center"><p>Extraction of PTMSI,</p><p>PTMSI Signature Value,</p><p>RAI and RAUS</p></td><td><p>Stored in 6F53 (decimal 28499 for SIM and 6F73</p><p>(decimal 28531) for USIM</p></td><td><p>(SIM)</p><p>AT+CRSM=176,28499,0,0,14</p><p>(USIM)</p><p>AT+CRSM=176,28531,0,0,14</p></td></tr><tr><td align="center"><p>Extraction of</p><p>THRESHOLD</p></td><td>Stored in 6F5C (decimal 28508), applied to USIM only</td><td><p>(USIM)</p><p>AT+CRSM=176,28508,0,0,3</p></td></tr><tr><td align="center">xtraction of Provider</td><td>-</td><td>AT+COPS?</td></tr><tr><td align="center"><p>Extraction of </p><p>Lac and</p><p>Cell ID</p></td><td>-</td><td>AT+CREG?</td></tr></tbody></table>

### AT Commands for SIM Cards

AT commands are a standardized set of text strings used to communicate with modems, including those embedded in SIM cards. Here's a list of common AT commands used for SIM card operations:

#### General Commands

* **AT:** Checks the modem's readiness.
* **ATE0:** Turns off echo.
* **ATZ:** Resets the modem.
* **AT+CGMI:** Gets the manufacturer ID of the SIM card.
* **AT+CGMM:** Gets the model name of the SIM card.
* **AT+CGMR:** Gets the revision number of the SIM card.

#### SIM Card Status and Information

* **AT+CREG?:** Queries the registration status of the SIM card on the network.
* **AT+CSCS?:** Gets the character set used for SMS messages.
* **AT+CPIN?:** Checks the SIM card PIN status.
* **AT+CPIN=1234:** Unlocks the SIM card with the PIN "1234".
* **AT+CPMS?:** Gets the memory locations for storing SMS messages.

#### SMS Commands

* **AT+CMGF=1:** Sets SMS mode to text mode.
* **AT+CMGS="+1234567890"** Sends an SMS to the number "+1234567890".
* **AT+CMGL=1,4** Reads SMS messages 1 to 4.
* **AT+CMGD=1** Deletes SMS message 1.

#### Phone Book Commands

* **AT+CPBF?** Checks the phone book storage.
* **AT+CPBS=1,1** Sets the phone book storage to SIM card.
* **AT+CPBA=1,1234567890,John Doe** Adds a contact to the phone book.
* **AT+CPBR=1,1** Reads a contact from the phone book.

#### Call Control Commands

* **ATD+1234567890;** Dials a phone number.
* **ATH:** Hangs up a call.
* **ATA:** Answers an incoming call.
* **AT+CLCK=1** Locks the keypad.

#### Network Settings

* **AT+CREG=2** Sets the registration status to manual.
* **AT+CGATT=1** Attaches to the GPRS network.
* **AT+CGACT=1,1** Activates the GPRS context.

The specific AT commands and their parameters may vary depending on the SIM card manufacturer and network provider. It's essential to consult the documentation provided by your SIM card or modem manufacturer for accurate information.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://gsm-hacking.telco-sec.com/sim-cards/at-commands.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
