Tag: generate


How to generate shellcode from custom exe in metasploit

To use a custom exe as a payload or to use your custom exe in a document or excel file, you have to “convert” your exe to shellcode. To accomplish this: 1> Run Kali Linux 2> Open a terminal window 3> Type msfconsolemsfconsole and hit enter 4> Type use payload/generic/customuse payload/generic/custom and hit enter 5> …


Generate PDF in Java using iText

First of all download iText. import com.itextpdf.text.Document; import com.itextpdf.text.DocumentException; import com.itextpdf.text.Paragraph; import com.itextpdf.text.pdf.PdfWriter; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream;   public class pdf {   public static void main(String[] args) { try (OutputStream pdffile = new FileOutputStream(new File("/home/username/Documents/test.pdf"))) { Document document = new Document(); PdfWriter.getInstance(document, pdffile); document.open(); document.add(new Paragraph("Hello, World!")); document.close(); pdffile.close(); } …


Generate Random Password

Simple Password Generator function generatePass($size) { $chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%()_-*+"; $passwd = ""; for($i=0;$i<$size;$i++) { $passwd .= $chars[rand(0, 72)]; } return $passwd; }function generatePass($size) { $chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%()_-*+"; $passwd = ""; for($i=0;$i<$size;$i++) { $passwd .= $chars[rand(0, 72)]; } return $passwd; } Example echo generatePass(8).'<br>’; echo generatePass(10).'<br>’; echo generatePass(12).'<br>’;echo generatePass(8).'<br>’; echo generatePass(10).'<br>’; echo generatePass(12).'<br>’;

Cross-Platform, Java

Generating unique IDs in Java

With the UUID class you can generate unique ids. The identifiers generated by UUID are universally unique identifiers. UUID is the fastest and easiest way to generate a unique ID in Java. import java.util.UUID; .. .. public String generateID(){ return String.valueOf(UUID.randomUUID()); } ..import java.util.UUID; .. .. public String generateID(){ return String.valueOf(UUID.randomUUID()); } ..