mirror of
https://github.com/The-Art-of-Hacking/h4cker
synced 2024-11-10 05:34:12 +00:00
Update c2_example1.md
This commit is contained in:
parent
8b431b64dd
commit
5a6995f81f
1 changed files with 8 additions and 3 deletions
|
@ -1,5 +1,8 @@
|
|||
# Example of Creating a C2 Using Python
|
||||
Let's create a Python script that sets up a listener to communicate with a remote device. The listener waits for a connection, then allows the user to send commands to the remote device. Here's a breakdown of the code:
|
||||
Let's create a Python script that sets up a listener to communicate with a remote device. The listener waits for a connection, then allows the user to send commands to the remote device.
|
||||
🤖 Checkout [this prompt in ChatGPT](https://chat.openai.com/share/a8399b03-9d33-444a-bce3-e7995d351316)
|
||||
|
||||
Here's a breakdown of the code:
|
||||
|
||||
1. **Importing Required Module**:
|
||||
```python
|
||||
|
@ -24,8 +27,8 @@ Let's create a Python script that sets up a listener to communicate with a remot
|
|||
|
||||
5. **Socket Address Configuration**:
|
||||
```python
|
||||
IP = "192.168.74.128"
|
||||
Port = 8008
|
||||
IP = "10.6.6.88"
|
||||
Port = 1337
|
||||
socket_address = (IP, Port)
|
||||
```
|
||||
The IP address and port for the listener are defined.
|
||||
|
@ -54,3 +57,5 @@ Let's create a Python script that sets up a listener to communicate with a remot
|
|||
|
||||
9. **Exception Handling**:
|
||||
If any exception occurs during command execution or communication, the script prints "Exception occurred" and closes the socket.
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue