EG Information

Main Index
EG Manual
Disclaimer
Legal Information
Hall of Fame
Hall of Shame
Member Rankings
Members List
Meet the Staff

Training Missions

Read Me First
Basic Skills
Realistic Scenarios
Cryptography
Software Cracking
Linux ELF Binary Cracking
Logical Thinking
Programming
Captcha Cracking
Patching
Steganography
Deface This Wall
/dev/null
/dev/urandom
/dev/extra

Knowledge Bank

Discussion Forums
Exploit Database New
PasteBin New
RSS Feeds RSS
Articles / Tutorials
Videos
Online EG MP3 Player Radio
Downloads
Tools

Code Resources

Submit Code
Ajax
ASM
Bash
C
CPP
Csharp
Delphi
Haskell
Java
Javascript
Jython
Lisp
mIRC
MySQL
Perl
PHP
Python
QBASIC
VisualBasic

Pimp Us Out!

Review enigmagroup.org on alexa.com

Has Enigma Group Helped You? Then Help Us By Advertising For Us. Place One Of The Following Images On Your Site And Create A Link Back To Enigma Group.

Enigma Group

Enigma Group

Enigma Group

Enigma Group

 

Affiliates



The Urinal

hackhound.org

suck-o.com

hack.org.za

flyninja.net

 

Enigma Group's Code Bank


rep0 - Cydia Repo Management for iPhone

By: c0re  -  Date Submitted: 2009-12-24 15:56:18

  1. #!/bin/bash
  2. #=======================================================#
  3. #
  4. # rep0
  5. # v8.0b
  6. #
  7. # created by c0re
  8. # licensed under CC (CreativeCommons)
  9. # http://creativecommons.org/licenses/by-nc-sa/3.0/
  10. #
  11. #=======================================================#
  12. if [ $(id -u) -ne 0 ]; then #check4root
  13. echo -e "\n\a[FATAL ERROR!] you MUST run me as root!"
  14. read -sp "..sorry.."
  15. echo -e "\n"
  16. exit 1
  17. fi
  18. echo -e "--created by c0re ($(echo 'c0re@psypanda.org' | tr q m))--"
  19. #set them as variables
  20. DIR1=/home/c0re/cydia/apps ; export DIR1
  21. DIR2=/home/c0re/cydia/upload ; export DIR2
  22. DIR3=/home/c0re/cydia/upload/debs ; export DIR3
  23. DIR6=main/binary-iphoneos-arm
  24. #check for needed dirs
  25. if [ ! -d ~/cydia ]; then
  26. mkdir -p $DIR1 $DIR3
  27. echo "ALL FOLDERS NOT EXITSTED >> created" >> $HOME/rep0.log
  28. else
  29. if [ ! -d $DIR1 ]; then
  30. mkdir $DIR1
  31. echo "no $DIR1 folder existed >> created" >> $HOME/rep0.log; fi
  32. if [ ! -d $DIR2 ]; then
  33. mkdir -p $DIR2
  34. echo "no $DIR2 folder existed >> created" >> $HOME/rep0.log; fi
  35. if [ ! -d $DIR3 ]; then
  36. mkdir $DIR3
  37. echo "no $DIR3 folder existed >> created" >> $HOME/rep0.log; fi
  38. fi
  39. while [ answer != "e" ]; do #menu
  40. clear
  41. echo -e "[Hello $USER] what can I do for you?\n"
  42. echo " 1 clear all old .deb's
  43. 2 build all .debs in one klick
  44. 3 build the Package-List
  45. 4 sign the Release file with GPGkey
  46. 5 upload everything to an FTP Server"
  47. echo -e "\n[OTHER OPTIONS]\n"
  48. echo " gpg create a gpg key
  49. e exit"
  50. echo -e "\n--------------------------------------------------------------\n"
  51. read -p " Sir ? " answer
  52. case "$answer" in
  53.  
  54. 1|rem|rm|RM|REM)
  55. echo -e "\n..removing all old files now!\n"
  56. find $DIR2 \( -name "*.bz2" -o -name "Packages" \) -print0 | xargs -0 rm -Rf
  57. find $DIR2 -name "Release.gpg" -print0 | xargs -0 rm -Rf
  58. for file in $DIR3/*.deb; do
  59. if [ ! "$file" = "$DIR3/*.deb" ]; then
  60. rm -Rf $file #remove old .debs
  61. else
  62. echo -e "\n\a[WARNING!] no .deb's in $DIR3"
  63. echo -e "..so nothing removed!\n"
  64. fi
  65. done
  66. read -sp "[DONE!] ..deleted all old files I could find!"
  67. ;;
  68.  
  69. 2|deb|DEB)
  70. find $DIR1 \( -name "postinst" -o -name "postrm" \) -exec chmod 0755 {} +
  71. find $DIR1 \( -name "preinst" -o -name "prerm" \) -exec chmod 0755 {} +
  72. find $DIR1 \( -name "extrainst_" -o -name "control" \) -exec chmod 0755 {} +
  73. find $DIR1 -type d -name "DEBIAN" -exec chmod 0755 {} +
  74. find $DIR1 -type f -name "*~" -print0 | xargs -0 rm -Rf #dont pack 'files~'
  75. echo -e "\n..building all packages now!\n"
  76. for file in $DIR1/*; do
  77. if [ ! "$file" = "$DIR1/*" ]; then
  78. dpkg-deb -b $file #pack 'em
  79. else
  80. echo -e "\n\a[ERROR!] no folders in $DIR1"
  81. read -sp "so nothing moved!"
  82. fi
  83. done
  84. sleep 1
  85. echo -e "\n..moving them to upload folder\n"
  86. for filez in $DIR1/*.deb; do
  87. if [ ! "$filez" = "$DIR1/*.deb" ]; then
  88. echo "moving $filez to $DIR3"
  89. mv $filez $DIR3 #move 'em
  90. else
  91. echo -e "\n\a[ERROR!] no .deb's in $DIR1"
  92. read -sp "..so nothing moved"
  93. fi
  94. done
  95. read -sp "[DONE!] ..packed' and moved all files I could find!"
  96. ;;
  97.  
  98. 3|list|LIST)
  99. createdpkg()
  100. {
  101. echo -e "..building the Packagelist\n"
  102. cd $DIR2
  103. dpkg-scanpackages -m . /dev/null >Packages #create Packagelist
  104. sleep 1
  105. if [ -f $DIR2/Packages ]; then
  106. echo -e "\n...compressing it...\n"
  107. bzip2 -k -f $DIR2/Packages #compress&move
  108. read -sp "[DONE!] ..Packagelist created & compressed!"
  109. else
  110. echo -e "\n\a[ERROR!] Packageliste was NOT created!"
  111. read -sp "..so nothing compressed!"
  112. sleep 1
  113. fi
  114. }
  115.  
  116. echo
  117. if [ -f /usr/bin/dpkg-scanpackages ] && [ -f /etc/perl/dpkg-gettext.pl ]; then
  118. createdpkg #all good
  119. else
  120. if [ ! -f /usr/bin/dpkg-scanpackages ]; then
  121. echo -e "\n\a[ERROR!] essential file 'dpkg-scanpackages' not found!"
  122. read -p " ..try to download it?.. [Y/N] " choice_1
  123. case "$choice_1" in
  124. yes|YES|y|Y)
  125. aptitude -y install dpkg-dev
  126. echo -e "\n..retrying now...\n"
  127. sleep 1
  128. createdpkg #retry now..
  129. ;;
  130. no|NO|n|N)
  131. echo -e "\n ..please download dpkg-scanpackages manually and place it in /usr/bin/"
  132. echo "..exiting now!"
  133. sleep 2
  134. exit 1
  135. ;;
  136. *)
  137. echo -e "\nsorry, but "$choice_1" is not a valid answer to my question!"
  138. read -sp "..please try again!"
  139. ;;
  140. esac
  141. else
  142. if [ ! -f /etc/perl/dpkg-gettext.pl ]; then
  143. echo -e "\n\a[ERROR!] essential file 'dpkg-gettext.pl' not found!"
  144. read -p " ..try to download it?.. [Y/N] " choice_2
  145. case "$choice_2" in
  146. yes|YES|y|Y)
  147. download=http://downloads.psypanda.org/dpkg-gettext.gz
  148. secTEMP=$(mktemp -d) #open secTEMP
  149. wget $download -o $secTEMP
  150. gunzip $secTEMP/dpkg-gettext.gz
  151. if [ -f $secTEMP/dpkg-gettext.pl ]; then
  152. cp $secTEMP/dpkg-gettext.pl /etc/perl
  153. chmod 0777 /etc/perl/dpkg-gettext.pl
  154. else
  155. echo -e "\n\a[ERROR!] dpkg-gettext.pl doesn't exist in $secTEMP"
  156. echo "..you need to download dpkg-gettext.pl manually & run me again!"
  157. exit 1
  158. fi
  159. echo -e "\n..retrying now...\n"
  160. sleep 1
  161. rm -Rf $secTEMP
  162. createdpkg #retry now..
  163. ;;
  164. no|NO|n|N)
  165. echo -e "\n\a ..please download dpkg-gettext.pl manually and place it in /etc/perl/"
  166. echo "..exiting now!"
  167. sleep 2
  168. exit 1
  169. ;;
  170. *)
  171. echo -e "\nsorry, but "$choice_2" is not a valid answer to my question!"
  172. read -sp "..please try again!"
  173. ;;
  174. esac
  175. fi
  176. fi
  177. fi
  178. ;;
  179.  
  180. 4|sign|SIGN)
  181. echo -e "\n=======================================================
  182. \a [WARNING!] MAKE SURE YOU KNOW WHAT YOUR DOING!
  183. ======================================================="
  184. read -sp "..otherwise please press CTRL+C to cancel now!!"
  185. echo -e "\nwriting MD5Sums to Release file.."
  186. if [ ! -f $DIR2/Packages ] || [ ! -f $DIR2/Packages.bz2 ]; then
  187. echo -e "\a[ERROR!] you havent created a Package file!"
  188. read -sp "..please create a Packagelist first!"
  189. echo -e "\n"
  190. exit 1
  191. else
  192. if [ -f $DIR2/Release ]; then
  193. sums_1=$(md5sum "$DIR2/Packages" | cut -c1-32) #md5sum=32chars
  194. sums_2=$(md5sum "$DIR2/Packages.bz2" | cut -c1-32)
  195. sbytes_1=$(stat -c%s "$DIR2/Packages")
  196. sbytes_2=$(stat -c%s "$DIR2/Packages.bz2")
  197. echo "MD5Sum:" >> $DIR2/Release
  198. echo " $sums_1 $sbytes_1 $DIR6/Packages" >> $DIR2/Release
  199. echo " $sums_2 $sbytes_2 $DIR6/Packages.bz2" >> $DIR2/Release
  200. echo "" >> $DIR2/Release #essential newline
  201. else
  202. echo -e "\n\a[ERROR!] there is no Release file in $DIR2"
  203. read -sp "..so nothing wrote to it!"
  204. echo -e "\n..please create a Release file first and then run me again!"
  205. sleep 2
  206. exit 1
  207. fi
  208. fi
  209. if [ -f $DIR2/Release ]; then
  210. echo -e "\nI assume you already created your GPG-key..\n"
  211. sleep 1
  212. gpg -abs -o $DIR2/Release.gpg $DIR2/Release
  213. echo -e "\n"
  214. read -sp "[DONE!] Packagelist signed successfull!"
  215. else
  216. echo -e "\n\a[ERROR!] There is no Release file in $DIR2"
  217. echo "..so nothing signed!"
  218. fi
  219. ;;
  220.  
  221. 5|ftp|FTP)
  222. ftpupload()
  223. {
  224. #==========EDIT BELOW==========#
  225. SERVER=
  226. USERNAME=
  227. PASSWORD=
  228. REMOTEDIR=
  229. #=========STOP EDITING=========#
  230. FTP="/usr/bin/ncftpput"
  231. for FILE in $DIR2/*; do
  232. if [ ! "$FILE" = "$DIR2/*" ]; then
  233. $FTP -m -R -u $USERNAME -p $PASSWORD $SERVER $REMOTEDIR $FILE
  234. else
  235. echo -e "\n\a[ERROR!] no folders in $DIR2"
  236. read -sp "so nothing uploaded!"
  237. fi
  238. read -sp "[DONE!] all files in folder $DIR2 uploaded!"
  239. done
  240. }
  241.  
  242. if [ -f /usr/bin/ncftpput ]; then
  243. ftpupload
  244. else
  245. echo -e "\n\a[ERROR!] ncftpput not installed!"
  246. read -p "..do you want me to download it? [Y/N] " choice_6
  247. case "$choice_6" in
  248. yes|YES|y|Y)
  249. aptitude -y install ncftp
  250. echo -e "\n..retrying now...\n"
  251. ftpupload #try now..
  252. ;;
  253. no|NO|n|N)
  254. echo -e "\n ..please download ncftpput manually!"
  255. echo "..exiting now!"
  256. sleep 2
  257. exit 1
  258. ;;
  259. *)
  260. echo -e "\nsorry, but "$choice_6" is not a valid answer to my question!"
  261. read -sp "..please try again!"
  262. ;;
  263. esac
  264. fi
  265. ;;
  266.  
  267. e|exit|E|EXIT)
  268. exit 0;;
  269.  
  270. gpg|GPG)
  271. echo -e "\n=======================================================
  272. \a [WARNING!] MAKE SURE YOU KNOW WHAT YOUR DOING!
  273. ======================================================="
  274. read -sp "..otherwise please press CTRL+C to cancel now!!"
  275. echo -e "\nCreating a GPGkey | ($(echo 'http://www.gnupg.org/' | tr q m))"
  276. read -p " ..do you want to create one?.. [Y/N] " choice_3
  277. case "$choice_3" in
  278. yes|YES|y|Y)
  279. echo -e "\n..this step may take a little bit longer..\n"
  280. sleep 1
  281. gpg --gen-key #create GPGkey
  282. echo -e "\n..GPG key created!"
  283. read -p "do you want to create a pubkey of this GPGkey? [Y/N] " choice_4
  284. case "$choice_4" in
  285. yes|YES|y|Y)
  286. echo -e "\n..befor we start I need to know the name you choosed for your GPGkey"
  287. echo -e "\a\n[WARNING!] make sure you write the name case sensitive!!\n"
  288. read -p "what is the name of your GPGkey? " youNAME
  289. read -p "you selected "$youNAME" - is this correct? [Y/N] " choice_5
  290. case "$choice_5" in
  291. yes|YES|y|Y)
  292. echo -e "\nOK - lets start..."
  293. gpg --armor --output $youNAME.pub --export '$youNAME'
  294. cp ./$youNAME.pub ~/cydia
  295. read -sp "[DONE!] your pubkey is copied to $HOME/cydia"
  296. ;;
  297. no|NO|n|N)
  298. echo -e "\n..I need to restart to give you another try - thx! -.-"
  299. sleep 3
  300. exit 1
  301. ;;
  302. *)
  303. echo -e "\nsorry, but "$choice_5" is not a valid answer to my question!"
  304. read -sp "..please try again!"
  305. ;;
  306. esac
  307. ;;
  308. no|NO|n|N)
  309. echo -e "\nOK - you need to manually make a pubkey using:"
  310. read -sp " gpg --armor --output KEYNAME.pub --export '-YOURNAMEHERE-'"
  311. ;;
  312. *)
  313. echo -e "\nsorry, but "$choice_4" is not a valid answer to my question!"
  314. read -sp "..please try again!"
  315. ;;
  316. esac
  317. ;;
  318. no|NO|n|N)
  319. echo -e "\n ..create your own GPG key using 'gpg --gen-key'"
  320. echo "..exiting now!"
  321. sleep 3
  322. exit 1
  323. ;;
  324. *)
  325. echo -e "\nsorry, but "$choice_3" is not a valid answer to my question!"
  326. read -sp "..please try again!"
  327. ;;
  328. esac
  329. ;;
  330.  
  331. *)
  332. echo -e "\n\a[OOOPS!] Sorry $USER ["$answer"] is not valid!"
  333. read -sp "..please try again!"
  334. ;;
  335.  
  336. esac
  337. done #gn8
Return to bash category list

Who Visited EnigmaGroup Today?

1585 Guests, 266 Users (185 Spiders)
hkevin, unicornrainbow, Hessesian, ArcAvenger, GothicLogic, JohnMalkovitzch, ddxc, 3ntr0py, flarornEral, suetekh, whisperer, batsbargy, strudels, Rex_Mundi, limited, Rik, hackaday, nmobin27, whoami, Caddyamilla, NIGHTWOLF, dark_void, Cockelala, Xendz, trueorfalse, Klosse, Blavatsky, InjectioN, Bumpadjuppy, DrOptix, blackknight911, Effomeidonize, Distorted, TheHarrisonW, Obop, ellisp, Vreality2007, advenlydent, zach, Vengeance987, m0rt, 2345, electro-technic, riesenjoe, IvanDimitriev, RomeoG, timetrust, 2142, BillTuer, advilapyday, lotato, lonely.connection, CloverCipher, vnd, aurena, rospark, valy1177, learning, st3alth, Partisan, K0gller, fitz, Jayjay, psychomarine, Vspectrum, San Marino, TinCardinal, brunoriversyhn, code-g, yshiau, Psiber_Syn, Seasharp, obencefoozy, SlayingDragons, Link-, tinuigimeni, jasonbourne, Fred, somebody777, Meonkzt, CJ_Omaha, jearrorne, cls777, unsugsNashy, Balksnuntails, Sir D. Naut, Macabre, Nightraven, Iccyx, Repuhlsive, vipervince2002, Janomatrix, lol, veceattainc, techno, Exclaw, Nikhil, evjfvir967nj, Mod777, nermtode, Tjm, bjy1997, hecky, saraf, elprof, damoniceht, trik, jordan86, SnoopSky, dan_movie, OnetInsolefon, darkfire1515, seojlhmyrhwh, Thoplehap, MaxMeier, 1028rajeev, Abhinav2107, autotuneuser, alexelixir, Tauya, Jozinbrejl, kernel_mod, quolc, anandoump, vladavlada, Taicadine, AnnaNoult, GreenTiger, baripadatimes, Ewing, Blackbeard, thepuppeteer, BON-SELE, hak4r, Unotohumsmush, m4f10, avacraft, becool, thecoder, n01se, alpha1, saki, ObesseJew, ActictGlync, sajan, Domihoolbob, matt.14, max66, SnowFury, Spud101, myfabregas, Ausome1, kajman121, Frudopvia, ideveloper6, OLOLO, Bugshuppy, lamb, VagWirura, LialiTiTviors, Ordeptpen, scifics, Pozycj-Z21, Gkjt, interPuscruse, aaftab, TheCheeseDemon, blackcyxx21, jollyjimbo, N4g4c3N, rineDriekly, Rap70r, Xargos, ovetz13, sonu sahu, Breezy, emitleBen, Hackpad, JWTSR, nicyun, kaizo, itevainee, luke460, AverageJoe, zeratu92, litbk, Mr.Pickle, mannavard1611, LoopyLion, NexusVos, mtroscheck, burberrybagsjr, nikedunksxm, xordux, jeho, Lonewolf034, Dragonite, nhorton, Reloaded, Odile, Kaptain_k1rk, Teefelltugh, grizzly, posthuman01, jakesboy2, pwnpwnlolz, Sabo, Lakhoamnmek, Røgue, dot_Cipher, mori, snickerless1, cart1m, KELATALFTUS, hubris, Afrika, welepocourl, carpinteyrofbt, ReottphoffBom, Reahastegah, pumashoesld, pdanielt, dmac006, DnA-Ender, Red Fox, couptupleakb, ryanjcrook, iMaxx, sh3llcod3, TimHortons, EmilaHapsaums, Feld Grau, burgeoningneophyte, Maroonhat, CookieAu, tinkansinar, Mitodina, timberlandoutletlufc, zsefvy, guccioutletox, AlexDiru, AbercrombieFitchhl, Ryuske, r0z4, slchill, kalak55, Ph4Kt480ii, beefarn, Jigoku, WrossyJes, pollolololo, ZepSung, Fragility, jell0, C9019, Othrguy, Noticon, KIKNWING, llasarus, mdubz, leah027, iellswo, MAZI_, Estilaamoli, subtentar, Trollorful
 
Enigma Group