|
|||||||
| Programming A place for our community to discuss their own security related coding projects. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
First off, I know its not programming, it's scripting, but I'm learning so cut me some slack.
Anyway, I've got four scripts I'd like to share. These are working on BackTrack 4 beta, haven't had a chance to compare with 4 prerelease, but I'm sure it can be adapted. I use these in specific with an Atheros based chipset (as they are for athX madwifi VAPs). To use these scripts, simply open Kate and copy the code, save to correct dir, then use console to Code:
root@bt:~# chmod 1777 /usr/sbin/xxxx-sc.sh I also use an array in my script, utilizing both monitor + connectivity modes on ath0 and ath1. Ath0 is designated as the monitor, and ath1 is used for connect. The only trick with this script is that the card's modes are bound together by channel, so if you connect on channel 6 you can only monitor on channel 6. If you are monitoring and channel hopping, you will have a hard time associating. ![]() /usr/sbin/dual-sc.sh Code:
killall wpa_supplicant killall NetworkManger killall knetworkmanager airmon-ng stop ath0 airmon-ng stop ath1 ifconfig wifi0 down macchanger --mac 00:10:24:00:13:37 ifconfig wifi0 up airmon-ng start wifi0 wlanconfig ath1 create wlandev wifi0 wlanmode sta -uniquebssid NetworkManager start knetworkmanager /usr/sbin/mon-sc.sh Code:
airmon-ng stop ath0 airmon-ng stop ath1 killall wpa_supplicant killall NetworkManager killall knetworkmanager ifconfig wifi0 down macchanger --mac 00:11:22:33:44:55 wifi0 ifconfig wifi0 up airmon-ng start wifi0 airodump-ng ath0 /usr/sbin/con-sc.sh Code:
airmon-ng stop ath0 airmon-ng stop ath1 ifconfig wifi0 down macchanger --mac 00:10:24:00:13:37 wifi0 ifconfig wifi0 up wlanconfig ath0 create wlandev wifi0 wlanmode sta -uniquebssid NetworkManager start knetworkmanager /usr/sbin/netdown-sc.sh Code:
killall wpa_supplicant killall NetworkManger killall knetworkmanager airmon-ng stop ath0 airmon-ng stop ath1 |
|
|||
|
If you will add variables, functions, conditional statements and loops in your script would you still call it just scripting? I wonder what's really the difference. Isn't it a program is some sequential instructions you write for the computer to execute, regardless if you have to compile the it beforehand or just to be read by an interpreter later? When you wrote a very nice shell script that executes various programs and process their output, would you still call yourself a script kiddie? Aren't these shells also considered as programming languages?
|
|
||||
|
I judge any sort of programming or scripting language on three things:
1) How much stuff you can do with it (e.g. can you read and write files, can you take input from the user, can you perform looping) 2) How portable it is (e.g. can you write a program that will run on M$Windoze, Mac, Solaris, Linux) 3) The quality of the "executable" file, how small it is in kilobytes, and how quickly it runs. There's no doubt that you can do some pretty neat stuff with Bash Script, some people have made some marvelous programs with it. The people who are extremely proficient at Bash Scripting would do very well at full-blown languages like C and C++, I suppose it's just a matter of time before they decide to move on. Bash is great, but you can do a lot more with the likes of C and C++. C++ is pretty much the best language to use (in terms of the 3 criteria I specify above) unless you're looking for extreme portability, in which case C would be the right choice. (By extreme portability, I mean stuff like compiling code for microcontrollers the size of the nail on your baby finger).
__________________
Ask questions on the open forums, that way everybody benefits from the solution, and everybody can be corrected when they make mistakes. Don't send me private messages asking questions that should be asked on the open forums, I won't respond. I decline all "Friend Requests". |
|
|||
|
Wrote a couple more. Here's some backtrack universal scanning scripts...once more, add to /usr/sbin/xxx.sh then from shell do "chmod 1777 /usr/sbin/xxx.sh"...then you will be able to run direct from shell as xxx.sh
Makes automated scanning easier :P longscan.sh Code:
echo "**************************" echo "** Mr Penguin's Long **" echo "** Range Artillery Scan **" echo "**************************" echo "Scans ..X-Y.1-255 of input IP, with specified port." echo "Builds output, then opens." echo "Scan which port/s?" read port echo "IP Block 1:" read block1 echo "IP Block 2:" read block2 echo "IP Block 3 Start:" read block3a echo "IP Block 3 End:" read block3b while [ $block3a -le $block3b ] do nmap -p $port $block1.$block2.$block3a.1-255 -oG /root/longscan.txt --append-output block3a=$(( block3a+1 )) done nano /root/longscan.txt Code:
echo "***********************" echo "** Mr Penguin's Auto **" echo "** Full IPBlock Scan **" echo "***********************" echo "Scans input of first three IP blocks with nmap, with input of port." echo "Builds output, then opens." echo "Input first three IP Blocks, Seperated by space" read ip1 ip2 ip3 echo "Port, please" read port nmap -v -p $port $ip1.$ip2.$ip3.1-255 -oG /root/open.txt --append-output nano /root/open.txt |
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|