-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnakedphskript.py
224 lines (206 loc) · 9.51 KB
/
nakedphskript.py
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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
!/usr/bin/env python3
# This is the checkout process on NakedCPH for an HSBC card with Verified by Visa
# Unfortunately, this is will likely need to be done on a case by case basis for
# different cart types.
import requests
import re
import time
import timeit
from bs4 import BeautifulSoup as bs
from getconf import *
def checkout(first, last):
i = first
while first <= last:
print ('Trying: ' + str(first))
password = '' # Your Verified by Visa password
soup = None
while soup is None:
try:
print ('Adding to cart')
payload = {
'action' : 'add',
'item_pid' : first,
'ajax' : '1'
}
response = session.post('http://www.nakedcph.com/cart', data=payload)
soup = bs(response.text, 'html.parser')
except Exception:
pass
print (soup)
if soup.find('a').getText() != 'Cart (0)':
none = None
while none is None:
try:
payload = {
'formid' : 'details.anonymous',
'email' : [email protected], #not mine enter yours
'email_repeat' : [email protected], #not mine enter yours
'first_name' : Insert, #not mine enter yours
'surname' : Name, #not mine enter yours
'address' : Insert, #not mine enter yours
'address2' : Addy, #not mine enter yours
'zip' : zippy, #not mine enter yours
'city' : rep, #not mine enter yours
'state' : state, #not mine enter yours
'country' : United States,
'phone' : 1234567890 #not mine enter yours
}
response = session.post('http://www.nakedcph.com/checkout/details', data=payload)
none = 1
except Exception:
pass
none = None
while none is None:
try:
payoad = {
'mode' : 'user',
'shipping' : '6', # Need to figure out which countries these correspond to
'payment' : 'quickpay10secure'
}
response = session.post('http://www.nakedcph.com/checkout/handling', data=payload)
none = 1
except Exception:
pass
none = None
while none is None:
try:
payload = {
'confirmed' : 'on'
}
response = session.post('http://www.nakedcph.com/checkout/confirm', data=payload)
soup = bs(response.text, 'html.parser')
none = 1
except Exception:
pass
payload = {
'agreement_id' : soup.find('input', {'name' : 'agreement_id'})['value'],
'amount' : soup.find('input', {'name' : 'amount'})['value'],
'autocapture' : soup.find('input', {'name' : 'autocapture'})['value'],
'callbackurl' : soup.find('input', {'name' : 'callbackurl'})['value'],
'cancelurl' : soup.find('input', {'name' : 'cancelurl'})['value'],
'continueurl' : soup.find('input', {'name' : 'continueurl'})['value'],
'currency' : soup.find('input', {'name' : 'currency'})['value'],
'language' : soup.find('input', {'name' : 'language'})['value'],
'merchant_id' : soup.find('input', {'name' : 'merchant_id'})['value'],
'order_id' : soup.find('input', {'name' : 'order_id'})['value'],
'payment_methods' : soup.find('input', {'name' : 'payment_methods'})['value'],
'version' : soup.find('input', {'name' : 'version'})['value'],
'checksum' : soup.find('input', {'name' : 'checksum'})['value']
}
response = session.post('https://payment.quickpay.net/', data=payload)
soup = bs(response.text, 'html.parser')
payload = {
'card_number' : Enter card info,
'month' : 02, #not mine enter yours
'year' : 21, #not mine enter yours
'cvd' : 677, #not mine enter yours
'session_id' : soup.find('input', {'name' : 'session_id'})['value']
}
# The 3d secure process should always be relatively similar for every card
response = session.post('https://payment.quickpay.net/prepare_3d_secure', data=payload)
soup = bs(response.text, 'html.parser')
MD = soup.find('input', {'name' : 'MD'})['value']
PaReq = soup.find('input', {'name' : 'PaReq'})['value']
TermUrl = soup.find('input', {'name' : 'TermUrl'})['value']
payload = {
'MD' : MD,
'PaReq' : PaReq,
'TermUrl' : TermUrl
}
secure5link = soup.find('form', {'id' : 'secure_3d_form'})['action']
response = session.post(secure5link, data=payload)
soup = bs(response.text, 'html.parser')
payload = {
'executionTime' : '0',
'PaReq' : PaReq,
'MD' : MD,
'TermUrl' : TermUrl,
'deviceSignature' : '',
'DeviceID' : '',
'CallerID' : '',
'IpAddress' : '',
'cancelHit' : '',
'CookieType' : '2',
'AcsCookie' : '!@#Dummy#@!',
'dnaError' : '',
'mesc' : '',
'mescIterationCount' : '0',
'desc' : '',
'isDNADone' : 'false',
'ABSlog' : 'DSP;FlashLoadTime:639;DEVICEID;'
}
response = session.post(secure5link, data=payload)
soup = bs(response.text, 'html.parser')
pattern = re.compile('getPartialSlotDefinition\("(.*?)","(.*?)","(.*?)"\)')
matches = pattern.findall(response.text)
slotData = []
if len(matches) > 0:
for match in matches:
if len(match) > 0:
slotData = match
if not slotData == []:
payload = {
'slotpin1' : password[int(slotData[0])-1],
'slotpin2' : password[int(slotData[1])-1],
'slotpin3' : password[int(slotData[2])-1],
'pin' : '0',
'submitted' : '1',
'authType' : 'Visa Password',
'cancelHit' : '0',
'forgotPassword' : '0',
'cardHolder' : Kwesi Yankson,
'authDefaultSelect' : 'Visa Password',
'AuthFallBack' : '',
'Phase' : 'passwd',
'pan' : 'XXXX XXXX XXXX ' + card_number[-4:],
'tryIndex' : '1',
'PaReq' : PaReq,
'TermUrl' : TermUrl,
'MD' : MD,
'PTerms' : '',
'PDescription' : '',
'PConditions' : '',
'ARCOTC' : '',
'ARCOTR' : '',
'Locale' : 'en_GB_hsbcvisadebit/',
'VSDCInput' : soup.find('input', {'name' : 'VSDCInput'})['value'],
'VSDCData' : '',
'ChipPluginName' : '',
'ChipPluginVersion' : '', # You need to check these values for your own card
'ChipPluginPresent' : 'TRUE', # Do you have a chip card?
'eAccessPresent' : 'FALSE',
'eAccessRequired' : 'FALSE',
'ChipSecret' : '',
'AcsCookie' : soup.find('input', {'name' : 'AcsCookie'})['value'],
'AcsCondData' : '1301',
'ABSlog' : 'GPP;INIT',
'DeviceID' : soup.find('input', {'name' : 'DeviceID'})['value'],
'CookieType' : '2'
}
TermUrl = soup.find('input', {'name' : 'TermUrl'})['value']
response = session.post('https://secure5.arcot.com/acspage/cap.cgi', data=payload)
soup = bs(response.text, 'html.parser')
payload = {
'PaRes' : soup.find('input', {'name' : 'PaRes'})['value'],
'MD' : MD,
'PaReq' : PaReq
}
response = session.post(TermUrl, data=payload)
soup = bs(response.text, 'html.parser')
response = session.get('https://payment.quickpay.net' + soup.find('a')['href'])
soup = bs(response.text, 'html.parser')
p = soup.find('p')
while not p is None and p.getText() == 'Please wait while we process your payment...':
response = session.get('https://payment.quickpay.net' + soup.find('a')['href'])
soup = bs(response.text, 'html.parser')
return
print ('ORDER PLACED')
else:
print ('Verification was not needed')
first = first + 1
if first == last:
first = i
session = requests.session()
first1 = 12345
last1 = 67890
checkout(first1, last1) # Only if you want a range of product IDS