can someone help me to code JavaScript? (wordpress ratings)

can someone help me to code JavaScript?

enter image description here

<div class="rate-bar" data-rate-value="8">     <div class="rate-dots">          <span></span>         <span></span>         <span></span>         <span></span>         <span></span>         <span></span>         <span></span>         <span></span>         <span class="active setrate">             <span class="rate-text">امتیاز <b>10</b> از 9</span>             </span><span>         </span>     </div> </div> 

demo: https://zoomfilm.info/

An error with my Function: “not all code paths return a value” [closed]

So I wrote a function which gets the closest object from my array and then gets the distance to the point where I want to spawn another Object, and if the distance is smaller then the min radius around an object, where I don´t want to spawn something, it is supposed to return false and if otherwise, it returns true. But know I have the error that not all code path return a value. Can somebody help me with that?

bool GetMinDistance(Vector2 Position) {     if (DecoreObjects.Length == 0)     {         return true;     }     else     {         float minDistance = Mathf.Infinity;         foreach (GameObject currentObject in DecoreObjects)         {             Vector2 currentObjectPosition = currentObject.transform.position;             Vector2 VectorDistance = currentObjectPosition - Position;             float currentDistance = Mathf.Sqrt(VectorDistance.x * VectorDistance.x + VectorDistance.y * VectorDistance.y);              if (currentDistance < minDistance)             {                 minDistance = currentDistance;             }              if (minDistance > minRadius)             {                 return true;             }             else             {                 return false;             }         }     } } 

I want to know the complexity of this following code


include

include

include

void main() { char p[10][5],temp[5]; int i,j,pt[10],wt[10],totwt=0,pr[10],temp1,n; float avgwt; printf(“Enter no of girls:”); scanf(“%d”,&n); for(i=0;ipr[j]) { temp1=pr[i]; pr[i]=pr[j]; pr[j]=temp1; temp1=pt[i]; pt[i]=pt[j]; pt[j]=temp1; strcpy(temp,p[i]); strcpy(p[i],p[j]); strcpy(p[j],temp); } } } wt[0]=0; for(i=1;i

How to deobfuscate malicious PHP code [duplicate]

This is my first malware analyis, so apologies for my probably noob-like question. I’m having a look at a website running an outdated version of WordPress which was hacked. The Website runs on a shared hosting.

I managed to identify the first layer. There is a hidden .ico file laying in /wp-admin which seems to be embedded in various other .php files such as index.php, etc. by using an @include statement. The .ico file (.4fb85c6a.ico) includes obfuscated PHP and a lot of senseless comments – I guess to make analysis harder. I stripped all comments and was left with three lines of code.

If I understood it correctly, the first line saves the name of the current file in the variable $ _ly98o. Second line is obfuscated code and I’m only partly understanding the third line. It seems that $ _ly98o is multiplied until it matches the length of $ _g8er6 and then those two are XOR’ed with each other. I replaced the eval statement with an echo and executed the script to see what it actually does. I’m stuck at this point as the echo only returns non-readable rubbish.

How do I deobfuscate/analyse the code returned from echo?

Code can be found on https://pastebin.com/8pkSZcLe due to character count limitations.

How to add the custom code to the particular category in WordPress

I am trying to add the script to the particular product category, but the code is not adding it to the category.

This is my code for the page (This is working):

function wpb_hook_faq_javascript() {   if (is_single ('8') || is_page ('8')) {      ?>     <script type="application/ld+json">      </script>   <?php } } add_action('wp_footer', 'wpb_hook_faq_javascript'); 

And I am trying to add this similar code to the product category page:

function wpb_hook_faqtocategory_javascript() {   if ( in_category( 'category-name' )) {      ?>     <script type="application/ld+json">      </script>   <?php } } add_action('wp_footer', 'wpb_hook_faqtocategory_javascript'); 

But the above code is not working. This is my product category URL: wp-admin/term.phptaxonomy=product_cat&tag_ID=9&post_type=product.

Any help is much appreciated.

Why does Chrome show 304 in Response Headers section but 200 in Status code?

Might be a silly question, but I haven’t found any clear answer yet. Why does Chrome show 304 in Response Headers section but 200 in Status code? Why doesn’t it show 304 in Status code (BTW, that is NOT 200 memory cache.)?

If it shows 200 I can’t know it is actually 304 without looking into request detail.

enter image description here

Compared to Firefox (the same request), 304 in status code.

enter image description here

Add metabox plugin data but as custom fields or php code instead

i am using a theme that has custom post type and this custom post type has two ‘boxes’ or fields or whatever they are named i will include the meta codde below now the problem is i am using a plugin to add the posts but the plugin can only add via regular custom fields with value , and i can get the value but i don’t know how to format them in such a way the metabox adds them to the database the is is how they show in the database enter image description here

here is the full code for each one of them this one is for ab_embedgroup

a:2:{i:0;a:3:{s:11:"ab_hostname";s:2:"sd";s:8:"ab_embed";s:203:"<iframe width="1263" height="480" src="https://www.youtube.com/embed/5Gsdtetr1zo" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>";s:6:"_state";s:8:"expanded";}i:1;a:3:{s:11:"ab_hostname";s:7:"fsdqfsd";s:8:"ab_embed";s:203:"<iframe width="1263" height="480" src="https://www.youtube.com/embed/5Gsdtetr1zo" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>";s:6:"_state";s:8:"expanded";}} 

and this one is for ab_downloadgroup which keep in mind i added nothing there meaning this is the default value

a:1:{i:0;a:1:{s:6:"_state";s:8:"expanded";}} 

now here is the meta file which is code for metabox settings and format

$  meta_boxes[] = array(         'id'         => 'episode',         'title'      => __( 'Episode' ),         'post_types' => array( 'watch' ),         'context'    => 'normal',         'autosave'   => true,         'fields'     => array(             array(                 'name'  => __( 'Episode' ),                 'id'    => "{$  prefix}eps",                 'type'  => 'text',             ),             array(                 'name'  => __( 'Episode Title' ),                 'id'    => "{$  prefix}epstitle",                 'type'  => 'text',             ),             array(                 'name' => __('Status', 'meta-box'),                 'id' => "{$  prefix}lang",                 'type' => 'radio',                 'options' => array(                     'RAW' => __('RAW', 'meta-box'),                     'Sub' => __('Sub', 'meta-box'),                 ),                 'multiple' => false,                 'std' => 'Sub'             ),             array(                 'name' => __('Series', 'meta-box'),                 'id' => "{$  prefix}series",                 'type' => 'post',                 'post_type' => 'series',                 'field_type' => 'select_advanced',                 'query_args' => array(                     'post_status' => 'publish',                     'posts_per_page' => -1,                     'orderby' => 'title',                     'order' => 'ASC'                 )             ),         ),     );     $  meta_boxes[] = array(         'title'  => 'Embed Video',         'pages' => array( 'post','watch' ),         'tabs'      => array(             'input-version' => array(                 'label' => 'Input Version',                 'icon'  => 'dashicons-admin-customizer',             ),             'sc-version'  => array(                 'label' => 'Shortcode Version',                 'icon'  => 'dashicons-editor-code',             ),         ),         'tab_style' => 'default',         'fields' => array(             array(                 'id'     => 'ab_embedgroup',                 'type'   => 'group',                 'clone'  => true,                 'sort_clone'  => true,                 'save_state' => true,                 'desc' => '<b style="color:red;">You can insert embed code or shortcode</b>',                 'tab'  => 'input-version',                 'fields' => array(                     array(                         'name'  => 'Host Name',                         'id'    => 'ab_hostname',                         'type'  => 'text',                     ),                     array(                         'name'   => 'Embed',                         'id'     => 'ab_embed',                         'type'   => 'textarea',                         'sanitize_callback' => 'none',                     ),                 ), //episode             ), //input-version             array(                 'name'  => __( 'Shortcode Video', 'meta-box' ),                 'id'    => "{$  prefix}embed",                 'type'  => 'textarea',                 'clone' => 'true',                 'sort_clone'  => true,                 'sanitize_callback' => 'none',                 'tab' => 'sc-version',             ),         ),     );     $  meta_boxes[] = array(         'title'  => 'Download',         'pages' => array( 'post','watch' ),         'tabs'      => array(             'input-version' => array(                 'label' => 'Input Version',                 'icon'  => 'dashicons-admin-customizer',             ),             'sc-version'  => array(                 'label' => 'Shortcode Version',                 'icon'  => 'dashicons-editor-code',             ),         ),         'tab_style' => 'default',         'fields' => array(             array(                 'id'     => 'ab_downloadgroup',                 'type'   => 'group',                 'clone'  => true,                 'sort_clone'  => true,                 'tab'  => 'input-version',                 'save_state' => true,                 'fields' => array(                     array(                         'name'  => 'Host Name',                         'id'    => 'ab_hostname',                         'type'  => 'text',                         'columns' => '3',                     ),                     array(                         'name'   => 'Language',                         'id'     => 'ab_language',                         'type'   => 'text',                         'columns' => '3',                     ),                     array(                         'name'   => 'Quality',                         'id'     => 'ab_quality',                         'type'   => 'text',                         'columns' => '3',                     ),                     array(                         'name'   => 'Link',                         'id'     => 'ab_linkurl',                         'type'   => 'text',                         'columns' => '3',                         'sanitize_callback' => 'none',                     ),                 ),             ), //input-version             array(                 'name'  => __( 'Shortcode Download', 'meta-box' ),                 'id'    => "{$  prefix}url",                 'type'  => 'textarea',                 'desc'  => 'Example: [dl n="FileHosting" u="http://domain.xxx" s="English" q="HD"]',                 'clone' => 'true',                 'sanitize_callback' => 'none',                 'tab' => 'sc-version',             ),         ),     ); 

here is how they show on the dashboard this the first box enter image description here

here is the second box enter image description here

and thank you in advace 🙂

Need to convert following python Signature verification code to Andorid?

I create to python3 application generat the RSA key pairs.

    from Crypto.PublicKey import RSA  print("--Private Key Generate--")  key = RSA.generate(2048) private_key = key.export_key() file_out = open("key/private.pem", "wb") file_out.write(private_key) file_out.close()  print("--Public Key Generate--")  public_key = key.publickey().export_key() file_out_1 = open("key/receiver.pem", "wb") file_out_1.write(public_key) file_out_1.close()  print("key Generated") 

I sign some data using python and create signature. It also verify using python succssfully.

 def sign(data):     private_key = RSA.import_key(open('key/private.pem').read())     h = SHA256.new(data)     signature =  base64.b64encode(pss.new(private_key).sign(h))     print("signature generate")     verify(data,signature)     return signature   def verify(recive_Data ,signature):     public_key = RSA.import_key(open('key/receiver.pem').read())     h =  SHA256.new(recive_Data)     verifier = pss.new(public_key)     try:         verifier.verify(h, base64.b64decode(signature))         print("The signature is authentic")     except (ValueError, TypeError):         print ("The signature is not authentic.") 

But acctual my verification implementaion in Andorid(min sdk 23 , target SDK 29). so , I need to convert this verification code to Android. I tried using following code , but not success. need some expert help to do it.

public class SecurityHelper {      private static String getKey(InputStream filename) throws IOException {         // Read key from file         String strKeyPEM = "";         BufferedReader br = new BufferedReader(new InputStreamReader(filename));         String line;         while ((line = br.readLine()) != null) {             strKeyPEM += line + "\n";         }         br.close();        // System.out.println(strKeyPEM);         return strKeyPEM;     }       public static PublicKey getPublicKey(InputStream filename) throws IOException, GeneralSecurityException {         String publicKeyPEM = getKey(filename);         return getPublicKeyFromString(publicKeyPEM);     }      public static PublicKey getPublicKeyFromString(String key) throws IOException, GeneralSecurityException {         String publicKeyPEM = key;         publicKeyPEM = publicKeyPEM.replace("-----BEGIN PUBLIC KEY-----\n", "");         publicKeyPEM = publicKeyPEM.replace("-----END PUBLIC KEY-----", "");         System.out.println(publicKeyPEM);         byte[] encoded = Base64.decode(publicKeyPEM ,Base64.CRLF);       //  System.out.println(encoded);         KeyFactory kf = KeyFactory.getInstance("RSA");         PublicKey pubKey = kf.generatePublic(new X509EncodedKeySpec(encoded));         System.out.println(pubKey);         return pubKey;     }       public static boolean verify(PublicKey publicKey, String message, String signature) throws SignatureException, NoSuchAlgorithmException, UnsupportedEncodingException, InvalidKeyException, InvalidAlgorithmParameterException {          Signature sign = Signature.getInstance("SHA256withRSA");         sign.initVerify(publicKey);         sign.update(message.getBytes("UTF-8"));         System.out.println(message);         return  sign.verify(Base64.decode(signature,Base64.CRLF));     }   } 

Is this bash command vulnerable to code injection?

I’m wondering if the following code is vulnerable to command injection in bash :

sumo /bin/netflash -Uk $  CONTROLED_OPTION 2>&1 

I’m thinking since it’s not included in ” ” it should be vulnerable but I’m not sure since I can’t make the command injection work, I tried $ () `` | && ||  but nothing is working.

or do I need the command to be inside a eval to be vulnerable ?

Thanks