Follow us on Twitter!
It is the path of least resistance that makes rivers and men crooked. - Bj Palmer
Wednesday, April 23, 2014
Navigation
Home
HellBoundHackers Main:
HellBoundHackers Find:
HellBoundHackers Information:
Learn
Communicate
Submit
Shop
Challenges
HellBoundHackers Exploit:
HellBoundHackers Programming:
HellBoundHackers Think:
HellBoundHackers Track:
HellBoundHackers Patch:
HellBoundHackers Other:
HellBoundHackers Need Help?
Other
Members Online
Total Online: 22
Guests Online: 17
Members Online: 5

Registered Members: 82876
Newest Member: bhl1986
Latest Articles
View Thread

HellBound Hackers | Computer General | Programming

Author

problem

buddywithgol
Member



Posts: 84
Location: behind tor
Joined: 08.01.12
Rank:
Newbie
Warn Level: 30
Posted on 25-03-12 03:31
is it possible to create a file in java and run it automatically? like if i create a .bat file using java, can i run it using java?Grin
www.h4xer.com
Author

RE: problem

scrptnnj
Member



Posts: 3
Location:
Joined: 10.11.11
Rank:
Guest
Posted on 25-03-12 04:49
I dont know about java but in other languages like python and php there are built in system functions
Code
 os.system("./run.sh")


Author

RE: problem

ellipsis
Member



Posts: 173
Location:
Joined: 13.06.09
Rank:
Uber Elite
Posted on 25-03-12 05:07
buddywithgol wrote:
is it possible to create a file in java and run it automatically? like if i create a .bat file using java, can i run it using java?:D


Java doesn't give you access to the underlying system and outside of the cwd. You can start a process with Java much like you would with C#. So if you know the path to the executable, you can start it using Java. You can also create a file with Java and write text to it... You can also detect the operating system, so you can know what sort of file to create (shell script or batch file).

Code

Process proc = Runtime.getRuntime().exec("\\Path\\To\\Batch.bat");





USE GOOGLE TO YOUR ADVANTAGE.



10000101
Author

RE: problem

Arabian
Banned



Posts: 332
Location: inside you.
Joined: 22.09.10
Rank:
Apprentice
Posted on 25-03-12 22:34
ellipsis wrote:
buddywithgol wrote:
is it possible to create a file in java and run it automatically? like if i create a .bat file using java, can i run it using java?Grin


Java doesn't give you access to the underlying system and outside of the cwd.


False: Java's Native Interface

JNI allows direct access to assembly, C code, and C++ code. JNI may make winAPI calls and create DLL's.

Completely out of the scope of OP's knowledge.


G'bye y'all! I was an asshole, So korg banned me.
Author

RE: problem

ellipsis
Member



Posts: 173
Location:
Joined: 13.06.09
Rank:
Uber Elite
Posted on 26-03-12 05:27
Arabian wrote:
ellipsis wrote:
buddywithgol wrote:
is it possible to create a file in java and run it automatically? like if i create a .bat file using java, can i run it using java?Grin


Java doesn't give you access to the underlying system and outside of the cwd.


False: Java's Native Interface

JNI allows direct access to assembly, C code, and C++ code. JNI may make winAPI calls and create DLL's.

Completely out of the scope of OP's knowledge.


Why would you need JNI to do what he wants to do?

He wants to create a text file, fill it with code, and execute it. He can do this and more with just Java.

I'll submit a code to the Java code bank and link here.


10000101
Author

RE: problem

ellipsis
Member



Posts: 173
Location:
Joined: 13.06.09
Rank:
Uber Elite
Posted on 26-03-12 06:01
buddywithgol wrote:
is it possible to create a file in java and run it automatically? like if i create a .bat file using java, can i run it using java?Grin


www.hellboundhackers.org/code/create-a-script-file-write-code-to-it-and-execute-in-java-2044_.html

If the operating system is Windows, it will create a batch script, if UNIX/Mac/Linux it will create a bash script. It will write "dir" to the batch script or "ls" to the bash script. Then it will execute the script. It will also delete the script if it fails to execute. All in Java.

EDIT: I'm stupid when it comes to BBCode or whatever these tags are. So just copy and paste the URL.


10000101

Edited by korg on 26-03-12 11:50
Author

RE: problem

Arabian
Banned



Posts: 332
Location: inside you.
Joined: 22.09.10
Rank:
Apprentice
Posted on 26-03-12 06:43
ellipsis wrote:

Why would you need JNI to do what he wants to do?

He wants to create a text file, fill it with code, and execute it. He can do this and more with just Java.

I'll submit a code to the Java code bank and link here.


I was replying in response to this bit:

Java doesn't give you access to the underlying system and outside of the cwd.


...which is false.




G'bye y'all! I was an asshole, So korg banned me.
Author

RE: problem

ellipsis
Member



Posts: 173
Location:
Joined: 13.06.09
Rank:
Uber Elite
Posted on 26-03-12 07:13
Arabian wrote:
ellipsis wrote:

Why would you need JNI to do what he wants to do?

He wants to create a text file, fill it with code, and execute it. He can do this and more with just Java.

I'll submit a code to the Java code bank and link here.


I was replying in response to this bit:

Java doesn't give you access to the underlying system and outside of the cwd.


...which is false.



Okay. Yes, JNI allows C++ and other languages to be implemented in Java code. Congratulations...


10000101
Author

RE: problem

Arabian
Banned



Posts: 332
Location: inside you.
Joined: 22.09.10
Rank:
Apprentice
Posted on 26-03-12 08:10
Don't be bitter. It's applicable if OP were attempting to write malicious code for his/her target operating system, and in that regard (which i believe he was hinting at with the .bat script reference), he'd be able to use knowledge of JNI to implement his vector.

Now, this IS fucking retarded to do in Java, but possible nonetheless.


G'bye y'all! I was an asshole, So korg banned me.
Author

RE: problem

tuere816
Member

Your avatar

Posts: 41
Location: In your closet, in your head
Joined: 27.11.11
Rank:
Apprentice
Posted on 26-03-12 19:14
Arabian wrote:
Don't be bitter. It's applicable if OP were attempting to write malicious code for his/her target operating system, and in that regard (which i believe he was hinting at with the .bat script reference), he'd be able to use knowledge of JNI to implement his vector.

Now, this IS fucking retarded to do in Java, but possible nonetheless.


I remember when i knew very little about stuff , not that i know much now.. i used to think the only method to execute something with files was to write a .bat file script or use Windows Explorer, maybe OP just has a bit lack of knowledge and no malicious intentions ....


=================================================================

THE NEED OF ME TO SEE THE BEST IN EVERY1././ Smile


www.hellboundhackers.org/sig/hbh2.png

THE SWEETEST KID ALIVE ..... in Virtual world
img255.imageshack.us/img255/5292/2566.png
kulkarniabhishek94@yahoo.co.in
Author

RE: problem

tuere816
Member

Your avatar

Posts: 41
Location: In your closet, in your head
Joined: 27.11.11
Rank:
Apprentice
Posted on 26-03-12 19:19
Arabian wrote:
Don't be bitter. It's applicable if OP were attempting to write malicious code for his/her target operating system, and in that regard (which i believe he was hinting at with the .bat script reference), he'd be able to use knowledge of JNI to implement his vector.

Now, this IS fucking retarded to do in Java, but possible nonetheless.


I remember when i knew very little about stuff , not that i know much now.. i used to think the only method to execute something with files was to write a .bat file script or use Windows Explorer, maybe OP just has a bit lack of knowledge and no malicious intentions ....


=================================================================

THE NEED OF ME TO SEE THE BEST IN EVERY1././ Smile


www.hellboundhackers.org/sig/hbh2.png

THE SWEETEST KID ALIVE ..... in Virtual world
img255.imageshack.us/img255/5292/2566.png
kulkarniabhishek94@yahoo.co.in
Author

RE: problem

ellipsis
Member



Posts: 173
Location:
Joined: 13.06.09
Rank:
Uber Elite
Posted on 27-03-12 07:10
Arabian wrote:
Don't be bitter. It's applicable if OP were attempting to write malicious code for his/her target operating system, and in that regard (which i believe he was hinting at with the .bat script reference), he'd be able to use knowledge of JNI to implement his vector.

Now, this IS fucking retarded to do in Java, but possible nonetheless.


Pardon me for being bitter, Arabian. I'm thinking that if he doesn't even know file i/o, he probably has zero malicious intent. I gave him a link to some decent Java. I graduated from my votech in '08, so I'm not a Java Jedi or anything, but I gave him some useful tools that he could use in delivering OS specific payloads of malicious code. The only thing required is a JVM and JRE on whatever he's trying to attack with whatever he decides to write in the future with whatever malicious intentions he may have, whenever he decides to write some malicious software. Who knows what his intentions are.

@OP, hope the link points you in the right direction.


10000101