Advertisement
Guest User

Untitled

a guest
Jan 17th, 2019
750
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.79 KB | None | 0 0
  1. // CREATED BY RENT A HACKER
  2. // CREATED BY RENT A HACKER
  3. // MAIN BIDDING FUNCTION MAIN BIDDING FUNCTION
  4. // this function performs no checking on the input variables
  5. // $username - the eBay user name
  6. // $password - the eBay user password
  7. // $item - the eBay item number to buy
  8. // $link - itemlink with referral, can leave empty i.e. ''
  9. function place_bin($username, $password, $item, $link) {
  10.  
  11. $cookies = dirname(__FILE__).'/cookies.txt';
  12.  
  13. //set success as default false
  14. $success = false;
  15. $bid_success = false;
  16.  
  17. $curl = curl_init();
  18. curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
  19. curl_setopt($curl, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; rv:15.0) Gecko/20100101 Firefox/15.0.1');
  20. curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
  21. curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
  22. curl_setopt($curl, CURLOPT_REFERER, $link);
  23. curl_setopt($curl, CURLOPT_COOKIEFILE, $cookies);
  24. curl_setopt($curl, CURLOPT_COOKIEJAR, $cookies);
  25.  
  26. //query the sign-out page
  27. //curl_setopt($curl, CURLOPT_URL, "http://signin.ebay.com/ws/eBayISAPI.dll?SignIn&lgout=1");
  28. //$ret = curl_exec ($curl);
  29.  
  30. //IMPORTANT
  31. //query the sign-in page to set the cookies
  32. curl_setopt($curl, CURLOPT_URL, 'http://signin.ebay.com/aw-cgi/eBayISAPI.dll?SignIn&campid=5337161990&customid=7');
  33. curl_exec ($curl);
  34.  
  35. //query the referal link page
  36. if ($link) {
  37. curl_setopt($curl, CURLOPT_URL, $link);
  38. $ret = curl_exec ($curl);
  39. }
  40.  
  41. //sign-in
  42. curl_setopt($curl, CURLOPT_URL, "http://signin.ebay.com/aw-cgi/eBayISAPI.dll?MfcISAPICommand=SignInWelcome&siteid=0&co_partnerId=2&UsingSSL=0&ru=&pp=&pa1=&pa2=&pa3=&i1=-1&pageType=-1&userid={$username}&pass={$password}");
  43. $ret = curl_exec ($curl);
  44. if(curl_errno($curl)){
  45. ebaylog('Curl error: ' . curl_error($curl));
  46. }
  47. if (!$ret) {
  48. $ret = curl_exec ($curl);
  49. if(curl_errno($curl)){
  50. ebaylog('Curl error: ' . curl_error($curl));
  51. }
  52. if (!$ret) {
  53. $ret = curl_exec ($curl);
  54. if(curl_errno($curl)){
  55. ebaylog('Curl error: ' . curl_error($curl));
  56. }
  57. }
  58. }
  59.  
  60. if (strpos($ret, '"loggedIn":true') === FALSE) {
  61. if (preg_match('%<b class="altTitle">(.*)</b>%', $ret, $regs)) {
  62. $err = $regs[1];
  63. ebaylog("\"{$err}\"");
  64. if (strpos($err, 'The alerts below') === 0) {
  65. ebaylog("{$item}: 'The alerts below' found, successful");
  66. //set it to succes
  67. }
  68. } else {
  69. ebaylog("{$item}: Failed signing in");
  70. if (preg_match('%<font face=".*?" size="3"><b>(.*?)</b></font>%', $ret, $regs)) {
  71. $err = $regs[1];
  72. ebaylog("\"{$err}\"");
  73. }
  74.  
  75. //test_write($ret);
  76. goto end;
  77. }
  78.  
  79.  
  80. } else {
  81. ebaylog("{$item}: Success signing in");
  82. }
  83.  
  84.  
  85. //place the initial bin
  86. curl_setopt($curl, CURLOPT_URL, "http://offer.ebay.com/ws/eBayISAPI.dll?BinConfirm&item={$item}&quantity=1&campid=5337161990&customid=7");
  87. $ret = curl_exec ($curl);
  88. if(curl_errno($curl)){
  89. ebaylog('Curl error: ' . curl_error($curl));
  90. }
  91. if (!$ret) {
  92. $ret = curl_exec ($curl);
  93. }
  94.  
  95.  
  96. if (preg_match_all('/(?:value="([-0-9a-zA-Z]*)" *)?name="stok"(?: *value="([-0-9a-zA-Z]*)")?/', $ret, $regs)) {
  97. $stok = $regs[1][0];
  98. } else {
  99. //Failed to get 'stok' value
  100. //try and determine why
  101.  
  102. //check if immediate paypal checkout required
  103. if (preg_match('%<p\W*>\W*(.*)</p>%i', $ret, $regs)) {
  104. $err = $regs[1];
  105. if (stripos($ret, "You're almost done!") === 0) {
  106. ebaylog("Requires immediate PayPal payment.");
  107. //set it to success
  108. $success = true;
  109. goto end;
  110. } else {
  111. test_write($ret);
  112. }
  113.  
  114. } else if (preg_match('%<div class="statusDiv">(.*?)</div>%', $ret, $regs)) {
  115. $err = $regs[1];
  116. ebaylog("'{$err}'");
  117. //if string starts with "Enter US $0.41 or more"
  118. if (stripos($err, 'Transaction Blocked') === 0) {
  119. ebaylog("{$item}: 'Transaction Blocked' found, aborting");
  120. //set it to success
  121. $success = true;
  122. } else {
  123. test_write($ret);
  124. }
  125.  
  126. } else if (preg_match('%"\d*" - Invalid Item</div>%', $ret)) {
  127. ebaylog("{$item}: 'Invalid Item' found, aborting");
  128. test_write($ret);
  129. //set it to success
  130. $success = true;
  131. } else if (preg_match('%<div class="subTlt"><ul class="errList"><li>(.*?)</li></ul></div>%', $ret)) {
  132. ebaylog("{$item}: 'no longer available' found, aborting");
  133. test_write($ret);
  134. //set it to success
  135. $success = true;
  136. } else if (preg_match('%id="w\d-\d-_msg".*?>(.*?)</span>%', $ret, $regs)) {
  137. ebaylog("'{$regs[1]}'");
  138. } else if (preg_match('%<div\s+class\s*=\s*"(?:errRed|errBlk|errTitle|statusDiv)"\s*>(.*?)</div>%i', $ret, $regs)) {
  139. ebaylog("'{$regs[1]}'");
  140. } else {
  141. //don't know why so log the page
  142. ebaylog("{$item}: Failed to get 'stok' value");
  143. test_write($ret);
  144. }
  145. goto end;
  146. }
  147.  
  148. if (preg_match_all('/(?:value="([-0-9a-zA-Z]*)" *)?name="uiid"(?: *value="([-0-9a-zA-Z]*)")?/', $ret, $regs)) {
  149. $uiid = $regs[1][0];
  150. } else {
  151. ebaylog("{$item}: Failed to get 'uiid' value");
  152. goto end;
  153. }
  154.  
  155.  
  156. if ($stok && $uiid) {
  157. ebaylog("{$item}: Success placing initial bid");
  158. } else {
  159. ebaylog("{$item}: Failed placing initial bid");
  160. goto end;
  161.  
  162. }
  163.  
  164. //confirm the bid
  165. $temp = "http://offer.ebay.com/ws/eBayISAPI.dll?MfcISAPICommand=BinConfirm&quantity=1&mode=1&stok={$stok}&xoredirect=true&uiid={$uiid}&co_partnerid=2&user={$username}&fb=0&item={$item}&campid=5337161990&customid=7";
  166. curl_setopt($curl, CURLOPT_URL, $temp);
  167. $ret = curl_exec ($curl);
  168. if(curl_errno($curl)){
  169. ebaylog('Curl error: ' . curl_error($curl));
  170. }
  171. if (!$ret) {
  172. $ret = curl_exec ($curl);
  173. }
  174.  
  175. if (stripos($ret, 'Commit to buy') !== FALSE) {
  176. ebaylog('Trying again');
  177. $ret = curl_exec ($curl);
  178. if(curl_errno($curl)){
  179. ebaylog('Curl error: ' . curl_error($curl));
  180. }
  181. if (!$ret) {
  182. $ret = curl_exec ($curl);
  183. }
  184. }
  185.  
  186. //perform a number of tests to determine if the bid was a success
  187. $bid_success = true;
  188. if (stripos($ret, 'Please pay now to complete your purchase.') === FALSE) {
  189. $bid_success = false;
  190. ebaylog("{$item}: Failed placing final bid");
  191. //try and determine why
  192. if (preg_match('%<div\s+class\s*=\s*"(?:errRed|errBlk|errTitle|statusDiv|title)"\s*>(.*?)</div>%i', $ret, $regs)) {
  193. $err = $regs[1];
  194. ebaylog("'{$err}'");
  195. } else {
  196. //we don't know why it failed so write the data
  197. test_write($ret);
  198. ebaylog($temp);
  199. }
  200. }
  201.  
  202. if ($bid_success) {
  203. ebaylog("{$item}: Success placing final bid");
  204. $success = true;
  205. }
  206.  
  207. end:
  208.  
  209. //close the curl session
  210. curl_close ($curl);
  211.  
  212. if ($success) {
  213. ebaylog("{$item}: Success: {$username}");
  214. } else {
  215. ebaylog("{$item}: Failure: {$username}");
  216. }
  217.  
  218. return $success;
  219. }
  220.  
  221.  
  222.  
  223. CREATED BY RENT A HACKER
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement