Friday, December 16, 2011

How to use libcurl in C/C++

libcurl
Newer languages such as Java and newer scripting languages such as Python come with good libraries to download files and do online work. A good way to download files using C/C++ is to download and install the libcurl library.
First run 'curl-config --libs' to see if you have the library '-libcurl'
search for the package: 'apt-cache search libcurl'
install the package: 'sudo apt-get install libcurl4-nss-dev'
check to see if you have the package again
Next, go to http://curl.haxx.se/libcurl/c/simple.html. Copy and paste the code, save as 'simple.c' Change the "http://example.com" to something you want.
Compile your code: 'gcc simple.c -lcurl -o simple.out'
Run the code: './simple.out'

Output of (http://www.google.com/):
http://curl.haxx.se/libcurl/c/simple.html

Saturday, December 10, 2011

How to hack Facebook accounts with a Phishing Scam

Facebook phishing scam

Its so amazing how easily people's emails and passwords are stolen in a matter of seconds. Phishing scams happen all the time, however the "frfacebook.fr" phishing scam went on for sometime, stealing hundreds of people's account information.

Most phishing scams involve Social Engineering, in which the attacker must talk the victim into doing at least one step in order for them to steal their information. In these Facebook phishing scams, they are much easier because Facebook is very social as it is. This particular Facebook scam simply posted the user's credentials in plain text in a text file located on the website.

So, I figured I would create my own to show how easy it really is.
Things you need: website, html, php
-extra: able to create long subdomains
1. Get the source code of the Facebook homepage: 
   curl -s -L facebook.com > index.html
2. Create a sub-domain on your website or buy a website name
3. I simply created a sub-domain called "facebook.com"
   This sub-domain adds on to your real domain. 
   Ex. facebook.com.(your domain).com
4. Now create Facebook-like folders that resemble legitimate 
   Facebook url
      I copied how Facebook did the groups folder and numbering. 
      Ex. facebook.com.(domain).com/groups/(15 digit number)/
5. The last step is to actually retrieve the data. Since php 
   is installed on my server, i created a login php script called
   "index.php" that takes the posts and saves them to a .txt file.
7. For the source code, submit form:
   a. change the action to action="/PATH/TO/PHP/SCRIPT/"
      - best to name the script index.php
   b. change the text field "name" of the email field to something 
      simple "VICTIM_EMAIL"
   c. then change the password field "name" to "VICTIM_PASS"
8. Make sure you have the "pass.txt" for the dumped passes in the 
   specified directory
9. Script I used (index.php): 
In the script above, the header() function redirects the real Facebook url I want my victim to get to after I took their email and pass. This way they believe they were logged out when they clicked the link and will most likely just "sign" back in.



The final result: facebook.com.(domain).com/groups/(15 digit number)/index.php.
Simply give the victim the url without the "index.php" and check the "pass.txt" for the results.

Sunday, November 20, 2011

How to hack MasteringEngineering with unlimited Attempts

Extra Tries and Answers
Ok, we all have been screwed over mastering engineering because of drawing vectors or simply being a decimal point off. Every time you enter an answer and accidentally get it wrong it says how many attempts you have left and takes points away each time. Im sick and tired of this crap.
Go to the Main Page:
http://session.masteringengineering.com/myct/courseHome?start=1

Click on your assignment, the box with all the questions will pop up.

Put your cursor on each link and read the link, their are unique IDs 
for every problem.

Ex. http://session.masteringengineering.com/myct/itemView?
assignmentProblemID=1565835&frame=banner

To "rework" and have unlimited tries until how to really work the 
problem, copy and paste the URL in the address bar and change the 
URL from:
http://session.masteringengineering.com/myct/itemView?
assignmentProblemID=1565835&frame=banner

to the new URL:
http://session.masteringengineering.com/myct/itemView?
assignmentProblemID=1565968&rework=1

The "1565968" problem ID is not unique and can be shared with others
doing the same problems.

Thursday, November 17, 2011

How to create Desktop Icons in Ubuntu

Desktop Icons

Where program is located:
echo $SHELL

Creating the Terminal Icon on the Desktop, just like Ubuntu 10.04
gnome-desktop-item-edit --create-new ~/Desktop

Application: /bin/bash

Wednesday, October 26, 2011

How to setup ADB for Linux terminals

Run adb from terminal
Since the new Eclipse and Android SDK install I had to redo this:

Open your .bashrc, located in your /home/"user"/ and add this:

# Android tools 
export PATH=${PATH}:~/android-sdk-linux_x86/tools 
export PATH=${PATH}:~/android-sdk-linux_x86/platform-tools

Save the file, then in a terminal, type in "source" to refresh the terminal

http://forum.xda-developers.com/showthread.php?p=11823740

Eclipse - Dependency Issues

Failure to Launch
Early this morning I loaded up Eclipse after the latest update(Indigo). To my surprise, all my extra plugins such as ADT and C/C++ were gone. Of course I tried to install them manually again via "Help > Install New Software" and ran into "Dependency Issues". After plenty of installing and re-installing and considering going back to an older version, further Googling led me to just REMOVE all the Eclipse files INCLUDING config files:
Run these commands
sudo -i
 - login as root
apt-get autoremove eclipse
 - unistall
rm -r /usr/lib/eclipse 
 - remove all config files

apt-get install eclipse 
- reinstall
http://ubuntuforums.org/showthread.php?t=1412320

Friday, October 7, 2011

How to disable Avahi Daemon

Disable
package: avahi-daemon
open config file:
 sudo gedit /etc/default/avahi-daemon
set: 
 AVAHI_DAEMON_START = 1

you might also have to:
 sudo gedit /etc/avahi/avahi-daemon.conf
set: 
 use-ipv4=no
 use-ipv6=no

restart:
 sudo /etc/init.d/avahi-daemon restart
or Unistall - Remove Package
sudo apt-get remove avahi-daemon

Friday, September 23, 2011

How to fix 'for' loop initial declarations are only allowed in C99 mode in Eclipse

For loop problem
Once again, programming in C using Eclipse in Linux is great, however when using "for" loops I get this error:
'for' loop initial declarations are only allowed in C99 mode
After a little bit of research, in Eclipse, go to Project > Properties > C/C++ Build > Settings > GCC C Compiler > Miscellaneous > add "-std=c99" to the "Linker Flags" text field.
http://www.eclipse.org/forums/index.php?t=msg&goto=212981&

How to fix undefined reference to `sqrt' in Eclipse

Math.h problem
Programming in C using Eclipse in Linux is great, however when i added variables that were doubles into the "sqrt" function from the "math.h" library there was a problem that came up.
undefined reference to `sqrt'
After a little bit of research, in Eclipse, go to Project > Properties > C/C++ Build > Settings > GCC C Linker > Miscellaneous > add "-lm" to the "Linker Flags" text field. That way it is properly linked to the project.
http://cboard.cprogramming.com/c-programming/88943-undefined-reference-sqrt.html

Thursday, September 8, 2011

How to change your MAC Address

Media Access Control address(MAC)

Linux in General (3 Possible Ways):
sudo ifconfig wlan0 down
- turn device off
sudo ifconfig wlan0 hw ether XX:XX:XX:XX:XX:XX
- set the mac you want
sudo ifconfig wlan0 up
- turn device on
sudo ip addr
- show config
sudo ip link set dev wlan0 address XX:XX:XX:XX:XX:XX
- set the mac you want
sudo pico /etc/network/interfaces
- edit your network devices
- add hwaddress ether XX:XX:XX:XX:XX:XX to your device

After you change your MAC address, run sudo /etc/init.d/networking stop then sudo /etc/init.d/networking start

GNU Mac Changer: www.alobbs.com/macchanger
Install: Install: sudo apt-get install macchanger

macchanger -s wlan0
- shows the current mac on the device

macchanger -mac wlan0 XX:XX:XX:XX:XX:XX
- set the mac you want

You might want to add a script in the /etc/rc.local to automatically change your MAC Address everytime on boot.

Monday, September 5, 2011

How to change your Hostname in Android

DHCP Hostname
With GingerBread, some devices show up in a router's DHCP list as 'android-sdr4r55ed'
Old Ways:
You can change host name in Gingerbread:
 > go to Settings -> Applications -> Development -> Device hostname or
Settings -> Wireless & networks -> Bluetooth settings -> Device name

Using adb shell, then
 > hostname NAME or edit /proc/sys/kernel/hostname
    echo NAME > /proc/sys/kernel/hostname

Using adb shell with busybox installed
 > busybox hostname NAME 

Best Way:
This worked for my Droid X, .602+ Rooted was using adb shell, then:
getprop net.hostname
setprop net.hostname NAME

Since the above code gets reset after each reboot, here is what else
I have found:


after

editing net.hostname
># getprop net.hostname
android_430217a864834bd5
># setprop net.hostname NAME

after the reboot it reverts to android_

so, hook your phone up to your computer:

your computer > adb > phone

> adb shell

> su
 - always backup all files first
> cp /data/data/com.android.providers.settings/databases/settings.db 
/data/data/com.android.providers.settings/databases/settings.db.backup

> cp /data/data/com.android.providers.settings/databases/settings.db 
/mnt/sdcard/settings.db

> rm /data/data/com.android.providers.settings/databases/settings.db

now click disk storage on the usb to access the mnt on your own computer

your computer > access your sdcard

> file settings.db

Ex. settings.db: SQLite 3.x database, user version 57

> sqlite3 settings.db

to show databases:

sqlite> .databases
seq  name             file                                                      
---  ---------------  ------------------------------
0    main             /media/249A-11E0/z/settings.db

to show tables:

sqlite> .tables
android_metadata   bookmarks          system           
bluetooth_devices  secure 

to show the column names:

sqlite> .schema secure
CREATE TABLE secure (_id INTEGER PRIMARY KEY AUTOINCREMENT,name TEXT 
UNIQUE ON CONFLICT REPLACE,value TEXT);
CREATE INDEX secureIndex1 ON secure (name);

The column names go from left to right: _id, name, value.

now select the table, secure, this command with show everything:

sqlite> select * from secure;

Here I picked id = 24, this is where my id was.

sqlite> select * from secure where _id = "24";
24|android_id|
 - just another way
sqlite> select * from secure where name = "android_id";
24|android_id|
 - just another way
sqlite> select * from secure where value = "";
24|android_id|

We can easily change the "ID" value from the <16 digit id> 
to any number. Here I changed it to 0:

sqlite> update secure set value = 0 where _id = 24;

Type .exit in order to exit.

sqlite> .exit

On the USB notification change from storage to charge to mount your 
sdcard to your phone.
phone > sdcard

again
> adb shell

> su

> cp /mnt/sdcard/settings.db 
/data/data/com.android.providers.settings/databases/settings.db

Now simply reboot your phone. You should now see "android_0" as your 
new hostname. I know I didnt change the entire hostname, however I will 
continue to look into this.

Thursday, September 1, 2011

Android - FREE Samples

Free Code and Projects
I used Google to find these, very helpful for learning new layouts and different android features.

GitHub
https://github.com/

Blogspot(Google Blogs)
http://android-coding.blogspot.com/
http://androidblogger.blogspot.com/
http://techdroid.kbeanie.com/

Google Code
http://code.google.com/p/androidnetworktester/
http://code.google.com/p/myandroidwidgets/

StackOverflow
http://stackoverflow.com/

Wordpess
http://pareshnmayani.wordpress.com/

Monday, August 29, 2011

How to hack Scribd to download documents for free

How to download documents for free
I was looking at an online document that SOMEONE ELSE UPLOADED and it was very helpful, so I wanted to download it. Scribd however, wanted to charge a daily fee of around $5 dollars to download the content, when it clearly says someone uploaded it.

Here was the document that I wanted: http://www.scribd.com/doc/90924585/The-Dark-Monk-Excerpt-by-Oliver-Potzsch 
For Public ID's(2012):
*document ID* = 90924585

http://www.scribd.com/mobile/documents/*document ID*/
or 
http://www.scribd.com/mobile/documents/*document ID*/download
Insert the number id in the here ^
Sometimes using the first download link is better because it creates a download button. It should should show a download link.  

Update(2/18/12): For Private ID's:

Example URLs:
http://www.scribd.com/doc/39976170/Anthro-2B-Midterm-Study-Guide http://www.scribd.com/doc/33840335

Right-click > View Page Source > Save as to a document on your computer *Make sure you do this to get the entire "Generated Source" (I used Mozilla FireFox)

 I saved this as "doc.html" Open the file "doc.html" > Search for "page.u" You should see something like "// page.uuid : 3kw800775slntll" 
page.uuid = "3kw800775slntll"
Now search for the page.uuid or "3kw800775slntll" and you should see something like: "http://html2.scribdassets.com/3kw800775slntll/pages/542-d2422da938.jsonp"

The URL can range from "html1.scribdassets.com" to "html4.scribdassets.com".

Here is a simple Linux Bash Script to download the images:
Make SURE you change the *page.uuid* to your page.uuid.
cat "doc.html" | grep pages | cut -d"/" -f6 | cut -d. -f1 | grep -vi scrib | while read ID; do wget "http://htmlimg1.scribdassets.com/*page.uuid*/images/$ID.jpg"; done;
However, once you find the page.uuid, you can substitute it in the URL. "http://htmlimg1.scribdassets.com/*page.uuid*/images/$ID.jpg"

Update(2/25/12): For Protect(Preview) ID's:

When there are previews on Scribd, they are trying to selling a document and other allow users to few select pages.  Downloading these would be illegal and the script above only downloads the images of the "protected" documents.



Tuesday, August 2, 2011

crypTo. - Android Application

crypTo. - Android Application


Mobile Encryption on the Go! Hash fast with crypTo.

Encryption on the Go! Hash fast with crypTo!

>>>>>>>>>Please Donate! - Be sure to Rate/Comment/Suggest!
*crypTo currently has 17 hashing algorithms!*

crypTo is an hashing/encryption application with the follow features:

Encoding (Hashing/Encryption and Decryption):
– Encrypts strings in Base64, Binary, CRC32, GOST, MD2, MD4, MD5, RipeMD128, RipeMD160, RipeMD256, RipeMD320, SHA-1, SHA-256, SHA-384, SHA-512, Tiger and Whirlpool!
– Decrypts Base64, Binary and looks up MD5 back to its original string!
– Hashing messages or numbers can be used in order to hide or send secret messages that could be decrypted later on!
– Hashing you own passwords and then pasting into Google in order to see if they have been cracked is a good way of checking the security of your passwords.

File Checksums (File Verification)
– Using CRC32, GOST, MD2, MD4, MD5, RipeMD128, RipeMD160, RipeMD256, RipeMD320, SHA-1, SHA-256, SHA-384, SHA-512, Tiger and Whirlpool!
– MAKE SURE TO USE A GOOD FILE MANAGER WHEN DOING FILE CHECKSUMS FOR BIG FILES (ex. ASTRO)
– Every file has a checksum and when downloading files it is very important that these checksums are matched to the checksum given by the source providing the downloaded file because the files could contain malware or may not work properly because it was not completely downloaded.

Compare Strings and Files
– Copy and Compare Strings and check is they match!
– After Hashing a String or File, you may check and compare Checksums to make sure they are correct!
– Compare File to File through MD5 File Checkum!

FAQ:
What is a string?
– A string can be letters or numbers before they are encrypted into a hash.

What is a hash?
– A hash is an encrypted string of letters or numbers by different encryption methods. Hashes are used in cryptography for creating strong passwords, data encryption and to check the integrity of files.

What is a checksum?
– A checksum is a hash of a file.

Test on the following phone(s):
– Droid X
– HTC Inspire

Explanation of permissions requested:
– Internet: MD5 Reverse Lookup

Suggestions/Possible Future Updates:
– Widgets
– Saving Hashes
– File Encryption
– More Encryption Methods such as Adler-32 and Haval-128


Tags: hash encryption decryption Base64 Binary CRC32 GOST MD2 MD4 MD5 RipeMD128 RipeMD160 RipeMD256 RipeMD320 SHA-1 SHA-256 SHA-384 SHA-512 Tiger Whirlpool password security hash hack hacking encryption decryption

Friday, July 22, 2011

Ubuntu - Trash Can

Open Terminal and follow the commands:

gconf-editor
go to apps > nautilus > desktop
check trash_icon_name

It should appear on your desktop :)

Monday, July 18, 2011

How to hack WebAssign for eBooks

If you use WebAssign, sometimes they give you the button to the "Read It" which shows the section of the book. However, you might be able to read the any part of the book..

If the URL looks like:
https://www.webassign.net/v4cgi/extra/bc_enhanced/index.tpl?asset=read_it&asset_url=/bc_enhanced/SerPSE8_w_player/read_it/serpse8.32.02.swf&UserPass=

Change the URL, "serpse8.32.02"
The "32" is the "chapter" and then the "02" is the "section number".
chapter.section

Monday, July 4, 2011

How to get Free Mobile 3G/4G Tethering

Using Operating System(No Software, No Root)


Ubuntu (Tested on Droid X)
Disclaimer - must have Bluetooth on your computer
1. Turn Bluetooth on both devices
2. On Ubuntu, select use device as "network device (NAP/PAN)"
3. Click on the "wifi/internet" icon and now your using your 3G/4G.

Using Windows 7(Tested on Droid X)
Disclaimer - must have Bluetooth on your computer
1. Go to start, search "Bluetooth", click on "Change Bluetooth Settings".
2. Turn on Bluetooth on the computer and allow other devices to connect to it in "Options".
3. Use your phone to Scan Bluetooth Devices and attempt to pair with the computer.
4. Accept both connections on the computer and the phone.
5. Go to Control Panel, Hardware and Sound and then Device and Printers.
There you should see your phone, right click and click on Connect Using Access Point.

PDA Net(No Root)

- http://junefabrics.com/

1. Go the main page, download the app to your phone.
2. Install the application to your computer.
3. Turn the app on your phone and connect to the net.

Easy Tether Lite(No Root)

- http://www.mobile-stream.com/easytether/android.html - http://easytether.blogspot.com


Wireless Tether(Requires Root- Tested on Froyo)

-Download

Saturday, July 2, 2011

How to change your Hostname in Linux

When first starting on the linux operating system such as Ubuntu, you may be prompted to create a hostname(computer name). Here is how you can change your hostname:

When opening up a terminal, you will see (your username)@(hostname). This is also the name that shows up in DHCP when connected to a network.


Run these commands to change the host name:

sudo sysctl kernel.hostname (new hostname)
or hostname (new hostname)

 For Android (You can ssh into your phone using an app or simply run root adb):
getprop net.hostname (shows you your current name)

 setprop net.hostname (new name)

Sunday, June 26, 2011

HelloWorld in Bash Scripting


HelloWorld.sh

#!/bin/sh
echo Hello World!
Create a Document > Empty File > Copy and Paste > File > Save As or rename > (file).sh

sh file.sh

HelloWorld with Batch Scripting


HelloWorld.bat

@echo off
echo HelloWorld!
pause
exit
Create a Text Document > Copy and Paste > File > Save As > (name).bat

Double Click on the .bat to run it.

or go to Command Prompt, cd (folder that file is in) then (file).bat

Thursday, June 16, 2011

How to use Old Addons in Mozilla FireFox

DISCLAIMER: This does not work for all addons!


When going to a Mozilla FireFox add-on download page (eg. https://addons.mozilla.org/en-US/firefox/addon/cookieswap/), the extension does not work on my 4.0.1 browser. Check your FireFox version by clicking Help > About FireFox.

We must change its compatibility by downloading the add-on. Dont click download directly because it tries to install the addon and will say the version is too old, so Right Click and Save Link As.. and save the ".xpi" file. (eg. https://addons.mozilla.org/firefox/downloads/latest/3255/addon-3255-latest.xpi)

The downloaded ".xpi" file is simply a ".zip" file. Double-click on the file and open it up and edit the "install.rdf" file. Change the "*.*.*" to the version of your browser. (eg. 4.0.*), leave the *(wildcard) at the end for further updates.

Source List
http://www.palaestratraining.com/blog/2008/07/firefox-3-make-older-add-ons-to-work/
http://kb.mozillazine.org/Install.rdf

How to add the Force Quit Button in Ubuntu 11.04+

If you use Ubuntu 11.04+ Unity(app panel to the left), you cannot add application shortcuts to the top panel any more. In order to add a Force Quit Button in the apps panel:

Open the "Terminal" and Copy and Paste, hit enter:

gedit ~/.local/share/applications/quit.desktop

Copy and Paste in the Text Document and hit enter:

[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Exec=xkill
Name=Force Quit
Icon=/usr/share/icons/Humanity/actions/48/process-stop.svg--adjust

Save the Text Document, then open home folder (view > show hidden files), browse to

.local/share/applications

And drag the quit.desktop onto the launcher

If you are using Gnome (Classic), here is what it would look like:


Friday, June 3, 2011

How to Hack WebAssign's Watch It

If you use WebAssign, sometimes they give you the button to the "Watch It" which are very helpful. However, you might be able to find the watch it to more than just the problems they give you..

If the URL looks like:
http://www.cengage.com/physics/book_content/1439048622_serway/SerPSE8e_w_player/SerPSE8e_21_033.html

or

http://www.webassign.net/v4cgi/extra/bc_enhanced/index.tpl?asset=watch_it_player&asset_url=/bc_enhanced/SerPSE8_w_player/SerPSE8_25_033.html&UserPass=

Change the URL "SerPSE8_21_033.html"
The "21" is the "chapter" and then the "33" is the "problem number".

Monday, May 30, 2011

How to write HelloWorld in C?


HelloWorld.c

#include <stdio.h>
int main() {
  printf("Hello world!\n");
}

HelloWorld in C++


HelloWorld.cpp

#include <iostream>

using namespace std;

int main() {
cout << "HelloWorld" << endl;
return 0;
}

HelloWorld in Java

For a pure Java HelloWorld:

HelloWorld.java

public class HelloWorld {
 public static void main(String[] args) {
  System.out.println("HelloWorld");
 }
}

javac HellWorld.java

java HelloWorld

HelloWorld in Android

1) Download Eclipse IDE: http://www.eclipse.org/downloads/
2) Download Android SDK for Eclipse: http://developer.android.com/sdk/index.html
-Installing Setup: http://developer.android.com/sdk/installing.html
3) Beginning Tutorial: http://developer.android.com/resources/tutorials/hello-world.html


HelloWorld.java
location: HelloWorld > src > com.HelloWord > HelloWorld.java
package com.HelloWorld;

import android.app.Activity;
import android.os.Bundle;

public class Hello extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
    }

}

main.xml

location: HelloWorld > res > layout > main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
<TextView  
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:text="@string/hello"
    />
</LinearLayout>

strings.xml

location: HelloWorld > res > values > strings.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="hello">Hello World, Hello!</string>
    <string name="app_name">HelloWorld</string>
</resources>

AndroidManifest.xml

location: HelloWorld > AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.HelloWorld"
      android:versionCode="1"
      android:versionName="1.0">
    <uses-sdk android:minSdkVersion="3" />

    <application android:icon="@drawable/icon" android:label="@string/app_name">
        <activity android:name=".Hello"
                  android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

    </application>
</manifest>


Notice: "System.out.println("HelloWorld!");" is not being used because "HelloWorld" is a string pulled from "strings.xml" which is used in the "main.xml"